Skip to content

Commit

Permalink
Fix Subs / Audio Tracks
Browse files Browse the repository at this point in the history
  • Loading branch information
jaruba committed Jan 15, 2025
1 parent 2176457 commit 799e968
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/TitanVideo/TitanVideo.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,15 @@ function TitanVideo(options) {
onPropChanged('buffering');
onPropChanged('buffered');
};
var loadedSubsAudio = false;
videoElement.onplaying = function() {
if (!loadedSubsAudio) {
loadedSubsAudio = true;
onPropChanged('subtitlesTracks');
onPropChanged('selectedSubtitlesTrackId');
onPropChanged('audioTracks');
onPropChanged('selectedAudioTrackId');
}
onPropChanged('time');
onPropChanged('buffering');
onPropChanged('buffered');
Expand Down Expand Up @@ -533,10 +541,6 @@ function TitanVideo(options) {
onPropChanged('duration');
onPropChanged('buffering');
onPropChanged('buffered');
onPropChanged('subtitlesTracks');
onPropChanged('selectedSubtitlesTrackId');
onPropChanged('audioTracks');
onPropChanged('selectedAudioTrackId');
videoElement.src = stream.url;
} else {
onError(Object.assign({}, ERROR.UNSUPPORTED_STREAM, {
Expand Down

0 comments on commit 799e968

Please sign in to comment.