Chromecast


The HTML5 player comes with a default Chromecast receiver implementation, however, you can use your own receiver by overriding the default Application ID. This is done by setting the appId option on the Chromecast button:

options['controlBar'] = {
  'chromeCastButton': {
    'appId': receiverAppId
  }
};

The receiver is compliant with the default chromecast receiver API unless otherwise stated. Information on how to build a sender and information on other functionalities can be found here.

Read more: EMP Chromecast Sender version 2

HTML5 Chromecast sender is a separte module emp-cast-sender.js. When this script is added a Chromecast button will appear in the control bar.
The bundle module emp-player-all.js includes the emp-cast-sender module.

Options for the emp-cast-sender module
[title, subtitle and image] showed in the Chromecast receiver can be set with player options. These options are only relevant when casting external streams. With EMP streams theses values are extracted from EPG data.

options['empcast'] = {
  'title':
  'subtitle':
  'image': {
    'url': //optional url to a program or asset image,
    'width': //optional image width default 155,
    'height': //optional image height default 100
  }
};

receiverAppId can also be set with player options, the chromeCastButton will not be visible in this case.

options['empcast'] = {
  'appId': receiverAppId
};

A background image can be showed when an Asset is casting, add an event listener for a program or asset changed and call the poster method on the player.

    player.poster(background image url);
    //or
    options['poster'] = background image url;

Take back casting session and continue play locally

options['empcast'] = {
  'takebacksession': true // , default is true
  }
};