Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/25 (UTC).
[null,null,["Dernière mise à jour le 2025/07/25 (UTC)."],[[["\u003cp\u003eThe \u003ccode\u003ecast.framework.ui.Controls\u003c/code\u003e class provides an interface for configuring UI controls on touch-enabled devices for the Cast Web Receiver application.\u003c/p\u003e\n"],["\u003cp\u003eYou can use the \u003ccode\u003eassignButton\u003c/code\u003e method to display custom buttons within predefined slots and \u003ccode\u003eclearDefaultSlotAssignments\u003c/code\u003e to remove default buttons.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ehasMediaControlsOverlay\u003c/code\u003e method indicates whether a media overlay will be shown during playback, and \u003ccode\u003esetBrowseContent\u003c/code\u003e allows you to set media browse content for user discovery.\u003c/p\u003e\n"],["\u003cp\u003eObtain an instance of the UI Controls using the \u003ccode\u003egetInstance\u003c/code\u003e static method.\u003c/p\u003e\n"]]],[],null,["# Class: Controls\n\ncast.[framework](/cast/docs/reference/web_receiver/cast.framework).[ui](/cast/docs/reference/web_receiver/cast.framework.ui).Controls\n=====================================================================================================================================\n\nclass static\n\nTouch Controls. Provides interface for configuring controls on touch-enabled\ndevices.\n\nMethods\n-------\n\n### getInstance\n\nstatic\n\ngetInstance() returns [cast.framework.ui.Controls](/cast/docs/reference/web_receiver/cast.framework.ui.Controls)\n\nReturns the UI Controls instance.\n\nReturns\n\n: [cast.framework.ui.Controls](/cast/docs/reference/web_receiver/cast.framework.ui.Controls) An instance of the UI Controls.\n\n### assignButton\n\nassignButton(slot, button)\n\nDisplays button in the specified slot.\n\n| #### Parameter ||\n|--------|---------------------------------------------------------------------------------------------------------------------------------|\n| slot | [cast.framework.ui.ControlsSlot](/cast/docs/reference/web_receiver/cast.framework.ui#.ControlsSlot) Value must not be null. |\n| button | [cast.framework.ui.ControlsButton](/cast/docs/reference/web_receiver/cast.framework.ui#.ControlsButton) Value must not be null. |\n\nThrows\n\n: `non-null Error` if slot or button name is incorrect\n\n### clearDefaultSlotAssignments\n\nclearDefaultSlotAssignments()\n\nRemove all buttons assigned by default from slots.\n\n### hasMediaControlsOverlay\n\nhasMediaControlsOverlay() returns Promise containing boolean\n\nSignals whether the media controls overlay will be rendered during playback\non top of the application UI.\n\nReturns\n\n: `non-null Promise containing boolean` a promise that resolves to `true` if the media\n controls will be rendered and to `false` otherwise.\n\n### setBrowseContent\n\nsetBrowseContent(browseContent)\n\nSet Media Browse content for users to discover more contents from your\nreceiver.\n\n| #### Parameter ||\n|---------------|-------------------------------------------------------------------------------------------------------------------------|\n| browseContent | [cast.framework.ui.BrowseContent](/cast/docs/reference/web_receiver/cast.framework.ui.BrowseContent) Value may be null. |"]]