2019-01-10 05:39:37 -07:00
|
|
|
define(['appSettings', 'browser', 'events'], function (appSettings, browser, events) {
|
|
|
|
'use strict';
|
2018-10-22 15:05:09 -07:00
|
|
|
|
|
|
|
function getSavedVolume() {
|
2020-05-04 03:44:12 -07:00
|
|
|
return appSettings.get('volume') || 1;
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function saveVolume(value) {
|
2019-01-10 05:39:37 -07:00
|
|
|
if (value) {
|
2020-05-04 03:44:12 -07:00
|
|
|
appSettings.set('volume', value);
|
2019-01-10 05:39:37 -07:00
|
|
|
}
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function getCrossOriginValue(mediaSource) {
|
2019-01-10 05:39:37 -07:00
|
|
|
if (mediaSource.IsRemote) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 'anonymous';
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function canPlayNativeHls() {
|
2019-01-10 05:39:37 -07:00
|
|
|
var media = document.createElement('video');
|
|
|
|
|
|
|
|
if (media.canPlayType('application/x-mpegURL').replace(/no/, '') ||
|
|
|
|
media.canPlayType('application/vnd.apple.mpegURL').replace(/no/, '')) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function enableHlsShakaPlayer(item, mediaSource, mediaType) {
|
2020-04-04 12:29:53 -07:00
|
|
|
/* eslint-disable-next-line compat/compat */
|
2019-01-10 05:39:37 -07:00
|
|
|
if (!!window.MediaSource && !!MediaSource.isTypeSupported) {
|
|
|
|
|
2018-10-22 15:05:09 -07:00
|
|
|
if (canPlayNativeHls()) {
|
2019-01-10 05:39:37 -07:00
|
|
|
|
|
|
|
if (browser.edge && mediaType === 'Video') {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
// simple playback should use the native support
|
|
|
|
if (mediaSource.RunTimeTicks) {
|
|
|
|
//if (!browser.edge) {
|
|
|
|
//return false;
|
|
|
|
//}
|
|
|
|
}
|
|
|
|
|
|
|
|
//return false;
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
2019-01-10 05:39:37 -07:00
|
|
|
|
|
|
|
return true;
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
2019-01-10 05:39:37 -07:00
|
|
|
|
|
|
|
return false;
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function enableHlsJsPlayer(runTimeTicks, mediaType) {
|
2019-01-10 05:39:37 -07:00
|
|
|
|
|
|
|
if (window.MediaSource == null) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// hls.js is only in beta. needs more testing.
|
|
|
|
if (browser.iOS) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// The native players on these devices support seeking live streams, no need to use hls.js here
|
|
|
|
if (browser.tizen || browser.web0s) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2018-10-22 15:05:09 -07:00
|
|
|
if (canPlayNativeHls()) {
|
2019-01-10 05:39:37 -07:00
|
|
|
|
|
|
|
// Having trouble with chrome's native support and transcoded music
|
|
|
|
if (browser.android && mediaType === 'Audio') {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (browser.edge && mediaType === 'Video') {
|
|
|
|
//return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
// simple playback should use the native support
|
|
|
|
if (runTimeTicks) {
|
|
|
|
//if (!browser.edge) {
|
|
|
|
return false;
|
|
|
|
//}
|
|
|
|
}
|
|
|
|
|
|
|
|
//return false;
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
2019-01-10 05:39:37 -07:00
|
|
|
|
|
|
|
return true;
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
|
|
|
|
2019-11-22 08:29:38 -07:00
|
|
|
var recoverDecodingErrorDate;
|
|
|
|
var recoverSwapAudioCodecDate;
|
2018-10-22 15:05:09 -07:00
|
|
|
function handleHlsJsMediaError(instance, reject) {
|
2019-01-10 05:39:37 -07:00
|
|
|
|
2018-10-22 15:05:09 -07:00
|
|
|
var hlsPlayer = instance._hlsPlayer;
|
2019-01-10 05:39:37 -07:00
|
|
|
|
|
|
|
if (!hlsPlayer) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
var now = Date.now();
|
|
|
|
|
|
|
|
if (window.performance && window.performance.now) {
|
2020-05-07 08:21:26 -07:00
|
|
|
now = performance.now(); // eslint-disable-line compat/compat
|
2019-01-10 05:39:37 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!recoverDecodingErrorDate || (now - recoverDecodingErrorDate) > 3000) {
|
|
|
|
recoverDecodingErrorDate = now;
|
2020-02-15 19:44:43 -07:00
|
|
|
console.debug('try to recover media Error ...');
|
2019-01-10 05:39:37 -07:00
|
|
|
hlsPlayer.recoverMediaError();
|
|
|
|
} else {
|
|
|
|
if (!recoverSwapAudioCodecDate || (now - recoverSwapAudioCodecDate) > 3000) {
|
|
|
|
recoverSwapAudioCodecDate = now;
|
2020-02-15 19:44:43 -07:00
|
|
|
console.debug('try to swap Audio Codec and recover media Error ...');
|
2019-01-10 05:39:37 -07:00
|
|
|
hlsPlayer.swapAudioCodec();
|
|
|
|
hlsPlayer.recoverMediaError();
|
|
|
|
} else {
|
|
|
|
console.error('cannot recover, last media error recovery failed ...');
|
|
|
|
|
|
|
|
if (reject) {
|
|
|
|
reject();
|
|
|
|
} else {
|
|
|
|
onErrorInternal(instance, 'mediadecodeerror');
|
|
|
|
}
|
|
|
|
}
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function onErrorInternal(instance, type) {
|
2019-01-10 05:39:37 -07:00
|
|
|
|
|
|
|
// Needed for video
|
|
|
|
if (instance.destroyCustomTrack) {
|
|
|
|
instance.destroyCustomTrack(instance._mediaElement);
|
|
|
|
}
|
|
|
|
|
|
|
|
events.trigger(instance, 'error', [
|
|
|
|
{
|
|
|
|
type: type
|
2019-11-22 08:29:38 -07:00
|
|
|
}
|
|
|
|
]);
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function isValidDuration(duration) {
|
2019-01-10 05:39:37 -07:00
|
|
|
if (duration && !isNaN(duration) && duration !== Number.POSITIVE_INFINITY && duration !== Number.NEGATIVE_INFINITY) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
|
|
|
|
2019-01-10 05:39:37 -07:00
|
|
|
function setCurrentTimeIfNeeded(element, seconds) {
|
|
|
|
if (Math.abs(element.currentTime || 0, seconds) <= 1) {
|
|
|
|
element.currentTime = seconds;
|
|
|
|
}
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
|
|
|
|
2020-04-15 09:29:21 -07:00
|
|
|
function seekOnPlaybackStart(instance, element, ticks, onMediaReady) {
|
2019-01-10 05:39:37 -07:00
|
|
|
|
|
|
|
var seconds = (ticks || 0) / 10000000;
|
|
|
|
|
2018-10-22 15:05:09 -07:00
|
|
|
if (seconds) {
|
2019-01-10 05:39:37 -07:00
|
|
|
var src = (instance.currentSrc() || '').toLowerCase();
|
|
|
|
|
|
|
|
// Appending #t=xxx to the query string doesn't seem to work with HLS
|
|
|
|
// For plain video files, not all browsers support it either
|
2020-04-07 07:33:51 -07:00
|
|
|
|
|
|
|
if (element.duration >= seconds) {
|
|
|
|
// media is ready, seek immediately
|
2019-01-10 05:39:37 -07:00
|
|
|
setCurrentTimeIfNeeded(element, seconds);
|
2020-04-15 09:29:21 -07:00
|
|
|
if (onMediaReady) onMediaReady();
|
2020-04-07 07:33:51 -07:00
|
|
|
} else {
|
|
|
|
// update video player position when media is ready to be sought
|
2020-05-04 03:44:12 -07:00
|
|
|
var events = ['durationchange', 'loadeddata', 'play', 'loadedmetadata'];
|
2020-04-07 07:33:51 -07:00
|
|
|
var onMediaChange = function(e) {
|
|
|
|
if (element.currentTime === 0 && element.duration >= seconds) {
|
|
|
|
// seek only when video position is exactly zero,
|
|
|
|
// as this is true only if video hasn't started yet or
|
|
|
|
// user rewound to the very beginning
|
|
|
|
// (but rewinding cannot happen as the first event with media of non-empty duration)
|
2020-04-07 13:32:08 -07:00
|
|
|
console.debug(`seeking to ${seconds} on ${e.type} event`);
|
2020-04-07 07:33:51 -07:00
|
|
|
setCurrentTimeIfNeeded(element, seconds);
|
|
|
|
events.map(function(name) {
|
|
|
|
element.removeEventListener(name, onMediaChange);
|
|
|
|
});
|
2020-04-15 09:29:21 -07:00
|
|
|
if (onMediaReady) onMediaReady();
|
2020-04-07 07:33:51 -07:00
|
|
|
}
|
|
|
|
};
|
|
|
|
events.map(function (name) {
|
2020-04-13 19:03:03 -07:00
|
|
|
return element.addEventListener(name, onMediaChange);
|
2020-04-07 07:33:51 -07:00
|
|
|
});
|
2019-01-10 05:39:37 -07:00
|
|
|
}
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function applySrc(elem, src, options) {
|
2019-01-10 05:39:37 -07:00
|
|
|
|
|
|
|
if (window.Windows && options.mediaSource && options.mediaSource.IsLocal) {
|
|
|
|
|
|
|
|
return Windows.Storage.StorageFile.getFileFromPathAsync(options.url).then(function (file) {
|
|
|
|
|
|
|
|
var playlist = new Windows.Media.Playback.MediaPlaybackList();
|
|
|
|
|
|
|
|
var source1 = Windows.Media.Core.MediaSource.createFromStorageFile(file);
|
|
|
|
var startTime = (options.playerStartPositionTicks || 0) / 10000;
|
|
|
|
playlist.items.append(new Windows.Media.Playback.MediaPlaybackItem(source1, startTime));
|
|
|
|
elem.src = URL.createObjectURL(playlist, { oneTimeOnly: true });
|
|
|
|
return Promise.resolve();
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
elem.src = src;
|
|
|
|
}
|
|
|
|
|
|
|
|
return Promise.resolve();
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function onSuccessfulPlay(elem, onErrorFn) {
|
2019-01-10 05:39:37 -07:00
|
|
|
|
|
|
|
elem.addEventListener('error', onErrorFn);
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function playWithPromise(elem, onErrorFn) {
|
2019-01-10 05:39:37 -07:00
|
|
|
|
2018-10-22 15:05:09 -07:00
|
|
|
try {
|
|
|
|
var promise = elem.play();
|
2019-01-10 05:39:37 -07:00
|
|
|
if (promise && promise.then) {
|
|
|
|
// Chrome now returns a promise
|
|
|
|
return promise.catch(function (e) {
|
|
|
|
|
|
|
|
var errorName = (e.name || '').toLowerCase();
|
|
|
|
// safari uses aborterror
|
|
|
|
if (errorName === 'notallowederror' ||
|
|
|
|
errorName === 'aborterror') {
|
|
|
|
// swallow this error because the user can still click the play button on the video element
|
|
|
|
onSuccessfulPlay(elem, onErrorFn);
|
|
|
|
return Promise.resolve();
|
|
|
|
}
|
|
|
|
return Promise.reject();
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
onSuccessfulPlay(elem, onErrorFn);
|
|
|
|
return Promise.resolve();
|
|
|
|
}
|
2018-10-22 15:05:09 -07:00
|
|
|
} catch (err) {
|
2020-02-15 19:44:43 -07:00
|
|
|
console.error('error calling video.play: ' + err);
|
2019-01-10 05:39:37 -07:00
|
|
|
return Promise.reject();
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function destroyCastPlayer(instance) {
|
2019-01-10 05:39:37 -07:00
|
|
|
|
2018-10-22 15:05:09 -07:00
|
|
|
var player = instance._castPlayer;
|
|
|
|
if (player) {
|
|
|
|
try {
|
2019-01-10 05:39:37 -07:00
|
|
|
player.unload();
|
2018-10-22 15:05:09 -07:00
|
|
|
} catch (err) {
|
2020-02-15 19:44:43 -07:00
|
|
|
console.error(err);
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
2019-01-10 05:39:37 -07:00
|
|
|
|
|
|
|
instance._castPlayer = null;
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function destroyShakaPlayer(instance) {
|
|
|
|
var player = instance._shakaPlayer;
|
|
|
|
if (player) {
|
|
|
|
try {
|
2019-01-10 05:39:37 -07:00
|
|
|
player.destroy();
|
2018-10-22 15:05:09 -07:00
|
|
|
} catch (err) {
|
2020-02-15 19:44:43 -07:00
|
|
|
console.error(err);
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
2019-01-10 05:39:37 -07:00
|
|
|
|
|
|
|
instance._shakaPlayer = null;
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function destroyHlsPlayer(instance) {
|
|
|
|
var player = instance._hlsPlayer;
|
|
|
|
if (player) {
|
|
|
|
try {
|
2019-01-10 05:39:37 -07:00
|
|
|
player.destroy();
|
2018-10-22 15:05:09 -07:00
|
|
|
} catch (err) {
|
2020-02-15 19:44:43 -07:00
|
|
|
console.error(err);
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
2019-01-10 05:39:37 -07:00
|
|
|
|
|
|
|
instance._hlsPlayer = null;
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function destroyFlvPlayer(instance) {
|
|
|
|
var player = instance._flvPlayer;
|
|
|
|
if (player) {
|
|
|
|
try {
|
2019-01-10 05:39:37 -07:00
|
|
|
player.unload();
|
|
|
|
player.detachMediaElement();
|
|
|
|
player.destroy();
|
2018-10-22 15:05:09 -07:00
|
|
|
} catch (err) {
|
2020-02-15 19:44:43 -07:00
|
|
|
console.error(err);
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
2019-01-10 05:39:37 -07:00
|
|
|
|
|
|
|
instance._flvPlayer = null;
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function bindEventsToHlsPlayer(instance, hls, elem, onErrorFn, resolve, reject) {
|
2019-01-10 05:39:37 -07:00
|
|
|
|
|
|
|
hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
|
|
|
playWithPromise(elem, onErrorFn).then(resolve, function () {
|
|
|
|
|
|
|
|
if (reject) {
|
|
|
|
reject();
|
|
|
|
reject = null;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
hls.on(Hls.Events.ERROR, function (event, data) {
|
|
|
|
|
2020-02-15 19:44:43 -07:00
|
|
|
console.error('HLS Error: Type: ' + data.type + ' Details: ' + (data.details || '') + ' Fatal: ' + (data.fatal || false));
|
2019-01-10 05:39:37 -07:00
|
|
|
|
|
|
|
switch (data.type) {
|
2018-10-22 15:05:09 -07:00
|
|
|
case Hls.ErrorTypes.NETWORK_ERROR:
|
2019-01-10 05:39:37 -07:00
|
|
|
// try to recover network error
|
|
|
|
if (data.response && data.response.code && data.response.code >= 400) {
|
|
|
|
|
2020-02-15 19:44:43 -07:00
|
|
|
console.debug('hls.js response error code: ' + data.response.code);
|
2019-01-10 05:39:37 -07:00
|
|
|
|
|
|
|
// Trigger failure differently depending on whether this is prior to start of playback, or after
|
|
|
|
hls.destroy();
|
|
|
|
|
|
|
|
if (reject) {
|
|
|
|
reject('servererror');
|
|
|
|
reject = null;
|
|
|
|
} else {
|
|
|
|
onErrorInternal(instance, 'servererror');
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2018-10-22 15:05:09 -07:00
|
|
|
break;
|
|
|
|
default:
|
2019-01-10 05:39:37 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (data.fatal) {
|
|
|
|
switch (data.type) {
|
|
|
|
case Hls.ErrorTypes.NETWORK_ERROR:
|
|
|
|
|
|
|
|
if (data.response && data.response.code === 0) {
|
|
|
|
|
|
|
|
// This could be a CORS error related to access control response headers
|
|
|
|
|
2020-02-15 19:44:43 -07:00
|
|
|
console.debug('hls.js response error code: ' + data.response.code);
|
2019-01-10 05:39:37 -07:00
|
|
|
|
|
|
|
// Trigger failure differently depending on whether this is prior to start of playback, or after
|
|
|
|
hls.destroy();
|
|
|
|
|
|
|
|
if (reject) {
|
|
|
|
reject('network');
|
|
|
|
reject = null;
|
|
|
|
} else {
|
|
|
|
onErrorInternal(instance, 'network');
|
|
|
|
}
|
2019-11-22 08:29:38 -07:00
|
|
|
} else {
|
2020-05-04 03:44:12 -07:00
|
|
|
console.debug('fatal network error encountered, try to recover');
|
2019-01-10 05:39:37 -07:00
|
|
|
hls.startLoad();
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
case Hls.ErrorTypes.MEDIA_ERROR:
|
2020-05-04 03:44:12 -07:00
|
|
|
console.debug('fatal media error encountered, try to recover');
|
2019-01-10 05:39:37 -07:00
|
|
|
var currentReject = reject;
|
|
|
|
reject = null;
|
|
|
|
handleHlsJsMediaError(instance, currentReject);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
|
2020-02-15 19:44:43 -07:00
|
|
|
console.debug('Cannot recover from hls error - destroy and trigger error');
|
2019-01-10 05:39:37 -07:00
|
|
|
// cannot recover
|
|
|
|
// Trigger failure differently depending on whether this is prior to start of playback, or after
|
|
|
|
hls.destroy();
|
|
|
|
|
|
|
|
if (reject) {
|
|
|
|
reject();
|
|
|
|
reject = null;
|
|
|
|
} else {
|
|
|
|
onErrorInternal(instance, 'mediadecodeerror');
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
2019-01-10 05:39:37 -07:00
|
|
|
});
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function onEndedInternal(instance, elem, onErrorFn) {
|
2019-01-10 05:39:37 -07:00
|
|
|
|
|
|
|
elem.removeEventListener('error', onErrorFn);
|
|
|
|
|
|
|
|
elem.src = '';
|
|
|
|
elem.innerHTML = '';
|
2020-05-04 03:44:12 -07:00
|
|
|
elem.removeAttribute('src');
|
2019-01-10 05:39:37 -07:00
|
|
|
|
|
|
|
destroyHlsPlayer(instance);
|
|
|
|
destroyFlvPlayer(instance);
|
|
|
|
destroyShakaPlayer(instance);
|
|
|
|
destroyCastPlayer(instance);
|
|
|
|
|
2018-10-22 15:05:09 -07:00
|
|
|
var stopInfo = {
|
|
|
|
src: instance._currentSrc
|
|
|
|
};
|
2019-01-10 05:39:37 -07:00
|
|
|
|
|
|
|
events.trigger(instance, 'stopped', [stopInfo]);
|
|
|
|
|
|
|
|
instance._currentTime = null;
|
|
|
|
instance._currentSrc = null;
|
|
|
|
instance._currentPlayOptions = null;
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function getBufferedRanges(instance, elem) {
|
2019-01-10 05:39:37 -07:00
|
|
|
|
|
|
|
var ranges = [];
|
|
|
|
var seekable = elem.buffered || [];
|
|
|
|
|
|
|
|
var offset;
|
|
|
|
var currentPlayOptions = instance._currentPlayOptions;
|
|
|
|
if (currentPlayOptions) {
|
|
|
|
offset = currentPlayOptions.transcodingOffsetTicks;
|
|
|
|
}
|
|
|
|
|
|
|
|
offset = offset || 0;
|
|
|
|
|
2018-10-22 15:05:09 -07:00
|
|
|
for (var i = 0, length = seekable.length; i < length; i++) {
|
2019-01-10 05:39:37 -07:00
|
|
|
|
|
|
|
var start = seekable.start(i);
|
|
|
|
var end = seekable.end(i);
|
|
|
|
|
|
|
|
if (!isValidDuration(start)) {
|
|
|
|
start = 0;
|
|
|
|
}
|
|
|
|
if (!isValidDuration(end)) {
|
|
|
|
end = 0;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
ranges.push({
|
|
|
|
start: (start * 10000000) + offset,
|
|
|
|
end: (end * 10000000) + offset
|
|
|
|
});
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
2019-01-10 05:39:37 -07:00
|
|
|
|
|
|
|
return ranges;
|
2018-10-22 15:05:09 -07:00
|
|
|
}
|
2019-01-10 05:39:37 -07:00
|
|
|
|
2018-10-22 15:05:09 -07:00
|
|
|
return {
|
|
|
|
getSavedVolume: getSavedVolume,
|
|
|
|
saveVolume: saveVolume,
|
|
|
|
enableHlsJsPlayer: enableHlsJsPlayer,
|
|
|
|
enableHlsShakaPlayer: enableHlsShakaPlayer,
|
|
|
|
handleHlsJsMediaError: handleHlsJsMediaError,
|
|
|
|
isValidDuration: isValidDuration,
|
|
|
|
onErrorInternal: onErrorInternal,
|
|
|
|
seekOnPlaybackStart: seekOnPlaybackStart,
|
|
|
|
applySrc: applySrc,
|
|
|
|
playWithPromise: playWithPromise,
|
|
|
|
destroyHlsPlayer: destroyHlsPlayer,
|
|
|
|
destroyFlvPlayer: destroyFlvPlayer,
|
|
|
|
destroyCastPlayer: destroyCastPlayer,
|
|
|
|
bindEventsToHlsPlayer: bindEventsToHlsPlayer,
|
|
|
|
onEndedInternal: onEndedInternal,
|
|
|
|
getCrossOriginValue: getCrossOriginValue,
|
|
|
|
getBufferedRanges: getBufferedRanges
|
2019-01-10 05:39:37 -07:00
|
|
|
};
|
2020-02-22 09:47:03 -07:00
|
|
|
});
|