סקירה כללית על שירות דפדפן המדיה
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
כדי ליצור שירות של דפדפן מדיה, מרחיבים את המחלקות הנתמכות MediaBrowserServiceCompat
או MediaLibraryService
. אחרי ההגדרה, מערכות Android Auto ו-Android Automotive OS (AAOS) יכולות להשתמש בשירות שלכם כדי:
הצגת תפריט למשתמש על ידי עיון בהיררכיית התוכן של האפליקציה.
כדי לשלוט בהשמעת אודיו, צריך לקבל את הטוקן של אובייקט MediaSessionCompat
באפליקציה.
אתם יכולים גם להשתמש בשירות של דפדפן המדיה כדי לאפשר ללקוחות אחרים לגשת לתוכן מדיה מהאפליקציה שלכם. לקוחות המדיה האלה יכולים להיות אפליקציות אחרות בטלפון של המשתמש, או לקוחות מרוחקים אחרים.
תוכן עניינים
בדפים האלה מוסבר איך עובדים עם דפדפן המדיה:
הנחיות עיצוב
מידע נוסף על הנחיות עיצוב:
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-08-22 (שעון UTC).
[null,null,["עדכון אחרון: 2025-08-22 (שעון UTC)."],[],[],null,["# Media browser service overview\n\nYou create a media browser service by extending the supported\n[`MediaBrowserServiceCompat`](/reference/androidx/media/MediaBrowserServiceCompat) or [`MediaLibraryService`](/media/media3/session/serve-content) classes. Android\nAuto and Android Automotive OS (AAOS) can then use your service to:\n\n- Browse your app's content hierarchy to present a menu to the user.\n\n- Get the token for your app's [`MediaSessionCompat`](/reference/android/support/v4/media/session/MediaSessionCompat) object to control\n audio playback.\n\nYou can also use your media browser service to let other clients access media\ncontent from your app. These media clients might be other apps on a user's\nphone, or they can be other remote clients.\n\nContents\n--------\n\nThese pages detail how to work with the media browser:\n\n- [Media browser lifecycle](/training/cars/media/create-media-browsers/workflow)\n- [Build content hierarchy](/training/cars/media/create-media-browser/content-hierarchy)\n- [Apply content styles](/training/cars/media/create-media-browser/content-styles)\n- [Display media artwork](/training/cars/media/create-media-browser/media-artwork)\n- [Display browsable search results](/training/cars/media/create-media-browser/browsable-search)\n- [Implement custom browse actions](/training/cars/media/create-media-browser/custom-browse-actions)\n\nDesign guidelines\n-----------------\n\nTo learn more about design guidelines, see:\n\n- [Plan navigation tabs](https://developers.google.com/cars/design/create-apps/media-apps/navigation-tabs)\n- [Plan browsing views](https://developers.google.com/cars/design/create-apps/media-apps/browsing-views)"]]