Skip to content

Commit

Permalink
fix(TitanVideo): remove buffered support
Browse files Browse the repository at this point in the history
  • Loading branch information
tymmesyde committed Feb 13, 2025
1 parent 9be3a9e commit 7c1bed7
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions src/TitanVideo/TitanVideo.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,48 +35,39 @@ function TitanVideo(options) {
};
videoElement.ontimeupdate = function() {
onPropChanged('time');
onPropChanged('buffered');
};
videoElement.ondurationchange = function() {
onPropChanged('duration');
};
videoElement.onwaiting = function() {
onPropChanged('buffering');
onPropChanged('buffered');
};
videoElement.onseeking = function() {
onPropChanged('time');
onPropChanged('buffering');
onPropChanged('buffered');
};
videoElement.onseeked = function() {
onPropChanged('time');
onPropChanged('buffering');
onPropChanged('buffered');
};
videoElement.onstalled = function() {
onPropChanged('buffering');
onPropChanged('buffered');
};
videoElement.onplaying = function() {
onPropChanged('time');
onPropChanged('buffering');
onPropChanged('buffered');
};
videoElement.oncanplay = function() {
onPropChanged('buffering');
onPropChanged('buffered');
};
videoElement.canplaythrough = function() {
onPropChanged('buffering');
onPropChanged('buffered');
};
videoElement.onloadedmetadata = function() {
onPropChanged('loaded');
};
videoElement.onloadeddata = function() {
onPropChanged('buffering');
onPropChanged('buffered');
};
videoElement.onvolumechange = function() {
onPropChanged('volume');
Expand Down Expand Up @@ -106,7 +97,6 @@ function TitanVideo(options) {
time: false,
duration: false,
buffering: false,
buffered: false,
subtitlesTracks: false,
selectedSubtitlesTrackId: false,
subtitlesOffset: false,
Expand Down Expand Up @@ -161,20 +151,6 @@ function TitanVideo(options) {

return videoElement.readyState < videoElement.HAVE_FUTURE_DATA;
}
case 'buffered': {
if (stream === null) {
return null;
}

var time = videoElement.currentTime !== null && isFinite(videoElement.currentTime) ? videoElement.currentTime : 0;
for (var i = 0; i < videoElement.buffered.length; i++) {
if (videoElement.buffered.start(i) <= time && time <= videoElement.buffered.end(i)) {
return Math.floor(videoElement.buffered.end(i) * 1000);
}
}

return Math.floor(time * 1000);
}
case 'subtitlesTracks': {
if (stream === null) {
return [];
Expand Down Expand Up @@ -529,7 +505,6 @@ function TitanVideo(options) {
onPropChanged('time');
onPropChanged('duration');
onPropChanged('buffering');
onPropChanged('buffered');
if (videoElement.textTracks) {
videoElement.textTracks.onaddtrack = function() {
videoElement.textTracks.onaddtrack = null;
Expand Down Expand Up @@ -571,7 +546,6 @@ function TitanVideo(options) {
onPropChanged('time');
onPropChanged('duration');
onPropChanged('buffering');
onPropChanged('buffered');
onPropChanged('subtitlesTracks');
onPropChanged('selectedSubtitlesTrackId');
onPropChanged('audioTracks');
Expand Down Expand Up @@ -659,7 +633,7 @@ TitanVideo.canPlayStream = function(stream) {
TitanVideo.manifest = {
name: 'TitanVideo',
external: false,
props: ['stream', 'loaded', 'paused', 'time', 'duration', 'buffering', 'buffered', 'audioTracks', 'selectedAudioTrackId', 'subtitlesTracks', 'selectedSubtitlesTrackId', 'subtitlesOffset', 'subtitlesSize', 'subtitlesTextColor', 'subtitlesBackgroundColor', 'subtitlesOutlineColor', 'volume', 'muted', 'playbackSpeed'],
props: ['stream', 'loaded', 'paused', 'time', 'duration', 'buffering', 'audioTracks', 'selectedAudioTrackId', 'subtitlesTracks', 'selectedSubtitlesTrackId', 'subtitlesOffset', 'subtitlesSize', 'subtitlesTextColor', 'subtitlesBackgroundColor', 'subtitlesOutlineColor', 'volume', 'muted', 'playbackSpeed'],
commands: ['load', 'unload', 'destroy'],
events: ['propValue', 'propChanged', 'ended', 'error', 'subtitlesTrackLoaded', 'audioTrackLoaded']
};
Expand Down

0 comments on commit 7c1bed7

Please sign in to comment.