📺 Chromecast Sender Library for the Browser
View on GitHub
// Create new Castjs instance
const cjs = new Castjs();
// Wait for user interaction
$('#cast').on('click', function() {
// Check if casting is available
if (cjs.available) {
// Initiate new cast session
cjs.cast('https://example.com/movie.mp4');
}
});