From: soufiane Date: Thu, 1 Jan 2026 22:40:30 +0000 (+0100) Subject: wip #7885 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=636098380fe8786dd2d1a290ac68c1c13f265a30;p=fluidbook-html5.git wip #7885 --- diff --git a/js/libs/fluidbook/fluidbook.video.js b/js/libs/fluidbook/fluidbook.video.js index 11b41ae7..7280a8e5 100644 --- a/js/libs/fluidbook/fluidbook.video.js +++ b/js/libs/fluidbook/fluidbook.video.js @@ -230,29 +230,61 @@ FluidbookVideo.prototype = { let defaultTrack = true; for (var i = 0; i < tracks.length; i++) { var track = tracks[i]; + if (!track.file) { continue; } - html += '' + html += '' + */}else { + html += ''; + + //$(e).append(html) + } + function sendPlayEvent() { if (!playEventSent) { $this.fluidbook.stats.trackEvent(statsType, 'play', statsName); @@ -260,11 +292,20 @@ FluidbookVideo.prototype = { } } - player = videojs(id, setup); - player.ready(function () { + player.controlBar.addChild('AudioTrackButton'); // Hide CC if disabled in video settings + + var tracks = player.audioTracks(); + console.log(tracks); + + for (var i = 0; i < tracks.length; i++) { + console.log(tracks[i].label, tracks[i].language, tracks[i].enabled); + } + + tracks[0].enabled = true + console.log('cc', cc); if (!cc) { console.log('cc disabled'); @@ -377,6 +418,10 @@ FluidbookVideo.prototype = { }); $this.fluidbook.sound.pauseAmbientIfSomethingIsPlaying(); + + + /*player.muted(1) + $("#audio_"+id)[0].play();*/ }); player.on('pause', function () { @@ -397,6 +442,8 @@ FluidbookVideo.prototype = { }); $this.fluidbook.sound.playAmbientIfNothingIsPlaying(); + + $("#audio_"+id)[0].pause(); }); player.on('fullscreenchange', function () { @@ -473,7 +520,8 @@ FluidbookVideo.prototype = { //console.log('Resulting HTML:', html); popup.html(html); - videojs($('#videoPopup video')); + var player = videojs($('#videoPopup video')); + $('body').addClass('videoPopup'); popup.show(); @@ -550,6 +598,8 @@ FluidbookVideo.prototype = { disposeVideo: function (player) { var id = player.id(); + console.log('id',id) + console.log("this",$(this)) // Save the current player info if it has started if (player.hasStarted()) {