[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003e\u003ccode\u003eRemotePlayerController\u003c/code\u003e provides data binding for a remote player to the cast state, managing player properties and events.\u003c/p\u003e\n"],["\u003cp\u003eIt offers methods to control playback (play/pause, stop, seek, mute), adjust volume, skip ads, and monitor player changes through events.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use \u003ccode\u003eRemotePlayerController\u003c/code\u003e to integrate and manage a Cast-enabled remote player within their web application.\u003c/p\u003e\n"],["\u003cp\u003eIt provides helper functions like formatting time, calculating seek positions, and converting between seek percentage and time.\u003c/p\u003e\n"]]],["The `RemotePlayerController` class manages a remote player, updating its properties and providing change events. Key actions include registering/unregistering event handlers via `addEventListener` and `removeEventListener`. It also offers methods to control playback, such as `playOrPause`, `muteOrUnmute`, `seek`, `stop`, `skipAd`. Time conversions are handled through `getFormattedTime`, `getSeekPosition`, and `getSeekTime`. Additionally, it has the `setVolumeLevel` method. A constructor, `RemotePlayerController`, initializes it with a `RemotePlayer`.\n"],null,["# Class: RemotePlayerController\n\ncast.[framework](/cast/docs/reference/web_sender/cast.framework).RemotePlayerController\n=======================================================================================\n\nclass static\n\nCast remote player controller, which provides data binding for a remote\nplayer to the cast state. It manages a player object and updates its\nproperties, providing events for player changes.\n\nConstructor\n-----------\n\n### RemotePlayerController\n\nnew\nRemotePlayerController(player)\n\n| #### Parameter ||\n|--------|-------------------------------------------------------------------------------------------------------------------------------------------|\n| player | [cast.framework.RemotePlayer](/cast/docs/reference/web_sender/cast.framework.RemotePlayer) The player to control. Value must not be null. |\n\nMethods\n-------\n\n### addEventListener\n\naddEventListener(type, handler)\n\nRegisters an event handler for a player change.\n\n| #### Parameter ||\n|---------|------------------------------------------------------------------------------------------------------------------------------------------------------|\n| type | [cast.framework.RemotePlayerEventType](/cast/docs/reference/web_sender/cast.framework#.RemotePlayerEventType) Event type. Value must not be null. |\n| handler | function(non-null [cast.framework.RemotePlayerChangedEvent](/cast/docs/reference/web_sender/cast.framework.RemotePlayerChangedEvent)) Event handler. |\n\n### getFormattedTime\n\ngetFormattedTime(timeInSec)\n\nConverts a number representing an interval of seconds to a string with\nHH:MM:SS format.\n\n| #### Parameter ||\n|-----------|----------------------------------------------------------------------------------|\n| timeInSec | number Must be positive. Intervals longer than 100 hours get truncated silently. |\n\n### getSeekPosition\n\ngetSeekPosition(currentTime, duration) returns number\n\nConvert current play time to a progress percentage.\n\n| #### Parameter ||\n|-------------|------------------------------------------|\n| currentTime | number The current playing time. |\n| duration | number Current media total playing time. |\n\nReturns\n\n: `number` Current seek position in percentage.\n\n### getSeekTime\n\ngetSeekTime(currentPosition, duration) returns number\n\nConvert current play seek percentage to seek time.\n\n| #### Parameter ||\n|-----------------|---------------------------------------------|\n| currentPosition | number Current seek position in percentage. |\n| duration | number Current media total playing time. |\n\nReturns\n\n: `number` The current playing time.\n\n### muteOrUnmute\n\nmuteOrUnmute()\n\nMute or unmute the audio of the connected device.\n\n### playOrPause\n\nplayOrPause()\n\nPlay or pause current playing media.\n\n### removeEventListener\n\nremoveEventListener(type, handler)\n\nUnregister an event handler for a player change.\n\n| #### Parameter ||\n|---------|------------------------------------------------------------------------------------------------------------------------------------------------------|\n| type | [cast.framework.RemotePlayerEventType](/cast/docs/reference/web_sender/cast.framework#.RemotePlayerEventType) Event type. Value must not be null. |\n| handler | function(non-null [cast.framework.RemotePlayerChangedEvent](/cast/docs/reference/web_sender/cast.framework.RemotePlayerChangedEvent)) Event handler. |\n\n### seek\n\nseek()\n\nSeeks the media item to player currentTime value.\n\n### setVolumeLevel\n\nsetVolumeLevel()\n\nSets the volume level of the connected device to the player volumeLevel\nvalue.\n\n### skipAd\n\nskipAd()\n\nSkip the ad currently playing on the receiver.\n\n### stop\n\nstop()\n\nStops the media player."]]