- "METADATA_UPDATED"
Fired when asset metadata has been updated
- "STATE_CHANGED"
Fired when receiver state has changed
- "RESOLUTION_CHANGED"
Fired when receiver 'resolution has changed - resolution parameter (if null, app should hide UI display element)
Implement cast.receiver.media.Player interface
Param | Type |
---|---|
receiver | empReceiver |
EmpReceiverEvents - Holds receiver events METADATA_UPDATED, STATE_CHANGED, RESOLUTION_CHANGED
Kind: global class
- empReceiver
- new empReceiver(element, [options], [ready])
- .state ⇒
string
- .isChromecast ⇒
bool
- .version ⇒
string
- .player ⇒
EmpPlayer
- .onMessage(event)
- .onEmpError(error)
- .getMediaInformation() ⇒
cast.receiver.media.MediaInformation
- .getMediaManager(safety) ⇒
cast.receiver.MediaManager
- .getCastReceiverManager(safety) ⇒
cast.receiver.CastReceiverManager
- .getVideoElement(safety) ⇒
Element
- .sendMessage(message, opt_senderId)
- .sendStatus(opt_senderId, opt_requestId)
empReceiver - Interacts with chromecast and senders
Param | Type | Description |
---|---|---|
element | String |
HTML video element id |
[options] | Object |
receiver options such as: playerOptions, statusText, controls, debug, messageUrn |
[ready] | Callback |
callback to be called when the receiver is reader |
Current receiver state. ['launching', 'loading','buffering', 'seeking', 'playing', 'paused', 'done', 'idle']
Kind: instance property of empReceiver
Returns: string
- empReceiver.ReceiverStates ['launching', 'loading','buffering', 'seeking', 'playing', 'paused', 'done', 'idle']
Check if running on Chromecast device.
Kind: instance property of empReceiver
Returns: bool
- True if running on Chromecast device.
EMPReceiver version
Kind: instance property of empReceiver
Returns: string
- The EMPReceiver version
Returns the underlying EmpPlayer version 2 EmpPlayer API: https://www.npmjs.com/package/empplayer2
Kind: instance property of empReceiver
Handle custom message from senders
Kind: instance method of empReceiver
Param | Type | Description |
---|---|---|
event | cast.receiver.CastMessageBus.Event |
{ data:{ type:'', data:{} } } |
Error handler for empPlayer Errors. Broadcast error message to all connected senders.
Kind: instance method of empReceiver
Param | Type | Description |
---|---|---|
error | string | object |
error message to broadcast |
Provides information about the media currently loaded.
Kind: instance method of empReceiver
Returns: cast.receiver.media.MediaInformation
- Google Cast MediaInformation.
Get current media manager instance The MediaManager is used to send/receive media messages/events It will print a warning by default about the danger of using the MediaManager directly but any argument that is passed in will silence the warning.
Kind: instance method of empReceiver
Returns: cast.receiver.MediaManager
- Google Cast MediaManager.
Param | Type | Description |
---|---|---|
safety | any |
Anything passed in to silence the warning |
Get current cast receiver manager instance The receiver manager allows communication with the platform and is used to send/receive system messages/events.
It will print a warning by default about the danger of using the CastReceiverManager directly but any argument that is passed in will silence the warning.
Kind: instance method of empReceiver
Returns: cast.receiver.CastReceiverManager
- Google Cast ReceiverManager.
Param | Type | Description |
---|---|---|
safety | any |
Anything passed in to silence the warning |
Get current Video Element
It will print a warning by default about the danger of using the Video Element directly but any argument that is passed in will silence the warning.
Kind: instance method of empReceiver
Returns: Element
- The Video Element
Param | Type | Description |
---|---|---|
safety | any |
Anything passed in to silence the warning |
Sends a custom message to a specific sender or broadcast custom message to all connected senders. It can be dangerous to send message directly from ReceiverApp, but if you know what you're doing it's public.
Kind: instance method of empReceiver
Param | Type | Description |
---|---|---|
message | object |
object with message details |
opt_senderId | string |
optional set if you want to send message to just one specific sender |
Sends media status to a specific sender or broadcast media status to all connected senders.
Kind: instance method of empReceiver
Param | Type | Description |
---|---|---|
opt_senderId | string |
optional sender id |
opt_requestId | number |
optional request id |
Fired when asset metadata has been updated
Fired when receiver state has changed
Fired when receiver 'resolution has changed - resolution parameter (if null, app should hide UI display element)
Kind: event emitted