changeset 21 | 48c4eec2b7e6 |
parent 18 | be944660c56a |
20:7b1b88e27a20 | 21:48c4eec2b7e6 |
---|---|
1016 |
1016 |
1017 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
1017 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
1018 |
1018 |
1019 var mejs = {}; |
1019 var mejs = {}; |
1020 |
1020 |
1021 mejs.version = '4.2.16'; |
1021 mejs.version = '4.2.17'; |
1022 |
1022 |
1023 mejs.html5media = { |
1023 mejs.html5media = { |
1024 properties: ['volume', 'src', 'currentTime', 'muted', 'duration', 'paused', 'ended', 'buffered', 'error', 'networkState', 'readyState', 'seeking', 'seekable', 'currentSrc', 'preload', 'bufferedBytes', 'bufferedTime', 'initialTime', 'startOffsetTime', 'defaultPlaybackRate', 'playbackRate', 'played', 'autoplay', 'loop', 'controls'], |
1024 properties: ['volume', 'src', 'currentTime', 'muted', 'duration', 'paused', 'ended', 'buffered', 'error', 'networkState', 'readyState', 'seeking', 'seekable', 'currentSrc', 'preload', 'bufferedBytes', 'bufferedTime', 'initialTime', 'startOffsetTime', 'defaultPlaybackRate', 'playbackRate', 'played', 'autoplay', 'loop', 'controls'], |
1025 readOnlyProperties: ['duration', 'paused', 'ended', 'buffered', 'error', 'networkState', 'readyState', 'seeking', 'seekable'], |
1025 readOnlyProperties: ['duration', 'paused', 'ended', 'buffered', 'error', 'networkState', 'readyState', 'seeking', 'seekable'], |
1026 |
1026 |
1305 |
1305 |
1306 if (!t.isVideo) { |
1306 if (!t.isVideo) { |
1307 return; |
1307 return; |
1308 } |
1308 } |
1309 |
1309 |
1310 if (t.options.useFakeFullscreen === false && Features.IS_IOS && Features.HAS_IOS_FULLSCREEN && typeof t.media.originalNode.webkitEnterFullscreen === 'function' && t.media.originalNode.canPlayType((0, _media.getTypeFromFile)(t.media.getSrc()))) { |
1310 if (t.options.useFakeFullscreen === false && (Features.IS_IOS || Features.IS_SAFARI) && Features.HAS_IOS_FULLSCREEN && typeof t.media.originalNode.webkitEnterFullscreen === 'function' && t.media.originalNode.canPlayType((0, _media.getTypeFromFile)(t.media.getSrc()))) { |
1311 t.media.originalNode.webkitEnterFullscreen(); |
1311 t.media.originalNode.webkitEnterFullscreen(); |
1312 return; |
1312 return; |
1313 } |
1313 } |
1314 |
1314 |
1315 (0, _dom.addClass)(_document2.default.documentElement, t.options.classPrefix + 'fullscreen'); |
1315 (0, _dom.addClass)(_document2.default.documentElement, t.options.classPrefix + 'fullscreen'); |
2941 } |
2941 } |
2942 }, |
2942 }, |
2943 |
2943 |
2944 dfxp: { |
2944 dfxp: { |
2945 parse: function parse(trackText) { |
2945 parse: function parse(trackText) { |
2946 trackText = $(trackText).filter('tt'); |
2946 var trackElem = _document2.default.adoptNode(new DOMParser().parseFromString(trackText, 'application/xml').documentElement), |
2947 var container = trackText.firstChild, |
2947 container = trackElem.querySelector('div'), |
2948 lines = container.querySelectorAll('p'), |
2948 lines = container.querySelectorAll('p'), |
2949 styleNode = trackText.getElementById('' + container.attr('style')), |
2949 styleNode = _document2.default.getElementById(container.getAttribute('style')), |
2950 entries = []; |
2950 entries = []; |
2951 |
2951 |
2952 var styles = void 0; |
2952 var styles = void 0; |
2953 |
2953 |
2954 if (styleNode.length) { |
2954 if (styleNode) { |
2955 styleNode.removeAttribute('id'); |
2955 styleNode.removeAttribute('id'); |
2956 var attributes = styleNode.attributes; |
2956 var attributes = styleNode.attributes; |
2957 if (attributes.length) { |
2957 if (attributes.length) { |
2958 styles = {}; |
2958 styles = {}; |
2959 for (var i = 0, total = attributes.length; i < total; i++) { |
2959 for (var i = 0, total = attributes.length; i < total; i++) { |
2969 stop: null, |
2969 stop: null, |
2970 style: null, |
2970 style: null, |
2971 text: null |
2971 text: null |
2972 }; |
2972 }; |
2973 |
2973 |
2974 if (lines.eq(_i16).attr('begin')) { |
2974 if (lines[_i16].getAttribute('begin')) { |
2975 _temp.start = (0, _time.convertSMPTEtoSeconds)(lines.eq(_i16).attr('begin')); |
2975 _temp.start = (0, _time.convertSMPTEtoSeconds)(lines[_i16].getAttribute('begin')); |
2976 } |
2976 } |
2977 if (!_temp.start && lines.eq(_i16 - 1).attr('end')) { |
2977 if (!_temp.start && lines[_i16 - 1].getAttribute('end')) { |
2978 _temp.start = (0, _time.convertSMPTEtoSeconds)(lines.eq(_i16 - 1).attr('end')); |
2978 _temp.start = (0, _time.convertSMPTEtoSeconds)(lines[_i16 - 1].getAttribute('end')); |
2979 } |
2979 } |
2980 if (lines.eq(_i16).attr('end')) { |
2980 if (lines[_i16].getAttribute('end')) { |
2981 _temp.stop = (0, _time.convertSMPTEtoSeconds)(lines.eq(_i16).attr('end')); |
2981 _temp.stop = (0, _time.convertSMPTEtoSeconds)(lines[_i16].getAttribute('end')); |
2982 } |
2982 } |
2983 if (!_temp.stop && lines.eq(_i16 + 1).attr('begin')) { |
2983 if (!_temp.stop && lines[_i16 + 1].getAttribute('begin')) { |
2984 _temp.stop = (0, _time.convertSMPTEtoSeconds)(lines.eq(_i16 + 1).attr('begin')); |
2984 _temp.stop = (0, _time.convertSMPTEtoSeconds)(lines[_i16 + 1].getAttribute('begin')); |
2985 } |
2985 } |
2986 |
2986 |
2987 if (styles) { |
2987 if (styles) { |
2988 style = ''; |
2988 style = ''; |
2989 for (var _style in styles) { |
2989 for (var _style in styles) { |
2990 style += _style + ':' + styles[_style] + ';'; |
2990 style += _style + ': ' + styles[_style] + ';'; |
2991 } |
2991 } |
2992 } |
2992 } |
2993 if (style) { |
2993 if (style) { |
2994 _temp.style = style; |
2994 _temp.style = style; |
2995 } |
2995 } |
2996 if (_temp.start === 0) { |
2996 if (_temp.start === 0) { |
2997 _temp.start = 0.200; |
2997 _temp.start = 0.200; |
2998 } |
2998 } |
2999 _temp.text = lines.eq(_i16).innerHTML.trim().replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig, "<a href='$1' target='_blank'>$1</a>"); |
2999 _temp.text = lines[_i16].innerHTML.trim().replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_| !:, .; ]*[-A-Z0-9+&@#\/%=~_|])/ig, "<a href='$1' target='_blank'>$1</a>"); |
3000 entries.push(_temp); |
3000 entries.push(_temp); |
3001 } |
3001 } |
3002 return entries; |
3002 return entries; |
3003 } |
3003 } |
3004 } |
3004 } |
3222 if (t.muted) { |
3222 if (t.muted) { |
3223 positionVolumeHandle(0); |
3223 positionVolumeHandle(0); |
3224 (0, _dom.removeClass)(mute, t.options.classPrefix + 'mute'); |
3224 (0, _dom.removeClass)(mute, t.options.classPrefix + 'mute'); |
3225 (0, _dom.addClass)(mute, t.options.classPrefix + 'unmute'); |
3225 (0, _dom.addClass)(mute, t.options.classPrefix + 'unmute'); |
3226 } else { |
3226 } else { |
3227 |
|
3227 positionVolumeHandle(media.volume); |
3228 positionVolumeHandle(media.volume); |
3228 (0, _dom.removeClass)(mute, t.options.classPrefix + 'unmute'); |
3229 (0, _dom.removeClass)(mute, t.options.classPrefix + 'unmute'); |
3229 (0, _dom.addClass)(mute, t.options.classPrefix + 'mute'); |
3230 (0, _dom.addClass)(mute, t.options.classPrefix + 'mute'); |
3230 } |
3231 } |
3231 }; |
3232 }; |
3342 if (!modified) { |
3343 if (!modified) { |
3343 setTimeout(function () { |
3344 setTimeout(function () { |
3344 rendered = true; |
3345 rendered = true; |
3345 if (player.options.startVolume === 0 || media.originalNode.muted) { |
3346 if (player.options.startVolume === 0 || media.originalNode.muted) { |
3346 media.setMuted(true); |
3347 media.setMuted(true); |
3347 player.options.startVolume = 0; |
|
3348 } |
3348 } |
3349 media.setVolume(player.options.startVolume); |
3349 media.setVolume(player.options.startVolume); |
3350 t.setControlsSize(); |
3350 t.setControlsSize(); |
3351 }, 250); |
3351 }, 250); |
3352 } |
3352 } |
3356 setTimeout(function () { |
3356 setTimeout(function () { |
3357 if (!modified && !rendered) { |
3357 if (!modified && !rendered) { |
3358 if (player.options.startVolume === 0 || media.originalNode.muted) { |
3358 if (player.options.startVolume === 0 || media.originalNode.muted) { |
3359 media.setMuted(true); |
3359 media.setMuted(true); |
3360 } |
3360 } |
3361 if (player.options.startVolume === 0) { |
|
3362 player.options.startVolume = 0; |
|
3363 } |
|
3361 media.setVolume(player.options.startVolume); |
3364 media.setVolume(player.options.startVolume); |
3362 t.setControlsSize(); |
3365 t.setControlsSize(); |
3363 } |
3366 } |
3364 rendered = false; |
3367 rendered = false; |
3365 }, 250); |
3368 }, 250); |
3366 }); |
3369 }); |
3367 |
3370 |
3368 if (player.options.startVolume === 0 || media.originalNode.muted) { |
3371 if (player.options.startVolume === 0 || media.originalNode.muted) { |
3369 media.setMuted(true); |
3372 media.setMuted(true); |
3370 player.options.startVolume = 0; |
3373 if (player.options.startVolume === 0) { |
3374 player.options.startVolume = 0; |
|
3375 } |
|
3371 toggleMute(); |
3376 toggleMute(); |
3372 } |
3377 } |
3373 |
3378 |
3374 t.getElement(t.container).addEventListener('controlsresize', function () { |
3379 t.getElement(t.container).addEventListener('controlsresize', function () { |
3375 toggleMute(); |
3380 toggleMute(); |
3992 key: '_meReady', |
3997 key: '_meReady', |
3993 value: function _meReady(media, domNode) { |
3998 value: function _meReady(media, domNode) { |
3994 var t = this, |
3999 var t = this, |
3995 autoplayAttr = domNode.getAttribute('autoplay'), |
4000 autoplayAttr = domNode.getAttribute('autoplay'), |
3996 autoplay = !(autoplayAttr === undefined || autoplayAttr === null || autoplayAttr === 'false'), |
4001 autoplay = !(autoplayAttr === undefined || autoplayAttr === null || autoplayAttr === 'false'), |
3997 isNative = media.rendererName !== null && /(native|html5)/i.test(t.media.rendererName); |
4002 isNative = media.rendererName !== null && /(native|html5)/i.test(media.rendererName); |
3998 |
4003 |
3999 if (t.getElement(t.controls)) { |
4004 if (t.getElement(t.controls)) { |
4000 t.enableControls(); |
4005 t.enableControls(); |
4001 } |
4006 } |
4002 |
4007 |
4431 } else { |
4436 } else { |
4432 return t.options.defaultAudioHeight; |
4437 return t.options.defaultAudioHeight; |
4433 } |
4438 } |
4434 }(), |
4439 }(), |
4435 aspectRatio = function () { |
4440 aspectRatio = function () { |
4441 if (!t.options.enableAutosize) { |
|
4442 return t.initialAspectRatio; |
|
4443 } |
|
4436 var ratio = 1; |
4444 var ratio = 1; |
4437 if (!t.isVideo) { |
4445 if (!t.isVideo) { |
4438 return ratio; |
4446 return ratio; |
4439 } |
4447 } |
4440 |
4448 |
5228 |
5236 |
5229 delete _mejs2.default.players[t.id]; |
5237 delete _mejs2.default.players[t.id]; |
5230 |
5238 |
5231 if (_typeof(t.getElement(t.container)) === 'object') { |
5239 if (_typeof(t.getElement(t.container)) === 'object') { |
5232 var offscreen = t.getElement(t.container).parentNode.querySelector('.' + t.options.classPrefix + 'offscreen'); |
5240 var offscreen = t.getElement(t.container).parentNode.querySelector('.' + t.options.classPrefix + 'offscreen'); |
5233 offscreen.remove(); |
5241 if (offscreen) { |
5242 offscreen.remove(); |
|
5243 } |
|
5234 t.getElement(t.container).remove(); |
5244 t.getElement(t.container).remove(); |
5235 } |
5245 } |
5236 t.globalUnbind('resize', t.globalResizeCallback); |
5246 t.globalUnbind('resize', t.globalResizeCallback); |
5237 t.globalUnbind('keydown', t.globalKeydownCallback); |
5247 t.globalUnbind('keydown', t.globalKeydownCallback); |
5238 t.globalUnbind('click', t.globalClickCallback); |
5248 t.globalUnbind('click', t.globalClickCallback); |
7253 id: youtube.id, |
7263 id: youtube.id, |
7254 containerId: youtubeContainer.id, |
7264 containerId: youtubeContainer.id, |
7255 videoId: videoId, |
7265 videoId: videoId, |
7256 height: height, |
7266 height: height, |
7257 width: width, |
7267 width: width, |
7268 host: youtube.options.youtube && youtube.options.youtube.nocookie ? 'https://www.youtube-nocookie.com' : undefined, |
|
7258 playerVars: Object.assign({ |
7269 playerVars: Object.assign({ |
7259 controls: 0, |
7270 controls: 0, |
7260 rel: 0, |
7271 rel: 0, |
7261 disablekb: 1, |
7272 disablekb: 1, |
7262 showinfo: 0, |
7273 showinfo: 0, |
8063 normalizedExt = normalizeExtension(ext); |
8074 normalizedExt = normalizeExtension(ext); |
8064 |
8075 |
8065 var mime = 'video/mp4'; |
8076 var mime = 'video/mp4'; |
8066 |
8077 |
8067 if (normalizedExt) { |
8078 if (normalizedExt) { |
8068 if (~['mp4', 'm4v', 'ogg', 'ogv', 'webm', 'flv', 'mpeg', 'mov'].indexOf(normalizedExt)) { |
8079 if (~['mp4', 'm4v', 'ogg', 'ogv', 'webm', 'flv', 'mpeg'].indexOf(normalizedExt)) { |
8069 mime = 'video/' + normalizedExt; |
8080 mime = 'video/' + normalizedExt; |
8081 } else if ('mov' === normalizedExt) { |
|
8082 mime = 'video/quicktime'; |
|
8070 } else if (~['mp3', 'oga', 'wav', 'mid', 'midi'].indexOf(normalizedExt)) { |
8083 } else if (~['mp3', 'oga', 'wav', 'mid', 'midi'].indexOf(normalizedExt)) { |
8071 mime = 'audio/' + normalizedExt; |
8084 mime = 'audio/' + normalizedExt; |
8072 } |
8085 } |
8073 } |
8086 } |
8074 |
8087 |