Fast Channel Switching
Switch between two channels without destroying the player and speeding up the process
Experience the Bitmovin Player’s ability to switch between streams without having to run setup twice. This improves the speed immensely
One setup call for multiple sources
Call the setup
function only for the initial player setup. The Bitmovin Player can load new
sources
without being destroyed and having to set up all the components again. This saves time for your
customers and
gives your page a more responsive feeling.
const conf = {
key: '<YOUR PLAYER KEY>',
playback: {
muted: true,
autoplay: true
}
};
var playerContainer = document.getElementById('player-container');
var player = new bitmovin.player.Player(playerContainer, conf);
Load a source dynamically
Respond to the user’s input and load a different source without having to run the setup again:
This functionality is especially valuable if you plan to create some kind of tv-station.
function switchChannel(channelID) {
var source;
if (channelID === '1') {
source = {
title: 'Art of Motion',
description: 'What is this event... Parcour?',
dash: 'https://cdn.bitmovin.com/content/assets/art-of-motion-dash-hls-progressive/mpds/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd',
hls: 'https://cdn.bitmovin.com/content/assets/art-of-motion-dash-hls-progressive/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8'
}
} else if (channelID === '2') {
source = {
title: 'Big Buck Bunny',
description: 'A day in the life of Big Buck Bunny.',
dash: 'https://cdn.bitmovin.com/content/assets/bbb/stream.mpd',
hls: 'https://cdn.bitmovin.com/content/assets/bbb/stream.m3u8'
};
} else {
source = {
title: 'Sintel',
description: 'The main character, Sintel, is attacked while traveling through a wintry mountainside.',
dash: 'https://cdn.bitmovin.com/content/assets/sintel/sintel.mpd',
hls: 'https://cdn.bitmovin.com/content/assets/sintel/hls/playlist.m3u8',
poster: 'https://cdn.bitmovin.com/content/assets/sintel/poster.png'
}
}
player.load(source);
}