[null,null,["最后更新时间 (UTC):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."]]