এই নির্দেশিকাগুলি মিডিয়াকম্প্যাট API নিয়ে আলোচনা করে, যেগুলি আর আপডেট করা হয় না। আমরা দৃঢ়ভাবে পরিবর্তে Jetpack Media3 লাইব্রেরি ব্যবহার করার পরামর্শ দিই।
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
যেহেতু একটি ভিডিও অ্যাপ তার মিডিয়া সেশন এবং মিডিয়া কন্ট্রোলারকে একই কার্যকলাপে চালায়, তাই মিডিয়া সেশন কলব্যাকগুলি অডিও অ্যাপ সার্ভার/ক্লায়েন্ট আর্কিটেকচারের জন্য দেখানো বাস্তবায়ন থেকে আলাদা। কোন পরিষেবা কল নেই, এবং বিজ্ঞপ্তিগুলি NotificationManager-এর মাধ্যমে পরিচালনা করা হয়৷ নিম্নলিখিত সারণী দেখায় কিভাবে বিভিন্ন বৈশিষ্ট্য প্রতিটি কলব্যাক পদ্ধতিতে নিয়ন্ত্রিত হয়:
[null,null,["2025-07-29 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["# Media session callbacks\n\nSince a video app runs its media session and media controller in the same activity, the media session callbacks\nare different from the implementation shown for the\n[audio app](/guide/topics/media-apps/audio-app/building-an-audio-app)\nserver/client architecture. There are no service calls, and notifications are handled via the NotificationManager. The following table shows how the various features are controlled in each callback method:\n\n\u003cbr /\u003e\n\n|--------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------|------------------------------------------------|\n| | **onPlay()** | **onPause()** | **onStop()** |\n| [Audio Focus](/guide/topics/media-apps/volume-and-earphones#audio-focus) | `requestFocus()` passing in your `OnAudioFocusChangeListener`. *Always call `requestFocus()` first, proceed only if focus is granted.* | | `abandonAudioFocus()` |\n| [Media Session](/guide/topics/media-apps/working-with-a-media-session) | `setActive(true)` - Update metadata and state | - Update metadata and state | `setActive(false)` - Update metadata and state |\n| Player Implementation | Start the player | Pause the player | Stop the player |\n| [Becoming Noisy](/guide/topics/media-apps/volume-and-earphones#becoming-noisy) | Register your `BroadcastReceiver` | Unregister your `BroadcastReceiver` | |\n| Notifications | Show notification | Update notification | |\n\n\u003cbr /\u003e\n\n| **Note:** People using the Google Assistant can control your app with voice commands if you create your MediaSession with the necessary callbacks. The requirements are explained in the [Google Assistant documentation](/guide/topics/media-apps/interacting-with-assistant)."]]