Web Receiver の概要
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Web Receiver アプリケーション
ウェブ レシーバ アプリケーションは、Chromecast などのウェブ レシーバ デバイスで実行される HTML5/JavaScript アプリケーションです。Web Receiver アプリケーションは、次の機能を実行します。
- アプリのコンテンツをテレビに表示するためのインターフェースを提供します。
- 送信者のアプリから送信されるメッセージを処理し、Web Receiver デバイス上でコンテンツを制御します。
- 送信者アプリケーションから送られた、アプリケーション固有のカスタム メッセージを処理します。

ウェブレシーバーは、追加機能を提供します。
Web Receiver SDK
Web Receiver SDK にはメディア プレーヤーも組み込まれているため、シームレスで簡単な再生が可能です。また、プレーヤーの UI をカスタマイズし、ウェブ レシーバに、カスタム ビジネス ロジックを実行するためのメッセージやメソッドをインターセプトしてオーバーライドする機能も備わっています。
Web Receiver アプリケーションは、次の方法で実装できます。
- スタイル付きメディア ウェブ レシーバーを使用する: 事前構築済みのウェブ レシーバー アプリケーションであり、音声と動画コンテンツ用のメディア プレーヤー UI を提供します。Web Receiver アプリにデフォルトの UI が用意されていますが、CSS ファイルを使用して UI の複数の要素をカスタマイズできます。
- カスタム ウェブ レシーバーを開発する: これは、テレビにアプリ コンテンツを表示する場合にホストする必要がある、カスタム作成の HTML5 アプリです。アプリで音声/動画メディア以外のコンテンツを表示したい場合、またはスタイル付きメディア レシーバーがアプリで必要なメディアタイプをサポートしていない場合は、カスタム レシーバーを作成する必要があります。
ウェブ レシーバを実装しないことを選択した場合、アプリケーションはデフォルトのメディア ウェブ レシーバを使用できます。
ウェブレシーバーを選択してください
Web Receiver SDK には、ビジネスニーズに合ったさまざまな種類のレシーバーが用意されています。さまざまな機能の比較については、レシーバー アプリの種類に関するガイドをご覧ください。
Styled Media Web Receiver は、Google がホストする事前構築済みのウェブ レシーバー アプリケーションであり、音声と動画のコンテンツをストリーミングできるように設計されています。CSS ファイルを使用して、独自の色やブランド アセットでインターフェースのスタイルを設定できます。
スタイル付きメディア ウェブレシーバーを使用するには、新しいアプリケーションを登録する際にスタイル付きメディア ウェブレシーバーを選択し、必要に応じて、ウェブ レシーバー アプリケーションの UI のカスタムを定義する CSS ファイルの URL を指定します。
Styled Media Web Receiver アプリの UI をカスタマイズできる CSS スタイルの詳細については、Styled Media Receiver ガイドをご覧ください。
カスタムのウェブレシーバー
アプリが画像ギャラリーなどのコンテンツを提供し、DRM、またはカスタム ビジネス ロジックを必要とする場合は、カスタム ウェブ レシーバー アプリケーションを構築する必要があります。カスタム ウェブ レシーバーは、独自のサーバーでホストされる HTML5 アプリであり、JavaScript Web Receiver API を使用して実装する必要があります。
Web Receiver API を使用してウェブ レシーバー アプリケーションを構築する方法について詳しくは、カスタム ウェブ レシーバー ガイドをご覧ください。
3 つ目の選択肢は、デフォルトのメディア ウェブ受信者です。これは、音声や動画のコンテンツをストリーミングできる、Google がホストする事前構築済みの Web Receiver アプリケーションです。Google Cast SDK Developer Console への登録は必須ではありませんが、デフォルトのメディア ウェブレシーバーで UI をカスタマイズすることはできません。
デベロッパー コンソールに登録してアプリ ID を受け取る代わりに、デフォルトのメディア ID とともにデフォルトのメディア ウェブレシーバーを使用できます。
- Android アプリの場合:
CastMediaControlIntent.DEFAULT_MEDIA_RECEIVER_APPLICATION_ID
- ウェブアプリの場合:
chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID
- iOS アプリの場合:
- <=v4.0.0
kGCKMediaDefaultReceiverApplicationID
- >=v4.0.2
kGCKDefaultMediaReceiverApplicationID
送信側のアプリから、キャスト デバイスでデフォルトのメディア ウェブレシーバー アプリを起動し、そのメディアを使用して URL を読み込みます。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2022-11-04 UTC。
[null,null,["最終更新日 2022-11-04 UTC。"],[[["\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."]]