{
"ui_configuration": {
"controlPanelElements": [
"loop"
]
}
}
Put a video on a continuous loop.
Adds a button that controls if the currently selected video is played in a loop.
{
"ui_configuration": {
"controlPanelElements": [
"loop"
]
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>HPlayer</title>
<!-- HPlayer compiled CSS library: -->
<link rel="stylesheet" href="css/index.css">
</head>
<body>
<!-- Container for the UI overlay-->
<div class="player-container">
<!-- HTMLVideoElement, width and height to 100% required to fill the player-container -->
<video class="h-player" style="width:100%;height:100%"></video>
</div>
<!-- HPlayer compiled JS library: -->
<script src="js/HPlayer.bundle.js"></script>
<script>
const videoContainer = document.querySelector('.player-container')
const video = document.querySelector('.h-player');
const options = {
basic: {
source: "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
},
ui_configuration: {
"controlPanelElements": [
"loop"
]
}
};
const hplayer = new HPlayer(video,videoContainer, options);
hplayer.init_();
</script>
</body>
</html>