با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
اپلیکیشن گیرنده وب
برنامه Web Receiver یک برنامه HTML5/JavaScript است که روی دستگاه گیرنده وب مانند Chromecast اجرا می شود. برنامه Web Receiver عملکردهای زیر را انجام می دهد:
یک رابط برای نمایش محتوای برنامه در تلویزیون فراهم می کند.
پیامهای برنامه فرستنده را برای کنترل محتوا در دستگاه گیرنده وب مدیریت میکند.
پیامهای سفارشی از برنامه فرستنده را که مخصوص برنامه هستند مدیریت میکند.
Web Receiver SDK همچنین دارای یک پخش کننده رسانه داخلی است که تجربه پخش یکپارچه و آسان را فراهم می کند. همچنین به شما این امکان را میدهد که رابط کاربری پخشکننده را سفارشی کنید و به گیرنده وب شما امکان رهگیری و نادیده گرفتن پیامها و روشها را برای اجرای منطق تجاری سفارشی شما فراهم میکند.
می توانید برنامه Web Receiver خود را به روش های زیر پیاده سازی کنید:
از Styled Media Web Receiver استفاده کنید: این یک برنامه گیرنده وب از پیش ساخته شده است که رابط کاربری پخش کننده رسانه را برای محتوای صوتی و تصویری فراهم می کند. این یک UI پیش فرض برای برنامه Web Receiver ارائه می دهد، اما می توانید چندین عنصر را در UI با یک فایل CSS سفارشی کنید.
یک گیرنده وب سفارشی ایجاد کنید: این یک برنامه سفارشی ساخته شده HTML5 است که باید میزبان آن باشید تا محتوای برنامه خود را در تلویزیون نمایش دهید. اگر برنامه شما بخواهد محتوایی غیر از رسانه صوتی/تصویری را نمایش دهد یا اگر گیرنده رسانه سبک از انواع رسانه مورد نیاز برنامه شما پشتیبانی نمی کند، ممکن است لازم باشد یک گیرنده سفارشی ایجاد کنید.
اگر انتخاب کنید که یک گیرنده وب را پیاده سازی نکنید، برنامه شما می تواند از گیرنده وب رسانه پیش فرض استفاده کند.
یک گیرنده وب را انتخاب کنید
Web Receiver SDK انواع مختلفی از گیرنده ها را برای رفع نیازهای تجاری شما فراهم می کند. برای مقایسه قابلیتهای مختلف، به انواع راهنمای برنامههای گیرنده مراجعه کنید).
گیرنده وب مدیا مدل دار
Styled Media Web Receiver یک برنامه گیرنده وب از پیش ساخته شده است که توسط Google میزبانی می شود و برای پخش محتوای صوتی و تصویری طراحی شده است. میتوانید با استفاده از یک فایل CSS، رابط را با رنگها و داراییهای برند خود سبک کنید.
برای استفاده از Styled Media Web Receiver، هنگام ثبت یک برنامه جدید ، Styled Media Web Receiver را انتخاب کنید و (به صورت اختیاری) URL یک فایل CSS را ارائه دهید که ظاهری سفارشی برای رابط کاربری برنامه Web Receiver تعریف می کند.
برای جزئیات بیشتر در مورد سبک های CSS که به شما امکان می دهد رابط کاربری Styled Media Web Receiver را سفارشی کنید، به راهنمای Styled Media Receiver مراجعه کنید.
گیرنده وب سفارشی
اگر برنامه شما محتوایی مانند گالری تصاویر را ارائه می دهد، به DRM یا منطق تجاری سفارشی نیاز دارد، باید یک برنامه گیرنده وب سفارشی بسازید. گیرنده وب سفارشی یک برنامه HTML5 است که روی سرورهای خود میزبانی میکنید و باید با استفاده از JavaScript Web Receiver API اجرا شود.
برای جزئیات در مورد نحوه ساخت برنامه Web Receiver خود با Web Receiver API، راهنمای Web Receiver سفارشی را ببینید.
گیرنده وب پیش فرض رسانه
گزینه سوم موجود، Default Media Web Receiver است. این یک برنامه گیرنده وب از پیش ساخته شده توسط Google است که برای پخش محتوای صوتی و تصویری شما طراحی شده است. نیازی به ثبت نام در Google Cast SDK Developer Console نیست، اما نمی توانید هیچ یک از رابط کاربری را در گیرنده وب رسانه پیش فرض سفارشی کنید.
به جای ثبت نام در کنسول توسعه دهنده برای دریافت شناسه برنامه، می توانید از گیرنده وب رسانه پیش فرض با شناسه برنامه پیش فرض استفاده کنید:
برای برنامههای Android: CastMediaControlIntent.DEFAULT_MEDIA_RECEIVER_APPLICATION_ID
برای برنامه های وب: chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID
برای برنامه های iOS:
<=v4.0.0 kGCKMediaDefaultReceiverApplicationID
>=v4.0.2 kGCKDefaultMediaReceiverApplicationID
از برنامه فرستنده خود، برنامه Default Media Web Receiver را در دستگاه Cast شروع می کنید و سپس از آن برای بارگیری URL در رسانه خود استفاده می کنید.
تاریخ آخرین بهروزرسانی 2022-11-04 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 2022-11-04 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eA Web Receiver application is an HTML5/JavaScript application that runs on devices like Chromecast, displaying content, handling sender messages, and enabling custom functionalities.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can choose from three Web Receiver options: the Styled Media Web Receiver (pre-built and customizable with CSS), the Custom Web Receiver (for bespoke content and logic), and the Default Media Web Receiver (basic, uncustomizable media streaming).\u003c/p\u003e\n"],["\u003cp\u003eThe Styled Media Web Receiver is hosted by Google and suitable for streaming audio and video, offering customization through a CSS file for branding.\u003c/p\u003e\n"],["\u003cp\u003eCustom Web Receivers are self-hosted, built using the Web Receiver API, and necessary for content beyond audio/video or when specific requirements aren't met by the Styled Media Receiver.\u003c/p\u003e\n"],["\u003cp\u003eThe Default Media Web Receiver is a basic, uncustomizable option for audio and video streaming, hosted by Google and requiring no registration, suitable for simple use cases.\u003c/p\u003e\n"]]],[],null,["# Web Receiver Overview\n\nWeb Receiver application\n------------------------\n\nA Web Receiver application is an HTML5/JavaScript application that runs on the\nWeb Receiver device, such as a Chromecast. The Web Receiver application performs\nthe following functions:\n\n- Provides an interface to display the app's content on the TV.\n- Handles messages from the sender application to control content on the Web Receiver device.\n- Handles custom messages from the sender application that are application-specific.\n\nThe Web Receiver provides\n[additional functionality](#web_receiver_features_overview).\n\nWeb Receiver SDK\n----------------\n\nThe Web Receiver SDK also comes with a built-in media player, which provides a\nseamless and easy playback experience. It also allows you to customize the\nplayer UI and provides your Web Receiver with the ability to intercept and\noverride messages and methods to execute your custom business logic.\n\nYou can implement your Web Receiver application in the following ways:\n\n- Use the [Styled Media Web Receiver](#styled_media_web_receiver): This is a pre-built Web Receiver application that provides a media player UI for audio and video content. It provides a default UI for the Web Receiver application, but you can customize several elements in the UI with a CSS file.\n- Develop a [Custom Web Receiver](#custom_web_receiver): This is a custom built HTML5 app that you must host to handle the display of your app content on the TV. You may need to create a Custom Receiver if your app wants to display content other than audio/video media or if the Styled Media Receiver does not support the media types your app requires.\n\nIf you choose not to implement a Web Receiver, your application can use the\n[Default Media Web Receiver](#default_media_web_receiver).\n| **Note:** All Web Receivers support the media types described in [Supported Media](/cast/docs/media).\n\nChoose a Web Receiver\n---------------------\n\nThe Web Receiver SDK provides different types of receivers to meet your business\nneeds. For a comparison of the different capabilities, see the\n[types of Receiver apps guide](/cast/docs/overview#types_of_receiver_apps)).\n\n### Styled Media Web Receiver\n\nThe Styled Media Web Receiver is a pre-built Web Receiver application hosted by\nGoogle that is designed for streaming audio and video content. You can style the\ninterface with your own colors and branding assets using a CSS file.\n\nTo use the Styled Media Web Receiver, select Styled Media Web Receiver when\n[registering a new application](/cast/docs/registration) and (optionally)\nprovide the URL to a CSS file that defines a custom look for the Web Receiver\napplication's UI.\n\nFor details about the CSS styles that allow you to customize the Styled Media\nWeb Receiver application's UI, see the\n[Styled Media Receiver](/cast/docs/styled_receiver) guide.\n\n### Custom Web Receiver\n\nIf your app provides content such as an image gallery, requires DRM, or custom\nbusiness logic, then you need to build a Custom Web Receiver application. A\nCustom Web Receiver is an HTML5 app that you host on your own servers and that\nmust be implemented using the JavaScript\n[Web Receiver API](/cast/docs/reference/caf_receiver).\n\nFor details about how to build your Web Receiver application with the Web\nReceiver API, see the [Custom Web Receiver](/cast/docs/caf_receiver/basic)\nguide.\n\n### Default Media Web Receiver\n\nA third option available is the Default Media Web Receiver. This is a pre-built\nWeb Receiver application hosted by Google that is designed for streaming your\naudio and video content. It does not require you to register with the Google\nCast SDK Developer Console, but you **cannot customize any of the UI** in the\nDefault Media Web Receiver.\n\nInstead of registering with the developer console to receive an app ID, you can\nuse the Default Media Web Receiver with the default app ID:\n\n- For Android apps: `CastMediaControlIntent.DEFAULT_MEDIA_RECEIVER_APPLICATION_ID`\n- For Web apps: `chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID`\n- For iOS apps:\n - \\\u003c=v4.0.0 `kGCKMediaDefaultReceiverApplicationID`\n - \\\u003e=v4.0.2 `kGCKDefaultMediaReceiverApplicationID`\n\nFrom your sender app, you start the Default Media Web Receiver app on the Cast\ndevice and then use it to load the URL to your media."]]