A Clappr plugin that adds Chromecast support on Chrome browser. As with all apps running on Chromecast it requires the Google Cast extension installed on the browser.
Please notice it's still not production ready, as it lacks a way to select tracks (audio, subtitles), as well as display media information.
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/clappr@latest/dist/clappr.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/clappr-chromecast-plugin@latest/dist/clappr-chromecast-plugin.min.js"></script>
</head>
<body>
<div id="player"></div>
<script>
var player = new Clappr.Player({
source: '//clappr.io/highline.mp4',
plugins: [ChromecastPlugin],
parentId: '#player',
chromecast: {
appId: '9DFB77C0',
contentType: 'video/mp4',
media: {
type: ChromecastPlugin.Movie,
title: 'Awesome Hot Air Balloon Slackline',
subtitle: 'You won\'t get much closer to Skylining than this!'
},
customData: {
licenseURL: 'http://widevine/yourLicenseServer'
}
}
});
</script>
</body>
</html>
There's also a demo page.
The plugin parameters are passed through the embed parameters object under the chromecast
key:
9DFB77C0
).ChromecastPlugin.Movie
(for movies), ChromecastPlugin.TvSeries
(for TV episodes) and ChromecastPlugin.None
(for generic metadata - can also be absent or set to null
/undefined
)Install dependencies:
npm install
Build:
npm run build
Run:
npm start