PluginProbe
Hostinger Tools / 2.2.1
Hostinger Tools v2.2.1
3.0.77 3.0.76 3.0.75 3.0.74 3.0.73 3.0.72 3.0.71 3.0.70 3.0.69 3.0.68 3.0.67 3.0.66 1.8.1 1.8.2 1.8.3 1.9.1 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.4 All 108 releases
hostinger / src / js / videos.js

videos.js in Hostinger Tools 2.2.1, at src/js/videos.js

37 lines 886 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import 'video.js/dist/video-js.css';
2 import videojs from "!video.js";
3 import 'videojs-youtube'
4
5 document.addEventListener( 'DOMContentLoaded', function () {
6 // Initialize the Video.js player
7 var playerElement = document.getElementById( 'hts-video-player' );
8
9 if ( playerElement ) {
10 var player = videojs( 'hts-video-player', {
11 "techOrder": [ "youtube" ],
12 "sources": [ {
13 "type": "video/youtube",
14 "src": "https://www.youtube.com/watch?v=WkbQr5dSGLs&t"
15 } ]
16 } );
17
18
19 var playlistItems = document.querySelectorAll( '.hsr-playlist-item' );
20 if ( playlistItems ) {
21 playlistItems.forEach( function ( item ) {
22 item.addEventListener( 'click', function () {
23 var videoSrc = this.getAttribute( 'data-video-src' );
24
25 player.src( {
26 type: 'video/youtube',
27 src: videoSrc
28 } );
29
30 player.load();
31 player.play();
32 } );
33 } );
34 }
35 }
36 } );
37