xgplayer-streaming-shared
Advanced tools
Comparing version 3.0.14-alpha.1 to 3.0.14-alpha.2
@@ -19,2 +19,3 @@ export type MSEErrorType = string; | ||
openLog: boolean; | ||
perferMMS: boolean; | ||
}; | ||
@@ -130,7 +131,1 @@ /** | ||
} | ||
declare const MediaSource: { | ||
new (): MediaSource; | ||
prototype: MediaSource; | ||
isTypeSupported(type: string): boolean; | ||
}; | ||
export {}; |
@@ -8,8 +8,12 @@ import { defineProperty as _defineProperty, inherits as _inherits, createSuper as _createSuper, createClass as _createClass, classCallCheck as _classCallCheck, wrapNativeSuper as _wrapNativeSuper, asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime } from "./_virtual/_rollupPluginBabelHelpers.js"; | ||
function getMediaSource() { | ||
var preferMMS = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true; | ||
try { | ||
return isBrowser ? window.MediaSource : null; | ||
if (!isBrowser) | ||
return null; | ||
if (preferMMS && typeof ManagedMediaSource !== "undefined") | ||
return ManagedMediaSource; | ||
return window.MediaSource; | ||
} catch (e) { | ||
} | ||
} | ||
var MediaSource = getMediaSource(); | ||
var MSEErrorType = { | ||
@@ -169,3 +173,3 @@ UPDATE_ERROR: "updateError" | ||
var _this5 = this; | ||
var ms, onOpen; | ||
var MediaSource, ms, onOpen; | ||
return _regeneratorRuntime().wrap(function _callee$(_context) { | ||
@@ -182,8 +186,9 @@ while (1) | ||
case 3: | ||
MediaSource = getMediaSource(this._config.perferMMS); | ||
if (!(!media || !MediaSource)) { | ||
_context.next = 5; | ||
_context.next = 6; | ||
break; | ||
} | ||
throw new Error("Param media or MediaSource does not exist"); | ||
case 5: | ||
case 6: | ||
this.media = media; | ||
@@ -204,4 +209,9 @@ ms = this.mediaSource = new MediaSource(); | ||
media.src = this._url; | ||
if (MediaSource.name === "ManagedMediaSource") { | ||
media.disableRemotePlayback = true; | ||
} else { | ||
media.disableRemotePlayback = false; | ||
} | ||
return _context.abrupt("return", this._openPromise); | ||
case 13: | ||
case 15: | ||
case "end": | ||
@@ -256,2 +266,3 @@ return _context.stop(); | ||
if (this.media) { | ||
this.media.disableRemotePlayback = false; | ||
this.media.removeAttribute("src"); | ||
@@ -594,3 +605,4 @@ try { | ||
return { | ||
openLog: false | ||
openLog: false, | ||
perferMMS: false | ||
}; | ||
@@ -602,2 +614,3 @@ } | ||
var mime = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 'video/mp4; codecs="avc1.42E01E,mp4a.40.2"'; | ||
var MediaSource = getMediaSource(); | ||
if (!MediaSource) | ||
@@ -604,0 +617,0 @@ return false; |
{ | ||
"name": "xgplayer-streaming-shared", | ||
"version": "3.0.14-alpha.1", | ||
"version": "3.0.14-alpha.2", | ||
"main": "dist/index.min.js", | ||
@@ -5,0 +5,0 @@ "module": "es/index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
354863
4614