[object Object] Icon

Encoding
Learn how to create, start, manage and modify Encodings

[object Object] Icon

Player
Learn how to create, start, manage and modify Players

[object Object] Icon

Analytics
Learn how to create, start, manage and modify Analyticss

Docs Home
User shortcuts for search
Focus by pressing f
Hide results by pressing Esc
Navigate via   keys

Mon Aug 27 2018

Is there a way to loop a video?

Starting the video again once the playback is finished, can be achieved using the event / handlers implementation of the Bitmovin Player. ON_PLAYBACK_FINISHED event can be used to detect the end of the playback and then trigger play() again inside the event callback.

An event handler can be added either via the Bitmovin Player API:

1player.addEventHandler(bitmovin.player.EVENT.ON_PLAYBACK_FINISHED, function () {
2 player.play();
3});

... or you can add one through the player configuration:

1var config = {
2 key: 'PLAYER_API_KEY',
3 source: {
4 dash: '//URL/stream.mpd',
5 hls: '//URL/stream.m3u8',
6 progressive: '//URL/file.mp4'
7 },
8 events: {
9 onPlaybackFinished: function () {
10 this.play();
11 }
12 }
13}

Give us feedback