CAF receiver app attempts to fallback when an error occurs.
- Receiver intercepts a load request
- Attempts to load
- Captures an error event
- Attempts to load the fallback url
Sender app provides a fallback option when making a load request:
const session = cast.framework.CastContext.getInstance().getCurrentSession();
const mediaInfo = new chrome.cast.media.MediaInfo('http://wrong-url-to-simulate-error');
const request = new chrome.cast.media.LoadRequest(mediaInfo);
request.fallback = 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4';
session.loadMedia(request);
- Open the file below:
├── sender/
│ ├── index.js
- Set the
APPLICATION_ID
yarn serve