byteark-player-react
Advanced tools
Comparing version 1.0.0-beta4 to 1.0.0-beta5
@@ -262,3 +262,3 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
var defautlSetupPlayerFunction = function defautlSetupPlayerFunction(options, loaderFunction, loadPluginOptions) { | ||
var defaultSetupPlayerFunction = function defaultSetupPlayerFunction(options, loaderFunction, loadPluginOptions) { | ||
try { | ||
@@ -339,14 +339,2 @@ return Promise.resolve(bytearkPlayer.setup(options, loaderFunction, loadPluginOptions)).then(function () {}); | ||
_this.componentDidMount = function () { | ||
try { | ||
return Promise.resolve(_this.loadPlayerResources()).then(function () { | ||
return Promise.resolve(_this.setupPlayer()).then(function () { | ||
return Promise.resolve(_this.createPlayerInstance()).then(function () {}); | ||
}); | ||
}); | ||
} catch (e) { | ||
return Promise.reject(e); | ||
} | ||
}; | ||
_this.createPlayerInstance = function () { | ||
@@ -376,2 +364,3 @@ try { | ||
_this.state = { | ||
mounted: false, | ||
loaded: false, | ||
@@ -402,8 +391,34 @@ ready: false, | ||
_proto.componentDidMount = function componentDidMount() { | ||
this.initializePlayer(); | ||
}; | ||
_proto.initializePlayer = function initializePlayer() { | ||
try { | ||
var _this3 = this; | ||
return Promise.resolve(_this3.loadPlayerResources()).then(function () { | ||
var isClient = typeof window !== 'undefined'; | ||
var _temp = function () { | ||
if (isClient) { | ||
return Promise.resolve(_this3.setupPlayer()).then(function () { | ||
return Promise.resolve(_this3.createPlayerInstance()).then(function () {}); | ||
}); | ||
} | ||
}(); | ||
if (_temp && _temp.then) return _temp.then(function () {}); | ||
}); | ||
} catch (e) { | ||
return Promise.reject(e); | ||
} | ||
}; | ||
_proto.loadPlayerResources = function loadPlayerResources() { | ||
try { | ||
var _temp3 = function _temp3(_result) { | ||
var _temp4 = function _temp4(_result) { | ||
if (_exit2) return _result; | ||
_this3.onPlayerLoaded(); | ||
_this5.onPlayerLoaded(); | ||
}; | ||
@@ -413,13 +428,13 @@ | ||
var _this3 = this; | ||
var _this5 = this; | ||
var _temp4 = _catch(function () { | ||
var _temp5 = _catch(function () { | ||
var promises = []; | ||
if (_this3.props.playerJsFileName) { | ||
promises.push(loadScriptOrStyle("byteark-player-script-" + _this3.props.playerVersion, _this3.props.playerEndpoint + "/" + _this3.props.playerVersion + "/" + _this3.props.playerJsFileName, 'script')); | ||
if (_this5.props.playerJsFileName) { | ||
promises.push(loadScriptOrStyle("byteark-player-script-" + _this5.props.playerVersion, _this5.props.playerEndpoint + "/" + _this5.props.playerVersion + "/" + _this5.props.playerJsFileName, 'script')); | ||
} | ||
if (_this3.props.playerCssFileName) { | ||
promises.push(loadScriptOrStyle("byteark-player-style-" + _this3.props.playerVersion, _this3.props.playerEndpoint + "/" + _this3.props.playerVersion + "/" + _this3.props.playerCssFileName, 'style')); | ||
if (_this5.props.playerCssFileName) { | ||
promises.push(loadScriptOrStyle("byteark-player-style-" + _this5.props.playerVersion, _this5.props.playerEndpoint + "/" + _this5.props.playerVersion + "/" + _this5.props.playerCssFileName, 'style')); | ||
} | ||
@@ -429,3 +444,3 @@ | ||
}, function (originalError) { | ||
_this3.onPlayerLoadError({ | ||
_this5.onPlayerLoadError({ | ||
code: 'ERROR_BYTEARK_PLAYER_REACT_100001', | ||
@@ -439,3 +454,3 @@ message: 'Sorry, something wrong when loading the video player.', | ||
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp3) : _temp3(_temp4)); | ||
return Promise.resolve(_temp5 && _temp5.then ? _temp5.then(_temp4) : _temp4(_temp5)); | ||
} catch (e) { | ||
@@ -448,10 +463,10 @@ return Promise.reject(e); | ||
try { | ||
var _this5 = this; | ||
var _this7 = this; | ||
return Promise.resolve(_catch(function () { | ||
return Promise.resolve(_this5.props.setupPlayerFunction(_this5.props, loadScriptOrStyle)).then(function () { | ||
_this5.onPlayerSetup(); | ||
return Promise.resolve(_this7.props.setupPlayerFunction(_this7.props, loadScriptOrStyle)).then(function () { | ||
_this7.onPlayerSetup(); | ||
}); | ||
}, function (originalError) { | ||
_this5.onPlayerSetupError({ | ||
_this7.onPlayerSetupError({ | ||
code: 'ERROR_BYTEARK_PLAYER_REACT_100001', | ||
@@ -524,3 +539,3 @@ message: 'Sorry, something wrong when loading the video player.', | ||
createPlayerFunction: defaultCreatePlayerFunction, | ||
setupPlayerFunction: defautlSetupPlayerFunction, | ||
setupPlayerFunction: defaultSetupPlayerFunction, | ||
playerEndpoint: 'https://byteark-sdk.cdn.byteark.com/player-core/', | ||
@@ -527,0 +542,0 @@ playerVersion: 'v2', |
@@ -260,3 +260,3 @@ import React from 'react'; | ||
var defautlSetupPlayerFunction = function defautlSetupPlayerFunction(options, loaderFunction, loadPluginOptions) { | ||
var defaultSetupPlayerFunction = function defaultSetupPlayerFunction(options, loaderFunction, loadPluginOptions) { | ||
try { | ||
@@ -337,14 +337,2 @@ return Promise.resolve(bytearkPlayer.setup(options, loaderFunction, loadPluginOptions)).then(function () {}); | ||
_this.componentDidMount = function () { | ||
try { | ||
return Promise.resolve(_this.loadPlayerResources()).then(function () { | ||
return Promise.resolve(_this.setupPlayer()).then(function () { | ||
return Promise.resolve(_this.createPlayerInstance()).then(function () {}); | ||
}); | ||
}); | ||
} catch (e) { | ||
return Promise.reject(e); | ||
} | ||
}; | ||
_this.createPlayerInstance = function () { | ||
@@ -374,2 +362,3 @@ try { | ||
_this.state = { | ||
mounted: false, | ||
loaded: false, | ||
@@ -400,8 +389,34 @@ ready: false, | ||
_proto.componentDidMount = function componentDidMount() { | ||
this.initializePlayer(); | ||
}; | ||
_proto.initializePlayer = function initializePlayer() { | ||
try { | ||
var _this3 = this; | ||
return Promise.resolve(_this3.loadPlayerResources()).then(function () { | ||
var isClient = typeof window !== 'undefined'; | ||
var _temp = function () { | ||
if (isClient) { | ||
return Promise.resolve(_this3.setupPlayer()).then(function () { | ||
return Promise.resolve(_this3.createPlayerInstance()).then(function () {}); | ||
}); | ||
} | ||
}(); | ||
if (_temp && _temp.then) return _temp.then(function () {}); | ||
}); | ||
} catch (e) { | ||
return Promise.reject(e); | ||
} | ||
}; | ||
_proto.loadPlayerResources = function loadPlayerResources() { | ||
try { | ||
var _temp3 = function _temp3(_result) { | ||
var _temp4 = function _temp4(_result) { | ||
if (_exit2) return _result; | ||
_this3.onPlayerLoaded(); | ||
_this5.onPlayerLoaded(); | ||
}; | ||
@@ -411,13 +426,13 @@ | ||
var _this3 = this; | ||
var _this5 = this; | ||
var _temp4 = _catch(function () { | ||
var _temp5 = _catch(function () { | ||
var promises = []; | ||
if (_this3.props.playerJsFileName) { | ||
promises.push(loadScriptOrStyle("byteark-player-script-" + _this3.props.playerVersion, _this3.props.playerEndpoint + "/" + _this3.props.playerVersion + "/" + _this3.props.playerJsFileName, 'script')); | ||
if (_this5.props.playerJsFileName) { | ||
promises.push(loadScriptOrStyle("byteark-player-script-" + _this5.props.playerVersion, _this5.props.playerEndpoint + "/" + _this5.props.playerVersion + "/" + _this5.props.playerJsFileName, 'script')); | ||
} | ||
if (_this3.props.playerCssFileName) { | ||
promises.push(loadScriptOrStyle("byteark-player-style-" + _this3.props.playerVersion, _this3.props.playerEndpoint + "/" + _this3.props.playerVersion + "/" + _this3.props.playerCssFileName, 'style')); | ||
if (_this5.props.playerCssFileName) { | ||
promises.push(loadScriptOrStyle("byteark-player-style-" + _this5.props.playerVersion, _this5.props.playerEndpoint + "/" + _this5.props.playerVersion + "/" + _this5.props.playerCssFileName, 'style')); | ||
} | ||
@@ -427,3 +442,3 @@ | ||
}, function (originalError) { | ||
_this3.onPlayerLoadError({ | ||
_this5.onPlayerLoadError({ | ||
code: 'ERROR_BYTEARK_PLAYER_REACT_100001', | ||
@@ -437,3 +452,3 @@ message: 'Sorry, something wrong when loading the video player.', | ||
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp3) : _temp3(_temp4)); | ||
return Promise.resolve(_temp5 && _temp5.then ? _temp5.then(_temp4) : _temp4(_temp5)); | ||
} catch (e) { | ||
@@ -446,10 +461,10 @@ return Promise.reject(e); | ||
try { | ||
var _this5 = this; | ||
var _this7 = this; | ||
return Promise.resolve(_catch(function () { | ||
return Promise.resolve(_this5.props.setupPlayerFunction(_this5.props, loadScriptOrStyle)).then(function () { | ||
_this5.onPlayerSetup(); | ||
return Promise.resolve(_this7.props.setupPlayerFunction(_this7.props, loadScriptOrStyle)).then(function () { | ||
_this7.onPlayerSetup(); | ||
}); | ||
}, function (originalError) { | ||
_this5.onPlayerSetupError({ | ||
_this7.onPlayerSetupError({ | ||
code: 'ERROR_BYTEARK_PLAYER_REACT_100001', | ||
@@ -522,3 +537,3 @@ message: 'Sorry, something wrong when loading the video player.', | ||
createPlayerFunction: defaultCreatePlayerFunction, | ||
setupPlayerFunction: defautlSetupPlayerFunction, | ||
setupPlayerFunction: defaultSetupPlayerFunction, | ||
playerEndpoint: 'https://byteark-sdk.cdn.byteark.com/player-core/', | ||
@@ -525,0 +540,0 @@ playerVersion: 'v2', |
{ | ||
"name": "byteark-player-react", | ||
"version": "1.0.0-beta4", | ||
"version": "1.0.0-beta5", | ||
"description": "ByteArk Player Container for React", | ||
@@ -5,0 +5,0 @@ "author": "byteark", |
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
136365
911
0