]> _ Git - fluidbook-html5.git/commitdiff
wip #7885
authorsoufiane <soufiane@cubedesigners.com>
Tue, 6 Jan 2026 19:29:10 +0000 (20:29 +0100)
committersoufiane <soufiane@cubedesigners.com>
Tue, 6 Jan 2026 19:29:10 +0000 (20:29 +0100)
js/libs/fluidbook/fluidbook.video.js

index 7fca1af4795cb4405e360ab891cfd7306318fb97..9fc7781d6d79a5e91f8da54100db237e244bbde3 100644 (file)
@@ -323,6 +323,7 @@ FluidbookVideo.prototype = {
 
         // Get the current player's AudioTrackList object.
         var audioTrackList = player.audioTracks();
+
         player.ready(function () {
             // Hide CC if disabled in video settings
             console.log('cc', cc);
@@ -472,11 +473,13 @@ FluidbookVideo.prototype = {
 
         // synchronize video and audio
         player.on('timeupdate', function () {
-            syncAudioAndVideo(audioTrackList)
+            //syncAudioAndVideo(audioTrackList)
         })
 
         // Listen to the "change" event.
         audioTrackList.addEventListener('change', function() {
+            player.muted(1)
+
             // Log the currently enabled AudioTrack label.
             for (var i = 0; i < audioTrackList.length; i++) {
                 var track = audioTrackList[i];
@@ -485,6 +488,7 @@ FluidbookVideo.prototype = {
 
                 if (track.enabled) {
                     $("audio#"+track.id)[0].play()
+                    $("audio#"+track.id)[0].currentTime = player.currentTime()
                     return;
                 }
             }