Ticket #24015: 24015.diff
File 24015.diff, 271.2 KB (added by , 11 years ago) |
---|
-
wp-includes/js/mediaelement/mediaelement-and-player.js
diff --git wp-includes/js/mediaelement/mediaelement-and-player.js wp-includes/js/mediaelement/mediaelement-and-player.js index 3601e4c..bb49d60 100644
8 8 * Can play MP4 (H.264), Ogg, WebM, FLV, WMV, WMA, ACC, and MP3 9 9 * 10 10 * Copyright 2010-2012, John Dyer (http://j.hn) 11 * Dual licensed under the MIT or GPL Version 2 licenses.11 * License: MIT 12 12 * 13 13 */ 14 14 // Namespace 15 15 var mejs = mejs || {}; 16 16 17 17 // version number 18 mejs.version = '2.1 0.1';18 mejs.version = '2.11.0'; 19 19 20 20 // player number (for missing, same id attr) 21 21 mejs.meIndex = 0; … … mejs.plugins = { 30 30 //,{version: [12,0], types: ['video/webm']} // for future reference (hopefully!) 31 31 ], 32 32 youtube: [ 33 {version: null, types: ['video/youtube', 'video/x-youtube' ]}33 {version: null, types: ['video/youtube', 'video/x-youtube', 'audio/youtube', 'audio/x-youtube']} 34 34 ], 35 35 vimeo: [ 36 36 {version: null, types: ['video/vimeo', 'video/x-vimeo']} 37 37 ] 38 38 }; 39 39 40 40 41 /* 41 42 Utility methods 42 43 */ … … mejs.Utility = { 85 86 } else if(typeof fps == 'undefined') { 86 87 fps = 25; 87 88 } 88 89 89 90 var hours = Math.floor(time / 3600) % 24, 90 91 minutes = Math.floor(time / 60) % 60, 91 92 seconds = Math.floor(time % 60), 92 93 frames = Math.floor(((time % 1)*fps).toFixed(3)), 93 result = 94 result = 94 95 ( (forceHours || hours > 0) ? (hours < 10 ? '0' + hours : hours) + ':' : '') 95 96 + (minutes < 10 ? '0' + minutes : minutes) + ':' 96 97 + (seconds < 10 ? '0' + seconds : seconds) 97 98 + ((showFrameCount) ? ':' + (frames < 10 ? '0' + frames : frames) : ''); 98 99 99 100 return result; 100 101 }, 101 102 102 103 timeCodeToSeconds: function(hh_mm_ss_ff, forceHours, showFrameCount, fps){ 103 104 if (typeof showFrameCount == 'undefined') { 104 105 showFrameCount=false; 105 106 } else if(typeof fps == 'undefined') { 106 107 fps = 25; 107 108 } 108 109 109 110 var tc_array = hh_mm_ss_ff.split(":"), 110 111 tc_hh = parseInt(tc_array[0], 10), 111 112 tc_mm = parseInt(tc_array[1], 10), 112 113 tc_ss = parseInt(tc_array[2], 10), 113 114 tc_ff = 0, 114 115 tc_in_seconds = 0; 115 116 116 117 if (showFrameCount) { 117 118 tc_ff = parseInt(tc_array[3])/fps; 118 119 } 119 120 120 121 tc_in_seconds = ( tc_hh * 3600 ) + ( tc_mm * 60 ) + tc_ss + tc_ff; 121 122 122 123 return tc_in_seconds; 123 124 }, 124 125 125 126 126 127 convertSMPTEtoSeconds: function (SMPTE) { 127 if (typeof SMPTE != 'string') 128 if (typeof SMPTE != 'string') 128 129 return false; 129 130 130 131 SMPTE = SMPTE.replace(',', '.'); 131 132 132 133 var secs = 0, 133 134 decimalLen = (SMPTE.indexOf('.') != -1) ? SMPTE.split('.')[1].length : 0, 134 135 multiplier = 1; 135 136 136 137 SMPTE = SMPTE.split(':').reverse(); 137 138 138 139 for (var i = 0; i < SMPTE.length; i++) { 139 140 multiplier = 1; 140 141 if (i > 0) { 141 multiplier = Math.pow(60, i); 142 multiplier = Math.pow(60, i); 142 143 } 143 144 secs += Number(SMPTE[i]) * multiplier; 144 145 } 145 146 return Number(secs.toFixed(decimalLen)); 146 }, 147 147 }, 148 148 149 /* borrowed from SWFObject: http://code.google.com/p/swfobject/source/browse/trunk/swfobject/src/swfobject.js#474 */ 149 150 removeSwf: function(id) { 150 151 var obj = document.getElementById(id); 151 if (obj && obj.nodeName == "OBJECT") {152 if (obj && /object|embed/i.test(obj.nodeName)) { 152 153 if (mejs.MediaFeatures.isIE) { 153 154 obj.style.display = "none"; 154 155 (function(){ … … mejs.Utility = { 172 173 } 173 174 } 174 175 obj.parentNode.removeChild(obj); 175 } 176 } 176 177 } 177 178 }; 178 179 … … mejs.MediaFeatures = { 303 304 t.isGecko = (ua.match(/gecko/gi) !== null) && !t.isWebkit; 304 305 t.isOpera = (ua.match(/opera/gi) !== null); 305 306 t.hasTouch = ('ontouchstart' in window); 306 307 307 308 // borrowed from Modernizr 308 309 t.svg = !! document.createElementNS && 309 310 !! document.createElementNS('http://www.w3.org/2000/svg','svg').createSVGRect; … … mejs.MediaFeatures = { 312 313 for (i=0; i<html5Elements.length; i++) { 313 314 v = document.createElement(html5Elements[i]); 314 315 } 315 316 316 317 t.supportsMediaTag = (typeof v.canPlayType !== 'undefined' || t.isBustedAndroid); 317 318 318 319 // detect native JavaScript fullscreen (Safari/Firefox only, Chrome still fails) 319 320 320 321 // iOS 321 322 t.hasSemiNativeFullScreen = (typeof v.webkitEnterFullscreen !== 'undefined'); 322 323 323 324 // Webkit/firefox 324 325 t.hasWebkitNativeFullScreen = (typeof v.webkitRequestFullScreen !== 'undefined'); 325 326 t.hasMozNativeFullScreen = (typeof v.mozRequestFullScreen !== 'undefined'); 326 327 327 328 t.hasTrueNativeFullScreen = (t.hasWebkitNativeFullScreen || t.hasMozNativeFullScreen); 328 329 t.nativeFullScreenEnabled = t.hasTrueNativeFullScreen; 329 330 if (t.hasMozNativeFullScreen) { 330 331 t.nativeFullScreenEnabled = v.mozFullScreenEnabled; 331 332 } 332 333 333 334 334 335 if (this.isChrome) { 335 336 t.hasSemiNativeFullScreen = false; 336 337 } 337 338 338 339 if (t.hasTrueNativeFullScreen) { 339 340 t.fullScreenEventName = (t.hasWebkitNativeFullScreen) ? 'webkitfullscreenchange' : 'mozfullscreenchange'; 340 341 341 342 342 343 t.isFullScreen = function() { 343 344 if (v.mozRequestFullScreen) { 344 345 return d.mozFullScreen; … … mejs.MediaFeatures = { 346 347 return d.webkitIsFullScreen; 347 348 } 348 349 } 349 350 350 351 t.requestFullScreen = function(el) { 351 352 352 353 if (t.hasWebkitNativeFullScreen) { 353 354 el.webkitRequestFullScreen(); 354 355 } else if (t.hasMozNativeFullScreen) { 355 356 el.mozRequestFullScreen(); 356 357 } 357 358 } 358 359 t.cancelFullScreen = function() { 359 360 t.cancelFullScreen = function() { 360 361 if (t.hasWebkitNativeFullScreen) { 361 362 document.webkitCancelFullScreen(); 362 363 } else if (t.hasMozNativeFullScreen) { 363 364 document.mozCancelFullScreen(); 364 365 } 365 } 366 366 } 367 367 368 } 368 369 369 370 370 371 // OS X 10.5 can't do this even if it says it can :( 371 372 if (t.hasSemiNativeFullScreen && ua.match(/mac os x 10_5/i)) { 372 373 t.hasNativeFullScreen = false; 373 374 t.hasSemiNativeFullScreen = false; 374 375 } 375 376 376 377 } 377 378 }; 378 379 mejs.MediaFeatures.init(); 379 380 380 381 381 /* 382 382 extension methods to <video> or <audio> object to bring it into parity with PluginMediaElement (see below) 383 383 */ … … mejs.HtmlMediaElement = { 405 405 // This can be a url string 406 406 // or an array [{src:'file.mp4',type:'video/mp4'},{src:'file.webm',type:'video/webm'}] 407 407 setSrc: function (url) { 408 408 409 409 // Fix for IE9 which can't set .src when there are <source> elements. Awesome, right? 410 var 410 var 411 411 existingSources = this.getElementsByTagName('source'); 412 412 while (existingSources.length > 0){ 413 413 this.removeChild(existingSources[0]); 414 414 } 415 415 416 416 if (typeof url == 'string') { 417 417 this.src = url; 418 418 } else { … … mejs.PluginMediaElement = function (pluginid, pluginType, mediaUrl) { 442 442 this.pluginType = pluginType; 443 443 this.src = mediaUrl; 444 444 this.events = {}; 445 this.attributes = {}; 445 446 }; 446 447 447 448 // JavaScript values and ExternalInterface methods that match HTML5 video properties methods … … mejs.PluginMediaElement.prototype = { 490 491 } else { 491 492 this.pluginApi.loadMedia(); 492 493 } 493 494 494 495 this.paused = false; 495 496 } 496 497 }, … … mejs.PluginMediaElement.prototype = { 500 501 this.pluginApi.pauseVideo(); 501 502 } else { 502 503 this.pluginApi.pauseMedia(); 503 } 504 505 504 } 505 506 506 507 this.paused = true; 507 508 } 508 509 }, … … mejs.PluginMediaElement.prototype = { 512 513 this.pluginApi.stopVideo(); 513 514 } else { 514 515 this.pluginApi.stopMedia(); 515 } 516 } 516 517 this.paused = true; 517 518 } 518 519 }, … … mejs.PluginMediaElement.prototype = { 532 533 for (j=0; j<pluginInfo.types.length; j++) { 533 534 // find plugin that can play the type 534 535 if (type == pluginInfo.types[j]) { 535 return true;536 return 'probably'; 536 537 } 537 538 } 538 539 } 539 540 } 540 541 541 return false;542 return ''; 542 543 }, 543 544 544 545 positionFullscreenButton: function(x,y,visibleAndAbove) { 545 546 if (this.pluginApi != null && this.pluginApi.positionFullscreenButton) { 546 547 this.pluginApi.positionFullscreenButton(x,y,visibleAndAbove); 547 548 } 548 549 }, 549 550 550 551 hideFullscreenButton: function() { 551 552 if (this.pluginApi != null && this.pluginApi.hideFullscreenButton) { 552 553 this.pluginApi.hideFullscreenButton(); 553 } 554 }, 555 554 } 555 }, 556 556 557 557 558 // custom methods since not all JavaScript implementations support get/set 558 559 … … mejs.PluginMediaElement.prototype = { 582 583 this.pluginApi.seekTo(time); 583 584 } else { 584 585 this.pluginApi.setCurrentTime(time); 585 } 586 587 588 586 } 587 588 589 589 590 this.currentTime = time; 590 591 } 591 592 }, … … mejs.PluginMediaElement.prototype = { 619 620 620 621 // additional non-HTML5 methods 621 622 setVideoSize: function (width, height) { 622 623 623 624 //if (this.pluginType == 'flash' || this.pluginType == 'silverlight') { 624 625 if ( this.pluginElement.style) { 625 626 this.pluginElement.style.width = width + 'px'; … … mejs.PluginMediaElement.prototype = { 636 637 this.pluginApi.setFullscreen(fullscreen); 637 638 } 638 639 }, 639 640 640 641 enterFullScreen: function() { 641 642 if (this.pluginApi != null && this.pluginApi.setFullscreen) { 642 643 this.setFullscreen(true); 643 } 644 644 } 645 645 646 }, 646 647 647 648 exitFullScreen: function() { 648 649 if (this.pluginApi != null && this.pluginApi.setFullscreen) { 649 650 this.setFullscreen(false); 650 651 } 651 }, 652 }, 652 653 653 654 // start: fake events 654 655 addEventListener: function (eventName, callback, bubble) { … … mejs.PluginMediaElement.prototype = { 667 668 } 668 669 } 669 670 return false; 670 }, 671 }, 671 672 dispatchEvent: function (eventName) { 672 673 var i, 673 674 args, … … mejs.PluginMediaElement.prototype = { 681 682 } 682 683 }, 683 684 // end: fake events 684 685 685 686 // fake DOM attribute methods 686 attributes: {},687 687 hasAttribute: function(name){ 688 return (name in this.attributes); 688 return (name in this.attributes); 689 689 }, 690 690 removeAttribute: function(name){ 691 691 delete this.attributes[name]; … … mejs.PluginMediaElement.prototype = { 702 702 703 703 remove: function() { 704 704 mejs.Utility.removeSwf(this.pluginElement.id); 705 mejs.MediaPluginBridge.unregisterPluginElement(this.pluginElement.id); 705 706 } 706 707 }; 707 708 … … mejs.MediaPluginBridge = { 716 717 this.htmlMediaElements[id] = htmlMediaElement; 717 718 }, 718 719 720 unregisterPluginElement: function (id) { 721 delete this.pluginMediaElements[id]; 722 delete this.htmlMediaElements[id]; 723 }, 724 719 725 // when Flash/Silverlight is ready, it calls out to this method 720 726 initPlugin: function (id) { 721 727 … … mejs.MediaPluginBridge = { 733 739 pluginMediaElement.pluginApi = pluginMediaElement.pluginElement.Content.MediaElementJS; 734 740 break; 735 741 } 736 742 737 743 if (pluginMediaElement.pluginApi != null && pluginMediaElement.success) { 738 744 pluginMediaElement.success(pluginMediaElement, htmlMediaElement); 739 745 } … … mejs.MediaElementDefaults = { 815 821 // overrides <video height> 816 822 pluginHeight: -1, 817 823 // additional plugin variables in 'key=value' form 818 pluginVars: [], 824 pluginVars: [], 819 825 // rate in milliseconds for Flash and Silverlight to fire the timeupdate event 820 826 // larger number is less accurate, but less strain on plugin->JavaScript bridge 821 827 timerRate: 250, … … mejs.HtmlMediaElementShim = { 856 862 } 857 863 858 864 // clean up attributes 859 src = (typeof src == 'undefined' || src === null || src == '') ? null : src; 865 src = (typeof src == 'undefined' || src === null || src == '') ? null : src; 860 866 poster = (typeof poster == 'undefined' || poster === null) ? '' : poster; 861 867 preload = (typeof preload == 'undefined' || preload === null || preload === 'false') ? 'none' : preload; 862 868 autoplay = !(typeof autoplay == 'undefined' || autoplay === null || autoplay === 'false'); … … mejs.HtmlMediaElementShim = { 874 880 htmlMediaElement.play(); 875 881 }, false); 876 882 } 877 883 878 884 // add methods to native HTMLMediaElement 879 885 return this.updateNative(playback, options, autoplay, preload); 880 886 } else if (playback.method !== '') { 881 887 // create plugin to mimic HTMLMediaElement 882 888 883 889 return this.createPlugin( playback, options, poster, autoplay, preload, controls); 884 890 } else { 885 891 // boo, no HTML5, no Flash, no Silverlight. 886 892 this.createErrorMessage( playback, options, poster ); 887 893 888 894 return this; 889 895 } 890 896 }, 891 897 892 898 determinePlayback: function(htmlMediaElement, options, supportsMediaTag, isMediaTag, src) { 893 899 var 894 900 mediaFiles = [], … … mejs.HtmlMediaElementShim = { 904 910 pluginInfo, 905 911 dummy, 906 912 media; 907 913 908 914 // STEP 1: Get URL and type from <video src> or <source src> 909 915 910 916 // supplied type overrides <video type> and <source type> 911 917 if (typeof options.type != 'undefined' && options.type !== '') { 912 918 913 919 // accept either string or array of types 914 920 if (typeof options.type == 'string') { 915 921 mediaFiles.push({type:options.type, url:src}); 916 922 } else { 917 923 918 924 for (i=0; i<options.type.length; i++) { 919 925 mediaFiles.push({type:options.type[i], url:src}); 920 926 } … … mejs.HtmlMediaElementShim = { 941 947 } 942 948 } 943 949 } 944 950 945 951 // in the case of dynamicly created players 946 952 // check for audio types 947 953 if (!isMediaTag && mediaFiles.length > 0 && mediaFiles[0].url !== null && this.getTypeFromFile(mediaFiles[0].url).indexOf('audio') > -1) { 948 954 result.isVideo = false; 949 955 } 950 956 951 957 952 958 // STEP 2: Test for playback method 953 959 954 960 // special case for Android which sadly doesn't implement the canPlayType function (always returns '') 955 961 if (mejs.MediaFeatures.isBustedAndroid) { 956 962 htmlMediaElement.canPlayType = function(type) { 957 963 return (type.match(/video\/(mp4|m4v)/gi) !== null) ? 'maybe' : ''; 958 964 }; 959 } 960 965 } 966 961 967 962 968 // test for native playback first 963 969 if (supportsMediaTag && (options.mode === 'auto' || options.mode === 'auto_plugin' || options.mode === 'native')) { 964 970 965 971 if (!isMediaTag) { 966 972 967 // create a real HTML5 Media Element 968 dummy = document.createElement( result.isVideo ? 'video' : 'audio'); 973 // create a real HTML5 Media Element 974 dummy = document.createElement( result.isVideo ? 'video' : 'audio'); 969 975 htmlMediaElement.parentNode.insertBefore(dummy, htmlMediaElement); 970 976 htmlMediaElement.style.display = 'none'; 971 977 972 978 // use this one from now on 973 979 result.htmlMediaElement = htmlMediaElement = dummy; 974 980 } 975 981 976 982 for (i=0; i<mediaFiles.length; i++) { 977 983 // normal check 978 if (htmlMediaElement.canPlayType(mediaFiles[i].type).replace(/no/, '') !== '' 984 if (htmlMediaElement.canPlayType(mediaFiles[i].type).replace(/no/, '') !== '' 979 985 // special case for Mac/Safari 5.0.3 which answers '' to canPlayType('audio/mp3') but 'maybe' to canPlayType('audio/mpeg') 980 986 || htmlMediaElement.canPlayType(mediaFiles[i].type.replace(/mp3/,'mpeg')).replace(/no/, '') !== '') { 981 987 result.method = 'native'; 982 988 result.url = mediaFiles[i].url; 983 989 break; 984 990 } 985 } 986 991 } 992 987 993 if (result.method === 'native') { 988 994 if (result.url !== null) { 989 995 htmlMediaElement.src = result.url; 990 996 } 991 997 992 998 // if `auto_plugin` mode, then cache the native result but try plugins. 993 999 if (options.mode !== 'auto_plugin') { 994 1000 return result; … … mejs.HtmlMediaElementShim = { 1005 1011 for (j=0; j<options.plugins.length; j++) { 1006 1012 1007 1013 pluginName = options.plugins[j]; 1008 1014 1009 1015 // test version of plugin (for future features) 1010 pluginVersions = mejs.plugins[pluginName]; 1011 1016 pluginVersions = mejs.plugins[pluginName]; 1017 1012 1018 for (k=0; k<pluginVersions.length; k++) { 1013 1019 pluginInfo = pluginVersions[k]; 1014 1020 1015 1021 // test if user has the correct plugin version 1016 1022 1017 1023 // for youtube/vimeo 1018 if (pluginInfo.version == null || 1019 1024 if (pluginInfo.version == null || 1025 1020 1026 mejs.PluginDetector.hasPluginVersion(pluginName, pluginInfo.version)) { 1021 1027 1022 1028 // test for plugin playback types … … mejs.HtmlMediaElementShim = { 1033 1039 } 1034 1040 } 1035 1041 } 1036 1042 1037 1043 // at this point, being in 'auto_plugin' mode implies that we tried plugins but failed. 1038 1044 // if we have native support then return that. 1039 1045 if (options.mode === 'auto_plugin' && result.method === 'native') { … … mejs.HtmlMediaElementShim = { 1052 1058 var ext; 1053 1059 1054 1060 // if no type is supplied, fake it with the extension 1055 if (url && !type) { 1061 if (url && !type) { 1056 1062 return this.getTypeFromFile(url); 1057 1063 } else { 1058 1064 // only return the mime part of the type in case the attribute contains the codec 1059 1065 // see http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#the-source-element 1060 1066 // `video/mp4; codecs="avc1.42E01E, mp4a.40.2"` becomes `video/mp4` 1061 1067 1062 1068 if (type && ~type.indexOf(';')) { 1063 return type.substr(0, type.indexOf(';')); 1069 return type.substr(0, type.indexOf(';')); 1064 1070 } else { 1065 1071 return type; 1066 1072 } 1067 1073 } 1068 1074 }, 1069 1075 1070 1076 getTypeFromFile: function(url) { 1071 1077 url = url.split('?')[0]; 1072 1078 var ext = url.substring(url.lastIndexOf('.') + 1); 1073 1079 return (/(mp4|m4v|ogg|ogv|webm|webmv|flv|wmv|mpeg|mov)/gi.test(ext) ? 'video' : 'audio') + '/' + this.getTypeFromExtension(ext); 1074 1080 }, 1075 1081 1076 1082 getTypeFromExtension: function(ext) { 1077 1083 1078 1084 switch (ext) { 1079 1085 case 'mp4': 1080 1086 case 'm4v': 1081 1087 return 'mp4'; 1082 1088 case 'webm': 1083 1089 case 'webma': 1084 case 'webmv': 1090 case 'webmv': 1085 1091 return 'webm'; 1086 1092 case 'ogg': 1087 1093 case 'oga': 1088 case 'ogv': 1094 case 'ogv': 1089 1095 return 'ogg'; 1090 1096 default: 1091 1097 return ext; … … mejs.HtmlMediaElementShim = { 1093 1099 }, 1094 1100 1095 1101 createErrorMessage: function(playback, options, poster) { 1096 var 1102 var 1097 1103 htmlMediaElement = playback.htmlMediaElement, 1098 1104 errorContainer = document.createElement('div'); 1099 1105 1100 1106 errorContainer.className = 'me-cannotplay'; 1101 1107 1102 1108 try { … … mejs.HtmlMediaElementShim = { 1115 1121 }, 1116 1122 1117 1123 createPlugin:function(playback, options, poster, autoplay, preload, controls) { 1118 var 1124 var 1119 1125 htmlMediaElement = playback.htmlMediaElement, 1120 1126 width = 1, 1121 1127 height = 1, … … mejs.HtmlMediaElementShim = { 1150 1156 if (playback.isVideo) { 1151 1157 width = (options.videoWidth > 0) ? options.videoWidth : (htmlMediaElement.getAttribute('width') !== null) ? htmlMediaElement.getAttribute('width') : options.defaultVideoWidth; 1152 1158 height = (options.videoHeight > 0) ? options.videoHeight : (htmlMediaElement.getAttribute('height') !== null) ? htmlMediaElement.getAttribute('height') : options.defaultVideoHeight; 1153 1159 1154 1160 // in case of '%' make sure it's encoded 1155 1161 width = mejs.Utility.encodeUrl(width); 1156 1162 height = mejs.Utility.encodeUrl(height); 1157 1163 1158 1164 } else { 1159 1165 if (options.enablePluginDebug) { 1160 1166 width = 320; … … mejs.HtmlMediaElementShim = { 1169 1175 // add container (must be added to DOM before inserting HTML for IE) 1170 1176 container.className = 'me-plugin'; 1171 1177 container.id = pluginid + '_container'; 1172 1178 1173 1179 if (playback.isVideo) { 1174 1180 htmlMediaElement.parentNode.insertBefore(container, htmlMediaElement); 1175 1181 } else { … … mejs.HtmlMediaElementShim = { 1206 1212 } 1207 1213 if (options.pluginVars) { 1208 1214 initVars = initVars.concat(options.pluginVars); 1209 } 1215 } 1210 1216 1211 1217 switch (playback.method) { 1212 1218 case 'silverlight': 1213 1219 container.innerHTML = 1214 '<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="' + pluginid + '" name="' + pluginid + '" width="' + width + '" height="' + height + '" >' +1220 '<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="' + pluginid + '" name="' + pluginid + '" width="' + width + '" height="' + height + '" class="mejs-shim">' + 1215 1221 '<param name="initParams" value="' + initVars.join(',') + '" />' + 1216 1222 '<param name="windowless" value="true" />' + 1217 1223 '<param name="background" value="black" />' + … … mejs.HtmlMediaElementShim = { 1228 1234 container.appendChild(specialIEContainer); 1229 1235 specialIEContainer.outerHTML = 1230 1236 '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" ' + 1231 'id="' + pluginid + '" width="' + width + '" height="' + height + '" >' +1237 'id="' + pluginid + '" width="' + width + '" height="' + height + '" class="mejs-shim">' + 1232 1238 '<param name="movie" value="' + options.pluginPath + options.flashName + '?x=' + (new Date()) + '" />' + 1233 1239 '<param name="flashvars" value="' + initVars.join('&') + '" />' + 1234 1240 '<param name="quality" value="high" />' + … … mejs.HtmlMediaElementShim = { 1253 1259 'src="' + options.pluginPath + options.flashName + '" ' + 1254 1260 'flashvars="' + initVars.join('&') + '" ' + 1255 1261 'width="' + width + '" ' + 1256 'height="' + height + '"></embed>'; 1262 'height="' + height + '" ' + 1263 'class="mejs-shim"></embed>'; 1257 1264 } 1258 1265 break; 1259 1266 1260 1267 case 'youtube': 1261 1262 1268 1269 1263 1270 var 1264 1271 videoId = playback.url.substr(playback.url.lastIndexOf('=')+1); 1265 1272 youtubeSettings = { … … mejs.HtmlMediaElementShim = { 1269 1276 pluginId: pluginid, 1270 1277 videoId: videoId, 1271 1278 height: height, 1272 width: width 1273 }; 1274 1279 width: width 1280 }; 1281 1275 1282 if (mejs.PluginDetector.hasPluginVersion('flash', [10,0,0]) ) { 1276 1283 mejs.YouTubeApi.createFlash(youtubeSettings); 1277 1284 } else { 1278 mejs.YouTubeApi.enqueueIframe(youtubeSettings); 1285 mejs.YouTubeApi.enqueueIframe(youtubeSettings); 1279 1286 } 1280 1287 1281 1288 break; 1282 1289 1283 1290 // DEMO Code. Does NOT work. 1284 1291 case 'vimeo': 1285 1292 //console.log('vimeoid'); 1286 1293 1287 1294 pluginMediaElement.vimeoid = playback.url.substr(playback.url.lastIndexOf('/')+1); 1288 1289 container.innerHTML ='<iframe src="http://player.vimeo.com/video/' + pluginMediaElement.vimeoid + '?portrait=0&byline=0&title=0" width="' + width +'" height="' + height +'" frameborder="0" ></iframe>';1290 1295 1296 container.innerHTML ='<iframe src="http://player.vimeo.com/video/' + pluginMediaElement.vimeoid + '?portrait=0&byline=0&title=0" width="' + width +'" height="' + height +'" frameborder="0" class="mejs-shim"></iframe>'; 1297 1291 1298 /* 1292 1299 container.innerHTML = 1293 '<object width="' + width + '" height="' + height + '" >' +1300 '<object width="' + width + '" height="' + height + '" class="mejs-shim">' + 1294 1301 '<param name="allowfullscreen" value="true" />' + 1295 1302 '<param name="allowscriptaccess" value="always" />' + 1296 '<param name="flashvars" value="api=1" />' + 1303 '<param name="flashvars" value="api=1" />' + 1297 1304 '<param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=' + pluginMediaElement.vimeoid + '&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=00adef&fullscreen=1&autoplay=0&loop=0" />' + 1298 '<embed src="//vimeo.com/moogaloop.swf?api=1&clip_id=' + pluginMediaElement.vimeoid + '&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=00adef&fullscreen=1&autoplay=0&loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' + width + '" height="' + height + '" ></embed>' +1305 '<embed src="//vimeo.com/moogaloop.swf?api=1&clip_id=' + pluginMediaElement.vimeoid + '&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=00adef&fullscreen=1&autoplay=0&loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' + width + '" height="' + height + '" class="mejs-shim"></embed>' + 1299 1306 '</object>'; 1300 1307 */ 1301 1302 break; 1308 1309 break; 1303 1310 } 1304 1311 // hide original element 1305 1312 htmlMediaElement.style.display = 'none'; 1306 1313 1307 1314 // FYI: options.success will be fired by the MediaPluginBridge 1308 1315 1309 1316 return pluginMediaElement; 1310 1317 }, 1311 1318 1312 1319 updateNative: function(playback, options, autoplay, preload) { 1313 1320 1314 1321 var htmlMediaElement = playback.htmlMediaElement, 1315 1322 m; 1316 1317 1323 1324 1318 1325 // add methods to video object to bring it into parity with Flash Object 1319 1326 for (m in mejs.HtmlMediaElement) { 1320 1327 htmlMediaElement[m] = mejs.HtmlMediaElement[m]; … … mejs.HtmlMediaElementShim = { 1323 1330 /* 1324 1331 Chrome now supports preload="none" 1325 1332 if (mejs.MediaFeatures.isChrome) { 1326 1333 1327 1334 // special case to enforce preload attribute (Chrome doesn't respect this) 1328 1335 if (preload === 'none' && !autoplay) { 1329 1336 1330 1337 // forces the browser to stop loading (note: fails in IE9) 1331 1338 htmlMediaElement.src = ''; 1332 1339 htmlMediaElement.load(); … … mejs.HtmlMediaElementShim = { 1350 1357 1351 1358 // fire success code 1352 1359 options.success(htmlMediaElement, htmlMediaElement); 1353 1360 1354 1361 return htmlMediaElement; 1355 1362 } 1356 1363 }; … … mejs.YouTubeApi = { 1376 1383 }, 1377 1384 iframeQueue: [], 1378 1385 enqueueIframe: function(yt) { 1379 1386 1380 1387 if (this.isLoaded) { 1381 1388 this.createIframe(yt); 1382 1389 } else { … … mejs.YouTubeApi = { 1385 1392 } 1386 1393 }, 1387 1394 createIframe: function(settings) { 1388 1395 1389 1396 var 1390 pluginMediaElement = settings.pluginMediaElement, 1397 pluginMediaElement = settings.pluginMediaElement, 1391 1398 player = new YT.Player(settings.containerId, { 1392 1399 height: settings.height, 1393 1400 width: settings.width, … … mejs.YouTubeApi = { 1395 1402 playerVars: {controls:0}, 1396 1403 events: { 1397 1404 'onReady': function() { 1398 1405 1399 1406 // hook up iframe object to MEjs 1400 1407 settings.pluginMediaElement.pluginApi = player; 1401 1408 1402 1409 // init mejs 1403 1410 mejs.MediaPluginBridge.initPlugin(settings.pluginId); 1404 1411 1405 1412 // create timer 1406 1413 setInterval(function() { 1407 1414 mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'timeupdate'); 1408 }, 250); 1415 }, 250); 1409 1416 }, 1410 1417 'onStateChange': function(e) { 1411 1418 1412 1419 mejs.YouTubeApi.handleStateChange(e.data, player, pluginMediaElement); 1413 1420 1414 1421 } 1415 1422 } 1416 1423 }); 1417 1424 }, 1418 1425 1419 1426 createEvent: function (player, pluginMediaElement, eventName) { 1420 1427 var obj = { 1421 1428 type: eventName, … … mejs.YouTubeApi = { 1423 1430 }; 1424 1431 1425 1432 if (player && player.getDuration) { 1426 1427 // time 1433 1434 // time 1428 1435 pluginMediaElement.currentTime = obj.currentTime = player.getCurrentTime(); 1429 1436 pluginMediaElement.duration = obj.duration = player.getDuration(); 1430 1437 1431 1438 // state 1432 1439 obj.paused = pluginMediaElement.paused; 1433 obj.ended = pluginMediaElement.ended; 1434 1440 obj.ended = pluginMediaElement.ended; 1441 1435 1442 // sound 1436 1443 obj.muted = player.isMuted(); 1437 1444 obj.volume = player.getVolume() / 100; 1438 1445 1439 1446 // progress 1440 1447 obj.bytesTotal = player.getVideoBytesTotal(); 1441 1448 obj.bufferedBytes = player.getVideoBytesLoaded(); 1442 1449 1443 1450 // fake the W3C buffered TimeRange 1444 1451 var bufferedTime = obj.bufferedBytes / obj.bytesTotal * obj.duration; 1445 1452 1446 1453 obj.target.buffered = obj.buffered = { 1447 1454 start: function(index) { 1448 1455 return 0; … … mejs.YouTubeApi = { 1452 1459 }, 1453 1460 length: 1 1454 1461 }; 1455 1462 1456 1463 } 1457 1464 1458 1465 // send event up the chain 1459 1466 pluginMediaElement.dispatchEvent(obj.type, obj); 1460 }, 1461 1467 }, 1468 1462 1469 iFrameReady: function() { 1463 1470 1464 1471 this.isLoaded = true; 1465 1472 this.isIframeLoaded = true; 1466 1473 1467 1474 while (this.iframeQueue.length > 0) { 1468 1475 var settings = this.iframeQueue.pop(); 1469 1476 this.createIframe(settings); 1470 } 1477 } 1471 1478 }, 1472 1479 1473 1480 // FLASH! 1474 1481 flashPlayers: {}, 1475 1482 createFlash: function(settings) { 1476 1483 1477 1484 this.flashPlayers[settings.pluginId] = settings; 1478 1485 1479 1486 /* 1480 1487 settings.container.innerHTML = 1481 1488 '<object type="application/x-shockwave-flash" id="' + settings.pluginId + '" data="//www.youtube.com/apiplayer?enablejsapi=1&playerapiid=' + settings.pluginId + '&version=3&autoplay=0&controls=0&modestbranding=1&loop=0" ' + 1482 'width="' + settings.width + '" height="' + settings.height + '" style="visibility: visible; " >' +1489 'width="' + settings.width + '" height="' + settings.height + '" style="visibility: visible; " class="mejs-shim">' + 1483 1490 '<param name="allowScriptAccess" value="always">' + 1484 1491 '<param name="wmode" value="transparent">' + 1485 1492 '</object>'; … … mejs.YouTubeApi = { 1487 1494 1488 1495 var specialIEContainer, 1489 1496 youtubeUrl = 'http://www.youtube.com/apiplayer?enablejsapi=1&playerapiid=' + settings.pluginId + '&version=3&autoplay=0&controls=0&modestbranding=1&loop=0'; 1490 1497 1491 1498 if (mejs.MediaFeatures.isIE) { 1492 1499 1493 1500 specialIEContainer = document.createElement('div'); 1494 1501 settings.container.appendChild(specialIEContainer); 1495 1502 specialIEContainer.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" ' + 1496 'id="' + settings.pluginId + '" width="' + settings.width + '" height="' + settings.height + '" >' +1503 'id="' + settings.pluginId + '" width="' + settings.width + '" height="' + settings.height + '" class="mejs-shim">' + 1497 1504 '<param name="movie" value="' + youtubeUrl + '" />' + 1498 1505 '<param name="wmode" value="transparent" />' + 1499 1506 '<param name="allowScriptAccess" value="always" />' + … … mejs.YouTubeApi = { 1502 1509 } else { 1503 1510 settings.container.innerHTML = 1504 1511 '<object type="application/x-shockwave-flash" id="' + settings.pluginId + '" data="' + youtubeUrl + '" ' + 1505 'width="' + settings.width + '" height="' + settings.height + '" style="visibility: visible; " >' +1512 'width="' + settings.width + '" height="' + settings.height + '" style="visibility: visible; " class="mejs-shim">' + 1506 1513 '<param name="allowScriptAccess" value="always">' + 1507 1514 '<param name="wmode" value="transparent">' + 1508 1515 '</object>'; 1509 } 1510 1516 } 1517 1511 1518 }, 1512 1519 1513 1520 flashReady: function(id) { 1514 1521 var 1515 1522 settings = this.flashPlayers[id], 1516 1523 player = document.getElementById(id), 1517 1524 pluginMediaElement = settings.pluginMediaElement; 1518 1519 // hook up and return to MediaELementPlayer.success 1520 pluginMediaElement.pluginApi = 1525 1526 // hook up and return to MediaELementPlayer.success 1527 pluginMediaElement.pluginApi = 1521 1528 pluginMediaElement.pluginElement = player; 1522 1529 mejs.MediaPluginBridge.initPlugin(id); 1523 1530 1524 1531 // load the youtube video 1525 1532 player.cueVideoById(settings.videoId); 1526 1527 var callbackName = settings.containerId + '_callback' 1528 1533 1534 var callbackName = settings.containerId + '_callback'; 1535 1529 1536 window[callbackName] = function(e) { 1530 1537 mejs.YouTubeApi.handleStateChange(e, player, pluginMediaElement); 1531 1538 } 1532 1539 1533 1540 player.addEventListener('onStateChange', callbackName); 1534 1541 1535 1542 setInterval(function() { 1536 1543 mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'timeupdate'); 1537 1544 }, 250); 1538 1545 }, 1539 1546 1540 1547 handleStateChange: function(youTubeState, player, pluginMediaElement) { 1541 1548 switch (youTubeState) { 1542 1549 case -1: // not started … … mejs.YouTubeApi = { 1552 1559 break; 1553 1560 case 1: 1554 1561 pluginMediaElement.paused = false; 1555 pluginMediaElement.ended = false; 1562 pluginMediaElement.ended = false; 1556 1563 mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'play'); 1557 1564 mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'playing'); 1558 1565 break; 1559 1566 case 2: 1560 1567 pluginMediaElement.paused = true; 1561 pluginMediaElement.ended = false; 1568 pluginMediaElement.ended = false; 1562 1569 mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'pause'); 1563 1570 break; 1564 1571 case 3: // buffering … … mejs.YouTubeApi = { 1566 1573 break; 1567 1574 case 5: 1568 1575 // cued? 1569 break; 1570 1571 } 1572 1576 break; 1577 1578 } 1579 1573 1580 } 1574 1581 } 1575 1582 // IFRAME … … window.MediaElement = mejs.MediaElement; 1814 1821 * using jQuery and MediaElement.js (HTML5 Flash/Silverlight wrapper) 1815 1822 * 1816 1823 * Copyright 2010-2012, John Dyer (http://j.hn/) 1817 * Dual licensed under the MIT or GPL Version 2 licenses.1824 * License: MIT 1818 1825 * 1819 1826 */ 1820 1827 if (typeof jQuery != 'undefined') { … … if (typeof jQuery != 'undefined') { 1841 1848 // default if the user doesn't specify 1842 1849 defaultAudioHeight: 30, 1843 1850 1844 // default amount to move back when back key is pressed 1851 // default amount to move back when back key is pressed 1845 1852 defaultSeekBackwardInterval: function(media) { 1846 1853 return (media.duration * 0.05); 1847 }, 1848 // default amount to move forward when forward key is pressed 1854 }, 1855 // default amount to move forward when forward key is pressed 1849 1856 defaultSeekForwardInterval: function(media) { 1850 1857 return (media.duration * 0.05); 1851 }, 1852 1858 }, 1859 1853 1860 // width of audio player 1854 1861 audioWidth: -1, 1855 1862 // height of audio player 1856 audioHeight: -1, 1863 audioHeight: -1, 1857 1864 // initial volume when the player starts (overrided by user cookie) 1858 1865 startVolume: 0.8, 1859 1866 // useful for <audio> player loops 1860 1867 loop: false, 1868 // rewind to beginning when media ends 1869 autoRewind: true, 1861 1870 // resize to media dimensions 1862 1871 enableAutosize: true, 1863 1872 // forces the hour marker (##:00:00) … … if (typeof jQuery != 'undefined') { 1867 1876 showTimecodeFrameCount: false, 1868 1877 // used when showTimecodeFrameCount is set to true 1869 1878 framesPerSecond: 25, 1870 1879 1871 1880 // automatically calculate the width of the progress bar based on the sizes of other elements 1872 1881 autosizeProgress : true, 1873 1882 // Hide controls when playing and mouse is not over the video 1874 1883 alwaysShowControls: false, 1884 // Display the video control 1885 hideVideoControlsOnLoad: false, 1886 // Enable click video element to toggle play/pause 1887 clickToPlayPause: true, 1875 1888 // force iPad's native controls 1876 1889 iPadUseNativeControls: false, 1877 1890 // force iPhone's native controls 1878 iPhoneUseNativeControls: false, 1891 iPhoneUseNativeControls: false, 1879 1892 // force Android's native controls 1880 AndroidUseNativeControls: false, 1893 AndroidUseNativeControls: false, 1881 1894 // features to show 1882 1895 features: ['playpause','current','progress','duration','tracks','volume','fullscreen'], 1883 1896 // only for dynamic 1884 1897 isVideo: true, 1885 1898 1886 1899 // turns keyboard support on and off for this instance 1887 1900 enableKeyboard: true, 1888 1901 1889 1902 // whenthis player starts, it will pause other players 1890 1903 pauseOtherPlayers: true, 1891 1904 1892 1905 // array of keyboard actions such as play pause 1893 1906 keyActions: [ 1894 1907 { … … if (typeof jQuery != 'undefined') { 1898 1911 ], 1899 1912 action: function(player, media) { 1900 1913 if (media.paused || media.ended) { 1901 media.play(); 1914 media.play(); 1902 1915 } else { 1903 1916 media.pause(); 1904 } 1917 } 1905 1918 } 1906 1919 }, 1907 1920 { … … if (typeof jQuery != 'undefined') { 1929 1942 player.showControls(); 1930 1943 player.startControlsTimer(); 1931 1944 } 1932 1945 1933 1946 // 5% 1934 1947 var newTime = Math.max(media.currentTime - player.options.defaultSeekBackwardInterval(media), 0); 1935 1948 media.setCurrentTime(newTime); … … if (typeof jQuery != 'undefined') { 1940 1953 keys: [ 1941 1954 39, // RIGHT 1942 1955 228 // Google TV forward 1943 ], 1956 ], 1944 1957 action: function(player, media) { 1945 1958 if (!isNaN(media.duration) && media.duration > 0) { 1946 1959 if (player.isVideo) { 1947 1960 player.showControls(); 1948 1961 player.startControlsTimer(); 1949 1962 } 1950 1963 1951 1964 // 5% 1952 var newTime = Math.min(media.currentTime + player.options.defaultSeekForwardInterval(media), media.duration); 1965 var newTime = Math.min(media.currentTime + player.options.defaultSeekForwardInterval(media), media.duration); 1953 1966 media.setCurrentTime(newTime); 1954 1967 } 1955 1968 } … … if (typeof jQuery != 'undefined') { 1965 1978 } 1966 1979 } 1967 1980 } 1968 } 1969 ] 1981 } 1982 ] 1970 1983 }; 1971 1984 1972 1985 mejs.mepIndex = 0; 1973 1974 mejs.players = [];1986 1987 mejs.players = {}; 1975 1988 1976 1989 // wraps a MediaElement object in player controls 1977 1990 mejs.MediaElementPlayer = function(node, o) { 1978 1991 // enforce object, even without "new" (via John Resig) 1979 1992 if ( !(this instanceof mejs.MediaElementPlayer) ) { 1980 1993 return new mejs.MediaElementPlayer(node, o); 1981 } 1994 } 1982 1995 1983 1996 var t = this; 1984 1997 1985 1998 // these will be reset after the MediaElement.success fires 1986 1999 t.$media = t.$node = $(node); 1987 t.node = t.media = t.$media[0]; 1988 2000 t.node = t.media = t.$media[0]; 2001 1989 2002 // check for existing player 1990 2003 if (typeof t.node.player != 'undefined') { 1991 2004 return t.node.player; … … if (typeof jQuery != 'undefined') { 1993 2006 // attach player to DOM node for reference 1994 2007 t.node.player = t; 1995 2008 } 1996 1997 2009 2010 1998 2011 // try to get options from data-mejsoptions 1999 2012 if (typeof o == 'undefined') { 2000 o = t.$node.data('mejsoptions'); 2013 o = t.$node.data('mejsoptions'); 2001 2014 } 2002 2015 2003 2016 // extend default options 2004 2017 t.options = $.extend({},mejs.MepDefaults,o); 2005 2018 2019 // unique ID 2020 t.id = 'mep_' + mejs.mepIndex++; 2021 2006 2022 // add to player array (for focus events) 2007 mejs.players .push(t);2008 2023 mejs.players[t.id] = t; 2024 2009 2025 // start up 2010 2026 t.init(); 2011 2027 … … if (typeof jQuery != 'undefined') { 2014 2030 2015 2031 // actual player 2016 2032 mejs.MediaElementPlayer.prototype = { 2017 2033 2018 2034 hasFocus: false, 2019 2035 2020 2036 controlsAreVisible: true, 2021 2037 2022 2038 init: function() { 2023 2039 2024 2040 var … … if (typeof jQuery != 'undefined') { 2030 2046 error: function(e) { t.handleError(e);} 2031 2047 }), 2032 2048 tagName = t.media.tagName.toLowerCase(); 2033 2049 2034 2050 t.isDynamic = (tagName !== 'audio' && tagName !== 'video'); 2035 2036 if (t.isDynamic) { 2037 // get video from src or href? 2038 t.isVideo = t.options.isVideo; 2051 2052 if (t.isDynamic) { 2053 // get video from src or href? 2054 t.isVideo = t.options.isVideo; 2039 2055 } else { 2040 2056 t.isVideo = (tagName !== 'audio' && t.options.isVideo); 2041 2057 } 2042 2043 // use native controls in iPad, iPhone, and Android 2058 2059 // use native controls in iPad, iPhone, and Android 2044 2060 if ((mf.isiPad && t.options.iPadUseNativeControls) || (mf.isiPhone && t.options.iPhoneUseNativeControls)) { 2045 2061 2046 2062 // add controls and stop 2047 2063 t.$media.attr('controls', 'controls'); 2048 2064 … … if (typeof jQuery != 'undefined') { 2055 2071 t.media.load(); 2056 2072 t.media.play(); 2057 2073 } 2058 2059 } else if (mf.isAndroid && t. AndroidUseNativeControls) {2060 2074 2075 } else if (mf.isAndroid && t.options.AndroidUseNativeControls) { 2076 2061 2077 // leave default player 2062 2078 2063 2079 } else { 2064 2080 2065 2081 // DESKTOP: use MediaElementPlayer controls 2066 2067 // remove native controls 2068 t.$media.removeAttr('controls'); 2069 2070 // unique ID 2071 t.id = 'mep_' + mejs.mepIndex++; 2082 2083 // remove native controls 2084 t.$media.removeAttr('controls'); 2072 2085 2073 2086 // build container 2074 2087 t.container = … … if (typeof jQuery != 'undefined') { 2081 2094 '</div>' + 2082 2095 '</div>') 2083 2096 .addClass(t.$media[0].className) 2084 .insertBefore(t.$media); 2085 2097 .insertBefore(t.$media); 2098 2086 2099 // add classes for user and content 2087 2100 t.container.addClass( 2088 2101 (mf.isAndroid ? 'mejs-android ' : '') + … … if (typeof jQuery != 'undefined') { 2090 2103 (mf.isiPad ? 'mejs-ipad ' : '') + 2091 2104 (mf.isiPhone ? 'mejs-iphone ' : '') + 2092 2105 (t.isVideo ? 'mejs-video ' : 'mejs-audio ') 2093 ); 2094 2106 ); 2107 2095 2108 2096 2109 // move the <video/video> tag into the right spot 2097 2110 if (mf.isiOS) { 2098 2111 2099 2112 // sadly, you can't move nodes in iOS, so we have to destroy and recreate it! 2100 2113 var $newMedia = t.$media.clone(); 2101 2114 2102 2115 t.container.find('.mejs-mediaelement').append($newMedia); 2103 2116 2104 2117 t.$media.remove(); 2105 2118 t.$node = t.$media = $newMedia; 2106 2119 t.node = t.media = $newMedia[0] 2107 2120 2108 2121 } else { 2109 2122 2110 2123 // normal way of moving it into place (doesn't work on iOS) 2111 2124 t.container.find('.mejs-mediaelement').append(t.$media); 2112 2125 } 2113 2126 2114 2127 // find parts 2115 2128 t.controls = t.container.find('.mejs-controls'); 2116 2129 t.layers = t.container.find('.mejs-layers'); 2117 2130 2118 2131 // determine the size 2119 2132 2120 2133 /* size priority: 2121 (1) videoWidth (forced), 2134 (1) videoWidth (forced), 2122 2135 (2) style="width;height;" 2123 2136 (3) width attribute, 2124 2137 (4) defaultVideoWidth (for unspecified cases) 2125 2138 */ 2126 2139 2127 2140 var tagType = (t.isVideo ? 'video' : 'audio'), 2128 2141 capsTagName = tagType.substring(0,1).toUpperCase() + tagType.substring(1); 2129 2130 2142 2143 2131 2144 if (t.options[tagType + 'Width'] > 0 || t.options[tagType + 'Width'].toString().indexOf('%') > -1) { 2132 2145 t.width = t.options[tagType + 'Width']; 2133 2146 } else if (t.media.style.width !== '' && t.media.style.width !== null) { 2134 t.width = t.media.style.width; 2147 t.width = t.media.style.width; 2135 2148 } else if (t.media.getAttribute('width') !== null) { 2136 2149 t.width = t.$media.attr('width'); 2137 2150 } else { 2138 2151 t.width = t.options['default' + capsTagName + 'Width']; 2139 2152 } 2140 2153 2141 2154 if (t.options[tagType + 'Height'] > 0 || t.options[tagType + 'Height'].toString().indexOf('%') > -1) { 2142 2155 t.height = t.options[tagType + 'Height']; 2143 2156 } else if (t.media.style.height !== '' && t.media.style.height !== null) { 2144 2157 t.height = t.media.style.height; 2145 2158 } else if (t.$media[0].getAttribute('height') !== null) { 2146 t.height = t.$media.attr('height'); 2159 t.height = t.$media.attr('height'); 2147 2160 } else { 2148 2161 t.height = t.options['default' + capsTagName + 'Height']; 2149 2162 } 2150 2163 2151 2164 // set the size, while we wait for the plugins to load below 2152 2165 t.setPlayerSize(t.width, t.height); 2153 2166 2154 2167 // create MediaElementShim 2155 2168 meOptions.pluginWidth = t.height; 2156 meOptions.pluginHeight = t.width; 2169 meOptions.pluginHeight = t.width; 2157 2170 } 2158 2159 2171 2172 2160 2173 2161 2174 // create MediaElement shim 2162 2175 mejs.MediaElement(t.$media[0], meOptions); 2176 2177 // controls are shown when loaded 2178 t.container.trigger('controlsshown'); 2163 2179 }, 2164 2180 2165 2181 showControls: function(doAnimation) { 2166 2182 var t = this; 2167 2183 2168 2184 doAnimation = typeof doAnimation == 'undefined' || doAnimation; 2169 2185 2170 2186 if (t.controlsAreVisible) 2171 2187 return; 2172 2188 2173 2189 if (doAnimation) { 2174 2190 t.controls 2175 2191 .css('visibility','visible') 2176 .stop(true, true).fadeIn(200, function() {t.controlsAreVisible = true;}); 2177 2192 .stop(true, true).fadeIn(200, function() { 2193 t.controlsAreVisible = true; 2194 t.container.trigger('controlsshown'); 2195 }); 2196 2178 2197 // any additional controls people might add and want to hide 2179 2198 t.container.find('.mejs-control') 2180 2199 .css('visibility','visible') 2181 .stop(true, true).fadeIn(200, function() {t.controlsAreVisible = true;}); 2182 2200 .stop(true, true).fadeIn(200, function() {t.controlsAreVisible = true;}); 2201 2183 2202 } else { 2184 2203 t.controls 2185 2204 .css('visibility','visible') 2186 2205 .css('display','block'); 2187 2206 2188 2207 // any additional controls people might add and want to hide 2189 2208 t.container.find('.mejs-control') 2190 2209 .css('visibility','visible') 2191 2210 .css('display','block'); 2192 2211 2193 2212 t.controlsAreVisible = true; 2213 t.container.trigger('controlsshown'); 2194 2214 } 2195 2215 2196 2216 t.setControlsSize(); 2197 2217 2198 2218 }, 2199 2219 2200 2220 hideControls: function(doAnimation) { 2201 2221 var t = this; 2202 2222 2203 2223 doAnimation = typeof doAnimation == 'undefined' || doAnimation; 2204 2224 2205 2225 if (!t.controlsAreVisible) 2206 2226 return; 2207 2227 2208 2228 if (doAnimation) { 2209 2229 // fade out main controls 2210 2230 t.controls.stop(true, true).fadeOut(200, function() { 2211 2231 $(this) 2212 2232 .css('visibility','hidden') 2213 2233 .css('display','block'); 2214 2234 2215 2235 t.controlsAreVisible = false; 2216 }); 2217 2236 t.container.trigger('controlshidden'); 2237 }); 2238 2218 2239 // any additional controls people might add and want to hide 2219 2240 t.container.find('.mejs-control').stop(true, true).fadeOut(200, function() { 2220 2241 $(this) 2221 2242 .css('visibility','hidden') 2222 2243 .css('display','block'); 2223 }); 2244 }); 2224 2245 } else { 2225 2246 2226 2247 // hide main controls 2227 2248 t.controls 2228 2249 .css('visibility','hidden') 2229 .css('display','block'); 2230 2250 .css('display','block'); 2251 2231 2252 // hide others 2232 2253 t.container.find('.mejs-control') 2233 2254 .css('visibility','hidden') 2234 2255 .css('display','block'); 2235 2256 2236 2257 t.controlsAreVisible = false; 2258 t.container.trigger('controlshidden'); 2237 2259 } 2238 }, 2260 }, 2239 2261 2240 2262 controlsTimer: null, 2241 2263 2242 2264 startControlsTimer: function(timeout) { 2243 2265 2244 2266 var t = this; 2245 2267 2246 2268 timeout = typeof timeout != 'undefined' ? timeout : 1500; 2247 2269 2248 2270 t.killControlsTimer('start'); … … if (typeof jQuery != 'undefined') { 2263 2285 delete t.controlsTimer; 2264 2286 t.controlsTimer = null; 2265 2287 } 2266 }, 2267 2288 }, 2289 2268 2290 controlsEnabled: true, 2269 2291 2270 2292 disableControls: function() { 2271 2293 var t= this; 2272 2294 2273 2295 t.killControlsTimer(); 2274 2296 t.hideControls(false); 2275 2297 this.controlsEnabled = false; 2276 2298 }, 2277 2299 2278 2300 enableControls: function() { 2279 2301 var t= this; 2280 2302 2281 2303 t.showControls(false); 2282 2304 2283 2305 t.controlsEnabled = true; 2284 }, 2285 2306 }, 2307 2286 2308 2287 2309 // Sets up all controls and events 2288 meReady: function(media, domNode) { 2289 2290 2310 meReady: function(media, domNode) { 2311 2312 2291 2313 var t = this, 2292 2314 mf = mejs.MediaFeatures, 2293 2315 autoplayAttr = domNode.getAttribute('autoplay'), … … if (typeof jQuery != 'undefined') { 2299 2321 if (t.created) 2300 2322 return; 2301 2323 else 2302 t.created = true; 2324 t.created = true; 2303 2325 2304 2326 t.media = media; 2305 2327 t.domNode = domNode; 2306 2307 if (!(mf.isAndroid && t.options.AndroidUseNativeControls) && !(mf.isiPad && t.options.iPadUseNativeControls) && !(mf.isiPhone && t.options.iPhoneUseNativeControls)) { 2308 2328 2329 if (!(mf.isAndroid && t.options.AndroidUseNativeControls) && !(mf.isiPad && t.options.iPadUseNativeControls) && !(mf.isiPhone && t.options.iPhoneUseNativeControls)) { 2330 2309 2331 // two built in features 2310 2332 t.buildposter(t, t.controls, t.layers, t.media); 2311 2333 t.buildkeyboard(t, t.controls, t.layers, t.media); … … if (typeof jQuery != 'undefined') { 2330 2352 } 2331 2353 2332 2354 t.container.trigger('controlsready'); 2333 2355 2334 2356 // reset all layers and controls 2335 2357 t.setPlayerSize(t.width, t.height); 2336 2358 t.setControlsSize(); 2337 2359 2338 2360 2339 2361 // controls fade 2340 2362 if (t.isVideo) { 2341 2363 2342 2364 if (mejs.MediaFeatures.hasTouch) { 2343 2365 2344 2366 // for touch devices (iOS, Android) 2345 2367 // show/hide without animation on touch 2346 2368 2347 2369 t.$media.bind('touchstart', function() { 2348 2349 2370 2371 2350 2372 // toggle controls 2351 2373 if (t.controlsAreVisible) { 2352 2374 t.hideControls(false); … … if (typeof jQuery != 'undefined') { 2355 2377 t.showControls(false); 2356 2378 } 2357 2379 } 2358 }); 2359 2380 }); 2381 2360 2382 } else { 2361 2383 // click to play/pause 2362 2384 t.media.addEventListener('click', function() { 2363 if (t.media.paused) { 2364 t.media.play(); 2365 } else { 2366 t.media.pause(); 2385 if (t.options.clickToPlayPause) { 2386 if (t.media.paused) { 2387 t.media.play(); 2388 } else { 2389 t.media.pause(); 2390 } 2367 2391 } 2368 2392 }); 2369 2393 2370 2394 // show/hide controls 2371 2395 t.container 2372 2396 .bind('mouseenter mouseover', function () { 2373 2397 if (t.controlsEnabled) { 2374 if (!t.options.alwaysShowControls) { 2398 if (!t.options.alwaysShowControls) { 2375 2399 t.killControlsTimer('enter'); 2376 2400 t.showControls(); 2377 t.startControlsTimer(2500); 2401 t.startControlsTimer(2500); 2378 2402 } 2379 2403 } 2380 2404 }) … … if (typeof jQuery != 'undefined') { 2392 2416 .bind('mouseleave', function () { 2393 2417 if (t.controlsEnabled) { 2394 2418 if (!t.media.paused && !t.options.alwaysShowControls) { 2395 t.startControlsTimer(1000); 2419 t.startControlsTimer(1000); 2396 2420 } 2397 2421 } 2398 2422 }); 2399 2423 } 2400 2424 2425 if(t.options.hideVideoControlsOnLoad) { 2426 t.hideControls(false); 2427 } 2428 2401 2429 // check for autoplay 2402 2430 if (autoplay && !t.options.alwaysShowControls) { 2403 2431 t.hideControls(); … … if (typeof jQuery != 'undefined') { 2416 2444 }, false); 2417 2445 } 2418 2446 } 2419 2447 2420 2448 // EVENTS 2421 2449 2422 2450 // FOCUS: when a video starts playing, it takes focus from other players (possibily pausing them) 2423 2451 media.addEventListener('play', function() { 2424 2452 var playerIndex; 2453 2425 2454 // go through all other players 2426 for ( var i=0, il=mejs.players.length; i<il; i++) {2427 var p = mejs.players[ i];2455 for (playerIndex in mejs.players) { 2456 var p = mejs.players[playerIndex]; 2428 2457 if (p.id != t.id && t.options.pauseOtherPlayers && !p.paused && !p.ended) { 2429 2458 p.pause(); 2430 2459 } 2431 2460 p.hasFocus = false; 2432 2461 } 2433 2462 2434 2463 t.hasFocus = true; 2435 2464 },false); 2436 2465 2437 2466 2438 2467 // ended for all 2439 2468 t.media.addEventListener('ended', function (e) { 2440 try{ 2441 t.media.setCurrentTime(0); 2442 } catch (exp) { 2443 2469 if(t.options.autoRewind) { 2470 try{ 2471 t.media.setCurrentTime(0); 2472 } catch (exp) { 2473 2474 } 2444 2475 } 2445 2476 t.media.pause(); 2446 2477 2447 2478 if (t.setProgressRail) 2448 2479 t.setProgressRail(); 2449 2480 if (t.setCurrentRail) 2450 t.setCurrentRail(); 2481 t.setCurrentRail(); 2451 2482 2452 2483 if (t.options.loop) { 2453 2484 t.media.play(); … … if (typeof jQuery != 'undefined') { 2455 2486 t.showControls(); 2456 2487 } 2457 2488 }, false); 2458 2489 2459 2490 // resize on the first play 2460 2491 t.media.addEventListener('loadedmetadata', function(e) { 2461 2492 if (t.updateDuration) { … … if (typeof jQuery != 'undefined') { 2464 2495 if (t.updateCurrent) { 2465 2496 t.updateCurrent(); 2466 2497 } 2467 2498 2468 2499 if (!t.isFullScreen) { 2469 2500 t.setPlayerSize(t.width, t.height); 2470 2501 t.setControlsSize(); … … if (typeof jQuery != 'undefined') { 2477 2508 t.setPlayerSize(t.width, t.height); 2478 2509 t.setControlsSize(); 2479 2510 }, 50); 2480 2511 2481 2512 // adjust controls whenever window sizes (used to be in fullscreen only) 2482 $(window).resize(function() {2483 2484 // don't resize for fullscreen mode 2513 t.globalBind('resize', function() { 2514 2515 // don't resize for fullscreen mode 2485 2516 if ( !(t.isFullScreen || (mejs.MediaFeatures.hasTrueNativeFullScreen && document.webkitIsFullScreen)) ) { 2486 2517 t.setPlayerSize(t.width, t.height); 2487 2518 } 2488 2519 2489 2520 // always adjust controls 2490 2521 t.setControlsSize(); 2491 }); 2522 }); 2492 2523 2493 2524 // TEMP: needs to be moved somewhere else 2494 2525 if (t.media.pluginType == 'youtube') { 2495 t.container.find('.mejs-overlay-play').hide(); 2526 t.container.find('.mejs-overlay-play').hide(); 2496 2527 } 2497 2528 } 2498 2529 2499 2530 // force autoplay for HTML5 2500 2531 if (autoplay && media.pluginType == 'native') { 2501 2532 media.load(); … … if (typeof jQuery != 'undefined') { 2504 2535 2505 2536 2506 2537 if (t.options.success) { 2507 2538 2508 2539 if (typeof t.options.success == 'string') { 2509 2540 window[t.options.success](t.media, t.domNode, t); 2510 2541 } else { … … if (typeof jQuery != 'undefined') { 2515 2546 2516 2547 handleError: function(e) { 2517 2548 var t = this; 2518 2549 2519 2550 t.controls.hide(); 2520 2551 2521 2552 // Tell user that the file cannot be played 2522 2553 if (t.options.error) { 2523 2554 t.options.error(e); … … if (typeof jQuery != 'undefined') { 2529 2560 2530 2561 if (typeof width != 'undefined') 2531 2562 t.width = width; 2532 2563 2533 2564 if (typeof height != 'undefined') 2534 2565 t.height = height; 2535 2566 2536 2567 // detect 100% mode - use currentStyle for IE since css() doesn't return percentages 2537 2568 if (t.height.toString().indexOf('%') > 0 || t.$node.css('max-width') === '100%' || (t.$node[0].currentStyle && t.$node[0].currentStyle.maxWidth === '100%')) { 2538 2569 2539 2570 // do we have the native dimensions yet? 2540 var 2571 var 2541 2572 nativeWidth = t.isVideo ? ((t.media.videoWidth && t.media.videoWidth > 0) ? t.media.videoWidth : t.options.defaultVideoWidth) : t.options.defaultAudioWidth, 2542 2573 nativeHeight = t.isVideo ? ((t.media.videoHeight && t.media.videoHeight > 0) ? t.media.videoHeight : t.options.defaultVideoHeight) : t.options.defaultAudioHeight, 2543 2574 parentWidth = t.container.parent().closest(':visible').width(), 2544 newHeight = parseInt(parentWidth * nativeHeight/nativeWidth, 10);2545 2575 newHeight = t.isVideo || !t.options.autosizeProgress ? parseInt(parentWidth * nativeHeight/nativeWidth, 10) : nativeHeight; 2576 2546 2577 if (t.container.parent()[0].tagName.toLowerCase() === 'body') { // && t.container.siblings().count == 0) { 2547 2578 parentWidth = $(window).width(); 2548 2579 newHeight = $(window).height(); 2549 2580 } 2550 2551 if ( newHeight != 0 ) {2581 2582 if ( newHeight != 0 && parentWidth != 0 ) { 2552 2583 // set outer container size 2553 2584 t.container 2554 2585 .width(parentWidth) 2555 2586 .height(newHeight); 2556 2557 // set native <video> or <audio> 2558 t.$media 2559 .width('100%') 2560 .height('100%'); 2561 2562 // set shims 2563 t.container.find('object, embed, iframe') 2587 2588 // set native <video> or <audio> and shims 2589 t.$media.add(t.container.find('.mejs-shim')) 2564 2590 .width('100%') 2565 2591 .height('100%'); 2566 2567 // if shim is ready, send the size to the embeded plugin 2592 2593 // if shim is ready, send the size to the embeded plugin 2568 2594 if (t.isVideo) { 2569 2595 if (t.media.setVideoSize) { 2570 2596 t.media.setVideoSize(parentWidth, newHeight); 2571 2597 } 2572 2598 } 2573 2599 2574 2600 // set the layers 2575 2601 t.layers.children('.mejs-layer') 2576 2602 .width('100%') 2577 2603 .height('100%'); 2578 2604 } 2579 2580 2605 2606 2581 2607 } else { 2582 2608 2583 2609 t.container 2584 2610 .width(t.width) 2585 2611 .height(t.height); 2586 2612 2587 2613 t.layers.children('.mejs-layer') 2588 2614 .width(t.width) 2589 2615 .height(t.height); 2590 2616 2591 2617 } 2592 2618 }, 2593 2619 … … if (typeof jQuery != 'undefined') { 2600 2626 current = t.controls.find('.mejs-time-current'), 2601 2627 loaded = t.controls.find('.mejs-time-loaded'), 2602 2628 others = rail.siblings(); 2603 2629 2604 2630 2605 2631 // allow the size to come from custom CSS 2606 2632 if (t.options && !t.options.autosizeProgress) { 2607 // Also, frontends devs can be more flexible 2633 // Also, frontends devs can be more flexible 2608 2634 // due the opportunity of absolute positioning. 2609 2635 railWidth = parseInt(rail.css('width')); 2610 2636 } 2611 2637 2612 2638 // attempt to autosize 2613 2639 if (railWidth === 0 || !railWidth) { 2614 2640 2615 2641 // find the size of all the other controls besides the rail 2616 2642 others.each(function() { 2617 if ($(this).css('position') != 'absolute') { 2643 var $this = $(this); 2644 if ($this.css('position') != 'absolute' && $this.is(':visible')) { 2618 2645 usedWidth += $(this).outerWidth(true); 2619 2646 } 2620 2647 }); 2621 2648 2622 2649 // fit the rail into the remaining space 2623 2650 railWidth = t.controls.width() - usedWidth - (rail.outerWidth(true) - rail.width()); 2624 2651 } … … if (typeof jQuery != 'undefined') { 2627 2654 rail.width(railWidth); 2628 2655 // dark space 2629 2656 total.width(railWidth - (total.outerWidth(true) - total.width())); 2630 2657 2631 2658 if (t.setProgressRail) 2632 2659 t.setProgressRail(); 2633 2660 if (t.setCurrentRail) 2634 t.setCurrentRail(); 2661 t.setCurrentRail(); 2635 2662 }, 2636 2663 2637 2664 2638 2665 buildposter: function(player, controls, layers, media) { 2639 2666 var t = this, 2640 poster = 2667 poster = 2641 2668 $('<div class="mejs-poster mejs-layer">' + 2642 2669 '</div>') 2643 2670 .appendTo(layers), … … if (typeof jQuery != 'undefined') { 2646 2673 // prioriy goes to option (this is useful if you need to support iOS 3.x (iOS completely fails with poster) 2647 2674 if (player.options.poster !== '') { 2648 2675 posterUrl = player.options.poster; 2649 } 2650 2676 } 2677 2651 2678 // second, try the real poster 2652 2679 if (posterUrl !== '' && posterUrl != null) { 2653 2680 t.setPoster(posterUrl); … … if (typeof jQuery != 'undefined') { 2659 2686 poster.hide(); 2660 2687 }, false); 2661 2688 }, 2662 2689 2663 2690 setPoster: function(url) { 2664 2691 var t = this, 2665 2692 posterDiv = t.container.find('.mejs-poster'), 2666 2693 posterImg = posterDiv.find('img'); 2667 2694 2668 2695 if (posterImg.length == 0) { 2669 2696 posterImg = $('<img width="100%" height="100%" />').appendTo(posterDiv); 2670 } 2671 2697 } 2698 2672 2699 posterImg.attr('src', url); 2673 2700 }, 2674 2701 2675 2702 buildoverlays: function(player, controls, layers, media) { 2703 var t = this; 2676 2704 if (!player.isVideo) 2677 2705 return; 2678 2706 2679 var 2680 loading = 2707 var 2708 loading = 2681 2709 $('<div class="mejs-overlay mejs-layer">'+ 2682 2710 '<div class="mejs-overlay-loading"><span></span></div>'+ 2683 2711 '</div>') 2684 2712 .hide() // start out hidden 2685 2713 .appendTo(layers), 2686 error = 2714 error = 2687 2715 $('<div class="mejs-overlay mejs-layer">'+ 2688 2716 '<div class="mejs-overlay-error"></div>'+ 2689 2717 '</div>') 2690 2718 .hide() // start out hidden 2691 2719 .appendTo(layers), 2692 2720 // this needs to come last so it's on top 2693 bigPlay = 2721 bigPlay = 2694 2722 $('<div class="mejs-overlay mejs-layer mejs-overlay-play">'+ 2695 2723 '<div class="mejs-overlay-button"></div>'+ 2696 2724 '</div>') 2697 2725 .appendTo(layers) 2698 2726 .click(function() { 2699 if (media.paused) { 2700 media.play(); 2701 } else { 2702 media.pause(); 2703 } 2727 if (t.options.clickToPlayPause) { 2728 if (media.paused) { 2729 media.play(); 2730 } else { 2731 media.pause(); 2732 } 2733 } 2704 2734 }); 2705 2735 2706 2736 /* 2707 2737 if (mejs.MediaFeatures.isiOS || mejs.MediaFeatures.isAndroid) { 2708 2738 bigPlay.remove(); 2709 2739 loading.remove(); 2710 2740 } 2711 2741 */ 2712 2742 2713 2743 2714 2744 // show/hide big play button 2715 2745 media.addEventListener('play',function() { … … if (typeof jQuery != 'undefined') { 2717 2747 loading.hide(); 2718 2748 controls.find('.mejs-time-buffering').hide(); 2719 2749 error.hide(); 2720 }, false); 2721 2750 }, false); 2751 2722 2752 media.addEventListener('playing', function() { 2723 2753 bigPlay.hide(); 2724 2754 loading.hide(); 2725 2755 controls.find('.mejs-time-buffering').hide(); 2726 error.hide(); 2756 error.hide(); 2727 2757 }, false); 2728 2758 2729 2759 media.addEventListener('seeking', function() { … … if (typeof jQuery != 'undefined') { 2735 2765 loading.hide(); 2736 2766 controls.find('.mejs-time-buffering').hide(); 2737 2767 }, false); 2738 2768 2739 2769 media.addEventListener('pause',function() { 2740 2770 if (!mejs.MediaFeatures.isiPhone) { 2741 2771 bigPlay.show(); 2742 2772 } 2743 2773 }, false); 2744 2774 2745 2775 media.addEventListener('waiting', function() { 2746 loading.show(); 2776 loading.show(); 2747 2777 controls.find('.mejs-time-buffering').show(); 2748 }, false); 2749 2750 2751 // show/hide loading 2778 }, false); 2779 2780 2781 // show/hide loading 2752 2782 media.addEventListener('loadeddata',function() { 2753 2783 // for some reason Chrome is firing this event 2754 2784 //if (mejs.MediaFeatures.isChrome && media.getAttribute && media.getAttribute('preload') === 'none') 2755 2785 // return; 2756 2786 2757 2787 loading.show(); 2758 2788 controls.find('.mejs-time-buffering').show(); 2759 }, false); 2789 }, false); 2760 2790 media.addEventListener('canplay',function() { 2761 2791 loading.hide(); 2762 2792 controls.find('.mejs-time-buffering').hide(); 2763 }, false); 2793 }, false); 2764 2794 2765 2795 // error handling 2766 2796 media.addEventListener('error',function() { … … if (typeof jQuery != 'undefined') { 2768 2798 controls.find('.mejs-time-buffering').hide(); 2769 2799 error.show(); 2770 2800 error.find('mejs-overlay-error').html("Error loading this resource"); 2771 }, false); 2801 }, false); 2772 2802 }, 2773 2803 2774 2804 buildkeyboard: function(player, controls, layers, media) { 2775 2805 2776 2806 var t = this; 2777 2807 2778 2808 // listen for key presses 2779 $(document).keydown(function(e) {2780 2809 t.globalBind('keydown', function(e) { 2810 2781 2811 if (player.hasFocus && player.options.enableKeyboard) { 2782 2812 2783 2813 // find a matching key 2784 2814 for (var i=0, il=player.options.keyActions.length; i<il; i++) { 2785 2815 var keyAction = player.options.keyActions[i]; 2786 2816 2787 2817 for (var j=0, jl=keyAction.keys.length; j<jl; j++) { 2788 2818 if (e.keyCode == keyAction.keys[j]) { 2789 2819 e.preventDefault(); 2790 2820 keyAction.action(player, media, e.keyCode); 2791 2821 return false; 2792 } 2822 } 2793 2823 } 2794 2824 } 2795 2825 } 2796 2826 2797 2827 return true; 2798 2828 }); 2799 2829 2800 2830 // check if someone clicked outside a player region, then kill its focus 2801 $(document).click(function(event) {2831 t.globalBind('click', function(event) { 2802 2832 if ($(event.target).closest('.mejs-container').length == 0) { 2803 2833 player.hasFocus = false; 2804 2834 } 2805 2835 }); 2806 2836 2807 2837 }, 2808 2838 2809 2839 findTracks: function() { … … if (typeof jQuery != 'undefined') { 2813 2843 // store for use by plugins 2814 2844 t.tracks = []; 2815 2845 tracktags.each(function(index, track) { 2816 2846 2817 2847 track = $(track); 2818 2848 2819 2849 t.tracks.push({ 2820 srclang: track.attr('srclang').toLowerCase(),2850 srclang: (track.attr('srclang')) ? track.attr('srclang').toLowerCase() : '', 2821 2851 src: track.attr('src'), 2822 2852 kind: track.attr('kind'), 2823 2853 label: track.attr('label') || '', … … if (typeof jQuery != 'undefined') { 2859 2889 this.media.setSrc(src); 2860 2890 }, 2861 2891 remove: function() { 2862 var t = this; 2863 2864 if (t.media.pluginType === 'flash') { 2865 t.media.remove(); 2866 } else if (t.media.pluginType === 'native') { 2892 var t = this, featureIndex, feature; 2893 2894 // invoke features cleanup 2895 for (featureIndex in t.options.features) { 2896 feature = t.options.features[featureIndex]; 2897 if (t['clean' + feature]) { 2898 try { 2899 t['clean' + feature](t); 2900 } catch (e) { 2901 // TODO: report control error 2902 //throw e; 2903 //console.log('error building ' + feature); 2904 //console.log(e); 2905 } 2906 } 2907 } 2908 2909 if (t.media.pluginType === 'native') { 2867 2910 t.$media.prop('controls', true); 2911 } else { 2912 t.media.remove(); 2868 2913 } 2869 2914 2870 2915 // grab video and put it back in place 2871 2916 if (!t.isDynamic) { 2872 t.$node.insertBefore(t.container) 2917 if (t.media.pluginType === 'native') { 2918 // detach events from the video 2919 // TODO: detach event listeners better than this; 2920 // also detach ONLY the events attached by this plugin! 2921 //t.$node.clone().insertBefore(t.container); 2922 //t.$node.remove(); 2923 } 2924 /*else*/ t.$node.insertBefore(t.container) 2873 2925 } 2874 2926 2927 // Remove the player from the mejs.players array so that pauseOtherPlayers doesn't blow up when trying to pause a non existance flash api. 2928 mejs.players.splice( $.inArray( t, mejs.players ), 1); 2929 2875 2930 t.container.remove(); 2931 t.globalUnbind(); 2932 delete t.node.player; 2933 delete mejs.players[t.id]; 2876 2934 } 2877 2935 }; 2878 2936 2937 (function(){ 2938 var rwindow = /^((after|before)print|(before)?unload|hashchange|message|o(ff|n)line|page(hide|show)|popstate|resize|storage)\b/; 2939 2940 function splitEvents(events, id) { 2941 // add player ID as an event namespace so it's easier to unbind them all later 2942 var ret = {d: [], w: []}; 2943 $.each((events || '').split(' '), function(k, v){ 2944 ret[rwindow.test(v) ? 'w' : 'd'].push(v + '.' + id); 2945 }); 2946 ret.d = ret.d.join(' '); 2947 ret.w = ret.w.join(' '); 2948 return ret; 2949 } 2950 2951 mejs.MediaElementPlayer.prototype.globalBind = function(events, data, callback) { 2952 var t = this; 2953 events = splitEvents(events, t.id); 2954 if (events.d) $(document).bind(events.d, data, callback); 2955 if (events.w) $(window).bind(events.w, data, callback); 2956 }; 2957 2958 mejs.MediaElementPlayer.prototype.globalUnbind = function(events, callback) { 2959 var t = this; 2960 events = splitEvents(events, t.id); 2961 if (events.d) $(document).unbind(events.d, callback); 2962 if (events.w) $(window).unbind(events.w, callback); 2963 }; 2964 })(); 2965 2879 2966 // turn into jQuery plugin 2880 2967 if (typeof jQuery != 'undefined') { 2881 2968 jQuery.fn.mediaelementplayer = function (options) { 2882 return this.each(function () { 2883 new mejs.MediaElementPlayer(this, options); 2884 }); 2969 if (options === false) { 2970 this.each(function () { 2971 var player = jQuery(this).data('mediaelementplayer'); 2972 if (player) { 2973 player.remove(); 2974 } 2975 jQuery(this).removeData('mediaelementplayer'); 2976 }); 2977 } 2978 else { 2979 this.each(function () { 2980 jQuery(this).data('mediaelementplayer', new mejs.MediaElementPlayer(this, options)); 2981 }); 2982 } 2983 return this; 2885 2984 }; 2886 2985 } 2887 2986 2888 2987 $(document).ready(function() { 2889 2988 // auto enable using JSON attribute 2890 2989 $('.mejs-player').mediaelementplayer(); 2891 2990 }); 2892 2991 2893 2992 // push out to window 2894 2993 window.MediaElementPlayer = mejs.MediaElementPlayer; 2895 2994 … … if (typeof jQuery != 'undefined') { 2904 3003 // PLAY/pause BUTTON 2905 3004 $.extend(MediaElementPlayer.prototype, { 2906 3005 buildplaypause: function(player, controls, layers, media) { 2907 var 3006 var 2908 3007 t = this, 2909 play = 3008 play = 2910 3009 $('<div class="mejs-button mejs-playpause-button mejs-play" >' + 2911 3010 '<button type="button" aria-controls="' + t.id + '" title="' + t.options.playpauseText + '"></button>' + 2912 3011 '</div>') 2913 3012 .appendTo(controls) 2914 3013 .click(function(e) { 2915 3014 e.preventDefault(); 2916 3015 2917 3016 if (media.paused) { 2918 3017 media.play(); 2919 3018 } else { 2920 3019 media.pause(); 2921 3020 } 2922 3021 2923 3022 return false; 2924 3023 }); 2925 3024 … … if (typeof jQuery != 'undefined') { 2939 3038 }, false); 2940 3039 } 2941 3040 }); 2942 3041 2943 3042 })(mejs.$); 2944 3043 (function($) { 2945 3044 … … if (typeof jQuery != 'undefined') { 2951 3050 $.extend(MediaElementPlayer.prototype, { 2952 3051 buildstop: function(player, controls, layers, media) { 2953 3052 var t = this, 2954 stop = 3053 stop = 2955 3054 $('<div class="mejs-button mejs-stop-button mejs-stop">' + 2956 3055 '<button type="button" aria-controls="' + t.id + '" title="' + t.options.stopText + '"></button>' + 2957 3056 '</div>') … … if (typeof jQuery != 'undefined') { 2966 3065 controls.find('.mejs-time-current').width('0px'); 2967 3066 controls.find('.mejs-time-handle').css('left', '0px'); 2968 3067 controls.find('.mejs-time-float-current').html( mejs.Utility.secondsToTimeCode(0) ); 2969 controls.find('.mejs-currenttime').html( mejs.Utility.secondsToTimeCode(0) ); 3068 controls.find('.mejs-currenttime').html( mejs.Utility.secondsToTimeCode(0) ); 2970 3069 layers.find('.mejs-poster').show(); 2971 3070 } 2972 3071 }); 2973 3072 } 2974 3073 }); 2975 3074 2976 3075 })(mejs.$); 2977 3076 (function($) { 2978 3077 // progress/loaded bar … … if (typeof jQuery != 'undefined') { 2985 3084 '<span class="mejs-time-loaded"></span>'+ 2986 3085 '<span class="mejs-time-current"></span>'+ 2987 3086 '<span class="mejs-time-handle"></span>'+ 2988 '<span class="mejs-time-float">' + 2989 '<span class="mejs-time-float-current">00:00</span>' + 2990 '<span class="mejs-time-float-corner"></span>' + 3087 '<span class="mejs-time-float">' + 3088 '<span class="mejs-time-float-current">00:00</span>' + 3089 '<span class="mejs-time-float-corner"></span>' + 2991 3090 '</span>'+ 2992 3091 '</span>'+ 2993 3092 '</div>') 2994 3093 .appendTo(controls); 2995 3094 controls.find('.mejs-time-buffering').hide(); 2996 3095 2997 var 3096 var 2998 3097 t = this, 2999 3098 total = controls.find('.mejs-time-total'), 3000 3099 loaded = controls.find('.mejs-time-loaded'), … … if (typeof jQuery != 'undefined') { 3009 3108 width = total.outerWidth(true), 3010 3109 percentage = 0, 3011 3110 newTime = 0, 3012 pos = x - offset.left;3111 pos = 0; 3013 3112 3014 3113 3015 if (x > offset.left && x <= width + offset.left && media.duration) { 3016 percentage = ((x - offset.left) / width); 3114 if (media.duration) { 3115 if (x < offset.left) { 3116 x = offset.left; 3117 } else if (x > width + offset.left) { 3118 x = width + offset.left; 3119 } 3120 3121 pos = x - offset.left; 3122 percentage = (pos / width); 3017 3123 newTime = (percentage <= 0.02) ? 0 : percentage * media.duration; 3018 3124 3019 3125 // seek to where the mouse is 3020 if (mouseIsDown ) {3126 if (mouseIsDown && newTime !== media.currentTime) { 3021 3127 media.setCurrentTime(newTime); 3022 3128 } 3023 3129 … … if (typeof jQuery != 'undefined') { 3040 3146 if (e.which === 1) { 3041 3147 mouseIsDown = true; 3042 3148 handleMouseMove(e); 3043 $(document) 3044 .bind('mousemove.dur', function(e) { 3045 handleMouseMove(e); 3046 }) 3047 .bind('mouseup.dur', function (e) { 3048 mouseIsDown = false; 3049 timefloat.hide(); 3050 $(document).unbind('.dur'); 3051 }); 3149 t.globalBind('mousemove.dur', function(e) { 3150 handleMouseMove(e); 3151 }); 3152 t.globalBind('mouseup.dur', function (e) { 3153 mouseIsDown = false; 3154 timefloat.hide(); 3155 t.globalUnbind('.dur'); 3156 }); 3052 3157 return false; 3053 3158 } 3054 3159 }) 3055 3160 .bind('mouseenter', function(e) { 3056 3161 mouseIsOver = true; 3057 $(document).bind('mousemove.dur', function(e) {3162 t.globalBind('mousemove.dur', function(e) { 3058 3163 handleMouseMove(e); 3059 3164 }); 3060 3165 if (!mejs.MediaFeatures.hasTouch) { … … if (typeof jQuery != 'undefined') { 3064 3169 .bind('mouseleave',function(e) { 3065 3170 mouseIsOver = false; 3066 3171 if (!mouseIsDown) { 3067 $(document).unbind('.dur');3172 t.globalUnbind('.dur'); 3068 3173 timefloat.hide(); 3069 3174 } 3070 3175 }); … … if (typeof jQuery != 'undefined') { 3080 3185 player.setProgressRail(e); 3081 3186 player.setCurrentRail(e); 3082 3187 }, false); 3083 3084 3188 3189 3085 3190 // store for later use 3086 3191 t.loaded = loaded; 3087 3192 t.total = total; … … if (typeof jQuery != 'undefined') { 3093 3198 var 3094 3199 t = this, 3095 3200 target = (e != undefined) ? e.target : t.media, 3096 percent = null; 3201 percent = null; 3097 3202 3098 3203 // newest HTML5 spec has buffered array (FF4, Webkit) 3099 3204 if (target && target.buffered && target.buffered.length > 0 && target.buffered.end && target.duration) { 3100 // TODO: account for a real array with multiple values (only Firefox 4 has this so far) 3205 // TODO: account for a real array with multiple values (only Firefox 4 has this so far) 3101 3206 percent = target.buffered.end(0) / target.duration; 3102 } 3207 } 3103 3208 // Some browsers (e.g., FF3.6 and Safari 5) cannot calculate target.bufferered.end() 3104 3209 // to be anything other than 0. If the byte count is available we use this instead. 3105 3210 // Browsers that support the else if do not seem to have the bufferedBytes value and … … if (typeof jQuery != 'undefined') { 3124 3229 setCurrentRail: function() { 3125 3230 3126 3231 var t = this; 3127 3232 3128 3233 if (t.media.currentTime != undefined && t.media.duration) { 3129 3234 3130 3235 // update bar and handle 3131 3236 if (t.total && t.handle) { 3132 var 3133 newWidth = t.total.width() * t.media.currentTime / t.media.duration,3134 handlePos = newWidth - (t.handle.outerWidth(true) / 2);3237 var 3238 newWidth = Math.round(t.total.width() * t.media.currentTime / t.media.duration), 3239 handlePos = newWidth - Math.round(t.handle.outerWidth(true) / 2); 3135 3240 3136 3241 t.current.width(newWidth); 3137 3242 t.handle.css('left', handlePos); 3138 3243 } 3139 3244 } 3140 3245 3141 } 3246 } 3142 3247 }); 3143 3248 })(mejs.$); 3249 3144 3250 (function($) { 3145 3251 3146 3252 // options 3147 3253 $.extend(mejs.MepDefaults, { 3148 3254 duration: -1, … … if (typeof jQuery != 'undefined') { 3154 3260 $.extend(MediaElementPlayer.prototype, { 3155 3261 buildcurrent: function(player, controls, layers, media) { 3156 3262 var t = this; 3157 3263 3158 3264 $('<div class="mejs-time">'+ 3159 3265 '<span class="mejs-currenttime">' + (player.options.alwaysShowHours ? '00:' : '') 3160 3266 + (player.options.showTimecodeFrameCount? '00:00:00':'00:00')+ '</span>'+ 3161 3267 '</div>') 3162 3268 .appendTo(controls); 3163 3269 3164 3270 t.currenttime = t.controls.find('.mejs-currenttime'); 3165 3271 3166 3272 media.addEventListener('timeupdate',function() { … … if (typeof jQuery != 'undefined') { 3171 3277 3172 3278 buildduration: function(player, controls, layers, media) { 3173 3279 var t = this; 3174 3280 3175 3281 if (controls.children().last().find('.mejs-currenttime').length > 0) { 3176 3282 $(t.options.timeAndDurationSeparator + 3177 '<span class="mejs-duration">' + 3178 (t.options.duration > 0 ? 3283 '<span class="mejs-duration">' + 3284 (t.options.duration > 0 ? 3179 3285 mejs.Utility.secondsToTimeCode(t.options.duration, t.options.alwaysShowHours || t.media.duration > 3600, t.options.showTimecodeFrameCount, t.options.framesPerSecond || 25) : 3180 ((player.options.alwaysShowHours ? '00:' : '') + (player.options.showTimecodeFrameCount? '00:00:00':'00:00')) 3181 ) + 3286 ((player.options.alwaysShowHours ? '00:' : '') + (player.options.showTimecodeFrameCount? '00:00:00':'00:00')) 3287 ) + 3182 3288 '</span>') 3183 3289 .appendTo(controls.find('.mejs-time')); 3184 3290 } else { 3185 3291 3186 3292 // add class to current time 3187 3293 controls.find('.mejs-currenttime').parent().addClass('mejs-currenttime-container'); 3188 3294 3189 3295 $('<div class="mejs-time mejs-duration-container">'+ 3190 '<span class="mejs-duration">' + 3191 (t.options.duration > 0 ? 3296 '<span class="mejs-duration">' + 3297 (t.options.duration > 0 ? 3192 3298 mejs.Utility.secondsToTimeCode(t.options.duration, t.options.alwaysShowHours || t.media.duration > 3600, t.options.showTimecodeFrameCount, t.options.framesPerSecond || 25) : 3193 ((player.options.alwaysShowHours ? '00:' : '') + (player.options.showTimecodeFrameCount? '00:00:00':'00:00')) 3194 ) + 3299 ((player.options.alwaysShowHours ? '00:' : '') + (player.options.showTimecodeFrameCount? '00:00:00':'00:00')) 3300 ) + 3195 3301 '</span>' + 3196 3302 '</div>') 3197 3303 .appendTo(controls); 3198 3304 } 3199 3305 3200 3306 t.durationD = t.controls.find('.mejs-duration'); 3201 3307 3202 3308 media.addEventListener('timeupdate',function() { 3203 3309 player.updateDuration(); 3204 3310 }, false); 3205 3311 }, 3206 3312 3207 3313 updateCurrent: function() { 3208 3314 var t = this; 3209 3315 … … if (typeof jQuery != 'undefined') { 3211 3317 t.currenttime.html(mejs.Utility.secondsToTimeCode(t.media.currentTime, t.options.alwaysShowHours || t.media.duration > 3600, t.options.showTimecodeFrameCount, t.options.framesPerSecond || 25)); 3212 3318 } 3213 3319 }, 3214 3215 updateDuration: function() { 3320 3321 updateDuration: function() { 3216 3322 var t = this; 3217 3218 if (t.media.duration && t.durationD) { 3219 t.durationD.html(mejs.Utility.secondsToTimeCode(t.media.duration, t.options.alwaysShowHours, t.options.showTimecodeFrameCount, t.options.framesPerSecond || 25)); 3220 } 3323 3324 //Toggle the long video class if the video is longer than an hour. 3325 t.container.toggleClass("mejs-long-video", t.media.duration > 3600); 3326 3327 if (t.durationD && (t.options.duration > 0 || t.media.duration)) { 3328 t.durationD.html(mejs.Utility.secondsToTimeCode(t.options.duration > 0 ? t.options.duration : t.media.duration, t.options.alwaysShowHours, t.options.showTimecodeFrameCount, t.options.framesPerSecond || 25)); 3329 } 3221 3330 } 3222 3331 }); 3223 3332 … … if (typeof jQuery != 'undefined') { 3227 3336 $.extend(mejs.MepDefaults, { 3228 3337 muteText: 'Mute Toggle', 3229 3338 hideVolumeOnTouchDevices: true, 3230 3339 3231 3340 audioVolume: 'horizontal', 3232 3341 videoVolume: 'vertical' 3233 3342 }); 3234 3343 3235 3344 $.extend(MediaElementPlayer.prototype, { 3236 3345 buildvolume: function(player, controls, layers, media) { 3237 3346 3238 3347 // Android and iOS don't support volume controls 3239 3348 if (mejs.MediaFeatures.hasTouch && this.options.hideVolumeOnTouchDevices) 3240 3349 return; 3241 3350 3242 3351 var t = this, 3243 3352 mode = (t.isVideo) ? t.options.videoVolume : t.options.audioVolume, 3244 3353 mute = (mode == 'horizontal') ? 3245 3354 3246 3355 // horizontal version 3247 3356 $('<div class="mejs-button mejs-volume-button mejs-mute">'+ 3248 3357 '<button type="button" aria-controls="' + t.id + '" title="' + t.options.muteText + '"></button>'+ … … if (typeof jQuery != 'undefined') { 3254 3363 '</div>' 3255 3364 ) 3256 3365 .appendTo(controls) : 3257 3366 3258 3367 // vertical version 3259 3368 $('<div class="mejs-button mejs-volume-button mejs-mute">'+ 3260 3369 '<button type="button" aria-controls="' + t.id + '" title="' + t.options.muteText + '"></button>'+ … … if (typeof jQuery != 'undefined') { 3278 3387 volumeSlider.hide() 3279 3388 return; 3280 3389 } 3281 3390 3282 3391 // correct to 0-1 3283 3392 volume = Math.max(0,volume); 3284 volume = Math.min(volume,1); 3285 3393 volume = Math.min(volume,1); 3394 3286 3395 // ajust mute button style 3287 3396 if (volume == 0) { 3288 3397 mute.removeClass('mejs-mute').addClass('mejs-unmute'); 3289 3398 } else { 3290 3399 mute.removeClass('mejs-unmute').addClass('mejs-mute'); 3291 } 3400 } 3292 3401 3293 // position slider 3402 // position slider 3294 3403 if (mode == 'vertical') { 3295 var 3296 3404 var 3405 3297 3406 // height of the full size volume slider background 3298 3407 totalHeight = volumeTotal.height(), 3299 3408 3300 3409 // top/left of full size volume slider background 3301 3410 totalPosition = volumeTotal.position(), 3302 3411 3303 3412 // the new top position based on the current volume 3304 3413 // 70% volume on 100px height == top:30px 3305 3414 newTop = totalHeight - (totalHeight * volume); 3306 3415 3307 3416 // handle 3308 3417 volumeHandle.css('top', Math.round(totalPosition.top + newTop - (volumeHandle.height() / 2))); 3309 3418 3310 3419 // show the current visibility 3311 3420 volumeCurrent.height(totalHeight - newTop ); 3312 3421 volumeCurrent.css('top', totalPosition.top + newTop); 3313 3422 } else { 3314 var 3315 3423 var 3424 3316 3425 // height of the full size volume slider background 3317 3426 totalWidth = volumeTotal.width(), 3318 3427 3319 3428 // top/left of full size volume slider background 3320 3429 totalPosition = volumeTotal.position(), 3321 3430 3322 3431 // the new left position based on the current volume 3323 3432 newLeft = totalWidth * volume; 3324 3433 3325 3434 // handle 3326 3435 volumeHandle.css('left', Math.round(totalPosition.left + newLeft - (volumeHandle.width() / 2))); 3327 3436 3328 3437 // rezize the current part of the volume bar 3329 3438 volumeCurrent.width( Math.round(newLeft) ); 3330 3439 } 3331 3440 }, 3332 3441 handleVolumeMove = function(e) { 3333 3442 3334 3443 var volume = null, 3335 3444 totalOffset = volumeTotal.offset(); 3336 3445 3337 3446 // calculate the new volume based on the moust position 3338 3447 if (mode == 'vertical') { 3339 3448 3340 3449 var 3341 3450 railHeight = volumeTotal.height(), 3342 3451 totalTop = parseInt(volumeTotal.css('top').replace(/px/,''),10), 3343 3452 newY = e.pageY - totalOffset.top; 3344 3453 3345 3454 volume = (railHeight - newY) / railHeight; 3346 3455 3347 3456 // the controls just hide themselves (usually when mouse moves too far up) 3348 3457 if (totalOffset.top == 0 || totalOffset.left == 0) 3349 3458 return; 3350 3459 3351 3460 } else { 3352 3461 var 3353 3462 railWidth = volumeTotal.width(), 3354 3463 newX = e.pageX - totalOffset.left; 3355 3464 3356 3465 volume = newX / railWidth; 3357 3466 } 3358 3467 3359 3468 // ensure the volume isn't outside 0-1 3360 3469 volume = Math.max(0,volume); 3361 3470 volume = Math.min(volume,1); 3362 3363 // position the slider and handle 3471 3472 // position the slider and handle 3364 3473 positionVolumeHandle(volume); 3365 3474 3366 3475 // set the media object (this will trigger the volumechanged event) 3367 3476 if (volume == 0) { 3368 3477 media.setMuted(true); 3369 3478 } else { 3370 3479 media.setMuted(false); 3371 3480 } 3372 media.setVolume(volume); 3481 media.setVolume(volume); 3373 3482 }, 3374 3483 mouseIsDown = false, 3375 3484 mouseIsOver = false; 3376 3485 3377 3486 // SLIDER 3378 3487 3379 3488 mute 3380 3489 .hover(function() { 3381 3490 volumeSlider.show(); 3382 3491 mouseIsOver = true; 3383 3492 }, function() { 3384 mouseIsOver = false; 3385 3493 mouseIsOver = false; 3494 3386 3495 if (!mouseIsDown && mode == 'vertical') { 3387 3496 volumeSlider.hide(); 3388 3497 } 3389 3498 }); 3390 3499 3391 3500 volumeSlider 3392 3501 .bind('mouseover', function() { 3393 mouseIsOver = true; 3502 mouseIsOver = true; 3394 3503 }) 3395 3504 .bind('mousedown', function (e) { 3396 3505 handleVolumeMove(e); 3397 $(document) 3398 .bind('mousemove.vol', function(e) { 3399 handleVolumeMove(e); 3400 }) 3401 .bind('mouseup.vol', function () { 3402 mouseIsDown = false; 3403 $(document).unbind('.vol'); 3506 t.globalBind('mousemove.vol', function(e) { 3507 handleVolumeMove(e); 3508 }); 3509 t.globalBind('mouseup.vol', function () { 3510 mouseIsDown = false; 3511 t.globalUnbind('.vol'); 3404 3512 3405 3406 3407 3408 3513 if (!mouseIsOver && mode == 'vertical') { 3514 volumeSlider.hide(); 3515 } 3516 }); 3409 3517 mouseIsDown = true; 3410 3518 3411 3519 return false; 3412 3520 }); 3413 3521 … … if (typeof jQuery != 'undefined') { 3433 3541 if (t.container.is(':visible')) { 3434 3542 // set initial volume 3435 3543 positionVolumeHandle(player.options.startVolume); 3436 3544 3545 // mutes the media and sets the volume icon muted if the initial volume is set to 0 3546 if (player.options.startVolume === 0) { 3547 media.setMuted(true); 3548 } 3549 3437 3550 // shim gets the startvolume as a parameter, but we have to set it on the native <video> and <audio> elements 3438 3551 if (media.pluginType === 'native') { 3439 3552 media.setVolume(player.options.startVolume); … … if (typeof jQuery != 'undefined') { 3441 3554 } 3442 3555 } 3443 3556 }); 3444 3557 3445 3558 })(mejs.$); 3446 3559 3447 3560 (function($) { … … if (typeof jQuery != 'undefined') { 3473 3586 if (mejs.MediaFeatures.hasTrueNativeFullScreen) { 3474 3587 3475 3588 // chrome doesn't alays fire this in an iframe 3476 var target = null; 3477 3478 if (mejs.MediaFeatures.hasMozNativeFullScreen) { 3479 target = $(document); 3480 } else { 3481 target = player.container; 3482 } 3483 3484 target.bind(mejs.MediaFeatures.fullScreenEventName, function(e) { 3589 var func = function(e) { 3485 3590 3486 3591 if (mejs.MediaFeatures.isFullScreen()) { 3487 3592 player.isNativeFullScreen = true; … … if (typeof jQuery != 'undefined') { 3493 3598 // make sure to put the player back into place 3494 3599 player.exitFullScreen(); 3495 3600 } 3496 }); 3601 }; 3602 3603 if (mejs.MediaFeatures.hasMozNativeFullScreen) { 3604 player.globalBind(mejs.MediaFeatures.fullScreenEventName, func); 3605 } else { 3606 player.container.bind(mejs.MediaFeatures.fullScreenEventName, func); 3607 } 3497 3608 } 3498 3609 3499 3610 var t = this, … … if (typeof jQuery != 'undefined') { 3599 3710 left: fullScreenBtnOffset + fullScreenBtnWidth}); 3600 3711 }; 3601 3712 3602 $(document).resize(function() {3713 t.globalBind('resize', function() { 3603 3714 positionHoverDivs(); 3604 3715 }); 3605 3716 … … if (typeof jQuery != 'undefined') { 3639 3750 // the mouseout event doesn't work on the fullscren button, because we already killed the pointer-events 3640 3751 // so we use the document.mousemove event to restore controls when the mouse moves outside the fullscreen button 3641 3752 /* 3642 $(document).mousemove(function(e) {3753 t.globalBind('mousemove', function(e) { 3643 3754 3644 3755 // if the mouse is anywhere but the fullsceen button, then restore it all 3645 3756 if (fullscreenIsDisabled) { … … if (typeof jQuery != 'undefined') { 3697 3808 3698 3809 player.fullscreenBtn = fullscreenBtn; 3699 3810 3700 $(document).bind('keydown',function (e) {3811 t.globalBind('keydown',function (e) { 3701 3812 if (((mejs.MediaFeatures.hasTrueNativeFullScreen && mejs.MediaFeatures.isFullScreen()) || t.isFullScreen) && e.keyCode == 27) { 3702 3813 player.exitFullScreen(); 3703 3814 } 3704 3815 }); 3705 3816 3706 3817 }, 3818 3819 cleanfullscreen: function(player) { 3820 player.exitFullScreen(); 3821 }, 3822 3707 3823 enterFullScreen: function() { 3708 3824 3709 3825 var t = this; … … if (typeof jQuery != 'undefined') { 3807 3923 .width('100%') 3808 3924 .height('100%'); 3809 3925 } else { 3810 t.container.find(' object, embed, iframe')3926 t.container.find('.mejs-shim') 3811 3927 .width('100%') 3812 3928 .height('100%'); 3813 3929 … … if (typeof jQuery != 'undefined') { 3884 4000 3885 4001 (function($) { 3886 4002 3887 // add extra default options 4003 // add extra default options 3888 4004 $.extend(mejs.MepDefaults, { 3889 4005 // this will automatically turn on a <track> 3890 4006 startLanguage: '', 3891 3892 tracksText: 'Captions/Subtitles' 4007 4008 tracksText: 'Captions/Subtitles', 4009 4010 // option to remove the [cc] button when no <track kind="subtitles"> are present 4011 hideCaptionsButtonWhenEmpty: true, 4012 4013 // If true and we only have one track, change captions to popup 4014 toggleCaptionsButtonWhenOnlyOne: false, 4015 4016 // #id or .class 4017 slidesSelector: '' 3893 4018 }); 3894 4019 3895 4020 $.extend(MediaElementPlayer.prototype, { 3896 4021 3897 4022 hasChapters: false, 3898 4023 3899 4024 buildtracks: function(player, controls, layers, media) { … … if (typeof jQuery != 'undefined') { 3903 4028 if (player.tracks.length == 0) 3904 4029 return; 3905 4030 3906 var t= this, i, options = ''; 4031 var t = this, 4032 i, 4033 options = ''; 3907 4034 3908 player.chapters = 4035 player.chapters = 3909 4036 $('<div class="mejs-chapters mejs-layer"></div>') 3910 4037 .prependTo(layers).hide(); 3911 player.captions = 3912 $('<div class="mejs-captions-layer mejs-layer"><div class="mejs-captions-position "><span class="mejs-captions-text"></span></div></div>')4038 player.captions = 4039 $('<div class="mejs-captions-layer mejs-layer"><div class="mejs-captions-position mejs-captions-position-hover"><span class="mejs-captions-text"></span></div></div>') 3913 4040 .prependTo(layers).hide(); 3914 4041 player.captionsText = player.captions.find('.mejs-captions-text'); 3915 player.captionsButton = 4042 player.captionsButton = 3916 4043 $('<div class="mejs-button mejs-captions-button">'+ 3917 4044 '<button type="button" aria-controls="' + t.id + '" title="' + t.options.tracksText + '"></button>'+ 3918 4045 '<div class="mejs-captions-selector">'+ … … if (typeof jQuery != 'undefined') { 3924 4051 '</ul>'+ 3925 4052 '</div>'+ 3926 4053 '</div>') 3927 .appendTo(controls) 3928 3929 // hover 3930 .hover(function() { 3931 $(this).find('.mejs-captions-selector').css('visibility','visible'); 3932 }, function() { 3933 $(this).find('.mejs-captions-selector').css('visibility','hidden'); 3934 }) 3935 3936 // handle clicks to the language radio buttons 3937 .delegate('input[type=radio]','click',function() { 3938 lang = this.value; 3939 3940 if (lang == 'none') { 3941 player.selectedTrack = null; 3942 } else { 3943 for (i=0; i<player.tracks.length; i++) { 3944 if (player.tracks[i].srclang == lang) { 3945 player.selectedTrack = player.tracks[i]; 3946 player.captions.attr('lang', player.selectedTrack.srclang); 3947 player.displayCaptions(); 3948 break; 3949 } 3950 } 3951 } 3952 }); 3953 //.bind('mouseenter', function() { 3954 // player.captionsButton.find('.mejs-captions-selector').css('visibility','visible') 3955 //}); 4054 .appendTo(controls); 4055 4056 4057 var subtitleCount = 0; 4058 for (i=0; i<player.tracks.length; i++) { 4059 if (player.tracks[i].kind == 'subtitles') { 4060 subtitleCount++; 4061 } 4062 } 4063 4064 // if only one language then just make the button a toggle 4065 if (t.options.toggleCaptionsButtonWhenOnlyOne && subtitleCount == 1){ 4066 // click 4067 player.captionsButton.on('click',function() { 4068 if (player.selectedTrack == null) { 4069 var lang = player.tracks[0].srclang; 4070 } else { 4071 var lang = 'none'; 4072 } 4073 player.setTrack(lang); 4074 }); 4075 } else { 4076 // hover 4077 player.captionsButton.hover(function() { 4078 $(this).find('.mejs-captions-selector').css('visibility','visible'); 4079 }, function() { 4080 $(this).find('.mejs-captions-selector').css('visibility','hidden'); 4081 }) 4082 4083 // handle clicks to the language radio buttons 4084 .on('click','input[type=radio]',function() { 4085 lang = this.value; 4086 player.setTrack(lang); 4087 }); 4088 4089 } 3956 4090 3957 4091 if (!player.options.alwaysShowControls) { 3958 4092 // move with controls 3959 4093 player.container 3960 .bind(' mouseenter', function () {4094 .bind('controlsshown', function () { 3961 4095 // push captions above controls 3962 4096 player.container.find('.mejs-captions-position').addClass('mejs-captions-position-hover'); 3963 4097 3964 4098 }) 3965 .bind(' mouseleave', function () {4099 .bind('controlshidden', function () { 3966 4100 if (!media.paused) { 3967 4101 // move back to normal place 3968 4102 player.container.find('.mejs-captions-position').removeClass('mejs-captions-position-hover'); … … if (typeof jQuery != 'undefined') { 3976 4110 player.selectedTrack = null; 3977 4111 player.isLoadingTrack = false; 3978 4112 3979 4113 3980 4114 3981 4115 // add to list 3982 4116 for (i=0; i<player.tracks.length; i++) { … … if (typeof jQuery != 'undefined') { 3985 4119 } 3986 4120 } 3987 4121 4122 // start loading tracks 3988 4123 player.loadNextTrack(); 3989 4124 3990 4125 … … if (typeof jQuery != 'undefined') { 3992 4127 player.displayCaptions(); 3993 4128 }, false); 3994 4129 4130 if (player.options.slidesSelector != '') { 4131 player.slidesContainer = $(player.options.slidesSelector); 4132 4133 media.addEventListener('timeupdate',function(e) { 4134 player.displaySlides(); 4135 }, false); 4136 4137 } 4138 3995 4139 media.addEventListener('loadedmetadata', function(e) { 3996 4140 player.displayChapters(); 3997 4141 }, false); … … if (typeof jQuery != 'undefined') { 4012 4156 }); 4013 4157 } 4014 4158 }); 4015 4159 4016 4160 // check for autoplay 4017 4161 if (player.node.getAttribute('autoplay') !== null) { 4018 4162 player.chapters.css('visibility','hidden'); 4019 4163 } 4020 4164 }, 4021 4165 4166 setTrack: function(lang){ 4167 4168 var t = this, 4169 i; 4170 4171 if (lang == 'none') { 4172 t.selectedTrack = null; 4173 t.captionsButton.removeClass('mejs-captions-enabled'); 4174 } else { 4175 for (i=0; i<t.tracks.length; i++) { 4176 if (t.tracks[i].srclang == lang) { 4177 if (t.selectedTrack == null) 4178 t.captionsButton.addClass('mejs-captions-enabled'); 4179 t.selectedTrack = t.tracks[i]; 4180 t.captions.attr('lang', t.selectedTrack.srclang); 4181 t.displayCaptions(); 4182 break; 4183 } 4184 } 4185 } 4186 }, 4187 4022 4188 loadNextTrack: function() { 4023 4189 var t = this; 4024 4190 … … if (typeof jQuery != 'undefined') { 4029 4195 } else { 4030 4196 // add done? 4031 4197 t.isLoadingTrack = false; 4198 4199 t.checkForTracks(); 4032 4200 } 4033 4201 }, 4034 4202 … … if (typeof jQuery != 'undefined') { 4056 4224 4057 4225 // parse the loaded file 4058 4226 if (typeof d == "string" && (/<tt\s+xml/ig).exec(d)) { 4059 track.entries = mejs.TrackFormatParser.dfxp.parse(d); 4060 } else { 4227 track.entries = mejs.TrackFormatParser.dfxp.parse(d); 4228 } else { 4061 4229 track.entries = mejs.TrackFormatParser.webvvt.parse(d); 4062 4230 } 4063 4231 4064 4232 after(); 4065 4233 4066 4234 if (track.kind == 'chapters') { … … if (typeof jQuery != 'undefined') { 4070 4238 } 4071 4239 }, false); 4072 4240 } 4241 4242 if (track.kind == 'slides') { 4243 t.setupSlides(track); 4244 } 4073 4245 }, 4074 4246 error: function() { 4075 4247 t.loadNextTrack(); … … if (typeof jQuery != 'undefined') { 4079 4251 4080 4252 enableTrackButton: function(lang, label) { 4081 4253 var t = this; 4082 4254 4083 4255 if (label === '') { 4084 4256 label = mejs.language.codes[lang] || lang; 4085 } 4257 } 4086 4258 4087 4259 t.captionsButton 4088 4260 .find('input[value=' + lang + ']') … … if (typeof jQuery != 'undefined') { 4126 4298 ); 4127 4299 }, 4128 4300 4301 checkForTracks: function() { 4302 var 4303 t = this, 4304 hasSubtitles = false; 4305 4306 // check if any subtitles 4307 if (t.options.hideCaptionsButtonWhenEmpty) { 4308 for (i=0; i<t.tracks.length; i++) { 4309 if (t.tracks[i].kind == 'subtitles') { 4310 hasSubtitles = true; 4311 break; 4312 } 4313 } 4314 4315 if (!hasSubtitles) { 4316 t.captionsButton.hide(); 4317 t.setControlsSize(); 4318 } 4319 } 4320 }, 4321 4129 4322 displayCaptions: function() { 4130 4323 4131 4324 if (typeof this.tracks == 'undefined') … … if (typeof jQuery != 'undefined') { 4150 4343 } 4151 4344 }, 4152 4345 4346 setupSlides: function(track) { 4347 var t = this; 4348 4349 t.slides = track; 4350 t.slides.entries.imgs = [t.slides.entries.text.length]; 4351 t.showSlide(0); 4352 4353 }, 4354 4355 showSlide: function(index) { 4356 if (typeof this.tracks == 'undefined' || typeof this.slidesContainer == 'undefined') { 4357 return; 4358 } 4359 4360 var t = this, 4361 url = t.slides.entries.text[index], 4362 img = t.slides.entries.imgs[index]; 4363 4364 if (typeof img == 'undefined' || typeof img.fadeIn == 'undefined') { 4365 4366 t.slides.entries.imgs[index] = img = $('<img src="' + url + '">') 4367 .on('load', function() { 4368 img.appendTo(t.slidesContainer) 4369 .hide() 4370 .fadeIn() 4371 .siblings(':visible') 4372 .fadeOut(); 4373 4374 }); 4375 4376 } else { 4377 4378 if (!img.is(':visible') && !img.is(':animated')) { 4379 4380 console.log('showing existing slide'); 4381 4382 img.fadeIn() 4383 .siblings(':visible') 4384 .fadeOut(); 4385 } 4386 } 4387 4388 }, 4389 4390 displaySlides: function() { 4391 4392 if (typeof this.slides == 'undefined') 4393 return; 4394 4395 var 4396 t = this, 4397 slides = t.slides, 4398 i; 4399 4400 for (i=0; i<slides.entries.times.length; i++) { 4401 if (t.media.currentTime >= slides.entries.times[i].start && t.media.currentTime <= slides.entries.times[i].stop){ 4402 4403 t.showSlide(i); 4404 4405 return; // exit out if one is visible; 4406 } 4407 } 4408 }, 4409 4153 4410 displayChapters: function() { 4154 var 4411 var 4155 4412 t = this, 4156 4413 i; 4157 4414 … … if (typeof jQuery != 'undefined') { 4165 4422 }, 4166 4423 4167 4424 drawChapters: function(chapters) { 4168 var 4425 var 4169 4426 t = this, 4170 4427 i, 4171 4428 dur, … … if (typeof jQuery != 'undefined') { 4191 4448 //} 4192 4449 4193 4450 t.chapters.append( $( 4194 '<div class="mejs-chapter" rel="' + chapters.entries.times[i].start + '" style="left: ' + usedPercent.toString() + '%;width: ' + percent.toString() + '%;">' + 4195 '<div class="mejs-chapter-block' + ((i==chapters.entries.times.length-1) ? ' mejs-chapter-block-last' : '') + '">' + 4196 '<span class="ch-title">' + chapters.entries.text[i] + '</span>' + 4197 '<span class="ch-time">' + mejs.Utility.secondsToTimeCode(chapters.entries.times[i].start) + '–' + mejs.Utility.secondsToTimeCode(chapters.entries.times[i].stop) + '</span>' + 4451 '<div class="mejs-chapter" rel="' + chapters.entries.times[i].start + '" style="left: ' + usedPercent.toString() + '%;width: ' + percent.toString() + '%;">' + 4452 '<div class="mejs-chapter-block' + ((i==chapters.entries.times.length-1) ? ' mejs-chapter-block-last' : '') + '">' + 4453 '<span class="ch-title">' + chapters.entries.text[i] + '</span>' + 4454 '<span class="ch-time">' + mejs.Utility.secondsToTimeCode(chapters.entries.times[i].start) + '–' + mejs.Utility.secondsToTimeCode(chapters.entries.times[i].stop) + '</span>' + 4198 4455 '</div>' + 4199 4456 '</div>')); 4200 4457 usedPercent += percent; … … if (typeof jQuery != 'undefined') { 4203 4460 t.chapters.find('div.mejs-chapter').click(function() { 4204 4461 t.media.setCurrentTime( parseFloat( $(this).attr('rel') ) ); 4205 4462 if (t.media.paused) { 4206 t.media.play(); 4463 t.media.play(); 4207 4464 } 4208 4465 }); 4209 4466 … … if (typeof jQuery != 'undefined') { 4278 4535 Parses WebVVT format which should be formatted as 4279 4536 ================================ 4280 4537 WEBVTT 4281 4538 4282 4539 1 4283 4540 00:00:01,1 --> 00:00:05,000 4284 4541 A line of text … … if (typeof jQuery != 'undefined') { 4286 4543 2 4287 4544 00:01:15,1 --> 00:02:05,000 4288 4545 A second line of text 4289 4546 4290 4547 =============================== 4291 4548 4292 4549 Adapted from: http://www.delphiki.com/html5/playr … … if (typeof jQuery != 'undefined') { 4298 4555 pattern_timecode: /^([0-9]{2}:[0-9]{2}:[0-9]{2}([,.][0-9]{1,3})?) --\> ([0-9]{2}:[0-9]{2}:[0-9]{2}([,.][0-9]{3})?)(.*)$/, 4299 4556 4300 4557 parse: function(trackText) { 4301 var 4558 var 4302 4559 i = 0, 4303 4560 lines = mejs.TrackFormatParser.split2(trackText, /\r?\n/), 4304 4561 entries = {text:[], times:[]}, … … if (typeof jQuery != 'undefined') { 4309 4566 if (this.pattern_identifier.exec(lines[i])){ 4310 4567 // skip to the next line where the start --> end time code should be 4311 4568 i++; 4312 timecode = this.pattern_timecode.exec(lines[i]); 4569 timecode = this.pattern_timecode.exec(lines[i]); 4313 4570 4314 4571 if (timecode && i<lines.length){ 4315 4572 i++; … … if (typeof jQuery != 'undefined') { 4339 4596 dfxp: { 4340 4597 parse: function(trackText) { 4341 4598 trackText = $(trackText).filter("tt"); 4342 var 4599 var 4343 4600 i = 0, 4344 4601 container = trackText.children("div").eq(0), 4345 4602 lines = container.find("p"), … … if (typeof jQuery != 'undefined') { 4375 4632 if (styles) { 4376 4633 style = ""; 4377 4634 for (var _style in styles) { 4378 style += _style + ":" + styles[_style] + ";"; 4635 style += _style + ":" + styles[_style] + ";"; 4379 4636 } 4380 4637 } 4381 4638 if (style) _temp_times.style = style; … … if (typeof jQuery != 'undefined') { 4394 4651 return text.split(regex); 4395 4652 } 4396 4653 }; 4397 4654 4398 4655 // test for browsers with bad String.split method. 4399 4656 if ('x\n\ny'.split(/\n/gi).length != 3) { 4400 4657 // add super slow IE8 and below version 4401 4658 mejs.TrackFormatParser.split2 = function(text, regex) { 4402 var 4403 parts = [], 4659 var 4660 parts = [], 4404 4661 chunk = '', 4405 4662 i; 4406 4663 … … if (typeof jQuery != 'undefined') { 4414 4671 parts.push(chunk); 4415 4672 return parts; 4416 4673 } 4417 } 4674 } 4418 4675 4419 4676 })(mejs.$); 4420 4677 4421 4678 /* 4422 4679 * ContextMenu Plugin 4423 * 4680 * 4424 4681 * 4425 4682 */ 4426 4683 … … if (typeof jQuery != 'undefined') { 4429 4686 $.extend(mejs.MepDefaults, 4430 4687 { 'contextMenuItems': [ 4431 4688 // demo of a fullscreen option 4432 { 4689 { 4433 4690 render: function(player) { 4434 4691 4435 4692 // check for fullscreen plugin 4436 4693 if (typeof player.enterFullScreen == 'undefined') 4437 4694 return null; 4438 4695 4439 4696 if (player.isFullScreen) { 4440 4697 return "Turn off Fullscreen"; 4441 4698 } else { … … $.extend(mejs.MepDefaults, 4452 4709 } 4453 4710 , 4454 4711 // demo of a mute/unmute button 4455 { 4712 { 4456 4713 render: function(player) { 4457 4714 if (player.media.muted) { 4458 4715 return "Unmute"; … … $.extend(mejs.MepDefaults, 4474 4731 } 4475 4732 , 4476 4733 // demo of simple download video 4477 { 4734 { 4478 4735 render: function(player) { 4479 4736 return "Download Video"; 4480 4737 }, 4481 4738 click: function(player) { 4482 4739 window.location.href = player.media.currentSrc; 4483 4740 } 4484 } 4741 } 4485 4742 ]} 4486 4743 ); 4487 4744 4488 4745 4489 4746 $.extend(MediaElementPlayer.prototype, { 4490 4747 buildcontextmenu: function(player, controls, layers, media) { 4491 4748 4492 4749 // create context menu 4493 4750 player.contextMenu = $('<div class="mejs-contextmenu"></div>') 4494 4751 .appendTo($('body')) 4495 4752 .hide(); 4496 4753 4497 4754 // create events for showing context menu 4498 4755 player.container.bind('contextmenu', function(e) { 4499 4756 if (player.isContextMenuEnabled) { … … $.extend(mejs.MepDefaults, 4504 4761 }); 4505 4762 player.container.bind('click', function() { 4506 4763 player.contextMenu.hide(); 4507 }); 4764 }); 4508 4765 player.contextMenu.bind('mouseleave', function() { 4509 4766 4510 4767 //console.log('context hover out'); 4511 4768 player.startContextMenuTimer(); 4512 4513 }); 4769 4770 }); 4514 4771 }, 4515 4772 4773 cleancontextmenu: function(player) { 4774 player.contextMenu.remove(); 4775 }, 4776 4516 4777 isContextMenuEnabled: true, 4517 4778 enableContextMenu: function() { 4518 4779 this.isContextMenuEnabled = true; … … $.extend(mejs.MepDefaults, 4520 4781 disableContextMenu: function() { 4521 4782 this.isContextMenuEnabled = false; 4522 4783 }, 4523 4784 4524 4785 contextMenuTimeout: null, 4525 4786 startContextMenuTimer: function() { 4526 4787 //console.log('startContextMenuTimer'); 4527 4788 4528 4789 var t = this; 4529 4790 4530 4791 t.killContextMenuTimer(); 4531 4792 4532 4793 t.contextMenuTimer = setTimeout(function() { 4533 4794 t.hideContextMenu(); 4534 4795 t.killContextMenuTimer(); … … $.extend(mejs.MepDefaults, 4536 4797 }, 4537 4798 killContextMenuTimer: function() { 4538 4799 var timer = this.contextMenuTimer; 4539 4800 4540 4801 //console.log('killContextMenuTimer', timer); 4541 4542 if (timer != null) { 4802 4803 if (timer != null) { 4543 4804 clearTimeout(timer); 4544 4805 delete timer; 4545 4806 timer = null; 4546 4807 } 4547 }, 4548 4808 }, 4809 4549 4810 hideContextMenu: function() { 4550 4811 this.contextMenu.hide(); 4551 4812 }, 4552 4813 4553 4814 renderContextMenu: function(x,y) { 4554 4815 4555 4816 // alway re-render the items so that things like "turn fullscreen on" and "turn fullscreen off" are always written correctly 4556 4817 var t = this, 4557 4818 html = '', 4558 4819 items = t.options.contextMenuItems; 4559 4820 4560 4821 for (var i=0, il=items.length; i<il; i++) { 4561 4822 4562 4823 if (items[i].isSeparator) { 4563 4824 html += '<div class="mejs-contextmenu-separator"></div>'; 4564 4825 } else { 4565 4826 4566 4827 var rendered = items[i].render(t); 4567 4828 4568 4829 // render can return null if the item doesn't need to be used at the moment 4569 4830 if (rendered != null) { 4570 4831 html += '<div class="mejs-contextmenu-item" data-itemindex="' + i + '" id="element-' + (Math.random()*1000000) + '">' + rendered + '</div>'; 4571 4832 } 4572 4833 } 4573 4834 } 4574 4835 4575 4836 // position and show the context menu 4576 4837 t.contextMenu 4577 4838 .empty() 4578 4839 .append($(html)) 4579 4840 .css({top:y, left:x}) 4580 4841 .show(); 4581 4842 4582 4843 // bind events 4583 4844 t.contextMenu.find('.mejs-contextmenu-item').each(function() { 4584 4845 4585 4846 // which one is this? 4586 4847 var $dom = $(this), 4587 4848 itemIndex = parseInt( $dom.data('itemindex'), 10 ), 4588 4849 item = t.options.contextMenuItems[itemIndex]; 4589 4850 4590 4851 // bind extra functionality? 4591 4852 if (typeof item.show != 'undefined') 4592 4853 item.show( $dom , t); 4593 4854 4594 4855 // bind click action 4595 $dom.click(function() { 4856 $dom.click(function() { 4596 4857 // perform click action 4597 4858 if (typeof item.click != 'undefined') 4598 4859 item.click(t); 4599 4860 4600 4861 // close 4601 t.contextMenu.hide(); 4602 }); 4603 }); 4604 4862 t.contextMenu.hide(); 4863 }); 4864 }); 4865 4605 4866 // stop the controls from hiding 4606 4867 setTimeout(function() { 4607 t.killControlsTimer('rev3'); 4868 t.killControlsTimer('rev3'); 4608 4869 }, 100); 4609 4870 4610 4871 } 4611 4872 }); 4612 4873 4613 4874 })(mejs.$); 4614 4875 /** 4615 4876 * Postroll plugin -
wp-includes/js/mediaelement/mediaelement-and-player.min.js
diff --git wp-includes/js/mediaelement/mediaelement-and-player.min.js wp-includes/js/mediaelement/mediaelement-and-player.min.js index dfd11c7..6f38e1b 100644
8 8 * Can play MP4 (H.264), Ogg, WebM, FLV, WMV, WMA, ACC, and MP3 9 9 * 10 10 * Copyright 2010-2012, John Dyer (http://j.hn) 11 * Dual licensed under the MIT or GPL Version 2 licenses.11 * License: MIT 12 12 * 13 */ 14 var mejs=mejs||{};mejs.version="2.10.1";mejs.meIndex=0;mejs.plugins={silverlight:[{version:[3,0],types:["video/mp4","video/m4v","video/mov","video/wmv","audio/wma","audio/m4a","audio/mp3","audio/wav","audio/mpeg"]}],flash:[{version:[9,0,124],types:["video/mp4","video/m4v","video/mov","video/flv","video/rtmp","video/x-flv","audio/flv","audio/x-flv","audio/mp3","audio/m4a","audio/mpeg","video/youtube","video/x-youtube"]}],youtube:[{version:null,types:["video/youtube","video/x-youtube"]}],vimeo:[{version:null,types:["video/vimeo","video/x-vimeo"]}]};mejs.Utility={encodeUrl:function(a){return encodeURIComponent(a)},escapeHTML:function(a){return a.toString().split("&").join("&").split("<").join("<").split('"').join(""")},absolutizeUrl:function(a){var b=document.createElement("div");b.innerHTML='<a href="'+this.escapeHTML(a)+'">x</a>';return b.firstChild.href},getScriptPath:function(h){var e=0,c,k="",a="",f,b=document.getElementsByTagName("script"),g=b.length,d=h.length;for(;e<g;e++){f=b[e].src;for(c=0;c<d;c++){a=h[c];if(f.indexOf(a)>-1){k=f.substring(0,f.indexOf(a));break}}if(k!==""){break}}return k},secondsToTimeCode:function(c,g,a,b){if(typeof a=="undefined"){a=false}else{if(typeof b=="undefined"){b=25}}var f=Math.floor(c/3600)%24,d=Math.floor(c/60)%60,h=Math.floor(c%60),e=Math.floor(((c%1)*b).toFixed(3)),j=((g||f>0)?(f<10?"0"+f:f)+":":"")+(d<10?"0"+d:d)+":"+(h<10?"0"+h:h)+((a)?":"+(e<10?"0"+e:e):"");return j},timeCodeToSeconds:function(c,k,d,e){if(typeof d=="undefined"){d=false}else{if(typeof e=="undefined"){e=25}}var f=c.split(":"),a=parseInt(f[0],10),b=parseInt(f[1],10),h=parseInt(f[2],10),j=0,g=0;if(d){j=parseInt(f[3])/e}g=(a*3600)+(b*60)+h+j;return g},convertSMPTEtoSeconds:function(a){if(typeof a!="string"){return false}a=a.replace(",",".");var d=0,b=(a.indexOf(".")!=-1)?a.split(".")[1].length:0,e=1;a=a.split(":").reverse();for(var c=0;c<a.length;c++){e=1;if(c>0){e=Math.pow(60,c)}d+=Number(a[c])*e}return Number(d.toFixed(b))},removeSwf:function(b){var a=document.getElementById(b);if(a&&a.nodeName=="OBJECT"){if(mejs.MediaFeatures.isIE){a.style.display="none";(function(){if(a.readyState==4){mejs.Utility.removeObjectInIE(b)}else{setTimeout(arguments.callee,10)}})()}else{a.parentNode.removeChild(a)}}},removeObjectInIE:function(c){var b=document.getElementById(c);if(b){for(var a in b){if(typeof b[a]=="function"){b[a]=null}}b.parentNode.removeChild(b)}}};mejs.PluginDetector={hasPluginVersion:function(c,a){var b=this.plugins[c];a[1]=a[1]||0;a[2]=a[2]||0;return(b[0]>a[0]||(b[0]==a[0]&&b[1]>a[1])||(b[0]==a[0]&&b[1]==a[1]&&b[2]>=a[2]))?true:false},nav:window.navigator,ua:window.navigator.userAgent.toLowerCase(),plugins:[],addPlugin:function(d,c,e,a,b){this.plugins[d]=this.detectPlugin(c,e,a,b)},detectPlugin:function(g,b,c,k){var h=[0,0,0],j,d,a;if(typeof(this.nav.plugins)!="undefined"&&typeof this.nav.plugins[g]=="object"){j=this.nav.plugins[g].description;if(j&&!(typeof this.nav.mimeTypes!="undefined"&&this.nav.mimeTypes[b]&&!this.nav.mimeTypes[b].enabledPlugin)){h=j.replace(g,"").replace(/^\s+/,"").replace(/\sr/gi,".").split(".");for(d=0;d<h.length;d++){h[d]=parseInt(h[d].match(/\d+/),10)}}}else{if(typeof(window.ActiveXObject)!="undefined"){try{a=new ActiveXObject(c);if(a){h=k(a)}}catch(f){}}}return h}};mejs.PluginDetector.addPlugin("flash","Shockwave Flash","application/x-shockwave-flash","ShockwaveFlash.ShockwaveFlash",function(b){var a=[],c=b.GetVariable("$version");if(c){c=c.split(" ")[1].split(",");a=[parseInt(c[0],10),parseInt(c[1],10),parseInt(c[2],10)]}return a});mejs.PluginDetector.addPlugin("silverlight","Silverlight Plug-In","application/x-silverlight-2","AgControl.AgControl",function(b){var a=[0,0,0,0],c=function(f,d,e,g){while(f.isVersionSupported(d[0]+"."+d[1]+"."+d[2]+"."+d[3])){d[e]+=g}d[e]-=g};c(b,a,0,1);c(b,a,1,1);c(b,a,2,10000);c(b,a,2,1000);c(b,a,2,100);c(b,a,2,10);c(b,a,2,1);c(b,a,3,1);return a});mejs.MediaFeatures={init:function(){var e=this,h=document,g=mejs.PluginDetector.nav,c=mejs.PluginDetector.ua.toLowerCase(),b,a,f=["source","track","audio","video"];e.isiPad=(c.match(/ipad/i)!==null);e.isiPhone=(c.match(/iphone/i)!==null);e.isiOS=e.isiPhone||e.isiPad;e.isAndroid=(c.match(/android/i)!==null);e.isBustedAndroid=(c.match(/android 2\.[12]/)!==null);e.isIE=(g.appName.toLowerCase().indexOf("microsoft")!=-1);e.isChrome=(c.match(/chrome/gi)!==null);e.isFirefox=(c.match(/firefox/gi)!==null);e.isWebkit=(c.match(/webkit/gi)!==null);e.isGecko=(c.match(/gecko/gi)!==null)&&!e.isWebkit;e.isOpera=(c.match(/opera/gi)!==null);e.hasTouch=("ontouchstart" in window);e.svg=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect;for(b=0;b<f.length;b++){a=document.createElement(f[b])}e.supportsMediaTag=(typeof a.canPlayType!=="undefined"||e.isBustedAndroid);e.hasSemiNativeFullScreen=(typeof a.webkitEnterFullscreen!=="undefined");e.hasWebkitNativeFullScreen=(typeof a.webkitRequestFullScreen!=="undefined");e.hasMozNativeFullScreen=(typeof a.mozRequestFullScreen!=="undefined");e.hasTrueNativeFullScreen=(e.hasWebkitNativeFullScreen||e.hasMozNativeFullScreen);e.nativeFullScreenEnabled=e.hasTrueNativeFullScreen;if(e.hasMozNativeFullScreen){e.nativeFullScreenEnabled=a.mozFullScreenEnabled}if(this.isChrome){e.hasSemiNativeFullScreen=false}if(e.hasTrueNativeFullScreen){e.fullScreenEventName=(e.hasWebkitNativeFullScreen)?"webkitfullscreenchange":"mozfullscreenchange";e.isFullScreen=function(){if(a.mozRequestFullScreen){return h.mozFullScreen}else{if(a.webkitRequestFullScreen){return h.webkitIsFullScreen}}};e.requestFullScreen=function(d){if(e.hasWebkitNativeFullScreen){d.webkitRequestFullScreen()}else{if(e.hasMozNativeFullScreen){d.mozRequestFullScreen()}}};e.cancelFullScreen=function(){if(e.hasWebkitNativeFullScreen){document.webkitCancelFullScreen()}else{if(e.hasMozNativeFullScreen){document.mozCancelFullScreen()}}}}if(e.hasSemiNativeFullScreen&&c.match(/mac os x 10_5/i)){e.hasNativeFullScreen=false;e.hasSemiNativeFullScreen=false}}};mejs.MediaFeatures.init();mejs.HtmlMediaElement={pluginType:"native",isFullScreen:false,setCurrentTime:function(a){this.currentTime=a},setMuted:function(a){this.muted=a},setVolume:function(a){this.volume=a},stop:function(){this.pause()},setSrc:function(a){var c=this.getElementsByTagName("source");while(c.length>0){this.removeChild(c[0])}if(typeof a=="string"){this.src=a}else{var b,d;for(b=0;b<a.length;b++){d=a[b];if(this.canPlayType(d.type)){this.src=d.src;break}}}},setVideoSize:function(b,a){this.width=b;this.height=a}};mejs.PluginMediaElement=function(b,c,a){this.id=b;this.pluginType=c;this.src=a;this.events={}};mejs.PluginMediaElement.prototype={pluginElement:null,pluginType:"",isFullScreen:false,playbackRate:-1,defaultPlaybackRate:-1,seekable:[],played:[],paused:true,ended:false,seeking:false,duration:0,error:null,tagName:"",muted:false,volume:1,currentTime:0,play:function(){if(this.pluginApi!=null){if(this.pluginType=="youtube"){this.pluginApi.playVideo()}else{this.pluginApi.playMedia()}this.paused=false}},load:function(){if(this.pluginApi!=null){if(this.pluginType=="youtube"){}else{this.pluginApi.loadMedia()}this.paused=false}},pause:function(){if(this.pluginApi!=null){if(this.pluginType=="youtube"){this.pluginApi.pauseVideo()}else{this.pluginApi.pauseMedia()}this.paused=true}},stop:function(){if(this.pluginApi!=null){if(this.pluginType=="youtube"){this.pluginApi.stopVideo()}else{this.pluginApi.stopMedia()}this.paused=true}},canPlayType:function(e){var d,c,a,b=mejs.plugins[this.pluginType];for(d=0;d<b.length;d++){a=b[d];if(mejs.PluginDetector.hasPluginVersion(this.pluginType,a.version)){for(c=0;c<a.types.length;c++){if(e==a.types[c]){return true}}}}return false},positionFullscreenButton:function(a,c,b){if(this.pluginApi!=null&&this.pluginApi.positionFullscreenButton){this.pluginApi.positionFullscreenButton(a,c,b)}},hideFullscreenButton:function(){if(this.pluginApi!=null&&this.pluginApi.hideFullscreenButton){this.pluginApi.hideFullscreenButton()}},setSrc:function(a){if(typeof a=="string"){this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(a));this.src=mejs.Utility.absolutizeUrl(a)}else{var b,c;for(b=0;b<a.length;b++){c=a[b];if(this.canPlayType(c.type)){this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(c.src));this.src=mejs.Utility.absolutizeUrl(a);break}}}},setCurrentTime:function(a){if(this.pluginApi!=null){if(this.pluginType=="youtube"){this.pluginApi.seekTo(a)}else{this.pluginApi.setCurrentTime(a)}this.currentTime=a}},setVolume:function(a){if(this.pluginApi!=null){if(this.pluginType=="youtube"){this.pluginApi.setVolume(a*100)}else{this.pluginApi.setVolume(a)}this.volume=a}},setMuted:function(a){if(this.pluginApi!=null){if(this.pluginType=="youtube"){if(a){this.pluginApi.mute()}else{this.pluginApi.unMute()}this.muted=a;this.dispatchEvent("volumechange")}else{this.pluginApi.setMuted(a)}this.muted=a}},setVideoSize:function(b,a){if(this.pluginElement.style){this.pluginElement.style.width=b+"px";this.pluginElement.style.height=a+"px"}if(this.pluginApi!=null&&this.pluginApi.setVideoSize){this.pluginApi.setVideoSize(b,a)}},setFullscreen:function(a){if(this.pluginApi!=null&&this.pluginApi.setFullscreen){this.pluginApi.setFullscreen(a)}},enterFullScreen:function(){if(this.pluginApi!=null&&this.pluginApi.setFullscreen){this.setFullscreen(true)}},exitFullScreen:function(){if(this.pluginApi!=null&&this.pluginApi.setFullscreen){this.setFullscreen(false)}},addEventListener:function(b,c,a){this.events[b]=this.events[b]||[];this.events[b].push(c)},removeEventListener:function(a,c){if(!a){this.events={};return true}var b=this.events[a];if(!b){return true}if(!c){this.events[a]=[];return true}for(i=0;i<b.length;i++){if(b[i]===c){this.events[a].splice(i,1);return true}}return false},dispatchEvent:function(a){var c,b,d=this.events[a];if(d){b=Array.prototype.slice.call(arguments,1);for(c=0;c<d.length;c++){d[c].apply(null,b)}}},attributes:{},hasAttribute:function(a){return(a in this.attributes)},removeAttribute:function(a){delete this.attributes[a]},getAttribute:function(a){if(this.hasAttribute(a)){return this.attributes[a]}return""},setAttribute:function(a,b){this.attributes[a]=b},remove:function(){mejs.Utility.removeSwf(this.pluginElement.id)}};mejs.MediaPluginBridge={pluginMediaElements:{},htmlMediaElements:{},registerPluginElement:function(c,a,b){this.pluginMediaElements[c]=a;this.htmlMediaElements[c]=b},initPlugin:function(c){var a=this.pluginMediaElements[c],b=this.htmlMediaElements[c];if(a){switch(a.pluginType){case"flash":a.pluginElement=a.pluginApi=document.getElementById(c);break;case"silverlight":a.pluginElement=document.getElementById(a.id);a.pluginApi=a.pluginElement.Content.MediaElementJS;break}if(a.pluginApi!=null&&a.success){a.success(a,b)}}},fireEvent:function(h,c,b){var g,f,a,d=this.pluginMediaElements[h];g={type:c,target:d};for(f in b){d[f]=b[f];g[f]=b[f]}a=b.bufferedTime||0;g.target.buffered=g.buffered={start:function(e){return 0},end:function(e){return a},length:1};d.dispatchEvent(g.type,g)}};mejs.MediaElementDefaults={mode:"auto",plugins:["flash","silverlight","youtube","vimeo"],enablePluginDebug:false,type:"",pluginPath:mejs.Utility.getScriptPath(["mediaelement.js","mediaelement.min.js","mediaelement-and-player.js","mediaelement-and-player.min.js"]),flashName:"flashmediaelement.swf",flashStreamer:"",enablePluginSmoothing:false,silverlightName:"silverlightmediaelement.xap",defaultVideoWidth:480,defaultVideoHeight:270,pluginWidth:-1,pluginHeight:-1,pluginVars:[],timerRate:250,startVolume:0.8,success:function(){},error:function(){}};mejs.MediaElement=function(a,b){return mejs.HtmlMediaElementShim.create(a,b)};mejs.HtmlMediaElementShim={create:function(e,d){var n=mejs.MediaElementDefaults,k=(typeof(e)=="string")?document.getElementById(e):e,h=k.tagName.toLowerCase(),g=(h==="audio"||h==="video"),b=(g)?k.getAttribute("src"):k.getAttribute("href"),l=k.getAttribute("poster"),f=k.getAttribute("autoplay"),j=k.getAttribute("preload"),m=k.getAttribute("controls"),a,c;for(c in d){n[c]=d[c]}b=(typeof b=="undefined"||b===null||b=="")?null:b;l=(typeof l=="undefined"||l===null)?"":l;j=(typeof j=="undefined"||j===null||j==="false")?"none":j;f=!(typeof f=="undefined"||f===null||f==="false");m=!(typeof m=="undefined"||m===null||m==="false");a=this.determinePlayback(k,n,mejs.MediaFeatures.supportsMediaTag,g,b);a.url=(a.url!==null)?mejs.Utility.absolutizeUrl(a.url):"";if(a.method=="native"){if(mejs.MediaFeatures.isBustedAndroid){k.src=a.url;k.addEventListener("click",function(){k.play()},false)}return this.updateNative(a,n,f,j)}else{if(a.method!==""){return this.createPlugin(a,n,l,f,j,m)}else{this.createErrorMessage(a,n,l);return this}}},determinePlayback:function(t,c,h,v,f){var o=[],s,r,q,p,m,d,g={method:"",url:"",htmlMediaElement:t,isVideo:(t.tagName.toLowerCase()!="audio")},a,b,u,w,e;if(typeof c.type!="undefined"&&c.type!==""){if(typeof c.type=="string"){o.push({type:c.type,url:f})}else{for(s=0;s<c.type.length;s++){o.push({type:c.type[s],url:f})}}}else{if(f!==null){d=this.formatType(f,t.getAttribute("type"));o.push({type:d,url:f})}else{for(s=0;s<t.childNodes.length;s++){m=t.childNodes[s];if(m.nodeType==1&&m.tagName.toLowerCase()=="source"){f=m.getAttribute("src");d=this.formatType(f,m.getAttribute("type"));e=m.getAttribute("media");if(!e||!window.matchMedia||(window.matchMedia&&window.matchMedia(e).matches)){o.push({type:d,url:f})}}}}}if(!v&&o.length>0&&o[0].url!==null&&this.getTypeFromFile(o[0].url).indexOf("audio")>-1){g.isVideo=false}if(mejs.MediaFeatures.isBustedAndroid){t.canPlayType=function(j){return(j.match(/video\/(mp4|m4v)/gi)!==null)?"maybe":""}}if(h&&(c.mode==="auto"||c.mode==="auto_plugin"||c.mode==="native")){if(!v){w=document.createElement(g.isVideo?"video":"audio");t.parentNode.insertBefore(w,t);t.style.display="none";g.htmlMediaElement=t=w}for(s=0;s<o.length;s++){if(t.canPlayType(o[s].type).replace(/no/,"")!==""||t.canPlayType(o[s].type.replace(/mp3/,"mpeg")).replace(/no/,"")!==""){g.method="native";g.url=o[s].url;break}}if(g.method==="native"){if(g.url!==null){t.src=g.url}if(c.mode!=="auto_plugin"){return g}}}if(c.mode==="auto"||c.mode==="auto_plugin"||c.mode==="shim"){for(s=0;s<o.length;s++){d=o[s].type;for(r=0;r<c.plugins.length;r++){a=c.plugins[r];b=mejs.plugins[a];for(q=0;q<b.length;q++){u=b[q];if(u.version==null||mejs.PluginDetector.hasPluginVersion(a,u.version)){for(p=0;p<u.types.length;p++){if(d==u.types[p]){g.method=a;g.url=o[s].url;return g}}}}}}}if(c.mode==="auto_plugin"&&g.method==="native"){return g}if(g.method===""&&o.length>0){g.url=o[0].url}return g},formatType:function(a,c){var b;if(a&&!c){return this.getTypeFromFile(a)}else{if(c&&~c.indexOf(";")){return c.substr(0,c.indexOf(";"))}else{return c}}},getTypeFromFile:function(a){a=a.split("?")[0];var b=a.substring(a.lastIndexOf(".")+1);return(/(mp4|m4v|ogg|ogv|webm|webmv|flv|wmv|mpeg|mov)/gi.test(b)?"video":"audio")+"/"+this.getTypeFromExtension(b)},getTypeFromExtension:function(a){switch(a){case"mp4":case"m4v":return"mp4";case"webm":case"webma":case"webmv":return"webm";case"ogg":case"oga":case"ogv":return"ogg";default:return a}},createErrorMessage:function(c,b,g){var d=c.htmlMediaElement,a=document.createElement("div");a.className="me-cannotplay";try{a.style.width=d.width+"px";a.style.height=d.height+"px"}catch(f){}a.innerHTML=(g!=="")?'<a href="'+c.url+'"><img src="'+g+'" width="100%" height="100%" /></a>':'<a href="'+c.url+'"><span>'+mejs.i18n.t("Download File")+"</span></a>";d.parentNode.insertBefore(a,d);d.style.display="none";b.error(d)},createPlugin:function(n,a,c,e,d,h){var r=n.htmlMediaElement,m=1,l=1,s="me_"+n.method+"_"+(mejs.meIndex++),o=new mejs.PluginMediaElement(s,n.method,n.url),g=document.createElement("div"),b,p,j;o.tagName=r.tagName;for(var q=0;q<r.attributes.length;q++){var f=r.attributes[q];if(f.specified==true){o.setAttribute(f.name,f.value)}}p=r.parentNode;while(p!==null&&p.tagName.toLowerCase()!="body"){if(p.parentNode.tagName.toLowerCase()=="p"){p.parentNode.parentNode.insertBefore(p,p.parentNode);break}p=p.parentNode}if(n.isVideo){m=(a.videoWidth>0)?a.videoWidth:(r.getAttribute("width")!==null)?r.getAttribute("width"):a.defaultVideoWidth;l=(a.videoHeight>0)?a.videoHeight:(r.getAttribute("height")!==null)?r.getAttribute("height"):a.defaultVideoHeight;m=mejs.Utility.encodeUrl(m);l=mejs.Utility.encodeUrl(l)}else{if(a.enablePluginDebug){m=320;l=240}}o.success=a.success;mejs.MediaPluginBridge.registerPluginElement(s,o,r);g.className="me-plugin";g.id=s+"_container";if(n.isVideo){r.parentNode.insertBefore(g,r)}else{document.body.insertBefore(g,document.body.childNodes[0])}j=["id="+s,"isvideo="+((n.isVideo)?"true":"false"),"autoplay="+((e)?"true":"false"),"preload="+d,"width="+m,"startvolume="+a.startVolume,"timerrate="+a.timerRate,"flashstreamer="+a.flashStreamer,"height="+l];if(n.url!==null){if(n.method=="flash"){j.push("file="+mejs.Utility.encodeUrl(n.url))}else{j.push("file="+n.url)}}if(a.enablePluginDebug){j.push("debug=true")}if(a.enablePluginSmoothing){j.push("smoothing=true")}if(h){j.push("controls=true")}if(a.pluginVars){j=j.concat(a.pluginVars)}switch(n.method){case"silverlight":g.innerHTML='<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="'+s+'" name="'+s+'" width="'+m+'" height="'+l+'"><param name="initParams" value="'+j.join(",")+'" /><param name="windowless" value="true" /><param name="background" value="black" /><param name="minRuntimeVersion" value="3.0.0.0" /><param name="autoUpgrade" value="true" /><param name="source" value="'+a.pluginPath+a.silverlightName+'" /></object>';break;case"flash":if(mejs.MediaFeatures.isIE){b=document.createElement("div");g.appendChild(b);b.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="'+s+'" width="'+m+'" height="'+l+'"><param name="movie" value="'+a.pluginPath+a.flashName+"?x="+(new Date())+'" /><param name="flashvars" value="'+j.join("&")+'" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /></object>'}else{g.innerHTML='<embed id="'+s+'" name="'+s+'" play="true" loop="false" quality="high" bgcolor="#000000" wmode="transparent" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="//www.macromedia.com/go/getflashplayer" src="'+a.pluginPath+a.flashName+'" flashvars="'+j.join("&")+'" width="'+m+'" height="'+l+'"></embed>'}break;case"youtube":var k=n.url.substr(n.url.lastIndexOf("=")+1);youtubeSettings={container:g,containerId:g.id,pluginMediaElement:o,pluginId:s,videoId:k,height:l,width:m};if(mejs.PluginDetector.hasPluginVersion("flash",[10,0,0])){mejs.YouTubeApi.createFlash(youtubeSettings)}else{mejs.YouTubeApi.enqueueIframe(youtubeSettings)}break;case"vimeo":o.vimeoid=n.url.substr(n.url.lastIndexOf("/")+1);g.innerHTML='<iframe src="http://player.vimeo.com/video/'+o.vimeoid+'?portrait=0&byline=0&title=0" width="'+m+'" height="'+l+'" frameborder="0"></iframe>';break}r.style.display="none";return o},updateNative:function(d,c,f,b){var e=d.htmlMediaElement,a;for(a in mejs.HtmlMediaElement){e[a]=mejs.HtmlMediaElement[a]}c.success(e,e);return e}};mejs.YouTubeApi={isIframeStarted:false,isIframeLoaded:false,loadIframeApi:function(){if(!this.isIframeStarted){var a=document.createElement("script");a.src="http://www.youtube.com/player_api";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b);this.isIframeStarted=true}},iframeQueue:[],enqueueIframe:function(a){if(this.isLoaded){this.createIframe(a)}else{this.loadIframeApi();this.iframeQueue.push(a)}},createIframe:function(c){var b=c.pluginMediaElement,a=new YT.Player(c.containerId,{height:c.height,width:c.width,videoId:c.videoId,playerVars:{controls:0},events:{onReady:function(){c.pluginMediaElement.pluginApi=a;mejs.MediaPluginBridge.initPlugin(c.pluginId);setInterval(function(){mejs.YouTubeApi.createEvent(a,b,"timeupdate")},250)},onStateChange:function(d){mejs.YouTubeApi.handleStateChange(d.data,a,b)}}})},createEvent:function(d,c,b){var e={type:b,target:c};if(d&&d.getDuration){c.currentTime=e.currentTime=d.getCurrentTime();c.duration=e.duration=d.getDuration();e.paused=c.paused;e.ended=c.ended;e.muted=d.isMuted();e.volume=d.getVolume()/100;e.bytesTotal=d.getVideoBytesTotal();e.bufferedBytes=d.getVideoBytesLoaded();var a=e.bufferedBytes/e.bytesTotal*e.duration;e.target.buffered=e.buffered={start:function(f){return 0},end:function(f){return a},length:1}}c.dispatchEvent(e.type,e)},iFrameReady:function(){this.isLoaded=true;this.isIframeLoaded=true;while(this.iframeQueue.length>0){var a=this.iframeQueue.pop();this.createIframe(a)}},flashPlayers:{},createFlash:function(c){this.flashPlayers[c.pluginId]=c;var b,a="http://www.youtube.com/apiplayer?enablejsapi=1&playerapiid="+c.pluginId+"&version=3&autoplay=0&controls=0&modestbranding=1&loop=0";if(mejs.MediaFeatures.isIE){b=document.createElement("div");c.container.appendChild(b);b.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="'+c.pluginId+'" width="'+c.width+'" height="'+c.height+'"><param name="movie" value="'+a+'" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /></object>'}else{c.container.innerHTML='<object type="application/x-shockwave-flash" id="'+c.pluginId+'" data="'+a+'" width="'+c.width+'" height="'+c.height+'" style="visibility: visible; "><param name="allowScriptAccess" value="always"><param name="wmode" value="transparent"></object>'}},flashReady:function(e){var c=this.flashPlayers[e],b=document.getElementById(e),a=c.pluginMediaElement;a.pluginApi=a.pluginElement=b;mejs.MediaPluginBridge.initPlugin(e);b.cueVideoById(c.videoId);var d=c.containerId+"_callback";window[d]=function(f){mejs.YouTubeApi.handleStateChange(f,b,a)};b.addEventListener("onStateChange",d);setInterval(function(){mejs.YouTubeApi.createEvent(b,a,"timeupdate")},250)},handleStateChange:function(c,b,a){switch(c){case -1:a.paused=true;a.ended=true;mejs.YouTubeApi.createEvent(b,a,"loadedmetadata");break;case 0:a.paused=false;a.ended=true;mejs.YouTubeApi.createEvent(b,a,"ended");break;case 1:a.paused=false;a.ended=false;mejs.YouTubeApi.createEvent(b,a,"play");mejs.YouTubeApi.createEvent(b,a,"playing");break;case 2:a.paused=true;a.ended=false;mejs.YouTubeApi.createEvent(b,a,"pause");break;case 3:mejs.YouTubeApi.createEvent(b,a,"progress");break;case 5:break}}};function onYouTubePlayerAPIReady(){mejs.YouTubeApi.iFrameReady()}function onYouTubePlayerReady(a){mejs.YouTubeApi.flashReady(a)}window.mejs=mejs;window.MediaElement=mejs.MediaElement; 15 /*! 16 * Adds Internationalization and localization to objects. 17 * 18 * What is the concept beyond i18n? 19 * http://en.wikipedia.org/wiki/Internationalization_and_localization 20 * 21 * 22 * This file both i18n methods and locale which is used to translate 23 * strings into other languages. 24 * 25 * Default translations are not available, you have to add them 26 * through locale objects which are named exactly as the langcode 27 * they stand for. The default language is always english (en). 28 * 29 * 30 * Wrapper built to be able to attach the i18n object to 31 * other objects without changing more than one line. 32 * 33 * 34 * LICENSE: 35 * 36 * The i18n file uses methods from the Drupal project (drupal.js): 37 * - i18n.methods.t() (modified) 38 * - i18n.methods.checkPlain() (full copy) 39 * - i18n.methods.formatString() (full copy) 40 * 41 * The Drupal project is (like mediaelementjs) licensed under GPLv2. 42 * - http://drupal.org/licensing/faq/#q1 43 * - https://github.com/johndyer/mediaelement 44 * - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 45 * 46 * 47 * @author 48 * Tim Latz (latz.tim@gmail.com) 49 * 50 * @see 51 * me-i18n-locale.js 52 * 53 * @params 54 * - $ - zepto || jQuery .. 55 * - context - document, iframe .. 56 * - exports - CommonJS, window .. 57 * 58 */ 59 (function(d,b,a,e){var c={locale:{strings:{}},methods:{}};c.locale.getLanguage=function(){return{language:navigator.language}};c.locale.INIT_LANGUAGE=c.locale.getLanguage();c.methods.checkPlain=function(j){var h,g,f={"&":"&",'"':""","<":"<",">":">"};j=String(j);for(h in f){if(f.hasOwnProperty(h)){g=new RegExp(h,"g");j=j.replace(g,f[h])}}return j};c.methods.formatString=function(h,f){for(var g in f){switch(g.charAt(0)){case"@":f[g]=c.methods.checkPlain(f[g]);break;case"!":break;case"%":default:f[g]='<em class="placeholder">'+c.methods.checkPlain(f[g])+"</em>";break}h=h.replace(g,f[g])}return h};c.methods.t=function(h,g,f){if(c.locale.strings&&c.locale.strings[f.context]&&c.locale.strings[f.context][h]){h=c.locale.strings[f.context][h]}if(g){h=c.methods.formatString(h,g)}return h};c.t=function(j,g,f){if(typeof j==="string"&&j.length>0){var h=c.locale.getLanguage();f=f||{context:h.language};return c.methods.t(j,g,f)}else{throw {name:"InvalidArgumentException",message:"First argument is either not a string or empty."}}};a.i18n=c}(jQuery,document,mejs)); 60 /*! 61 * This is a i18n.locale language object. 62 * 63 *<de> German translation by Tim Latz, latz.tim@gmail.com 64 * 65 * @author 66 * Tim Latz (latz.tim@gmail.com) 67 * 68 * @see 69 * me-i18n.js 70 * 71 * @params 72 * - exports - CommonJS, window .. 73 */ 74 (function(a,b){a.de={Fullscreen:"Vollbild","Go Fullscreen":"Vollbild an","Turn off Fullscreen":"Vollbild aus",Close:"Schließen"}}(mejs.i18n.locale.strings)); 13 */var mejs=mejs||{};mejs.version="2.11.0";mejs.meIndex=0; 14 mejs.plugins={silverlight:[{version:[3,0],types:["video/mp4","video/m4v","video/mov","video/wmv","audio/wma","audio/m4a","audio/mp3","audio/wav","audio/mpeg"]}],flash:[{version:[9,0,124],types:["video/mp4","video/m4v","video/mov","video/flv","video/rtmp","video/x-flv","audio/flv","audio/x-flv","audio/mp3","audio/m4a","audio/mpeg","video/youtube","video/x-youtube"]}],youtube:[{version:null,types:["video/youtube","video/x-youtube","audio/youtube","audio/x-youtube"]}],vimeo:[{version:null,types:["video/vimeo", 15 "video/x-vimeo"]}]}; 16 mejs.Utility={encodeUrl:function(a){return encodeURIComponent(a)},escapeHTML:function(a){return a.toString().split("&").join("&").split("<").join("<").split('"').join(""")},absolutizeUrl:function(a){var b=document.createElement("div");b.innerHTML='<a href="'+this.escapeHTML(a)+'">x</a>';return b.firstChild.href},getScriptPath:function(a){for(var b=0,c,d="",e="",g,f=document.getElementsByTagName("script"),h=f.length,l=a.length;b<h;b++){g=f[b].src;for(c=0;c<l;c++){e=a[c];if(g.indexOf(e)> 17 -1){d=g.substring(0,g.indexOf(e));break}}if(d!=="")break}return d},secondsToTimeCode:function(a,b,c,d){if(typeof c=="undefined")c=false;else if(typeof d=="undefined")d=25;var e=Math.floor(a/3600)%24,g=Math.floor(a/60)%60,f=Math.floor(a%60);a=Math.floor((a%1*d).toFixed(3));return(b||e>0?(e<10?"0"+e:e)+":":"")+(g<10?"0"+g:g)+":"+(f<10?"0"+f:f)+(c?":"+(a<10?"0"+a:a):"")},timeCodeToSeconds:function(a,b,c,d){if(typeof c=="undefined")c=false;else if(typeof d=="undefined")d=25;a=a.split(":");b=parseInt(a[0], 18 10);var e=parseInt(a[1],10),g=parseInt(a[2],10),f=0,h=0;if(c)f=parseInt(a[3])/d;return h=b*3600+e*60+g+f},convertSMPTEtoSeconds:function(a){if(typeof a!="string")return false;a=a.replace(",",".");var b=0,c=a.indexOf(".")!=-1?a.split(".")[1].length:0,d=1;a=a.split(":").reverse();for(var e=0;e<a.length;e++){d=1;if(e>0)d=Math.pow(60,e);b+=Number(a[e])*d}return Number(b.toFixed(c))},removeSwf:function(a){var b=document.getElementById(a);if(b&&/object|embed/i.test(b.nodeName))if(mejs.MediaFeatures.isIE){b.style.display= 19 "none";(function(){b.readyState==4?mejs.Utility.removeObjectInIE(a):setTimeout(arguments.callee,10)})()}else b.parentNode.removeChild(b)},removeObjectInIE:function(a){if(a=document.getElementById(a)){for(var b in a)if(typeof a[b]=="function")a[b]=null;a.parentNode.removeChild(a)}}}; 20 mejs.PluginDetector={hasPluginVersion:function(a,b){var c=this.plugins[a];b[1]=b[1]||0;b[2]=b[2]||0;return c[0]>b[0]||c[0]==b[0]&&c[1]>b[1]||c[0]==b[0]&&c[1]==b[1]&&c[2]>=b[2]?true:false},nav:window.navigator,ua:window.navigator.userAgent.toLowerCase(),plugins:[],addPlugin:function(a,b,c,d,e){this.plugins[a]=this.detectPlugin(b,c,d,e)},detectPlugin:function(a,b,c,d){var e=[0,0,0],g;if(typeof this.nav.plugins!="undefined"&&typeof this.nav.plugins[a]=="object"){if((c=this.nav.plugins[a].description)&& 21 !(typeof this.nav.mimeTypes!="undefined"&&this.nav.mimeTypes[b]&&!this.nav.mimeTypes[b].enabledPlugin)){e=c.replace(a,"").replace(/^\s+/,"").replace(/\sr/gi,".").split(".");for(a=0;a<e.length;a++)e[a]=parseInt(e[a].match(/\d+/),10)}}else if(typeof window.ActiveXObject!="undefined")try{if(g=new ActiveXObject(c))e=d(g)}catch(f){}return e}}; 22 mejs.PluginDetector.addPlugin("flash","Shockwave Flash","application/x-shockwave-flash","ShockwaveFlash.ShockwaveFlash",function(a){var b=[];if(a=a.GetVariable("$version")){a=a.split(" ")[1].split(",");b=[parseInt(a[0],10),parseInt(a[1],10),parseInt(a[2],10)]}return b}); 23 mejs.PluginDetector.addPlugin("silverlight","Silverlight Plug-In","application/x-silverlight-2","AgControl.AgControl",function(a){var b=[0,0,0,0],c=function(d,e,g,f){for(;d.isVersionSupported(e[0]+"."+e[1]+"."+e[2]+"."+e[3]);)e[g]+=f;e[g]-=f};c(a,b,0,1);c(a,b,1,1);c(a,b,2,1E4);c(a,b,2,1E3);c(a,b,2,100);c(a,b,2,10);c(a,b,2,1);c(a,b,3,1);return b}); 24 mejs.MediaFeatures={init:function(){var a=this,b=document,c=mejs.PluginDetector.nav,d=mejs.PluginDetector.ua.toLowerCase(),e,g=["source","track","audio","video"];a.isiPad=d.match(/ipad/i)!==null;a.isiPhone=d.match(/iphone/i)!==null;a.isiOS=a.isiPhone||a.isiPad;a.isAndroid=d.match(/android/i)!==null;a.isBustedAndroid=d.match(/android 2\.[12]/)!==null;a.isIE=c.appName.toLowerCase().indexOf("microsoft")!=-1;a.isChrome=d.match(/chrome/gi)!==null;a.isFirefox=d.match(/firefox/gi)!==null;a.isWebkit=d.match(/webkit/gi)!== 25 null;a.isGecko=d.match(/gecko/gi)!==null&&!a.isWebkit;a.isOpera=d.match(/opera/gi)!==null;a.hasTouch="ontouchstart"in window;a.svg=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect;for(c=0;c<g.length;c++)e=document.createElement(g[c]);a.supportsMediaTag=typeof e.canPlayType!=="undefined"||a.isBustedAndroid;a.hasSemiNativeFullScreen=typeof e.webkitEnterFullscreen!=="undefined";a.hasWebkitNativeFullScreen=typeof e.webkitRequestFullScreen!=="undefined"; 26 a.hasMozNativeFullScreen=typeof e.mozRequestFullScreen!=="undefined";a.hasTrueNativeFullScreen=a.hasWebkitNativeFullScreen||a.hasMozNativeFullScreen;a.nativeFullScreenEnabled=a.hasTrueNativeFullScreen;if(a.hasMozNativeFullScreen)a.nativeFullScreenEnabled=e.mozFullScreenEnabled;if(this.isChrome)a.hasSemiNativeFullScreen=false;if(a.hasTrueNativeFullScreen){a.fullScreenEventName=a.hasWebkitNativeFullScreen?"webkitfullscreenchange":"mozfullscreenchange";a.isFullScreen=function(){if(e.mozRequestFullScreen)return b.mozFullScreen; 27 else if(e.webkitRequestFullScreen)return b.webkitIsFullScreen};a.requestFullScreen=function(f){if(a.hasWebkitNativeFullScreen)f.webkitRequestFullScreen();else a.hasMozNativeFullScreen&&f.mozRequestFullScreen()};a.cancelFullScreen=function(){if(a.hasWebkitNativeFullScreen)document.webkitCancelFullScreen();else a.hasMozNativeFullScreen&&document.mozCancelFullScreen()}}if(a.hasSemiNativeFullScreen&&d.match(/mac os x 10_5/i)){a.hasNativeFullScreen=false;a.hasSemiNativeFullScreen=false}}};mejs.MediaFeatures.init(); 28 mejs.HtmlMediaElement={pluginType:"native",isFullScreen:false,setCurrentTime:function(a){this.currentTime=a},setMuted:function(a){this.muted=a},setVolume:function(a){this.volume=a},stop:function(){this.pause()},setSrc:function(a){for(var b=this.getElementsByTagName("source");b.length>0;)this.removeChild(b[0]);if(typeof a=="string")this.src=a;else{var c;for(b=0;b<a.length;b++){c=a[b];if(this.canPlayType(c.type)){this.src=c.src;break}}}},setVideoSize:function(a,b){this.width=a;this.height=b}}; 29 mejs.PluginMediaElement=function(a,b,c){this.id=a;this.pluginType=b;this.src=c;this.events={};this.attributes={}}; 30 mejs.PluginMediaElement.prototype={pluginElement:null,pluginType:"",isFullScreen:false,playbackRate:-1,defaultPlaybackRate:-1,seekable:[],played:[],paused:true,ended:false,seeking:false,duration:0,error:null,tagName:"",muted:false,volume:1,currentTime:0,play:function(){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.playVideo():this.pluginApi.playMedia();this.paused=false}},load:function(){if(this.pluginApi!=null){this.pluginType!="youtube"&&this.pluginApi.loadMedia();this.paused= 31 false}},pause:function(){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.pauseVideo():this.pluginApi.pauseMedia();this.paused=true}},stop:function(){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.stopVideo():this.pluginApi.stopMedia();this.paused=true}},canPlayType:function(a){var b,c,d,e=mejs.plugins[this.pluginType];for(b=0;b<e.length;b++){d=e[b];if(mejs.PluginDetector.hasPluginVersion(this.pluginType,d.version))for(c=0;c<d.types.length;c++)if(a==d.types[c])return"probably"}return""}, 32 positionFullscreenButton:function(a,b,c){this.pluginApi!=null&&this.pluginApi.positionFullscreenButton&&this.pluginApi.positionFullscreenButton(a,b,c)},hideFullscreenButton:function(){this.pluginApi!=null&&this.pluginApi.hideFullscreenButton&&this.pluginApi.hideFullscreenButton()},setSrc:function(a){if(typeof a=="string"){this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(a));this.src=mejs.Utility.absolutizeUrl(a)}else{var b,c;for(b=0;b<a.length;b++){c=a[b];if(this.canPlayType(c.type)){this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(c.src)); 33 this.src=mejs.Utility.absolutizeUrl(a);break}}}},setCurrentTime:function(a){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.seekTo(a):this.pluginApi.setCurrentTime(a);this.currentTime=a}},setVolume:function(a){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.setVolume(a*100):this.pluginApi.setVolume(a);this.volume=a}},setMuted:function(a){if(this.pluginApi!=null){if(this.pluginType=="youtube"){a?this.pluginApi.mute():this.pluginApi.unMute();this.muted=a;this.dispatchEvent("volumechange")}else this.pluginApi.setMuted(a); 34 this.muted=a}},setVideoSize:function(a,b){if(this.pluginElement.style){this.pluginElement.style.width=a+"px";this.pluginElement.style.height=b+"px"}this.pluginApi!=null&&this.pluginApi.setVideoSize&&this.pluginApi.setVideoSize(a,b)},setFullscreen:function(a){this.pluginApi!=null&&this.pluginApi.setFullscreen&&this.pluginApi.setFullscreen(a)},enterFullScreen:function(){this.pluginApi!=null&&this.pluginApi.setFullscreen&&this.setFullscreen(true)},exitFullScreen:function(){this.pluginApi!=null&&this.pluginApi.setFullscreen&& 35 this.setFullscreen(false)},addEventListener:function(a,b){this.events[a]=this.events[a]||[];this.events[a].push(b)},removeEventListener:function(a,b){if(!a){this.events={};return true}var c=this.events[a];if(!c)return true;if(!b){this.events[a]=[];return true}for(i=0;i<c.length;i++)if(c[i]===b){this.events[a].splice(i,1);return true}return false},dispatchEvent:function(a){var b,c,d=this.events[a];if(d){c=Array.prototype.slice.call(arguments,1);for(b=0;b<d.length;b++)d[b].apply(null,c)}},hasAttribute:function(a){return a in 36 this.attributes},removeAttribute:function(a){delete this.attributes[a]},getAttribute:function(a){if(this.hasAttribute(a))return this.attributes[a];return""},setAttribute:function(a,b){this.attributes[a]=b},remove:function(){mejs.Utility.removeSwf(this.pluginElement.id);mejs.MediaPluginBridge.unregisterPluginElement(this.pluginElement.id)}}; 37 mejs.MediaPluginBridge={pluginMediaElements:{},htmlMediaElements:{},registerPluginElement:function(a,b,c){this.pluginMediaElements[a]=b;this.htmlMediaElements[a]=c},unregisterPluginElement:function(a){delete this.pluginMediaElements[a];delete this.htmlMediaElements[a]},initPlugin:function(a){var b=this.pluginMediaElements[a],c=this.htmlMediaElements[a];if(b){switch(b.pluginType){case "flash":b.pluginElement=b.pluginApi=document.getElementById(a);break;case "silverlight":b.pluginElement=document.getElementById(b.id); 38 b.pluginApi=b.pluginElement.Content.MediaElementJS}b.pluginApi!=null&&b.success&&b.success(b,c)}},fireEvent:function(a,b,c){var d,e;a=this.pluginMediaElements[a];b={type:b,target:a};for(d in c){a[d]=c[d];b[d]=c[d]}e=c.bufferedTime||0;b.target.buffered=b.buffered={start:function(){return 0},end:function(){return e},length:1};a.dispatchEvent(b.type,b)}}; 39 mejs.MediaElementDefaults={mode:"auto",plugins:["flash","silverlight","youtube","vimeo"],enablePluginDebug:false,type:"",pluginPath:mejs.Utility.getScriptPath(["mediaelement.js","mediaelement.min.js","mediaelement-and-player.js","mediaelement-and-player.min.js"]),flashName:"flashmediaelement.swf",flashStreamer:"",enablePluginSmoothing:false,silverlightName:"silverlightmediaelement.xap",defaultVideoWidth:480,defaultVideoHeight:270,pluginWidth:-1,pluginHeight:-1,pluginVars:[],timerRate:250,startVolume:0.8, 40 success:function(){},error:function(){}};mejs.MediaElement=function(a,b){return mejs.HtmlMediaElementShim.create(a,b)}; 41 mejs.HtmlMediaElementShim={create:function(a,b){var c=mejs.MediaElementDefaults,d=typeof a=="string"?document.getElementById(a):a,e=d.tagName.toLowerCase(),g=e==="audio"||e==="video",f=g?d.getAttribute("src"):d.getAttribute("href");e=d.getAttribute("poster");var h=d.getAttribute("autoplay"),l=d.getAttribute("preload"),j=d.getAttribute("controls"),k;for(k in b)c[k]=b[k];f=typeof f=="undefined"||f===null||f==""?null:f;e=typeof e=="undefined"||e===null?"":e;l=typeof l=="undefined"||l===null||l==="false"? 42 "none":l;h=!(typeof h=="undefined"||h===null||h==="false");j=!(typeof j=="undefined"||j===null||j==="false");k=this.determinePlayback(d,c,mejs.MediaFeatures.supportsMediaTag,g,f);k.url=k.url!==null?mejs.Utility.absolutizeUrl(k.url):"";if(k.method=="native"){if(mejs.MediaFeatures.isBustedAndroid){d.src=k.url;d.addEventListener("click",function(){d.play()},false)}return this.updateNative(k,c,h,l)}else if(k.method!=="")return this.createPlugin(k,c,e,h,l,j);else{this.createErrorMessage(k,c,e);return this}}, 43 determinePlayback:function(a,b,c,d,e){var g=[],f,h,l,j={method:"",url:"",htmlMediaElement:a,isVideo:a.tagName.toLowerCase()!="audio"},k;if(typeof b.type!="undefined"&&b.type!=="")if(typeof b.type=="string")g.push({type:b.type,url:e});else for(f=0;f<b.type.length;f++)g.push({type:b.type[f],url:e});else if(e!==null){l=this.formatType(e,a.getAttribute("type"));g.push({type:l,url:e})}else for(f=0;f<a.childNodes.length;f++){h=a.childNodes[f];if(h.nodeType==1&&h.tagName.toLowerCase()=="source"){e=h.getAttribute("src"); 44 l=this.formatType(e,h.getAttribute("type"));h=h.getAttribute("media");if(!h||!window.matchMedia||window.matchMedia&&window.matchMedia(h).matches)g.push({type:l,url:e})}}if(!d&&g.length>0&&g[0].url!==null&&this.getTypeFromFile(g[0].url).indexOf("audio")>-1)j.isVideo=false;if(mejs.MediaFeatures.isBustedAndroid)a.canPlayType=function(m){return m.match(/video\/(mp4|m4v)/gi)!==null?"maybe":""};if(c&&(b.mode==="auto"||b.mode==="auto_plugin"||b.mode==="native")){if(!d){f=document.createElement(j.isVideo? 45 "video":"audio");a.parentNode.insertBefore(f,a);a.style.display="none";j.htmlMediaElement=a=f}for(f=0;f<g.length;f++)if(a.canPlayType(g[f].type).replace(/no/,"")!==""||a.canPlayType(g[f].type.replace(/mp3/,"mpeg")).replace(/no/,"")!==""){j.method="native";j.url=g[f].url;break}if(j.method==="native"){if(j.url!==null)a.src=j.url;if(b.mode!=="auto_plugin")return j}}if(b.mode==="auto"||b.mode==="auto_plugin"||b.mode==="shim")for(f=0;f<g.length;f++){l=g[f].type;for(a=0;a<b.plugins.length;a++){e=b.plugins[a]; 46 h=mejs.plugins[e];for(c=0;c<h.length;c++){k=h[c];if(k.version==null||mejs.PluginDetector.hasPluginVersion(e,k.version))for(d=0;d<k.types.length;d++)if(l==k.types[d]){j.method=e;j.url=g[f].url;return j}}}}if(b.mode==="auto_plugin"&&j.method==="native")return j;if(j.method===""&&g.length>0)j.url=g[0].url;return j},formatType:function(a,b){return a&&!b?this.getTypeFromFile(a):b&&~b.indexOf(";")?b.substr(0,b.indexOf(";")):b},getTypeFromFile:function(a){a=a.split("?")[0];a=a.substring(a.lastIndexOf(".")+ 47 1);return(/(mp4|m4v|ogg|ogv|webm|webmv|flv|wmv|mpeg|mov)/gi.test(a)?"video":"audio")+"/"+this.getTypeFromExtension(a)},getTypeFromExtension:function(a){switch(a){case "mp4":case "m4v":return"mp4";case "webm":case "webma":case "webmv":return"webm";case "ogg":case "oga":case "ogv":return"ogg";default:return a}},createErrorMessage:function(a,b,c){var d=a.htmlMediaElement,e=document.createElement("div");e.className="me-cannotplay";try{e.style.width=d.width+"px";e.style.height=d.height+"px"}catch(g){}e.innerHTML= 48 c!==""?'<a href="'+a.url+'"><img src="'+c+'" width="100%" height="100%" /></a>':'<a href="'+a.url+'"><span>'+mejs.i18n.t("Download File")+"</span></a>";d.parentNode.insertBefore(e,d);d.style.display="none";b.error(d)},createPlugin:function(a,b,c,d,e,g){c=a.htmlMediaElement;var f=1,h=1,l="me_"+a.method+"_"+mejs.meIndex++,j=new mejs.PluginMediaElement(l,a.method,a.url),k=document.createElement("div"),m;j.tagName=c.tagName;for(m=0;m<c.attributes.length;m++){var n=c.attributes[m];n.specified==true&&j.setAttribute(n.name, 49 n.value)}for(m=c.parentNode;m!==null&&m.tagName.toLowerCase()!="body";){if(m.parentNode.tagName.toLowerCase()=="p"){m.parentNode.parentNode.insertBefore(m,m.parentNode);break}m=m.parentNode}if(a.isVideo){f=b.videoWidth>0?b.videoWidth:c.getAttribute("width")!==null?c.getAttribute("width"):b.defaultVideoWidth;h=b.videoHeight>0?b.videoHeight:c.getAttribute("height")!==null?c.getAttribute("height"):b.defaultVideoHeight;f=mejs.Utility.encodeUrl(f);h=mejs.Utility.encodeUrl(h)}else if(b.enablePluginDebug){f= 50 320;h=240}j.success=b.success;mejs.MediaPluginBridge.registerPluginElement(l,j,c);k.className="me-plugin";k.id=l+"_container";a.isVideo?c.parentNode.insertBefore(k,c):document.body.insertBefore(k,document.body.childNodes[0]);d=["id="+l,"isvideo="+(a.isVideo?"true":"false"),"autoplay="+(d?"true":"false"),"preload="+e,"width="+f,"startvolume="+b.startVolume,"timerrate="+b.timerRate,"flashstreamer="+b.flashStreamer,"height="+h];if(a.url!==null)a.method=="flash"?d.push("file="+mejs.Utility.encodeUrl(a.url)): 51 d.push("file="+a.url);b.enablePluginDebug&&d.push("debug=true");b.enablePluginSmoothing&&d.push("smoothing=true");g&&d.push("controls=true");if(b.pluginVars)d=d.concat(b.pluginVars);switch(a.method){case "silverlight":k.innerHTML='<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="'+l+'" name="'+l+'" width="'+f+'" height="'+h+'" class="mejs-shim"><param name="initParams" value="'+d.join(",")+'" /><param name="windowless" value="true" /><param name="background" value="black" /><param name="minRuntimeVersion" value="3.0.0.0" /><param name="autoUpgrade" value="true" /><param name="source" value="'+ 52 b.pluginPath+b.silverlightName+'" /></object>';break;case "flash":if(mejs.MediaFeatures.isIE){a=document.createElement("div");k.appendChild(a);a.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="'+l+'" width="'+f+'" height="'+h+'" class="mejs-shim"><param name="movie" value="'+b.pluginPath+b.flashName+"?x="+new Date+'" /><param name="flashvars" value="'+d.join("&")+'" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /></object>'}else k.innerHTML= 53 '<embed id="'+l+'" name="'+l+'" play="true" loop="false" quality="high" bgcolor="#000000" wmode="transparent" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="//www.macromedia.com/go/getflashplayer" src="'+b.pluginPath+b.flashName+'" flashvars="'+d.join("&")+'" width="'+f+'" height="'+h+'" class="mejs-shim"></embed>';break;case "youtube":b=a.url.substr(a.url.lastIndexOf("=")+1);youtubeSettings={container:k,containerId:k.id,pluginMediaElement:j,pluginId:l, 54 videoId:b,height:h,width:f};mejs.PluginDetector.hasPluginVersion("flash",[10,0,0])?mejs.YouTubeApi.createFlash(youtubeSettings):mejs.YouTubeApi.enqueueIframe(youtubeSettings);break;case "vimeo":j.vimeoid=a.url.substr(a.url.lastIndexOf("/")+1);k.innerHTML='<iframe src="http://player.vimeo.com/video/'+j.vimeoid+'?portrait=0&byline=0&title=0" width="'+f+'" height="'+h+'" frameborder="0" class="mejs-shim"></iframe>'}c.style.display="none";return j},updateNative:function(a,b){var c=a.htmlMediaElement, 55 d;for(d in mejs.HtmlMediaElement)c[d]=mejs.HtmlMediaElement[d];b.success(c,c);return c}}; 56 mejs.YouTubeApi={isIframeStarted:false,isIframeLoaded:false,loadIframeApi:function(){if(!this.isIframeStarted){var a=document.createElement("script");a.src="http://www.youtube.com/player_api";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b);this.isIframeStarted=true}},iframeQueue:[],enqueueIframe:function(a){if(this.isLoaded)this.createIframe(a);else{this.loadIframeApi();this.iframeQueue.push(a)}},createIframe:function(a){var b=a.pluginMediaElement,c=new YT.Player(a.containerId, 57 {height:a.height,width:a.width,videoId:a.videoId,playerVars:{controls:0},events:{onReady:function(){a.pluginMediaElement.pluginApi=c;mejs.MediaPluginBridge.initPlugin(a.pluginId);setInterval(function(){mejs.YouTubeApi.createEvent(c,b,"timeupdate")},250)},onStateChange:function(d){mejs.YouTubeApi.handleStateChange(d.data,c,b)}}})},createEvent:function(a,b,c){c={type:c,target:b};if(a&&a.getDuration){b.currentTime=c.currentTime=a.getCurrentTime();b.duration=c.duration=a.getDuration();c.paused=b.paused; 58 c.ended=b.ended;c.muted=a.isMuted();c.volume=a.getVolume()/100;c.bytesTotal=a.getVideoBytesTotal();c.bufferedBytes=a.getVideoBytesLoaded();var d=c.bufferedBytes/c.bytesTotal*c.duration;c.target.buffered=c.buffered={start:function(){return 0},end:function(){return d},length:1}}b.dispatchEvent(c.type,c)},iFrameReady:function(){for(this.isIframeLoaded=this.isLoaded=true;this.iframeQueue.length>0;)this.createIframe(this.iframeQueue.pop())},flashPlayers:{},createFlash:function(a){this.flashPlayers[a.pluginId]= 59 a;var b,c="http://www.youtube.com/apiplayer?enablejsapi=1&playerapiid="+a.pluginId+"&version=3&autoplay=0&controls=0&modestbranding=1&loop=0";if(mejs.MediaFeatures.isIE){b=document.createElement("div");a.container.appendChild(b);b.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="'+a.pluginId+'" width="'+a.width+'" height="'+a.height+'" class="mejs-shim"><param name="movie" value="'+ 60 c+'" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /></object>'}else a.container.innerHTML='<object type="application/x-shockwave-flash" id="'+a.pluginId+'" data="'+c+'" width="'+a.width+'" height="'+a.height+'" style="visibility: visible; " class="mejs-shim"><param name="allowScriptAccess" value="always"><param name="wmode" value="transparent"></object>'},flashReady:function(a){var b=this.flashPlayers[a],c= 61 document.getElementById(a),d=b.pluginMediaElement;d.pluginApi=d.pluginElement=c;mejs.MediaPluginBridge.initPlugin(a);c.cueVideoById(b.videoId);a=b.containerId+"_callback";window[a]=function(e){mejs.YouTubeApi.handleStateChange(e,c,d)};c.addEventListener("onStateChange",a);setInterval(function(){mejs.YouTubeApi.createEvent(c,d,"timeupdate")},250)},handleStateChange:function(a,b,c){switch(a){case -1:c.paused=true;c.ended=true;mejs.YouTubeApi.createEvent(b,c,"loadedmetadata");break;case 0:c.paused=false; 62 c.ended=true;mejs.YouTubeApi.createEvent(b,c,"ended");break;case 1:c.paused=false;c.ended=false;mejs.YouTubeApi.createEvent(b,c,"play");mejs.YouTubeApi.createEvent(b,c,"playing");break;case 2:c.paused=true;c.ended=false;mejs.YouTubeApi.createEvent(b,c,"pause");break;case 3:mejs.YouTubeApi.createEvent(b,c,"progress")}}};function onYouTubePlayerAPIReady(){mejs.YouTubeApi.iFrameReady()}function onYouTubePlayerReady(a){mejs.YouTubeApi.flashReady(a)}window.mejs=mejs;window.MediaElement=mejs.MediaElement; 63 (function(a,b,c){var d={locale:{strings:{}},methods:{}};d.locale.getLanguage=function(){return{language:navigator.language}};d.locale.INIT_LANGUAGE=d.locale.getLanguage();d.methods.checkPlain=function(e){var g,f,h={"&":"&",'"':""","<":"<",">":">"};e=String(e);for(g in h)if(h.hasOwnProperty(g)){f=RegExp(g,"g");e=e.replace(f,h[g])}return e};d.methods.formatString=function(e,g){for(var f in g){switch(f.charAt(0)){case "@":g[f]=d.methods.checkPlain(g[f]);break;case "!":break;default:g[f]= 64 '<em class="placeholder">'+d.methods.checkPlain(g[f])+"</em>"}e=e.replace(f,g[f])}return e};d.methods.t=function(e,g,f){if(d.locale.strings&&d.locale.strings[f.context]&&d.locale.strings[f.context][e])e=d.locale.strings[f.context][e];if(g)e=d.methods.formatString(e,g);return e};d.t=function(e,g,f){if(typeof e==="string"&&e.length>0){var h=d.locale.getLanguage();f=f||{context:h.language};return d.methods.t(e,g,f)}else throw{name:"InvalidArgumentException",message:"First argument is either not a string or empty."}; 65 };c.i18n=d})(jQuery,document,mejs);(function(a){a.de={Fullscreen:"Vollbild","Go Fullscreen":"Vollbild an","Turn off Fullscreen":"Vollbild aus",Close:"Schlie\u00dfen"}})(mejs.i18n.locale.strings); 66 75 67 /*! 76 68 * MediaElementPlayer 77 69 * http://mediaelementjs.com/ … … var mejs=mejs||{};mejs.version="2.10.1";mejs.meIndex=0;mejs.plugins={silverlight 80 72 * using jQuery and MediaElement.js (HTML5 Flash/Silverlight wrapper) 81 73 * 82 74 * Copyright 2010-2012, John Dyer (http://j.hn/) 83 * Dual licensed under the MIT or GPL Version 2 licenses. 84 * 85 */ 86 if(typeof jQuery!="undefined"){mejs.$=jQuery}else{if(typeof ender!="undefined"){mejs.$=ender}}(function(a){mejs.MepDefaults={poster:"",defaultVideoWidth:480,defaultVideoHeight:270,videoWidth:-1,videoHeight:-1,defaultAudioWidth:400,defaultAudioHeight:30,defaultSeekBackwardInterval:function(b){return(b.duration*0.05)},defaultSeekForwardInterval:function(b){return(b.duration*0.05)},audioWidth:-1,audioHeight:-1,startVolume:0.8,loop:false,enableAutosize:true,alwaysShowHours:false,showTimecodeFrameCount:false,framesPerSecond:25,autosizeProgress:true,alwaysShowControls:false,iPadUseNativeControls:false,iPhoneUseNativeControls:false,AndroidUseNativeControls:false,features:["playpause","current","progress","duration","tracks","volume","fullscreen"],isVideo:true,enableKeyboard:true,pauseOtherPlayers:true,keyActions:[{keys:[32,179],action:function(b,c){if(c.paused||c.ended){c.play()}else{c.pause()}}},{keys:[38],action:function(b,d){var c=Math.min(d.volume+0.1,1);d.setVolume(c)}},{keys:[40],action:function(b,d){var c=Math.max(d.volume-0.1,0);d.setVolume(c)}},{keys:[37,227],action:function(b,d){if(!isNaN(d.duration)&&d.duration>0){if(b.isVideo){b.showControls();b.startControlsTimer()}var c=Math.max(d.currentTime-b.options.defaultSeekBackwardInterval(d),0);d.setCurrentTime(c)}}},{keys:[39,228],action:function(b,d){if(!isNaN(d.duration)&&d.duration>0){if(b.isVideo){b.showControls();b.startControlsTimer()}var c=Math.min(d.currentTime+b.options.defaultSeekForwardInterval(d),d.duration);d.setCurrentTime(c)}}},{keys:[70],action:function(b,c){if(typeof b.enterFullScreen!="undefined"){if(b.isFullScreen){b.exitFullScreen()}else{b.enterFullScreen()}}}}]};mejs.mepIndex=0;mejs.players=[];mejs.MediaElementPlayer=function(c,d){if(!(this instanceof mejs.MediaElementPlayer)){return new mejs.MediaElementPlayer(c,d)}var b=this;b.$media=b.$node=a(c);b.node=b.media=b.$media[0];if(typeof b.node.player!="undefined"){return b.node.player}else{b.node.player=b}if(typeof d=="undefined"){d=b.$node.data("mejsoptions")}b.options=a.extend({},mejs.MepDefaults,d);mejs.players.push(b);b.init();return b};mejs.MediaElementPlayer.prototype={hasFocus:false,controlsAreVisible:true,init:function(){var d=this,e=mejs.MediaFeatures,h=a.extend(true,{},d.options,{success:function(k,j){d.meReady(k,j)},error:function(j){d.handleError(j)}}),c=d.media.tagName.toLowerCase();d.isDynamic=(c!=="audio"&&c!=="video");if(d.isDynamic){d.isVideo=d.options.isVideo}else{d.isVideo=(c!=="audio"&&d.options.isVideo)}if((e.isiPad&&d.options.iPadUseNativeControls)||(e.isiPhone&&d.options.iPhoneUseNativeControls)){d.$media.attr("controls","controls");if(e.isiPad&&d.media.getAttribute("autoplay")!==null){d.media.load();d.media.play()}}else{if(e.isAndroid&&d.AndroidUseNativeControls){}else{d.$media.removeAttr("controls");d.id="mep_"+mejs.mepIndex++;d.container=a('<div id="'+d.id+'" class="mejs-container '+(mejs.MediaFeatures.svg?"svg":"no-svg")+'"><div class="mejs-inner"><div class="mejs-mediaelement"></div><div class="mejs-layers"></div><div class="mejs-controls"></div><div class="mejs-clear"></div></div></div>').addClass(d.$media[0].className).insertBefore(d.$media);d.container.addClass((e.isAndroid?"mejs-android ":"")+(e.isiOS?"mejs-ios ":"")+(e.isiPad?"mejs-ipad ":"")+(e.isiPhone?"mejs-iphone ":"")+(d.isVideo?"mejs-video ":"mejs-audio "));if(e.isiOS){var g=d.$media.clone();d.container.find(".mejs-mediaelement").append(g);d.$media.remove();d.$node=d.$media=g;d.node=d.media=g[0]}else{d.container.find(".mejs-mediaelement").append(d.$media)}d.controls=d.container.find(".mejs-controls");d.layers=d.container.find(".mejs-layers");var f=(d.isVideo?"video":"audio"),b=f.substring(0,1).toUpperCase()+f.substring(1);if(d.options[f+"Width"]>0||d.options[f+"Width"].toString().indexOf("%")>-1){d.width=d.options[f+"Width"]}else{if(d.media.style.width!==""&&d.media.style.width!==null){d.width=d.media.style.width}else{if(d.media.getAttribute("width")!==null){d.width=d.$media.attr("width")}else{d.width=d.options["default"+b+"Width"]}}}if(d.options[f+"Height"]>0||d.options[f+"Height"].toString().indexOf("%")>-1){d.height=d.options[f+"Height"]}else{if(d.media.style.height!==""&&d.media.style.height!==null){d.height=d.media.style.height}else{if(d.$media[0].getAttribute("height")!==null){d.height=d.$media.attr("height")}else{d.height=d.options["default"+b+"Height"]}}}d.setPlayerSize(d.width,d.height);h.pluginWidth=d.height;h.pluginHeight=d.width}}mejs.MediaElement(d.$media[0],h)},showControls:function(b){var c=this;b=typeof b=="undefined"||b;if(c.controlsAreVisible){return}if(b){c.controls.css("visibility","visible").stop(true,true).fadeIn(200,function(){c.controlsAreVisible=true});c.container.find(".mejs-control").css("visibility","visible").stop(true,true).fadeIn(200,function(){c.controlsAreVisible=true})}else{c.controls.css("visibility","visible").css("display","block");c.container.find(".mejs-control").css("visibility","visible").css("display","block");c.controlsAreVisible=true}c.setControlsSize()},hideControls:function(b){var c=this;b=typeof b=="undefined"||b;if(!c.controlsAreVisible){return}if(b){c.controls.stop(true,true).fadeOut(200,function(){a(this).css("visibility","hidden").css("display","block");c.controlsAreVisible=false});c.container.find(".mejs-control").stop(true,true).fadeOut(200,function(){a(this).css("visibility","hidden").css("display","block")})}else{c.controls.css("visibility","hidden").css("display","block");c.container.find(".mejs-control").css("visibility","hidden").css("display","block");c.controlsAreVisible=false}},controlsTimer:null,startControlsTimer:function(c){var b=this;c=typeof c!="undefined"?c:1500;b.killControlsTimer("start");b.controlsTimer=setTimeout(function(){b.hideControls();b.killControlsTimer("hide")},c)},killControlsTimer:function(c){var b=this;if(b.controlsTimer!==null){clearTimeout(b.controlsTimer);delete b.controlsTimer;b.controlsTimer=null}},controlsEnabled:true,disableControls:function(){var b=this;b.killControlsTimer();b.hideControls(false);this.controlsEnabled=false},enableControls:function(){var b=this;b.showControls(false);b.controlsEnabled=true},meReady:function(c,f){var k=this,j=mejs.MediaFeatures,g=f.getAttribute("autoplay"),d=!(typeof g=="undefined"||g===null||g==="false"),b,l;if(k.created){return}else{k.created=true}k.media=c;k.domNode=f;if(!(j.isAndroid&&k.options.AndroidUseNativeControls)&&!(j.isiPad&&k.options.iPadUseNativeControls)&&!(j.isiPhone&&k.options.iPhoneUseNativeControls)){k.buildposter(k,k.controls,k.layers,k.media);k.buildkeyboard(k,k.controls,k.layers,k.media);k.buildoverlays(k,k.controls,k.layers,k.media);k.findTracks();for(b in k.options.features){l=k.options.features[b];if(k["build"+l]){try{k["build"+l](k,k.controls,k.layers,k.media)}catch(h){}}}k.container.trigger("controlsready");k.setPlayerSize(k.width,k.height);k.setControlsSize();if(k.isVideo){if(mejs.MediaFeatures.hasTouch){k.$media.bind("touchstart",function(){if(k.controlsAreVisible){k.hideControls(false)}else{if(k.controlsEnabled){k.showControls(false)}}})}else{k.media.addEventListener("click",function(){if(k.media.paused){k.media.play()}else{k.media.pause()}});k.container.bind("mouseenter mouseover",function(){if(k.controlsEnabled){if(!k.options.alwaysShowControls){k.killControlsTimer("enter");k.showControls();k.startControlsTimer(2500)}}}).bind("mousemove",function(){if(k.controlsEnabled){if(!k.controlsAreVisible){k.showControls()}if(!k.options.alwaysShowControls){k.startControlsTimer(2500)}}}).bind("mouseleave",function(){if(k.controlsEnabled){if(!k.media.paused&&!k.options.alwaysShowControls){k.startControlsTimer(1000)}}})}if(d&&!k.options.alwaysShowControls){k.hideControls()}if(k.options.enableAutosize){k.media.addEventListener("loadedmetadata",function(m){if(k.options.videoHeight<=0&&k.domNode.getAttribute("height")===null&&!isNaN(m.target.videoHeight)){k.setPlayerSize(m.target.videoWidth,m.target.videoHeight);k.setControlsSize();k.media.setVideoSize(m.target.videoWidth,m.target.videoHeight)}},false)}}c.addEventListener("play",function(){for(var m=0,e=mejs.players.length;m<e;m++){var n=mejs.players[m];if(n.id!=k.id&&k.options.pauseOtherPlayers&&!n.paused&&!n.ended){n.pause()}n.hasFocus=false}k.hasFocus=true},false);k.media.addEventListener("ended",function(m){try{k.media.setCurrentTime(0)}catch(n){}k.media.pause();if(k.setProgressRail){k.setProgressRail()}if(k.setCurrentRail){k.setCurrentRail()}if(k.options.loop){k.media.play()}else{if(!k.options.alwaysShowControls&&k.controlsEnabled){k.showControls()}}},false);k.media.addEventListener("loadedmetadata",function(m){if(k.updateDuration){k.updateDuration()}if(k.updateCurrent){k.updateCurrent()}if(!k.isFullScreen){k.setPlayerSize(k.width,k.height);k.setControlsSize()}},false);setTimeout(function(){k.setPlayerSize(k.width,k.height);k.setControlsSize()},50);a(window).resize(function(){if(!(k.isFullScreen||(mejs.MediaFeatures.hasTrueNativeFullScreen&&document.webkitIsFullScreen))){k.setPlayerSize(k.width,k.height)}k.setControlsSize()});if(k.media.pluginType=="youtube"){k.container.find(".mejs-overlay-play").hide()}}if(d&&c.pluginType=="native"){c.load();c.play()}if(k.options.success){if(typeof k.options.success=="string"){window[k.options.success](k.media,k.domNode,k)}else{k.options.success(k.media,k.domNode,k)}}},handleError:function(c){var b=this;b.controls.hide();if(b.options.error){b.options.error(c)}},setPlayerSize:function(g,b){var e=this;if(typeof g!="undefined"){e.width=g}if(typeof b!="undefined"){e.height=b}if(e.height.toString().indexOf("%")>0||e.$node.css("max-width")==="100%"||(e.$node[0].currentStyle&&e.$node[0].currentStyle.maxWidth==="100%")){var h=e.isVideo?((e.media.videoWidth&&e.media.videoWidth>0)?e.media.videoWidth:e.options.defaultVideoWidth):e.options.defaultAudioWidth,d=e.isVideo?((e.media.videoHeight&&e.media.videoHeight>0)?e.media.videoHeight:e.options.defaultVideoHeight):e.options.defaultAudioHeight,f=e.container.parent().closest(":visible").width(),c=parseInt(f*d/h,10);if(e.container.parent()[0].tagName.toLowerCase()==="body"){f=a(window).width();c=a(window).height()}if(c!=0){e.container.width(f).height(c);e.$media.width("100%").height("100%");e.container.find("object, embed, iframe").width("100%").height("100%");if(e.isVideo){if(e.media.setVideoSize){e.media.setVideoSize(f,c)}}e.layers.children(".mejs-layer").width("100%").height("100%")}}else{e.container.width(e.width).height(e.height);e.layers.children(".mejs-layer").width(e.width).height(e.height)}},setControlsSize:function(){var c=this,g=0,j=0,h=c.controls.find(".mejs-time-rail"),e=c.controls.find(".mejs-time-total"),f=c.controls.find(".mejs-time-current"),b=c.controls.find(".mejs-time-loaded"),d=h.siblings();if(c.options&&!c.options.autosizeProgress){j=parseInt(h.css("width"))}if(j===0||!j){d.each(function(){if(a(this).css("position")!="absolute"){g+=a(this).outerWidth(true)}});j=c.controls.width()-g-(h.outerWidth(true)-h.width())}h.width(j);e.width(j-(e.outerWidth(true)-e.width()));if(c.setProgressRail){c.setProgressRail()}if(c.setCurrentRail){c.setCurrentRail()}},buildposter:function(e,b,g,f){var d=this,h=a('<div class="mejs-poster mejs-layer"></div>').appendTo(g),c=e.$media.attr("poster");if(e.options.poster!==""){c=e.options.poster}if(c!==""&&c!=null){d.setPoster(c)}else{h.hide()}f.addEventListener("play",function(){h.hide()},false)},setPoster:function(c){var d=this,e=d.container.find(".mejs-poster"),b=e.find("img");if(b.length==0){b=a('<img width="100%" height="100%" />').appendTo(e)}b.attr("src",c)},buildoverlays:function(e,b,g,f){if(!e.isVideo){return}var h=a('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-loading"><span></span></div></div>').hide().appendTo(g),c=a('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-error"></div></div>').hide().appendTo(g),d=a('<div class="mejs-overlay mejs-layer mejs-overlay-play"><div class="mejs-overlay-button"></div></div>').appendTo(g).click(function(){if(f.paused){f.play()}else{f.pause()}});f.addEventListener("play",function(){d.hide();h.hide();b.find(".mejs-time-buffering").hide();c.hide()},false);f.addEventListener("playing",function(){d.hide();h.hide();b.find(".mejs-time-buffering").hide();c.hide()},false);f.addEventListener("seeking",function(){h.show();b.find(".mejs-time-buffering").show()},false);f.addEventListener("seeked",function(){h.hide();b.find(".mejs-time-buffering").hide()},false);f.addEventListener("pause",function(){if(!mejs.MediaFeatures.isiPhone){d.show()}},false);f.addEventListener("waiting",function(){h.show();b.find(".mejs-time-buffering").show()},false);f.addEventListener("loadeddata",function(){h.show();b.find(".mejs-time-buffering").show()},false);f.addEventListener("canplay",function(){h.hide();b.find(".mejs-time-buffering").hide()},false);f.addEventListener("error",function(){h.hide();b.find(".mejs-time-buffering").hide();c.show();c.find("mejs-overlay-error").html("Error loading this resource")},false)},buildkeyboard:function(d,b,f,e){var c=this;a(document).keydown(function(n){if(d.hasFocus&&d.options.enableKeyboard){for(var m=0,g=d.options.keyActions.length;m<g;m++){var l=d.options.keyActions[m];for(var h=0,k=l.keys.length;h<k;h++){if(n.keyCode==l.keys[h]){n.preventDefault();l.action(d,e,n.keyCode);return false}}}}return true});a(document).click(function(g){if(a(g.target).closest(".mejs-container").length==0){d.hasFocus=false}})},findTracks:function(){var b=this,c=b.$media.find("track");b.tracks=[];c.each(function(e,d){d=a(d);b.tracks.push({srclang:d.attr("srclang").toLowerCase(),src:d.attr("src"),kind:d.attr("kind"),label:d.attr("label")||"",entries:[],isLoaded:false})})},changeSkin:function(b){this.container[0].className="mejs-container "+b;this.setPlayerSize(this.width,this.height);this.setControlsSize()},play:function(){this.media.play()},pause:function(){this.media.pause()},load:function(){this.media.load()},setMuted:function(b){this.media.setMuted(b)},setCurrentTime:function(b){this.media.setCurrentTime(b)},getCurrentTime:function(){return this.media.currentTime},setVolume:function(b){this.media.setVolume(b)},getVolume:function(){return this.media.volume},setSrc:function(b){this.media.setSrc(b)},remove:function(){var b=this;if(b.media.pluginType==="flash"){b.media.remove()}else{if(b.media.pluginType==="native"){b.$media.prop("controls",true)}}if(!b.isDynamic){b.$node.insertBefore(b.container)}b.container.remove()}};if(typeof jQuery!="undefined"){jQuery.fn.mediaelementplayer=function(b){return this.each(function(){new mejs.MediaElementPlayer(this,b)})}}a(document).ready(function(){a(".mejs-player").mediaelementplayer()});window.MediaElementPlayer=mejs.MediaElementPlayer})(mejs.$);(function(a){a.extend(mejs.MepDefaults,{playpauseText:"Play/Pause"});a.extend(MediaElementPlayer.prototype,{buildplaypause:function(d,b,g,f){var c=this,e=a('<div class="mejs-button mejs-playpause-button mejs-play" ><button type="button" aria-controls="'+c.id+'" title="'+c.options.playpauseText+'"></button></div>').appendTo(b).click(function(h){h.preventDefault();if(f.paused){f.play()}else{f.pause()}return false});f.addEventListener("play",function(){e.removeClass("mejs-play").addClass("mejs-pause")},false);f.addEventListener("playing",function(){e.removeClass("mejs-play").addClass("mejs-pause")},false);f.addEventListener("pause",function(){e.removeClass("mejs-pause").addClass("mejs-play")},false);f.addEventListener("paused",function(){e.removeClass("mejs-pause").addClass("mejs-play")},false)}})})(mejs.$);(function(a){a.extend(mejs.MepDefaults,{stopText:"Stop"});a.extend(MediaElementPlayer.prototype,{buildstop:function(e,b,g,f){var d=this,c=a('<div class="mejs-button mejs-stop-button mejs-stop"><button type="button" aria-controls="'+d.id+'" title="'+d.options.stopText+'"></button></div>').appendTo(b).click(function(){if(!f.paused){f.pause()}if(f.currentTime>0){f.setCurrentTime(0);f.pause();b.find(".mejs-time-current").width("0px");b.find(".mejs-time-handle").css("left","0px");b.find(".mejs-time-float-current").html(mejs.Utility.secondsToTimeCode(0));b.find(".mejs-currenttime").html(mejs.Utility.secondsToTimeCode(0));g.find(".mejs-poster").show()}})}})})(mejs.$);(function(a){a.extend(MediaElementPlayer.prototype,{buildprogress:function(n,o,f,c){a('<div class="mejs-time-rail"><span class="mejs-time-total"><span class="mejs-time-buffering"></span><span class="mejs-time-loaded"></span><span class="mejs-time-current"></span><span class="mejs-time-handle"></span><span class="mejs-time-float"><span class="mejs-time-float-current">00:00</span><span class="mejs-time-float-corner"></span></span></span></div>').appendTo(o);o.find(".mejs-time-buffering").hide();var p=this,l=o.find(".mejs-time-total"),g=o.find(".mejs-time-loaded"),k=o.find(".mejs-time-current"),j=o.find(".mejs-time-handle"),m=o.find(".mejs-time-float"),b=o.find(".mejs-time-float-current"),e=function(u){var q=u.pageX,v=l.offset(),s=l.outerWidth(true),r=0,t=0,w=q-v.left;if(q>v.left&&q<=s+v.left&&c.duration){r=((q-v.left)/s);t=(r<=0.02)?0:r*c.duration;if(h){c.setCurrentTime(t)}if(!mejs.MediaFeatures.hasTouch){m.css("left",w);b.html(mejs.Utility.secondsToTimeCode(t));m.show()}}},h=false,d=false;l.bind("mousedown",function(q){if(q.which===1){h=true;e(q);a(document).bind("mousemove.dur",function(r){e(r)}).bind("mouseup.dur",function(r){h=false;m.hide();a(document).unbind(".dur")});return false}}).bind("mouseenter",function(q){d=true;a(document).bind("mousemove.dur",function(r){e(r)});if(!mejs.MediaFeatures.hasTouch){m.show()}}).bind("mouseleave",function(q){d=false;if(!h){a(document).unbind(".dur");m.hide()}});c.addEventListener("progress",function(q){n.setProgressRail(q);n.setCurrentRail(q)},false);c.addEventListener("timeupdate",function(q){n.setProgressRail(q);n.setCurrentRail(q)},false);p.loaded=g;p.total=l;p.current=k;p.handle=j},setProgressRail:function(f){var b=this,d=(f!=undefined)?f.target:b.media,c=null;if(d&&d.buffered&&d.buffered.length>0&&d.buffered.end&&d.duration){c=d.buffered.end(0)/d.duration}else{if(d&&d.bytesTotal!=undefined&&d.bytesTotal>0&&d.bufferedBytes!=undefined){c=d.bufferedBytes/d.bytesTotal}else{if(f&&f.lengthComputable&&f.total!=0){c=f.loaded/f.total}}}if(c!==null){c=Math.min(1,Math.max(0,c));if(b.loaded&&b.total){b.loaded.width(b.total.width()*c)}}},setCurrentRail:function(){var b=this;if(b.media.currentTime!=undefined&&b.media.duration){if(b.total&&b.handle){var d=b.total.width()*b.media.currentTime/b.media.duration,c=d-(b.handle.outerWidth(true)/2);b.current.width(d);b.handle.css("left",c)}}}})})(mejs.$);(function(a){a.extend(mejs.MepDefaults,{duration:-1,timeAndDurationSeparator:" <span> | </span> "});a.extend(MediaElementPlayer.prototype,{buildcurrent:function(d,b,f,e){var c=this;a('<div class="mejs-time"><span class="mejs-currenttime">'+(d.options.alwaysShowHours?"00:":"")+(d.options.showTimecodeFrameCount?"00:00:00":"00:00")+"</span></div>").appendTo(b);c.currenttime=c.controls.find(".mejs-currenttime");e.addEventListener("timeupdate",function(){d.updateCurrent()},false)},buildduration:function(d,b,f,e){var c=this;if(b.children().last().find(".mejs-currenttime").length>0){a(c.options.timeAndDurationSeparator+'<span class="mejs-duration">'+(c.options.duration>0?mejs.Utility.secondsToTimeCode(c.options.duration,c.options.alwaysShowHours||c.media.duration>3600,c.options.showTimecodeFrameCount,c.options.framesPerSecond||25):((d.options.alwaysShowHours?"00:":"")+(d.options.showTimecodeFrameCount?"00:00:00":"00:00")))+"</span>").appendTo(b.find(".mejs-time"))}else{b.find(".mejs-currenttime").parent().addClass("mejs-currenttime-container");a('<div class="mejs-time mejs-duration-container"><span class="mejs-duration">'+(c.options.duration>0?mejs.Utility.secondsToTimeCode(c.options.duration,c.options.alwaysShowHours||c.media.duration>3600,c.options.showTimecodeFrameCount,c.options.framesPerSecond||25):((d.options.alwaysShowHours?"00:":"")+(d.options.showTimecodeFrameCount?"00:00:00":"00:00")))+"</span></div>").appendTo(b)}c.durationD=c.controls.find(".mejs-duration");e.addEventListener("timeupdate",function(){d.updateDuration()},false)},updateCurrent:function(){var b=this;if(b.currenttime){b.currenttime.html(mejs.Utility.secondsToTimeCode(b.media.currentTime,b.options.alwaysShowHours||b.media.duration>3600,b.options.showTimecodeFrameCount,b.options.framesPerSecond||25))}},updateDuration:function(){var b=this;if(b.media.duration&&b.durationD){b.durationD.html(mejs.Utility.secondsToTimeCode(b.media.duration,b.options.alwaysShowHours,b.options.showTimecodeFrameCount,b.options.framesPerSecond||25))}}})})(mejs.$);(function(a){a.extend(mejs.MepDefaults,{muteText:"Mute Toggle",hideVolumeOnTouchDevices:true,audioVolume:"horizontal",videoVolume:"vertical"});a.extend(MediaElementPlayer.prototype,{buildvolume:function(n,o,j,d){if(mejs.MediaFeatures.hasTouch&&this.options.hideVolumeOnTouchDevices){return}var p=this,l=(p.isVideo)?p.options.videoVolume:p.options.audioVolume,f=(l=="horizontal")?a('<div class="mejs-button mejs-volume-button mejs-mute"><button type="button" aria-controls="'+p.id+'" title="'+p.options.muteText+'"></button></div><div class="mejs-horizontal-volume-slider"><div class="mejs-horizontal-volume-total"></div><div class="mejs-horizontal-volume-current"></div><div class="mejs-horizontal-volume-handle"></div></div>').appendTo(o):a('<div class="mejs-button mejs-volume-button mejs-mute"><button type="button" aria-controls="'+p.id+'" title="'+p.options.muteText+'"></button><div class="mejs-volume-slider"><div class="mejs-volume-total"></div><div class="mejs-volume-current"></div><div class="mejs-volume-handle"></div></div></div>').appendTo(o),q=p.container.find(".mejs-volume-slider, .mejs-horizontal-volume-slider"),b=p.container.find(".mejs-volume-total, .mejs-horizontal-volume-total"),h=p.container.find(".mejs-volume-current, .mejs-horizontal-volume-current"),g=p.container.find(".mejs-volume-handle, .mejs-horizontal-volume-handle"),m=function(w,x){if(!q.is(":visible")&&typeof x=="undefined"){q.show();m(w,true);q.hide();return}w=Math.max(0,w);w=Math.min(w,1);if(w==0){f.removeClass("mejs-mute").addClass("mejs-unmute")}else{f.removeClass("mejs-unmute").addClass("mejs-mute")}if(l=="vertical"){var u=b.height(),t=b.position(),s=u-(u*w);g.css("top",Math.round(t.top+s-(g.height()/2)));h.height(u-s);h.css("top",t.top+s)}else{var r=b.width(),t=b.position(),v=r*w;g.css("left",Math.round(t.left+v-(g.width()/2)));h.width(Math.round(v))}},c=function(w){var u=null,s=b.offset();if(l=="vertical"){var t=b.height(),r=parseInt(b.css("top").replace(/px/,""),10),v=w.pageY-s.top;u=(t-v)/t;if(s.top==0||s.left==0){return}}else{var y=b.width(),x=w.pageX-s.left;u=x/y}u=Math.max(0,u);u=Math.min(u,1);m(u);if(u==0){d.setMuted(true)}else{d.setMuted(false)}d.setVolume(u)},k=false,e=false;f.hover(function(){q.show();e=true},function(){e=false;if(!k&&l=="vertical"){q.hide()}});q.bind("mouseover",function(){e=true}).bind("mousedown",function(r){c(r);a(document).bind("mousemove.vol",function(s){c(s)}).bind("mouseup.vol",function(){k=false;a(document).unbind(".vol");if(!e&&l=="vertical"){q.hide()}});k=true;return false});f.find("button").click(function(){d.setMuted(!d.muted)});d.addEventListener("volumechange",function(r){if(!k){if(d.muted){m(0);f.removeClass("mejs-mute").addClass("mejs-unmute")}else{m(d.volume);f.removeClass("mejs-unmute").addClass("mejs-mute")}}},false);if(p.container.is(":visible")){m(n.options.startVolume);if(d.pluginType==="native"){d.setVolume(n.options.startVolume)}}}})})(mejs.$);(function(a){a.extend(mejs.MepDefaults,{usePluginFullScreen:true,newWindowCallback:function(){return""},fullscreenText:mejs.i18n.t("Fullscreen")});a.extend(MediaElementPlayer.prototype,{isFullScreen:false,isNativeFullScreen:false,docStyleOverflow:null,isInIframe:false,buildfullscreen:function(q,p,g,f){if(!q.isVideo){return}q.isInIframe=(window.location!=window.parent.location);if(mejs.MediaFeatures.hasTrueNativeFullScreen){var u=null;if(mejs.MediaFeatures.hasMozNativeFullScreen){u=a(document)}else{u=q.container}u.bind(mejs.MediaFeatures.fullScreenEventName,function(t){if(mejs.MediaFeatures.isFullScreen()){q.isNativeFullScreen=true;q.setControlsSize()}else{q.isNativeFullScreen=false;q.exitFullScreen()}})}var o=this,e=0,c=0,n=q.container,b=a('<div class="mejs-button mejs-fullscreen-button"><button type="button" aria-controls="'+o.id+'" title="'+o.options.fullscreenText+'"></button></div>').appendTo(p);if(o.media.pluginType==="native"||(!o.options.usePluginFullScreen&&!mejs.MediaFeatures.isFirefox)){b.click(function(){var t=(mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen())||q.isFullScreen;if(t){q.exitFullScreen()}else{q.enterFullScreen()}})}else{var m=null,h=(function(){var v=document.createElement("x"),w=document.documentElement,x=window.getComputedStyle,t;if(!("pointerEvents" in v.style)){return false}v.style.pointerEvents="auto";v.style.pointerEvents="x";w.appendChild(v);t=x&&x(v,"").pointerEvents==="auto";w.removeChild(v);return !!t})();if(h&&!mejs.MediaFeatures.isOpera){var l=false,r=function(){if(l){j.hide();d.hide();k.hide();b.css("pointer-events","");o.controls.css("pointer-events","");l=false}},j=a('<div class="mejs-fullscreen-hover" />').appendTo(o.container).mouseover(r),d=a('<div class="mejs-fullscreen-hover" />').appendTo(o.container).mouseover(r),k=a('<div class="mejs-fullscreen-hover" />').appendTo(o.container).mouseover(r),s=function(){var v={position:"absolute",top:0,left:0};j.css(v);d.css(v);k.css(v);j.width(o.container.width()).height(o.container.height()-o.controls.height());var t=b.offset().left-o.container.offset().left;fullScreenBtnWidth=b.outerWidth(true);d.width(t).height(o.controls.height()).css({top:o.container.height()-o.controls.height()});k.width(o.container.width()-t-fullScreenBtnWidth).height(o.controls.height()).css({top:o.container.height()-o.controls.height(),left:t+fullScreenBtnWidth})};a(document).resize(function(){s()});b.mouseover(function(){if(!o.isFullScreen){var t=b.offset(),v=q.container.offset();f.positionFullscreenButton(t.left-v.left,t.top-v.top,false);b.css("pointer-events","none");o.controls.css("pointer-events","none");j.show();k.show();d.show();s();l=true}});f.addEventListener("fullscreenchange",function(t){r()})}else{b.mouseover(function(){if(m!==null){clearTimeout(m);delete m}var t=b.offset(),v=q.container.offset();f.positionFullscreenButton(t.left-v.left,t.top-v.top,true)}).mouseout(function(){if(m!==null){clearTimeout(m);delete m}m=setTimeout(function(){f.hideFullscreenButton()},1500)})}}q.fullscreenBtn=b;a(document).bind("keydown",function(t){if(((mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen())||o.isFullScreen)&&t.keyCode==27){q.exitFullScreen()}})},enterFullScreen:function(){var c=this;if(c.media.pluginType!=="native"&&(mejs.MediaFeatures.isFirefox||c.options.usePluginFullScreen)){return}docStyleOverflow=document.documentElement.style.overflow;document.documentElement.style.overflow="hidden";normalHeight=c.container.height();normalWidth=c.container.width();if(c.media.pluginType==="native"){if(mejs.MediaFeatures.hasTrueNativeFullScreen){mejs.MediaFeatures.requestFullScreen(c.container[0]);if(c.isInIframe){setTimeout(function d(){if(c.isNativeFullScreen){if(a(window).width()!==screen.width){c.exitFullScreen()}else{setTimeout(d,500)}}},500)}}else{if(mejs.MediaFeatures.hasSemiNativeFullScreen){c.media.webkitEnterFullscreen();return}}}if(c.isInIframe){var b=c.options.newWindowCallback(this);if(b!==""){if(!mejs.MediaFeatures.hasTrueNativeFullScreen){c.pause();window.open(b,c.id,"top=0,left=0,width="+screen.availWidth+",height="+screen.availHeight+",resizable=yes,scrollbars=no,status=no,toolbar=no");return}else{setTimeout(function(){if(!c.isNativeFullScreen){c.pause();window.open(b,c.id,"top=0,left=0,width="+screen.availWidth+",height="+screen.availHeight+",resizable=yes,scrollbars=no,status=no,toolbar=no")}},250)}}}c.container.addClass("mejs-container-fullscreen").width("100%").height("100%");setTimeout(function(){c.container.css({width:"100%",height:"100%"});c.setControlsSize()},500);if(c.pluginType==="native"){c.$media.width("100%").height("100%")}else{c.container.find("object, embed, iframe").width("100%").height("100%");c.media.setVideoSize(a(window).width(),a(window).height())}c.layers.children("div").width("100%").height("100%");if(c.fullscreenBtn){c.fullscreenBtn.removeClass("mejs-fullscreen").addClass("mejs-unfullscreen")}c.setControlsSize();c.isFullScreen=true},exitFullScreen:function(){var b=this;if(b.media.pluginType!=="native"&&mejs.MediaFeatures.isFirefox){b.media.setFullscreen(false);return}if(mejs.MediaFeatures.hasTrueNativeFullScreen&&(mejs.MediaFeatures.isFullScreen()||b.isFullScreen)){mejs.MediaFeatures.cancelFullScreen()}document.documentElement.style.overflow=docStyleOverflow;b.container.removeClass("mejs-container-fullscreen").width(normalWidth).height(normalHeight);if(b.pluginType==="native"){b.$media.width(normalWidth).height(normalHeight)}else{b.container.find("object embed").width(normalWidth).height(normalHeight);b.media.setVideoSize(normalWidth,normalHeight)}b.layers.children("div").width(normalWidth).height(normalHeight);b.fullscreenBtn.removeClass("mejs-unfullscreen").addClass("mejs-fullscreen");b.setControlsSize();b.isFullScreen=false}})})(mejs.$);(function(a){a.extend(mejs.MepDefaults,{startLanguage:"",tracksText:"Captions/Subtitles"});a.extend(MediaElementPlayer.prototype,{hasChapters:false,buildtracks:function(f,b,h,g){if(!f.isVideo){return}if(f.tracks.length==0){return}var e=this,d,c="";f.chapters=a('<div class="mejs-chapters mejs-layer"></div>').prependTo(h).hide();f.captions=a('<div class="mejs-captions-layer mejs-layer"><div class="mejs-captions-position"><span class="mejs-captions-text"></span></div></div>').prependTo(h).hide();f.captionsText=f.captions.find(".mejs-captions-text");f.captionsButton=a('<div class="mejs-button mejs-captions-button"><button type="button" aria-controls="'+e.id+'" title="'+e.options.tracksText+'"></button><div class="mejs-captions-selector"><ul><li><input type="radio" name="'+f.id+'_captions" id="'+f.id+'_captions_none" value="none" checked="checked" /><label for="'+f.id+'_captions_none">None</label></li></ul></div></div>').appendTo(b).hover(function(){a(this).find(".mejs-captions-selector").css("visibility","visible")},function(){a(this).find(".mejs-captions-selector").css("visibility","hidden")}).delegate("input[type=radio]","click",function(){lang=this.value;if(lang=="none"){f.selectedTrack=null}else{for(d=0;d<f.tracks.length;d++){if(f.tracks[d].srclang==lang){f.selectedTrack=f.tracks[d];f.captions.attr("lang",f.selectedTrack.srclang);f.displayCaptions();break}}}});if(!f.options.alwaysShowControls){f.container.bind("mouseenter",function(){f.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover")}).bind("mouseleave",function(){if(!g.paused){f.container.find(".mejs-captions-position").removeClass("mejs-captions-position-hover")}})}else{f.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover")}f.trackToLoad=-1;f.selectedTrack=null;f.isLoadingTrack=false;for(d=0;d<f.tracks.length;d++){if(f.tracks[d].kind=="subtitles"){f.addTrackButton(f.tracks[d].srclang,f.tracks[d].label)}}f.loadNextTrack();g.addEventListener("timeupdate",function(j){f.displayCaptions()},false);g.addEventListener("loadedmetadata",function(j){f.displayChapters()},false);f.container.hover(function(){if(f.hasChapters){f.chapters.css("visibility","visible");f.chapters.fadeIn(200).height(f.chapters.find(".mejs-chapter").outerHeight())}},function(){if(f.hasChapters&&!g.paused){f.chapters.fadeOut(200,function(){a(this).css("visibility","hidden");a(this).css("display","block")})}});if(f.node.getAttribute("autoplay")!==null){f.chapters.css("visibility","hidden")}},loadNextTrack:function(){var b=this;b.trackToLoad++;if(b.trackToLoad<b.tracks.length){b.isLoadingTrack=true;b.loadTrack(b.trackToLoad)}else{b.isLoadingTrack=false}},loadTrack:function(c){var d=this,b=d.tracks[c],e=function(){b.isLoaded=true;d.enableTrackButton(b.srclang,b.label);d.loadNextTrack()};a.ajax({url:b.src,dataType:"text",success:function(f){if(typeof f=="string"&&(/<tt\s+xml/ig).exec(f)){b.entries=mejs.TrackFormatParser.dfxp.parse(f)}else{b.entries=mejs.TrackFormatParser.webvvt.parse(f)}e();if(b.kind=="chapters"){d.media.addEventListener("play",function(g){if(d.media.duration>0){d.displayChapters(b)}},false)}},error:function(){d.loadNextTrack()}})},enableTrackButton:function(d,b){var c=this;if(b===""){b=mejs.language.codes[d]||d}c.captionsButton.find("input[value="+d+"]").prop("disabled",false).siblings("label").html(b);if(c.options.startLanguage==d){a("#"+c.id+"_captions_"+d).click()}c.adjustLanguageBox()},addTrackButton:function(d,b){var c=this;if(b===""){b=mejs.language.codes[d]||d}c.captionsButton.find("ul").append(a('<li><input type="radio" name="'+c.id+'_captions" id="'+c.id+"_captions_"+d+'" value="'+d+'" disabled="disabled" /><label for="'+c.id+"_captions_"+d+'">'+b+" (loading)</label></li>"));c.adjustLanguageBox();c.container.find(".mejs-captions-translations option[value="+d+"]").remove()},adjustLanguageBox:function(){var b=this;b.captionsButton.find(".mejs-captions-selector").height(b.captionsButton.find(".mejs-captions-selector ul").outerHeight(true)+b.captionsButton.find(".mejs-captions-translations").outerHeight(true))},displayCaptions:function(){if(typeof this.tracks=="undefined"){return}var d=this,c,b=d.selectedTrack;if(b!=null&&b.isLoaded){for(c=0;c<b.entries.times.length;c++){if(d.media.currentTime>=b.entries.times[c].start&&d.media.currentTime<=b.entries.times[c].stop){d.captionsText.html(b.entries.text[c]);d.captions.show().height(0);return}}d.captions.hide()}else{d.captions.hide()}},displayChapters:function(){var c=this,b;for(b=0;b<c.tracks.length;b++){if(c.tracks[b].kind=="chapters"&&c.tracks[b].isLoaded){c.drawChapters(c.tracks[b]);c.hasChapters=true;break}}},drawChapters:function(f){var c=this,b,d,e=0,g=0;c.chapters.empty();for(b=0;b<f.entries.times.length;b++){d=f.entries.times[b].stop-f.entries.times[b].start;e=Math.floor(d/c.media.duration*100);if(e+g>100||b==f.entries.times.length-1&&e+g<100){e=100-g}c.chapters.append(a('<div class="mejs-chapter" rel="'+f.entries.times[b].start+'" style="left: '+g.toString()+"%;width: "+e.toString()+'%;"><div class="mejs-chapter-block'+((b==f.entries.times.length-1)?" mejs-chapter-block-last":"")+'"><span class="ch-title">'+f.entries.text[b]+'</span><span class="ch-time">'+mejs.Utility.secondsToTimeCode(f.entries.times[b].start)+"–"+mejs.Utility.secondsToTimeCode(f.entries.times[b].stop)+"</span></div></div>"));g+=e}c.chapters.find("div.mejs-chapter").click(function(){c.media.setCurrentTime(parseFloat(a(this).attr("rel")));if(c.media.paused){c.media.play()}});c.chapters.show()}});mejs.language={codes:{af:"Afrikaans",sq:"Albanian",ar:"Arabic",be:"Belarusian",bg:"Bulgarian",ca:"Catalan",zh:"Chinese","zh-cn":"Chinese Simplified","zh-tw":"Chinese Traditional",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch",en:"English",et:"Estonian",tl:"Filipino",fi:"Finnish",fr:"French",gl:"Galician",de:"German",el:"Greek",ht:"Haitian Creole",iw:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",ga:"Irish",it:"Italian",ja:"Japanese",ko:"Korean",lv:"Latvian",lt:"Lithuanian",mk:"Macedonian",ms:"Malay",mt:"Maltese",no:"Norwegian",fa:"Persian",pl:"Polish",pt:"Portuguese",ro:"Romanian",ru:"Russian",sr:"Serbian",sk:"Slovak",sl:"Slovenian",es:"Spanish",sw:"Swahili",sv:"Swedish",tl:"Tagalog",th:"Thai",tr:"Turkish",uk:"Ukrainian",vi:"Vietnamese",cy:"Welsh",yi:"Yiddish"}};mejs.TrackFormatParser={webvvt:{pattern_identifier:/^([a-zA-z]+-)?[0-9]+$/,pattern_timecode:/^([0-9]{2}:[0-9]{2}:[0-9]{2}([,.][0-9]{1,3})?) --\> ([0-9]{2}:[0-9]{2}:[0-9]{2}([,.][0-9]{3})?)(.*)$/,parse:function(g){var e=0,d=mejs.TrackFormatParser.split2(g,/\r?\n/),c={text:[],times:[]},b,f;for(;e<d.length;e++){if(this.pattern_identifier.exec(d[e])){e++;b=this.pattern_timecode.exec(d[e]);if(b&&e<d.length){e++;f=d[e];e++;while(d[e]!==""&&e<d.length){f=f+"\n"+d[e];e++}f=a.trim(f).replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig,"<a href='$1' target='_blank'>$1</a>");c.text.push(f);c.times.push({start:(mejs.Utility.convertSMPTEtoSeconds(b[1])==0)?0.2:mejs.Utility.convertSMPTEtoSeconds(b[1]),stop:mejs.Utility.convertSMPTEtoSeconds(b[3]),settings:b[5]})}}}return c}},dfxp:{parse:function(l){l=a(l).filter("tt");var j=0,c=l.children("div").eq(0),p=c.find("p"),h=l.find("#"+c.attr("style")),o,d,f,n,k={text:[],times:[]};if(h.length){var g=h.removeAttr("id").get(0).attributes;if(g.length){o={};for(j=0;j<g.length;j++){o[g[j].name.split(":")[1]]=g[j].value}}}for(j=0;j<p.length;j++){var b;var m={start:null,stop:null,style:null};if(p.eq(j).attr("begin")){m.start=mejs.Utility.convertSMPTEtoSeconds(p.eq(j).attr("begin"))}if(!m.start&&p.eq(j-1).attr("end")){m.start=mejs.Utility.convertSMPTEtoSeconds(p.eq(j-1).attr("end"))}if(p.eq(j).attr("end")){m.stop=mejs.Utility.convertSMPTEtoSeconds(p.eq(j).attr("end"))}if(!m.stop&&p.eq(j+1).attr("begin")){m.stop=mejs.Utility.convertSMPTEtoSeconds(p.eq(j+1).attr("begin"))}if(o){b="";for(var e in o){b+=e+":"+o[e]+";"}}if(b){m.style=b}if(m.start==0){m.start=0.2}k.times.push(m);n=a.trim(p.eq(j).html()).replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig,"<a href='$1' target='_blank'>$1</a>");k.text.push(n);if(k.times.start==0){k.times.start=2}}return k}},split2:function(c,b){return c.split(b)}};if("x\n\ny".split(/\n/gi).length!=3){mejs.TrackFormatParser.split2=function(f,d){var e=[],b="",c;for(c=0;c<f.length;c++){b+=f.substring(c,c+1);if(d.test(b)){e.push(b.replace(d,""));b=""}}e.push(b);return e}}})(mejs.$);(function(a){a.extend(mejs.MepDefaults,{contextMenuItems:[{render:function(b){if(typeof b.enterFullScreen=="undefined"){return null}if(b.isFullScreen){return"Turn off Fullscreen"}else{return"Go Fullscreen"}},click:function(b){if(b.isFullScreen){b.exitFullScreen()}else{b.enterFullScreen()}}},{render:function(b){if(b.media.muted){return"Unmute"}else{return"Mute"}},click:function(b){if(b.media.muted){b.setMuted(false)}else{b.setMuted(true)}}},{isSeparator:true},{render:function(b){return"Download Video"},click:function(b){window.location.href=b.media.currentSrc}}]});a.extend(MediaElementPlayer.prototype,{buildcontextmenu:function(c,b,e,d){c.contextMenu=a('<div class="mejs-contextmenu"></div>').appendTo(a("body")).hide();c.container.bind("contextmenu",function(f){if(c.isContextMenuEnabled){f.preventDefault();c.renderContextMenu(f.clientX-1,f.clientY-1);return false}});c.container.bind("click",function(){c.contextMenu.hide()});c.contextMenu.bind("mouseleave",function(){c.startContextMenuTimer()})},isContextMenuEnabled:true,enableContextMenu:function(){this.isContextMenuEnabled=true},disableContextMenu:function(){this.isContextMenuEnabled=false},contextMenuTimeout:null,startContextMenuTimer:function(){var b=this;b.killContextMenuTimer();b.contextMenuTimer=setTimeout(function(){b.hideContextMenu();b.killContextMenuTimer()},750)},killContextMenuTimer:function(){var b=this.contextMenuTimer;if(b!=null){clearTimeout(b);delete b;b=null}},hideContextMenu:function(){this.contextMenu.hide()},renderContextMenu:function(b,j){var g=this,f="",d=g.options.contextMenuItems;for(var e=0,c=d.length;e<c;e++){if(d[e].isSeparator){f+='<div class="mejs-contextmenu-separator"></div>'}else{var h=d[e].render(g);if(h!=null){f+='<div class="mejs-contextmenu-item" data-itemindex="'+e+'" id="element-'+(Math.random()*1000000)+'">'+h+"</div>"}}}g.contextMenu.empty().append(a(f)).css({top:j,left:b}).show();g.contextMenu.find(".mejs-contextmenu-item").each(function(){var k=a(this),l=parseInt(k.data("itemindex"),10),m=g.options.contextMenuItems[l];if(typeof m.show!="undefined"){m.show(k,g)}k.click(function(){if(typeof m.click!="undefined"){m.click(g)}g.contextMenu.hide()})});setTimeout(function(){g.killControlsTimer("rev3")},100)}})})(mejs.$);(function(a){a.extend(mejs.MepDefaults,{postrollCloseText:mejs.i18n.t("Close")});a.extend(MediaElementPlayer.prototype,{buildpostroll:function(e,c,g,f){var d=this,b=d.container.find('link[rel="postroll"]').attr("href");if(typeof b!=="undefined"){e.postroll=a('<div class="mejs-postroll-layer mejs-layer"><a class="mejs-postroll-close" onclick="$(this).parent().hide();return false;">'+d.options.postrollCloseText+'</a><div class="mejs-postroll-layer-content"></div></div>').prependTo(g).hide();d.media.addEventListener("ended",function(h){a.ajax({dataType:"html",url:b,success:function(j,k){g.find(".mejs-postroll-layer-content").html(j)}});e.postroll.show()},false)}}})})(mejs.$); 87 No newline at end of file 75 * License: MIT 76 * 77 */if(typeof jQuery!="undefined")mejs.$=jQuery;else if(typeof ender!="undefined")mejs.$=ender; 78 (function(f){mejs.MepDefaults={poster:"",defaultVideoWidth:480,defaultVideoHeight:270,videoWidth:-1,videoHeight:-1,defaultAudioWidth:400,defaultAudioHeight:30,defaultSeekBackwardInterval:function(a){return a.duration*0.05},defaultSeekForwardInterval:function(a){return a.duration*0.05},audioWidth:-1,audioHeight:-1,startVolume:0.8,loop:false,autoRewind:true,enableAutosize:true,alwaysShowHours:false,showTimecodeFrameCount:false,framesPerSecond:25,autosizeProgress:true,alwaysShowControls:false,hideVideoControlsOnLoad:false, 79 clickToPlayPause:true,iPadUseNativeControls:false,iPhoneUseNativeControls:false,AndroidUseNativeControls:false,features:["playpause","current","progress","duration","tracks","volume","fullscreen"],isVideo:true,enableKeyboard:true,pauseOtherPlayers:true,keyActions:[{keys:[32,179],action:function(a,b){b.paused||b.ended?b.play():b.pause()}},{keys:[38],action:function(a,b){b.setVolume(Math.min(b.volume+0.1,1))}},{keys:[40],action:function(a,b){b.setVolume(Math.max(b.volume-0.1,0))}},{keys:[37,227],action:function(a, 80 b){if(!isNaN(b.duration)&&b.duration>0){if(a.isVideo){a.showControls();a.startControlsTimer()}var c=Math.max(b.currentTime-a.options.defaultSeekBackwardInterval(b),0);b.setCurrentTime(c)}}},{keys:[39,228],action:function(a,b){if(!isNaN(b.duration)&&b.duration>0){if(a.isVideo){a.showControls();a.startControlsTimer()}var c=Math.min(b.currentTime+a.options.defaultSeekForwardInterval(b),b.duration);b.setCurrentTime(c)}}},{keys:[70],action:function(a){if(typeof a.enterFullScreen!="undefined")a.isFullScreen? 81 a.exitFullScreen():a.enterFullScreen()}}]};mejs.mepIndex=0;mejs.players={};mejs.MediaElementPlayer=function(a,b){if(!(this instanceof mejs.MediaElementPlayer))return new mejs.MediaElementPlayer(a,b);this.$media=this.$node=f(a);this.node=this.media=this.$media[0];if(typeof this.node.player!="undefined")return this.node.player;else this.node.player=this;if(typeof b=="undefined")b=this.$node.data("mejsoptions");this.options=f.extend({},mejs.MepDefaults,b);this.id="mep_"+mejs.mepIndex++;mejs.players[this.id]= 82 this;this.init();return this};mejs.MediaElementPlayer.prototype={hasFocus:false,controlsAreVisible:true,init:function(){var a=this,b=mejs.MediaFeatures,c=f.extend(true,{},a.options,{success:function(e,g){a.meReady(e,g)},error:function(e){a.handleError(e)}}),d=a.media.tagName.toLowerCase();a.isDynamic=d!=="audio"&&d!=="video";a.isVideo=a.isDynamic?a.options.isVideo:d!=="audio"&&a.options.isVideo;if(b.isiPad&&a.options.iPadUseNativeControls||b.isiPhone&&a.options.iPhoneUseNativeControls){a.$media.attr("controls", 83 "controls");if(b.isiPad&&a.media.getAttribute("autoplay")!==null){a.media.load();a.media.play()}}else if(!(b.isAndroid&&a.options.AndroidUseNativeControls)){a.$media.removeAttr("controls");a.container=f('<div id="'+a.id+'" class="mejs-container '+(mejs.MediaFeatures.svg?"svg":"no-svg")+'"><div class="mejs-inner"><div class="mejs-mediaelement"></div><div class="mejs-layers"></div><div class="mejs-controls"></div><div class="mejs-clear"></div></div></div>').addClass(a.$media[0].className).insertBefore(a.$media); 84 a.container.addClass((b.isAndroid?"mejs-android ":"")+(b.isiOS?"mejs-ios ":"")+(b.isiPad?"mejs-ipad ":"")+(b.isiPhone?"mejs-iphone ":"")+(a.isVideo?"mejs-video ":"mejs-audio "));if(b.isiOS){b=a.$media.clone();a.container.find(".mejs-mediaelement").append(b);a.$media.remove();a.$node=a.$media=b;a.node=a.media=b[0]}else a.container.find(".mejs-mediaelement").append(a.$media);a.controls=a.container.find(".mejs-controls");a.layers=a.container.find(".mejs-layers");b=a.isVideo?"video":"audio";d=b.substring(0, 85 1).toUpperCase()+b.substring(1);a.width=a.options[b+"Width"]>0||a.options[b+"Width"].toString().indexOf("%")>-1?a.options[b+"Width"]:a.media.style.width!==""&&a.media.style.width!==null?a.media.style.width:a.media.getAttribute("width")!==null?a.$media.attr("width"):a.options["default"+d+"Width"];a.height=a.options[b+"Height"]>0||a.options[b+"Height"].toString().indexOf("%")>-1?a.options[b+"Height"]:a.media.style.height!==""&&a.media.style.height!==null?a.media.style.height:a.$media[0].getAttribute("height")!== 86 null?a.$media.attr("height"):a.options["default"+d+"Height"];a.setPlayerSize(a.width,a.height);c.pluginWidth=a.height;c.pluginHeight=a.width}mejs.MediaElement(a.$media[0],c);a.container.trigger("controlsshown")},showControls:function(a){var b=this;a=typeof a=="undefined"||a;if(!b.controlsAreVisible){if(a){b.controls.css("visibility","visible").stop(true,true).fadeIn(200,function(){b.controlsAreVisible=true;b.container.trigger("controlsshown")});b.container.find(".mejs-control").css("visibility","visible").stop(true, 87 true).fadeIn(200,function(){b.controlsAreVisible=true})}else{b.controls.css("visibility","visible").css("display","block");b.container.find(".mejs-control").css("visibility","visible").css("display","block");b.controlsAreVisible=true;b.container.trigger("controlsshown")}b.setControlsSize()}},hideControls:function(a){var b=this;a=typeof a=="undefined"||a;if(b.controlsAreVisible)if(a){b.controls.stop(true,true).fadeOut(200,function(){f(this).css("visibility","hidden").css("display","block");b.controlsAreVisible= 88 false;b.container.trigger("controlshidden")});b.container.find(".mejs-control").stop(true,true).fadeOut(200,function(){f(this).css("visibility","hidden").css("display","block")})}else{b.controls.css("visibility","hidden").css("display","block");b.container.find(".mejs-control").css("visibility","hidden").css("display","block");b.controlsAreVisible=false;b.container.trigger("controlshidden")}},controlsTimer:null,startControlsTimer:function(a){var b=this;a=typeof a!="undefined"?a:1500;b.killControlsTimer("start"); 89 b.controlsTimer=setTimeout(function(){b.hideControls();b.killControlsTimer("hide")},a)},killControlsTimer:function(){if(this.controlsTimer!==null){clearTimeout(this.controlsTimer);delete this.controlsTimer;this.controlsTimer=null}},controlsEnabled:true,disableControls:function(){this.killControlsTimer();this.hideControls(false);this.controlsEnabled=false},enableControls:function(){this.showControls(false);this.controlsEnabled=true},meReady:function(a,b){var c=this,d=mejs.MediaFeatures,e=b.getAttribute("autoplay"); 90 e=!(typeof e=="undefined"||e===null||e==="false");var g;if(!c.created){c.created=true;c.media=a;c.domNode=b;if(!(d.isAndroid&&c.options.AndroidUseNativeControls)&&!(d.isiPad&&c.options.iPadUseNativeControls)&&!(d.isiPhone&&c.options.iPhoneUseNativeControls)){c.buildposter(c,c.controls,c.layers,c.media);c.buildkeyboard(c,c.controls,c.layers,c.media);c.buildoverlays(c,c.controls,c.layers,c.media);c.findTracks();for(g in c.options.features){d=c.options.features[g];if(c["build"+d])try{c["build"+d](c, 91 c.controls,c.layers,c.media)}catch(l){}}c.container.trigger("controlsready");c.setPlayerSize(c.width,c.height);c.setControlsSize();if(c.isVideo){if(mejs.MediaFeatures.hasTouch)c.$media.bind("touchstart",function(){if(c.controlsAreVisible)c.hideControls(false);else c.controlsEnabled&&c.showControls(false)});else{c.media.addEventListener("click",function(){if(c.options.clickToPlayPause)c.media.paused?c.media.play():c.media.pause()});c.container.bind("mouseenter mouseover",function(){if(c.controlsEnabled)if(!c.options.alwaysShowControls){c.killControlsTimer("enter"); 92 c.showControls();c.startControlsTimer(2500)}}).bind("mousemove",function(){if(c.controlsEnabled){c.controlsAreVisible||c.showControls();c.options.alwaysShowControls||c.startControlsTimer(2500)}}).bind("mouseleave",function(){c.controlsEnabled&&!c.media.paused&&!c.options.alwaysShowControls&&c.startControlsTimer(1E3)})}c.options.hideVideoControlsOnLoad&&c.hideControls(false);e&&!c.options.alwaysShowControls&&c.hideControls();c.options.enableAutosize&&c.media.addEventListener("loadedmetadata",function(j){if(c.options.videoHeight<= 93 0&&c.domNode.getAttribute("height")===null&&!isNaN(j.target.videoHeight)){c.setPlayerSize(j.target.videoWidth,j.target.videoHeight);c.setControlsSize();c.media.setVideoSize(j.target.videoWidth,j.target.videoHeight)}},false)}a.addEventListener("play",function(){for(var j in mejs.players){var k=mejs.players[j];k.id!=c.id&&c.options.pauseOtherPlayers&&!k.paused&&!k.ended&&k.pause();k.hasFocus=false}c.hasFocus=true},false);c.media.addEventListener("ended",function(){if(c.options.autoRewind)try{c.media.setCurrentTime(0)}catch(j){}c.media.pause(); 94 c.setProgressRail&&c.setProgressRail();c.setCurrentRail&&c.setCurrentRail();if(c.options.loop)c.media.play();else!c.options.alwaysShowControls&&c.controlsEnabled&&c.showControls()},false);c.media.addEventListener("loadedmetadata",function(){c.updateDuration&&c.updateDuration();c.updateCurrent&&c.updateCurrent();if(!c.isFullScreen){c.setPlayerSize(c.width,c.height);c.setControlsSize()}},false);setTimeout(function(){c.setPlayerSize(c.width,c.height);c.setControlsSize()},50);c.globalBind("resize",function(){c.isFullScreen|| 95 mejs.MediaFeatures.hasTrueNativeFullScreen&&document.webkitIsFullScreen||c.setPlayerSize(c.width,c.height);c.setControlsSize()});c.media.pluginType=="youtube"&&c.container.find(".mejs-overlay-play").hide()}if(e&&a.pluginType=="native"){a.load();a.play()}if(c.options.success)typeof c.options.success=="string"?window[c.options.success](c.media,c.domNode,c):c.options.success(c.media,c.domNode,c)}},handleError:function(a){this.controls.hide();this.options.error&&this.options.error(a)},setPlayerSize:function(a, 96 b){if(typeof a!="undefined")this.width=a;if(typeof b!="undefined")this.height=b;if(this.height.toString().indexOf("%")>0||this.$node.css("max-width")==="100%"||this.$node[0].currentStyle&&this.$node[0].currentStyle.maxWidth==="100%"){var c=this.isVideo?this.media.videoWidth&&this.media.videoWidth>0?this.media.videoWidth:this.options.defaultVideoWidth:this.options.defaultAudioWidth,d=this.isVideo?this.media.videoHeight&&this.media.videoHeight>0?this.media.videoHeight:this.options.defaultVideoHeight: 97 this.options.defaultAudioHeight,e=this.container.parent().closest(":visible").width();c=this.isVideo||!this.options.autosizeProgress?parseInt(e*d/c,10):d;if(this.container.parent()[0].tagName.toLowerCase()==="body"){e=f(window).width();c=f(window).height()}if(c!=0&&e!=0){this.container.width(e).height(c);this.$media.add(this.container.find(".mejs-shim")).width("100%").height("100%");this.isVideo&&this.media.setVideoSize&&this.media.setVideoSize(e,c);this.layers.children(".mejs-layer").width("100%").height("100%")}}else{this.container.width(this.width).height(this.height); 98 this.layers.children(".mejs-layer").width(this.width).height(this.height)}},setControlsSize:function(){var a=0,b=0,c=this.controls.find(".mejs-time-rail"),d=this.controls.find(".mejs-time-total");this.controls.find(".mejs-time-current");this.controls.find(".mejs-time-loaded");var e=c.siblings();if(this.options&&!this.options.autosizeProgress)b=parseInt(c.css("width"));if(b===0||!b){e.each(function(){var g=f(this);if(g.css("position")!="absolute"&&g.is(":visible"))a+=f(this).outerWidth(true)});b=this.controls.width()- 99 a-(c.outerWidth(true)-c.width())}c.width(b);d.width(b-(d.outerWidth(true)-d.width()));this.setProgressRail&&this.setProgressRail();this.setCurrentRail&&this.setCurrentRail()},buildposter:function(a,b,c,d){var e=f('<div class="mejs-poster mejs-layer"></div>').appendTo(c);b=a.$media.attr("poster");if(a.options.poster!=="")b=a.options.poster;b!==""&&b!=null?this.setPoster(b):e.hide();d.addEventListener("play",function(){e.hide()},false)},setPoster:function(a){var b=this.container.find(".mejs-poster"), 100 c=b.find("img");if(c.length==0)c=f('<img width="100%" height="100%" />').appendTo(b);c.attr("src",a)},buildoverlays:function(a,b,c,d){var e=this;if(a.isVideo){var g=f('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-loading"><span></span></div></div>').hide().appendTo(c),l=f('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-error"></div></div>').hide().appendTo(c),j=f('<div class="mejs-overlay mejs-layer mejs-overlay-play"><div class="mejs-overlay-button"></div></div>').appendTo(c).click(function(){if(e.options.clickToPlayPause)d.paused? 101 d.play():d.pause()});d.addEventListener("play",function(){j.hide();g.hide();b.find(".mejs-time-buffering").hide();l.hide()},false);d.addEventListener("playing",function(){j.hide();g.hide();b.find(".mejs-time-buffering").hide();l.hide()},false);d.addEventListener("seeking",function(){g.show();b.find(".mejs-time-buffering").show()},false);d.addEventListener("seeked",function(){g.hide();b.find(".mejs-time-buffering").hide()},false);d.addEventListener("pause",function(){mejs.MediaFeatures.isiPhone||j.show()}, 102 false);d.addEventListener("waiting",function(){g.show();b.find(".mejs-time-buffering").show()},false);d.addEventListener("loadeddata",function(){g.show();b.find(".mejs-time-buffering").show()},false);d.addEventListener("canplay",function(){g.hide();b.find(".mejs-time-buffering").hide()},false);d.addEventListener("error",function(){g.hide();b.find(".mejs-time-buffering").hide();l.show();l.find("mejs-overlay-error").html("Error loading this resource")},false)}},buildkeyboard:function(a,b,c,d){this.globalBind("keydown", 103 function(e){if(a.hasFocus&&a.options.enableKeyboard)for(var g=0,l=a.options.keyActions.length;g<l;g++)for(var j=a.options.keyActions[g],k=0,s=j.keys.length;k<s;k++)if(e.keyCode==j.keys[k]){e.preventDefault();j.action(a,d,e.keyCode);return false}return true});this.globalBind("click",function(e){if(f(e.target).closest(".mejs-container").length==0)a.hasFocus=false})},findTracks:function(){var a=this,b=a.$media.find("track");a.tracks=[];b.each(function(c,d){d=f(d);a.tracks.push({srclang:d.attr("srclang")? 104 d.attr("srclang").toLowerCase():"",src:d.attr("src"),kind:d.attr("kind"),label:d.attr("label")||"",entries:[],isLoaded:false})})},changeSkin:function(a){this.container[0].className="mejs-container "+a;this.setPlayerSize(this.width,this.height);this.setControlsSize()},play:function(){this.media.play()},pause:function(){this.media.pause()},load:function(){this.media.load()},setMuted:function(a){this.media.setMuted(a)},setCurrentTime:function(a){this.media.setCurrentTime(a)},getCurrentTime:function(){return this.media.currentTime}, 105 setVolume:function(a){this.media.setVolume(a)},getVolume:function(){return this.media.volume},setSrc:function(a){this.media.setSrc(a)},remove:function(){var a,b;for(a in this.options.features){b=this.options.features[a];if(this["clean"+b])try{this["clean"+b](this)}catch(c){}}this.media.pluginType==="native"?this.$media.prop("controls",true):this.media.remove();this.isDynamic||this.$node.insertBefore(this.container);mejs.players.splice(f.inArray(this,mejs.players),1);this.container.remove();this.globalUnbind(); 106 delete this.node.player;delete mejs.players[this.id]}};(function(){function a(c,d){var e={d:[],w:[]};f.each((c||"").split(" "),function(g,l){e[b.test(l)?"w":"d"].push(l+"."+d)});e.d=e.d.join(" ");e.w=e.w.join(" ");return e}var b=/^((after|before)print|(before)?unload|hashchange|message|o(ff|n)line|page(hide|show)|popstate|resize|storage)\b/;mejs.MediaElementPlayer.prototype.globalBind=function(c,d,e){c=a(c,this.id);c.d&&f(document).bind(c.d,d,e);c.w&&f(window).bind(c.w,d,e)};mejs.MediaElementPlayer.prototype.globalUnbind= 107 function(c,d){c=a(c,this.id);c.d&&f(document).unbind(c.d,d);c.w&&f(window).unbind(c.w,d)}})();if(typeof jQuery!="undefined")jQuery.fn.mediaelementplayer=function(a){a===false?this.each(function(){var b=jQuery(this).data("mediaelementplayer");b&&b.remove();jQuery(this).removeData("mediaelementplayer")}):this.each(function(){jQuery(this).data("mediaelementplayer",new mejs.MediaElementPlayer(this,a))});return this};f(document).ready(function(){f(".mejs-player").mediaelementplayer()});window.MediaElementPlayer= 108 mejs.MediaElementPlayer})(mejs.$); 109 (function(f){f.extend(mejs.MepDefaults,{playpauseText:"Play/Pause"});f.extend(MediaElementPlayer.prototype,{buildplaypause:function(a,b,c,d){var e=f('<div class="mejs-button mejs-playpause-button mejs-play" ><button type="button" aria-controls="'+this.id+'" title="'+this.options.playpauseText+'"></button></div>').appendTo(b).click(function(g){g.preventDefault();d.paused?d.play():d.pause();return false});d.addEventListener("play",function(){e.removeClass("mejs-play").addClass("mejs-pause")},false); 110 d.addEventListener("playing",function(){e.removeClass("mejs-play").addClass("mejs-pause")},false);d.addEventListener("pause",function(){e.removeClass("mejs-pause").addClass("mejs-play")},false);d.addEventListener("paused",function(){e.removeClass("mejs-pause").addClass("mejs-play")},false)}})})(mejs.$); 111 (function(f){f.extend(mejs.MepDefaults,{stopText:"Stop"});f.extend(MediaElementPlayer.prototype,{buildstop:function(a,b,c,d){f('<div class="mejs-button mejs-stop-button mejs-stop"><button type="button" aria-controls="'+this.id+'" title="'+this.options.stopText+'"></button></div>').appendTo(b).click(function(){d.paused||d.pause();if(d.currentTime>0){d.setCurrentTime(0);d.pause();b.find(".mejs-time-current").width("0px");b.find(".mejs-time-handle").css("left","0px");b.find(".mejs-time-float-current").html(mejs.Utility.secondsToTimeCode(0)); 112 b.find(".mejs-currenttime").html(mejs.Utility.secondsToTimeCode(0));c.find(".mejs-poster").show()}})}})})(mejs.$); 113 (function(f){f.extend(MediaElementPlayer.prototype,{buildprogress:function(a,b,c,d){f('<div class="mejs-time-rail"><span class="mejs-time-total"><span class="mejs-time-buffering"></span><span class="mejs-time-loaded"></span><span class="mejs-time-current"></span><span class="mejs-time-handle"></span><span class="mejs-time-float"><span class="mejs-time-float-current">00:00</span><span class="mejs-time-float-corner"></span></span></span></div>').appendTo(b);b.find(".mejs-time-buffering").hide();var e= 114 this,g=b.find(".mejs-time-total");c=b.find(".mejs-time-loaded");var l=b.find(".mejs-time-current"),j=b.find(".mejs-time-handle"),k=b.find(".mejs-time-float"),s=b.find(".mejs-time-float-current"),p=function(n){n=n.pageX;var h=g.offset(),q=g.outerWidth(true),m=0,o=m=0;if(d.duration){if(n<h.left)n=h.left;else if(n>q+h.left)n=q+h.left;o=n-h.left;m=o/q;m=m<=0.02?0:m*d.duration;r&&m!==d.currentTime&&d.setCurrentTime(m);if(!mejs.MediaFeatures.hasTouch){k.css("left",o);s.html(mejs.Utility.secondsToTimeCode(m)); 115 k.show()}}},r=false;g.bind("mousedown",function(n){if(n.which===1){r=true;p(n);e.globalBind("mousemove.dur",function(h){p(h)});e.globalBind("mouseup.dur",function(){r=false;k.hide();e.globalUnbind(".dur")});return false}}).bind("mouseenter",function(){e.globalBind("mousemove.dur",function(n){p(n)});mejs.MediaFeatures.hasTouch||k.show()}).bind("mouseleave",function(){if(!r){e.globalUnbind(".dur");k.hide()}});d.addEventListener("progress",function(n){a.setProgressRail(n);a.setCurrentRail(n)},false); 116 d.addEventListener("timeupdate",function(n){a.setProgressRail(n);a.setCurrentRail(n)},false);e.loaded=c;e.total=g;e.current=l;e.handle=j},setProgressRail:function(a){var b=a!=undefined?a.target:this.media,c=null;if(b&&b.buffered&&b.buffered.length>0&&b.buffered.end&&b.duration)c=b.buffered.end(0)/b.duration;else if(b&&b.bytesTotal!=undefined&&b.bytesTotal>0&&b.bufferedBytes!=undefined)c=b.bufferedBytes/b.bytesTotal;else if(a&&a.lengthComputable&&a.total!=0)c=a.loaded/a.total;if(c!==null){c=Math.min(1, 117 Math.max(0,c));this.loaded&&this.total&&this.loaded.width(this.total.width()*c)}},setCurrentRail:function(){if(this.media.currentTime!=undefined&&this.media.duration)if(this.total&&this.handle){var a=Math.round(this.total.width()*this.media.currentTime/this.media.duration),b=a-Math.round(this.handle.outerWidth(true)/2);this.current.width(a);this.handle.css("left",b)}}})})(mejs.$); 118 (function(f){f.extend(mejs.MepDefaults,{duration:-1,timeAndDurationSeparator:" <span> | </span> "});f.extend(MediaElementPlayer.prototype,{buildcurrent:function(a,b,c,d){f('<div class="mejs-time"><span class="mejs-currenttime">'+(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00")+"</span></div>").appendTo(b);this.currenttime=this.controls.find(".mejs-currenttime");d.addEventListener("timeupdate",function(){a.updateCurrent()},false)},buildduration:function(a, 119 b,c,d){if(b.children().last().find(".mejs-currenttime").length>0)f(this.options.timeAndDurationSeparator+'<span class="mejs-duration">'+(this.options.duration>0?mejs.Utility.secondsToTimeCode(this.options.duration,this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25):(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00"))+"</span>").appendTo(b.find(".mejs-time"));else{b.find(".mejs-currenttime").parent().addClass("mejs-currenttime-container"); 120 f('<div class="mejs-time mejs-duration-container"><span class="mejs-duration">'+(this.options.duration>0?mejs.Utility.secondsToTimeCode(this.options.duration,this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25):(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00"))+"</span></div>").appendTo(b)}this.durationD=this.controls.find(".mejs-duration");d.addEventListener("timeupdate",function(){a.updateDuration()}, 121 false)},updateCurrent:function(){if(this.currenttime)this.currenttime.html(mejs.Utility.secondsToTimeCode(this.media.currentTime,this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25))},updateDuration:function(){this.container.toggleClass("mejs-long-video",this.media.duration>3600);if(this.durationD&&(this.options.duration>0||this.media.duration))this.durationD.html(mejs.Utility.secondsToTimeCode(this.options.duration>0?this.options.duration: 122 this.media.duration,this.options.alwaysShowHours,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25))}})})(mejs.$); 123 (function(f){f.extend(mejs.MepDefaults,{muteText:"Mute Toggle",hideVolumeOnTouchDevices:true,audioVolume:"horizontal",videoVolume:"vertical"});f.extend(MediaElementPlayer.prototype,{buildvolume:function(a,b,c,d){if(!(mejs.MediaFeatures.hasTouch&&this.options.hideVolumeOnTouchDevices)){var e=this,g=e.isVideo?e.options.videoVolume:e.options.audioVolume,l=g=="horizontal"?f('<div class="mejs-button mejs-volume-button mejs-mute"><button type="button" aria-controls="'+e.id+'" title="'+e.options.muteText+ 124 '"></button></div><div class="mejs-horizontal-volume-slider"><div class="mejs-horizontal-volume-total"></div><div class="mejs-horizontal-volume-current"></div><div class="mejs-horizontal-volume-handle"></div></div>').appendTo(b):f('<div class="mejs-button mejs-volume-button mejs-mute"><button type="button" aria-controls="'+e.id+'" title="'+e.options.muteText+'"></button><div class="mejs-volume-slider"><div class="mejs-volume-total"></div><div class="mejs-volume-current"></div><div class="mejs-volume-handle"></div></div></div>').appendTo(b), 125 j=e.container.find(".mejs-volume-slider, .mejs-horizontal-volume-slider"),k=e.container.find(".mejs-volume-total, .mejs-horizontal-volume-total"),s=e.container.find(".mejs-volume-current, .mejs-horizontal-volume-current"),p=e.container.find(".mejs-volume-handle, .mejs-horizontal-volume-handle"),r=function(m,o){if(!j.is(":visible")&&typeof o=="undefined"){j.show();r(m,true);j.hide()}else{m=Math.max(0,m);m=Math.min(m,1);m==0?l.removeClass("mejs-mute").addClass("mejs-unmute"):l.removeClass("mejs-unmute").addClass("mejs-mute"); 126 if(g=="vertical"){var t=k.height(),u=k.position(),v=t-t*m;p.css("top",Math.round(u.top+v-p.height()/2));s.height(t-v);s.css("top",u.top+v)}else{t=k.width();u=k.position();t=t*m;p.css("left",Math.round(u.left+t-p.width()/2));s.width(Math.round(t))}}},n=function(m){var o=null,t=k.offset();if(g=="vertical"){o=k.height();parseInt(k.css("top").replace(/px/,""),10);o=(o-(m.pageY-t.top))/o;if(t.top==0||t.left==0)return}else{o=k.width();o=(m.pageX-t.left)/o}o=Math.max(0,o);o=Math.min(o,1);r(o);o==0?d.setMuted(true): 127 d.setMuted(false);d.setVolume(o)},h=false,q=false;l.hover(function(){j.show();q=true},function(){q=false;!h&&g=="vertical"&&j.hide()});j.bind("mouseover",function(){q=true}).bind("mousedown",function(m){n(m);e.globalBind("mousemove.vol",function(o){n(o)});e.globalBind("mouseup.vol",function(){h=false;e.globalUnbind(".vol");!q&&g=="vertical"&&j.hide()});h=true;return false});l.find("button").click(function(){d.setMuted(!d.muted)});d.addEventListener("volumechange",function(){if(!h)if(d.muted){r(0); 128 l.removeClass("mejs-mute").addClass("mejs-unmute")}else{r(d.volume);l.removeClass("mejs-unmute").addClass("mejs-mute")}},false);if(e.container.is(":visible")){r(a.options.startVolume);a.options.startVolume===0&&d.setMuted(true);d.pluginType==="native"&&d.setVolume(a.options.startVolume)}}}})})(mejs.$); 129 (function(f){f.extend(mejs.MepDefaults,{usePluginFullScreen:true,newWindowCallback:function(){return""},fullscreenText:mejs.i18n.t("Fullscreen")});f.extend(MediaElementPlayer.prototype,{isFullScreen:false,isNativeFullScreen:false,docStyleOverflow:null,isInIframe:false,buildfullscreen:function(a,b,c,d){if(a.isVideo){a.isInIframe=window.location!=window.parent.location;if(mejs.MediaFeatures.hasTrueNativeFullScreen){c=function(){if(mejs.MediaFeatures.isFullScreen()){a.isNativeFullScreen=true;a.setControlsSize()}else{a.isNativeFullScreen= 130 false;a.exitFullScreen()}};mejs.MediaFeatures.hasMozNativeFullScreen?a.globalBind(mejs.MediaFeatures.fullScreenEventName,c):a.container.bind(mejs.MediaFeatures.fullScreenEventName,c)}var e=this,g=f('<div class="mejs-button mejs-fullscreen-button"><button type="button" aria-controls="'+e.id+'" title="'+e.options.fullscreenText+'"></button></div>').appendTo(b);if(e.media.pluginType==="native"||!e.options.usePluginFullScreen&&!mejs.MediaFeatures.isFirefox)g.click(function(){mejs.MediaFeatures.hasTrueNativeFullScreen&& 131 mejs.MediaFeatures.isFullScreen()||a.isFullScreen?a.exitFullScreen():a.enterFullScreen()});else{var l=null;if(function(){var h=document.createElement("x"),q=document.documentElement,m=window.getComputedStyle;if(!("pointerEvents"in h.style))return false;h.style.pointerEvents="auto";h.style.pointerEvents="x";q.appendChild(h);m=m&&m(h,"").pointerEvents==="auto";q.removeChild(h);return!!m}()&&!mejs.MediaFeatures.isOpera){var j=false,k=function(){if(j){s.hide();p.hide();r.hide();g.css("pointer-events", 132 "");e.controls.css("pointer-events","");j=false}},s=f('<div class="mejs-fullscreen-hover" />').appendTo(e.container).mouseover(k),p=f('<div class="mejs-fullscreen-hover" />').appendTo(e.container).mouseover(k),r=f('<div class="mejs-fullscreen-hover" />').appendTo(e.container).mouseover(k),n=function(){var h={position:"absolute",top:0,left:0};s.css(h);p.css(h);r.css(h);s.width(e.container.width()).height(e.container.height()-e.controls.height());h=g.offset().left-e.container.offset().left;fullScreenBtnWidth= 133 g.outerWidth(true);p.width(h).height(e.controls.height()).css({top:e.container.height()-e.controls.height()});r.width(e.container.width()-h-fullScreenBtnWidth).height(e.controls.height()).css({top:e.container.height()-e.controls.height(),left:h+fullScreenBtnWidth})};e.globalBind("resize",function(){n()});g.mouseover(function(){if(!e.isFullScreen){var h=g.offset(),q=a.container.offset();d.positionFullscreenButton(h.left-q.left,h.top-q.top,false);g.css("pointer-events","none");e.controls.css("pointer-events", 134 "none");s.show();r.show();p.show();n();j=true}});d.addEventListener("fullscreenchange",function(){k()})}else g.mouseover(function(){if(l!==null){clearTimeout(l);delete l}var h=g.offset(),q=a.container.offset();d.positionFullscreenButton(h.left-q.left,h.top-q.top,true)}).mouseout(function(){if(l!==null){clearTimeout(l);delete l}l=setTimeout(function(){d.hideFullscreenButton()},1500)})}a.fullscreenBtn=g;e.globalBind("keydown",function(h){if((mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()|| 135 e.isFullScreen)&&h.keyCode==27)a.exitFullScreen()})}},cleanfullscreen:function(a){a.exitFullScreen()},enterFullScreen:function(){var a=this;if(!(a.media.pluginType!=="native"&&(mejs.MediaFeatures.isFirefox||a.options.usePluginFullScreen))){docStyleOverflow=document.documentElement.style.overflow;document.documentElement.style.overflow="hidden";normalHeight=a.container.height();normalWidth=a.container.width();if(a.media.pluginType==="native")if(mejs.MediaFeatures.hasTrueNativeFullScreen){mejs.MediaFeatures.requestFullScreen(a.container[0]); 136 a.isInIframe&&setTimeout(function c(){if(a.isNativeFullScreen)f(window).width()!==screen.width?a.exitFullScreen():setTimeout(c,500)},500)}else if(mejs.MediaFeatures.hasSemiNativeFullScreen){a.media.webkitEnterFullscreen();return}if(a.isInIframe){var b=a.options.newWindowCallback(this);if(b!=="")if(mejs.MediaFeatures.hasTrueNativeFullScreen)setTimeout(function(){if(!a.isNativeFullScreen){a.pause();window.open(b,a.id,"top=0,left=0,width="+screen.availWidth+",height="+screen.availHeight+",resizable=yes,scrollbars=no,status=no,toolbar=no")}}, 137 250);else{a.pause();window.open(b,a.id,"top=0,left=0,width="+screen.availWidth+",height="+screen.availHeight+",resizable=yes,scrollbars=no,status=no,toolbar=no");return}}a.container.addClass("mejs-container-fullscreen").width("100%").height("100%");setTimeout(function(){a.container.css({width:"100%",height:"100%"});a.setControlsSize()},500);if(a.pluginType==="native")a.$media.width("100%").height("100%");else{a.container.find(".mejs-shim").width("100%").height("100%");a.media.setVideoSize(f(window).width(), 138 f(window).height())}a.layers.children("div").width("100%").height("100%");a.fullscreenBtn&&a.fullscreenBtn.removeClass("mejs-fullscreen").addClass("mejs-unfullscreen");a.setControlsSize();a.isFullScreen=true}},exitFullScreen:function(){if(this.media.pluginType!=="native"&&mejs.MediaFeatures.isFirefox)this.media.setFullscreen(false);else{if(mejs.MediaFeatures.hasTrueNativeFullScreen&&(mejs.MediaFeatures.isFullScreen()||this.isFullScreen))mejs.MediaFeatures.cancelFullScreen();document.documentElement.style.overflow= 139 docStyleOverflow;this.container.removeClass("mejs-container-fullscreen").width(normalWidth).height(normalHeight);if(this.pluginType==="native")this.$media.width(normalWidth).height(normalHeight);else{this.container.find("object embed").width(normalWidth).height(normalHeight);this.media.setVideoSize(normalWidth,normalHeight)}this.layers.children("div").width(normalWidth).height(normalHeight);this.fullscreenBtn.removeClass("mejs-unfullscreen").addClass("mejs-fullscreen");this.setControlsSize();this.isFullScreen= 140 false}}})})(mejs.$); 141 (function(f){f.extend(mejs.MepDefaults,{startLanguage:"",tracksText:"Captions/Subtitles",hideCaptionsButtonWhenEmpty:true,toggleCaptionsButtonWhenOnlyOne:false,slidesSelector:""});f.extend(MediaElementPlayer.prototype,{hasChapters:false,buildtracks:function(a,b,c,d){if(a.isVideo)if(a.tracks.length!=0){a.chapters=f('<div class="mejs-chapters mejs-layer"></div>').prependTo(c).hide();a.captions=f('<div class="mejs-captions-layer mejs-layer"><div class="mejs-captions-position mejs-captions-position-hover"><span class="mejs-captions-text"></span></div></div>').prependTo(c).hide();a.captionsText= 142 a.captions.find(".mejs-captions-text");a.captionsButton=f('<div class="mejs-button mejs-captions-button"><button type="button" aria-controls="'+this.id+'" title="'+this.options.tracksText+'"></button><div class="mejs-captions-selector"><ul><li><input type="radio" name="'+a.id+'_captions" id="'+a.id+'_captions_none" value="none" checked="checked" /><label for="'+a.id+'_captions_none">None</label></li></ul></div></div>').appendTo(b);for(b=c=0;b<a.tracks.length;b++)a.tracks[b].kind=="subtitles"&&c++; 143 this.options.toggleCaptionsButtonWhenOnlyOne&&c==1?a.captionsButton.on("click",function(){a.setTrack(a.selectedTrack==null?a.tracks[0].srclang:"none")}):a.captionsButton.hover(function(){f(this).find(".mejs-captions-selector").css("visibility","visible")},function(){f(this).find(".mejs-captions-selector").css("visibility","hidden")}).on("click","input[type=radio]",function(){lang=this.value;a.setTrack(lang)});a.options.alwaysShowControls?a.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover"): 144 a.container.bind("controlsshown",function(){a.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover")}).bind("controlshidden",function(){d.paused||a.container.find(".mejs-captions-position").removeClass("mejs-captions-position-hover")});a.trackToLoad=-1;a.selectedTrack=null;a.isLoadingTrack=false;for(b=0;b<a.tracks.length;b++)a.tracks[b].kind=="subtitles"&&a.addTrackButton(a.tracks[b].srclang,a.tracks[b].label);a.loadNextTrack();d.addEventListener("timeupdate",function(){a.displayCaptions()}, 145 false);if(a.options.slidesSelector!=""){a.slidesContainer=f(a.options.slidesSelector);d.addEventListener("timeupdate",function(){a.displaySlides()},false)}d.addEventListener("loadedmetadata",function(){a.displayChapters()},false);a.container.hover(function(){if(a.hasChapters){a.chapters.css("visibility","visible");a.chapters.fadeIn(200).height(a.chapters.find(".mejs-chapter").outerHeight())}},function(){a.hasChapters&&!d.paused&&a.chapters.fadeOut(200,function(){f(this).css("visibility","hidden"); 146 f(this).css("display","block")})});a.node.getAttribute("autoplay")!==null&&a.chapters.css("visibility","hidden")}},setTrack:function(a){var b;if(a=="none"){this.selectedTrack=null;this.captionsButton.removeClass("mejs-captions-enabled")}else for(b=0;b<this.tracks.length;b++)if(this.tracks[b].srclang==a){this.selectedTrack==null&&this.captionsButton.addClass("mejs-captions-enabled");this.selectedTrack=this.tracks[b];this.captions.attr("lang",this.selectedTrack.srclang);this.displayCaptions();break}}, 147 loadNextTrack:function(){this.trackToLoad++;if(this.trackToLoad<this.tracks.length){this.isLoadingTrack=true;this.loadTrack(this.trackToLoad)}else{this.isLoadingTrack=false;this.checkForTracks()}},loadTrack:function(a){var b=this,c=b.tracks[a];f.ajax({url:c.src,dataType:"text",success:function(d){c.entries=typeof d=="string"&&/<tt\s+xml/ig.exec(d)?mejs.TrackFormatParser.dfxp.parse(d):mejs.TrackFormatParser.webvvt.parse(d);c.isLoaded=true;b.enableTrackButton(c.srclang,c.label);b.loadNextTrack();c.kind== 148 "chapters"&&b.media.addEventListener("play",function(){b.media.duration>0&&b.displayChapters(c)},false);c.kind=="slides"&&b.setupSlides(c)},error:function(){b.loadNextTrack()}})},enableTrackButton:function(a,b){if(b==="")b=mejs.language.codes[a]||a;this.captionsButton.find("input[value="+a+"]").prop("disabled",false).siblings("label").html(b);this.options.startLanguage==a&&f("#"+this.id+"_captions_"+a).click();this.adjustLanguageBox()},addTrackButton:function(a,b){if(b==="")b=mejs.language.codes[a]|| 149 a;this.captionsButton.find("ul").append(f('<li><input type="radio" name="'+this.id+'_captions" id="'+this.id+"_captions_"+a+'" value="'+a+'" disabled="disabled" /><label for="'+this.id+"_captions_"+a+'">'+b+" (loading)</label></li>"));this.adjustLanguageBox();this.container.find(".mejs-captions-translations option[value="+a+"]").remove()},adjustLanguageBox:function(){this.captionsButton.find(".mejs-captions-selector").height(this.captionsButton.find(".mejs-captions-selector ul").outerHeight(true)+ 150 this.captionsButton.find(".mejs-captions-translations").outerHeight(true))},checkForTracks:function(){var a=false;if(this.options.hideCaptionsButtonWhenEmpty){for(i=0;i<this.tracks.length;i++)if(this.tracks[i].kind=="subtitles"){a=true;break}if(!a){this.captionsButton.hide();this.setControlsSize()}}},displayCaptions:function(){if(typeof this.tracks!="undefined"){var a,b=this.selectedTrack;if(b!=null&&b.isLoaded)for(a=0;a<b.entries.times.length;a++)if(this.media.currentTime>=b.entries.times[a].start&& 151 this.media.currentTime<=b.entries.times[a].stop){this.captionsText.html(b.entries.text[a]);this.captions.show().height(0);return}this.captions.hide()}},setupSlides:function(a){this.slides=a;this.slides.entries.imgs=[this.slides.entries.text.length];this.showSlide(0)},showSlide:function(a){if(!(typeof this.tracks=="undefined"||typeof this.slidesContainer=="undefined")){var b=this,c=b.slides.entries.text[a],d=b.slides.entries.imgs[a];if(typeof d=="undefined"||typeof d.fadeIn=="undefined")b.slides.entries.imgs[a]= 152 d=f('<img src="'+c+'">').on("load",function(){d.appendTo(b.slidesContainer).hide().fadeIn().siblings(":visible").fadeOut()});else if(!d.is(":visible")&&!d.is(":animated")){console.log("showing existing slide");d.fadeIn().siblings(":visible").fadeOut()}}},displaySlides:function(){if(typeof this.slides!="undefined"){var a=this.slides,b;for(b=0;b<a.entries.times.length;b++)if(this.media.currentTime>=a.entries.times[b].start&&this.media.currentTime<=a.entries.times[b].stop){this.showSlide(b);break}}}, 153 displayChapters:function(){var a;for(a=0;a<this.tracks.length;a++)if(this.tracks[a].kind=="chapters"&&this.tracks[a].isLoaded){this.drawChapters(this.tracks[a]);this.hasChapters=true;break}},drawChapters:function(a){var b=this,c,d,e=d=0;b.chapters.empty();for(c=0;c<a.entries.times.length;c++){d=a.entries.times[c].stop-a.entries.times[c].start;d=Math.floor(d/b.media.duration*100);if(d+e>100||c==a.entries.times.length-1&&d+e<100)d=100-e;b.chapters.append(f('<div class="mejs-chapter" rel="'+a.entries.times[c].start+ 154 '" style="left: '+e.toString()+"%;width: "+d.toString()+'%;"><div class="mejs-chapter-block'+(c==a.entries.times.length-1?" mejs-chapter-block-last":"")+'"><span class="ch-title">'+a.entries.text[c]+'</span><span class="ch-time">'+mejs.Utility.secondsToTimeCode(a.entries.times[c].start)+"–"+mejs.Utility.secondsToTimeCode(a.entries.times[c].stop)+"</span></div></div>"));e+=d}b.chapters.find("div.mejs-chapter").click(function(){b.media.setCurrentTime(parseFloat(f(this).attr("rel")));b.media.paused&& 155 b.media.play()});b.chapters.show()}});mejs.language={codes:{af:"Afrikaans",sq:"Albanian",ar:"Arabic",be:"Belarusian",bg:"Bulgarian",ca:"Catalan",zh:"Chinese","zh-cn":"Chinese Simplified","zh-tw":"Chinese Traditional",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch",en:"English",et:"Estonian",tl:"Filipino",fi:"Finnish",fr:"French",gl:"Galician",de:"German",el:"Greek",ht:"Haitian Creole",iw:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",ga:"Irish",it:"Italian",ja:"Japanese",ko:"Korean", 156 lv:"Latvian",lt:"Lithuanian",mk:"Macedonian",ms:"Malay",mt:"Maltese",no:"Norwegian",fa:"Persian",pl:"Polish",pt:"Portuguese",ro:"Romanian",ru:"Russian",sr:"Serbian",sk:"Slovak",sl:"Slovenian",es:"Spanish",sw:"Swahili",sv:"Swedish",tl:"Tagalog",th:"Thai",tr:"Turkish",uk:"Ukrainian",vi:"Vietnamese",cy:"Welsh",yi:"Yiddish"}};mejs.TrackFormatParser={webvvt:{pattern_identifier:/^([a-zA-z]+-)?[0-9]+$/,pattern_timecode:/^([0-9]{2}:[0-9]{2}:[0-9]{2}([,.][0-9]{1,3})?) --\> ([0-9]{2}:[0-9]{2}:[0-9]{2}([,.][0-9]{3})?)(.*)$/, 157 parse:function(a){var b=0;a=mejs.TrackFormatParser.split2(a,/\r?\n/);for(var c={text:[],times:[]},d,e;b<a.length;b++)if(this.pattern_identifier.exec(a[b])){b++;if((d=this.pattern_timecode.exec(a[b]))&&b<a.length){b++;e=a[b];for(b++;a[b]!==""&&b<a.length;){e=e+"\n"+a[b];b++}e=f.trim(e).replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig,"<a href='$1' target='_blank'>$1</a>");c.text.push(e);c.times.push({start:mejs.Utility.convertSMPTEtoSeconds(d[1])==0?0.2:mejs.Utility.convertSMPTEtoSeconds(d[1]), 158 stop:mejs.Utility.convertSMPTEtoSeconds(d[3]),settings:d[5]})}}return c}},dfxp:{parse:function(a){a=f(a).filter("tt");var b=0;b=a.children("div").eq(0);var c=b.find("p");b=a.find("#"+b.attr("style"));var d,e;a={text:[],times:[]};if(b.length){e=b.removeAttr("id").get(0).attributes;if(e.length){d={};for(b=0;b<e.length;b++)d[e[b].name.split(":")[1]]=e[b].value}}for(b=0;b<c.length;b++){var g;e={start:null,stop:null,style:null};if(c.eq(b).attr("begin"))e.start=mejs.Utility.convertSMPTEtoSeconds(c.eq(b).attr("begin")); 159 if(!e.start&&c.eq(b-1).attr("end"))e.start=mejs.Utility.convertSMPTEtoSeconds(c.eq(b-1).attr("end"));if(c.eq(b).attr("end"))e.stop=mejs.Utility.convertSMPTEtoSeconds(c.eq(b).attr("end"));if(!e.stop&&c.eq(b+1).attr("begin"))e.stop=mejs.Utility.convertSMPTEtoSeconds(c.eq(b+1).attr("begin"));if(d){g="";for(var l in d)g+=l+":"+d[l]+";"}if(g)e.style=g;if(e.start==0)e.start=0.2;a.times.push(e);e=f.trim(c.eq(b).html()).replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig, 160 "<a href='$1' target='_blank'>$1</a>");a.text.push(e);if(a.times.start==0)a.times.start=2}return a}},split2:function(a,b){return a.split(b)}};if("x\n\ny".split(/\n/gi).length!=3)mejs.TrackFormatParser.split2=function(a,b){var c=[],d="",e;for(e=0;e<a.length;e++){d+=a.substring(e,e+1);if(b.test(d)){c.push(d.replace(b,""));d=""}}c.push(d);return c}})(mejs.$); 161 (function(f){f.extend(mejs.MepDefaults,{contextMenuItems:[{render:function(a){if(typeof a.enterFullScreen=="undefined")return null;return a.isFullScreen?"Turn off Fullscreen":"Go Fullscreen"},click:function(a){a.isFullScreen?a.exitFullScreen():a.enterFullScreen()}},{render:function(a){return a.media.muted?"Unmute":"Mute"},click:function(a){a.media.muted?a.setMuted(false):a.setMuted(true)}},{isSeparator:true},{render:function(){return"Download Video"},click:function(a){window.location.href=a.media.currentSrc}}]}); 162 f.extend(MediaElementPlayer.prototype,{buildcontextmenu:function(a){a.contextMenu=f('<div class="mejs-contextmenu"></div>').appendTo(f("body")).hide();a.container.bind("contextmenu",function(b){if(a.isContextMenuEnabled){b.preventDefault();a.renderContextMenu(b.clientX-1,b.clientY-1);return false}});a.container.bind("click",function(){a.contextMenu.hide()});a.contextMenu.bind("mouseleave",function(){a.startContextMenuTimer()})},cleancontextmenu:function(a){a.contextMenu.remove()},isContextMenuEnabled:true, 163 enableContextMenu:function(){this.isContextMenuEnabled=true},disableContextMenu:function(){this.isContextMenuEnabled=false},contextMenuTimeout:null,startContextMenuTimer:function(){var a=this;a.killContextMenuTimer();a.contextMenuTimer=setTimeout(function(){a.hideContextMenu();a.killContextMenuTimer()},750)},killContextMenuTimer:function(){var a=this.contextMenuTimer;if(a!=null){clearTimeout(a);delete a}},hideContextMenu:function(){this.contextMenu.hide()},renderContextMenu:function(a,b){for(var c= 164 this,d="",e=c.options.contextMenuItems,g=0,l=e.length;g<l;g++)if(e[g].isSeparator)d+='<div class="mejs-contextmenu-separator"></div>';else{var j=e[g].render(c);if(j!=null)d+='<div class="mejs-contextmenu-item" data-itemindex="'+g+'" id="element-'+Math.random()*1E6+'">'+j+"</div>"}c.contextMenu.empty().append(f(d)).css({top:b,left:a}).show();c.contextMenu.find(".mejs-contextmenu-item").each(function(){var k=f(this),s=parseInt(k.data("itemindex"),10),p=c.options.contextMenuItems[s];typeof p.show!="undefined"&& 165 p.show(k,c);k.click(function(){typeof p.click!="undefined"&&p.click(c);c.contextMenu.hide()})});setTimeout(function(){c.killControlsTimer("rev3")},100)}})})(mejs.$); 166 (function(f){f.extend(mejs.MepDefaults,{postrollCloseText:mejs.i18n.t("Close")});f.extend(MediaElementPlayer.prototype,{buildpostroll:function(a,b,c){var d=this.container.find('link[rel="postroll"]').attr("href");if(typeof d!=="undefined"){a.postroll=f('<div class="mejs-postroll-layer mejs-layer"><a class="mejs-postroll-close" onclick="$(this).parent().hide();return false;">'+this.options.postrollCloseText+'</a><div class="mejs-postroll-layer-content"></div></div>').prependTo(c).hide();this.media.addEventListener("ended", 167 function(){f.ajax({dataType:"html",url:d,success:function(e){c.find(".mejs-postroll-layer-content").html(e)}});a.postroll.show()},false)}}})})(mejs.$); 168 -
wp-includes/js/mediaelement/mediaelementplayer.css
diff --git wp-includes/js/mediaelement/mediaelementplayer.css wp-includes/js/mediaelement/mediaelementplayer.css index 5516294..620942c 100644
76 76 margin: -50px 0 0 -50px; 77 77 background: url(bigplay.svg) no-repeat; 78 78 } 79 .no-svg .mejs-overlay-button { 79 .no-svg .mejs-overlay-button { 80 80 background-image: url(bigplay.png); 81 81 } 82 82 .mejs-overlay:hover .mejs-overlay-button { … … 120 120 background: url(background.png); 121 121 background: rgba(0, 0, 0, 0.7); 122 122 background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(50,50,50,0.7)), to(rgba(0,0,0,0.7))); 123 background: -webkit-linear-gradient(top, rgba(50,50,50,0.7), rgba(0,0,0,0.7)); 123 background: -webkit-linear-gradient(top, rgba(50,50,50,0.7), rgba(0,0,0,0.7)); 124 124 background: -moz-linear-gradient(top, rgba(50,50,50,0.7), rgba(0,0,0,0.7)); 125 background: -o-linear-gradient(top, rgba(50,50,50,0.7), rgba(0,0,0,0.7)); 126 background: -ms-linear-gradient(top, rgba(50,50,50,0.7), rgba(0,0,0,0.7)); 127 background: linear-gradient(rgba(50,50,50,0.7), rgba(0,0,0,0.7)); 125 background: -o-linear-gradient(top, rgba(50,50,50,0.7), rgba(0,0,0,0.7)); 126 background: -ms-linear-gradient(top, rgba(50,50,50,0.7), rgba(0,0,0,0.7)); 127 background: linear-gradient(rgba(50,50,50,0.7), rgba(0,0,0,0.7)); 128 128 height: 30px; 129 129 width: 100%; 130 130 } … … 159 159 background: transparent url(controls.svg) no-repeat; 160 160 } 161 161 162 .no-svg .mejs-controls .mejs-button button { 162 .no-svg .mejs-controls .mejs-button button { 163 163 background-image: url(controls.png); 164 164 } 165 165 … … 232 232 background: #333; 233 233 background: rgba(50,50,50,0.8); 234 234 background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(30,30,30,0.8)), to(rgba(60,60,60,0.8))); 235 background: -webkit-linear-gradient(top, rgba(30,30,30,0.8), rgba(60,60,60,0.8)); 235 background: -webkit-linear-gradient(top, rgba(30,30,30,0.8), rgba(60,60,60,0.8)); 236 236 background: -moz-linear-gradient(top, rgba(30,30,30,0.8), rgba(60,60,60,0.8)); 237 237 background: -o-linear-gradient(top, rgba(30,30,30,0.8), rgba(60,60,60,0.8)); 238 238 background: -ms-linear-gradient(top, rgba(30,30,30,0.8), rgba(60,60,60,0.8)); … … 266 266 .mejs-controls .mejs-time-rail .mejs-time-loaded { 267 267 background: #3caac8; 268 268 background: rgba(60,170,200,0.8); 269 background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(44,124,145,0.8)), to(rgba(78,183,212,0.8))); 269 background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(44,124,145,0.8)), to(rgba(78,183,212,0.8))); 270 270 background: -webkit-linear-gradient(top, rgba(44,124,145,0.8), rgba(78,183,212,0.8)); 271 271 background: -moz-linear-gradient(top, rgba(44,124,145,0.8), rgba(78,183,212,0.8)); 272 272 background: -o-linear-gradient(top, rgba(44,124,145,0.8), rgba(78,183,212,0.8)); … … 280 280 background: rgba(255,255,255,0.8); 281 281 background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(255,255,255,0.9)), to(rgba(200,200,200,0.8))); 282 282 background: -webkit-linear-gradient(top, rgba(255,255,255,0.9), rgba(200,200,200,0.8)); 283 background: -moz-linear-gradient(top, rgba(255,255,255,0.9), rgba(200,200,200,0.8)); 283 background: -moz-linear-gradient(top, rgba(255,255,255,0.9), rgba(200,200,200,0.8)); 284 284 background: -o-linear-gradient(top, rgba(255,255,255,0.9), rgba(200,200,200,0.8)); 285 285 background: -ms-linear-gradient(top, rgba(255,255,255,0.9), rgba(200,200,200,0.8)); 286 286 background: linear-gradient(rgba(255,255,255,0.9), rgba(200,200,200,0.8)); … … 321 321 text-align: center; 322 322 left: 0; 323 323 } 324 324 325 .mejs-controls .mejs-time-rail .mejs-time-float-corner { 325 326 position: absolute; 326 327 display: block; … … 334 335 border-radius: 0; 335 336 top: 15px; 336 337 left: 13px; 338 } 337 339 340 .mejs-long-video .mejs-controls .mejs-time-rail .mejs-time-float { 341 width: 48px; 338 342 } 339 343 344 .mejs-long-video .mejs-controls .mejs-time-rail .mejs-time-float-current { 345 width: 44px; 346 } 347 348 .mejs-long-video .mejs-controls .mejs-time-rail .mejs-time-float-corner { 349 left: 18px; 350 } 340 351 341 352 342 353 … … 454 465 margin: 0; 455 466 padding: 0; 456 467 font-size: 1px; 457 468 458 469 -webkit-border-radius: 2px; 459 470 -moz-border-radius: 2px; 460 border-radius: 2px; 471 border-radius: 2px; 461 472 462 473 background: #333; 463 474 background: rgba(50,50,50,0.8); 464 475 background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(30,30,30,0.8)), to(rgba(60,60,60,0.8))); 465 background: -webkit-linear-gradient(top, rgba(30,30,30,0.8), rgba(60,60,60,0.8)); 476 background: -webkit-linear-gradient(top, rgba(30,30,30,0.8), rgba(60,60,60,0.8)); 466 477 background: -moz-linear-gradient(top, rgba(30,30,30,0.8), rgba(60,60,60,0.8)); 467 478 background: -o-linear-gradient(top, rgba(30,30,30,0.8), rgba(60,60,60,0.8)); 468 479 background: -ms-linear-gradient(top, rgba(30,30,30,0.8), rgba(60,60,60,0.8)); … … 488 499 background: rgba(255,255,255,0.8); 489 500 background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(255,255,255,0.9)), to(rgba(200,200,200,0.8))); 490 501 background: -webkit-linear-gradient(top, rgba(255,255,255,0.9), rgba(200,200,200,0.8)); 491 background: -moz-linear-gradient(top, rgba(255,255,255,0.9), rgba(200,200,200,0.8)); 502 background: -moz-linear-gradient(top, rgba(255,255,255,0.9), rgba(200,200,200,0.8)); 492 503 background: -o-linear-gradient(top, rgba(255,255,255,0.9), rgba(200,200,200,0.8)); 493 504 background: -ms-linear-gradient(top, rgba(255,255,255,0.9), rgba(200,200,200,0.8)); 494 505 background: linear-gradient(rgba(255,255,255,0.9), rgba(200,200,200,0.8)); … … 588 599 background: -moz-linear-gradient(top, rgba(50,50,50,0.7), rgba(0,0,0,0.7)); 589 600 background: -o-linear-gradient(top, rgba(50,50,50,0.7), rgba(0,0,0,0.7)); 590 601 background: -ms-linear-gradient(top, rgba(50,50,50,0.7), rgba(0,0,0,0.7)); 591 background: linear-gradient(rgba(50,50,50,0.7), rgba(0,0,0,0.7)); 592 filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, startColorstr=#323232,endColorstr=#000000); 602 background: linear-gradient(rgba(50,50,50,0.7), rgba(0,0,0,0.7)); 603 filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, startColorstr=#323232,endColorstr=#000000); 593 604 overflow: hidden; 594 605 border: 0; 595 606 } … … 616 627 background: -o-linear-gradient(top, rgba(102,102,102,0.7), rgba(50,50,50,0.6)); 617 628 background: -ms-linear-gradient(top, rgba(102,102,102,0.7), rgba(50,50,50,0.6)); 618 629 background: linear-gradient(rgba(102,102,102,0.7), rgba(50,50,50,0.6)); 619 filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, startColorstr=#666666,endColorstr=#323232); 630 filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, startColorstr=#666666,endColorstr=#323232); 620 631 } 621 632 .mejs-chapters .mejs-chapter .mejs-chapter-block .ch-title { 622 633 font-size: 12px; … … 737 748 height: 1px; 738 749 font-size: 0; 739 750 margin: 5px 6px; 740 background: #333; 751 background: #333; 741 752 } 742 753 743 754 .mejs-contextmenu .mejs-contextmenu-item { … … 745 756 font-size: 12px; 746 757 padding: 4px 6px; 747 758 cursor: pointer; 748 color: #333; 759 color: #333; 749 760 } 750 761 .mejs-contextmenu .mejs-contextmenu-item:hover { 751 762 background: #2C7C91; -
wp-includes/js/mediaelement/mediaelementplayer.min.css
diff --git wp-includes/js/mediaelement/mediaelementplayer.min.css wp-includes/js/mediaelement/mediaelementplayer.min.css index 115e186..dfc1910 100644
1 .mejs-container{position:relative;background:#000;font-family:Helvetica,Arial;text-align:left;vertical-align:top;text-indent:0 }.me-plugin{position:absolute}.mejs-embed,.mejs-embed body{width:100%;height:100%;margin:0;padding:0;background:#000;overflow:hidden}.mejs-container-fullscreen{position:fixed;left:0;top:0;right:0;bottom:0;overflow:hidden;z-index:1000}.mejs-container-fullscreen .mejs-mediaelement,.mejs-container-fullscreen video{width:100%;height:100%}.mejs-background{position:absolute;top:0;left:0}.mejs-mediaelement{position:absolute;top:0;left:0;width:100%;height:100%}.mejs-poster{position:absolute;top:0;left:0}.mejs-poster img{border:0;padding:0;border:0;display:block}.mejs-overlay{position:absolute;top:0;left:0}.mejs-overlay-play{cursor:pointer}.mejs-overlay-button{position:absolute;top:50%;left:50%;width:100px;height:100px;margin:-50px 0 0 -50px;background:url(bigplay.svg) no-repeat}.no-svg .mejs-overlay-button{background-image:url(bigplay.png)}.mejs-overlay:hover .mejs-overlay-button{background-position:0 -100px}.mejs-overlay-loading{position:absolute;top:50%;left:50%;width:80px;height:80px;margin:-40px 0 0 -40px;background:#333;background:url(background.png);background:rgba(0,0,0,0.9);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(50,50,50,0.9)),to(rgba(0,0,0,0.9)));background:-webkit-linear-gradient(top,rgba(50,50,50,0.9),rgba(0,0,0,0.9));background:-moz-linear-gradient(top,rgba(50,50,50,0.9),rgba(0,0,0,0.9));background:-o-linear-gradient(top,rgba(50,50,50,0.9),rgba(0,0,0,0.9));background:-ms-linear-gradient(top,rgba(50,50,50,0.9),rgba(0,0,0,0.9));background:linear-gradient(rgba(50,50,50,0.9),rgba(0,0,0,0.9))}.mejs-overlay-loading span{display:block;width:80px;height:80px;background:transparent url(loading.gif) 50% 50% no-repeat}.mejs-container .mejs-controls{position:absolute;background:0;list-style-type:none;margin:0;padding:0;bottom:0;left:0;background:url(background.png);background:rgba(0,0,0,0.7);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(50,50,50,0.7)),to(rgba(0,0,0,0.7)));background:-webkit-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-moz-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-o-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-ms-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:linear-gradient(rgba(50,50,50,0.7),rgba(0,0,0,0.7));height:30px;width:100%}.mejs-container .mejs-controls div{list-style-type:none;background-image:none;display:block;float:left;margin:0;padding:0;width:26px;height:26px;font-size:11px;line-height:11px;background:0;font-family:Helvetica,Arial;border:0}.mejs-controls .mejs-button button{cursor:pointer;display:block;font-size:0;line-height:0;text-decoration:none;margin:7px 5px;padding:0;position:absolute;height:16px;width:16px;border:0;background:transparent url(controls.svg) no-repeat}.no-svg .mejs-controls .mejs-button button{background-image:url(controls.png)}.mejs-controls .mejs-button button:focus{outline:solid 1px yellow}.mejs-container .mejs-controls .mejs-time{color:#fff;display:block;height:17px;width:auto;padding:8px 3px 0 3px;overflow:hidden;text-align:center;padding:auto 4px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}.mejs-container .mejs-controls .mejs-time span{font-size:11px;color:#fff;line-height:12px;display:block;float:left;margin:1px 2px 0 0;width:auto}.mejs-controls .mejs-play button{background-position:0 0}.mejs-controls .mejs-pause button{background-position:0 -16px}.mejs-controls .mejs-stop button{background-position:-112px 0}.mejs-controls div.mejs-time-rail{width:200px;padding-top:5px}.mejs-controls .mejs-time-rail span{display:block;position:absolute;width:180px;height:10px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;cursor:pointer}.mejs-controls .mejs-time-rail .mejs-time-total{margin:5px;background:#333;background:rgba(50,50,50,0.8);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(30,30,30,0.8)),to(rgba(60,60,60,0.8)));background:-webkit-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-moz-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-o-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-ms-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:linear-gradient(rgba(30,30,30,0.8),rgba(60,60,60,0.8))}.mejs-controls .mejs-time-rail .mejs-time-buffering{width:100%;background-image:-o-linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-ms-linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);-webkit-background-size:15px 15px;-moz-background-size:15px 15px;-o-background-size:15px 15px;background-size:15px 15px;-webkit-animation:buffering-stripes 2s linear infinite;-moz-animation:buffering-stripes 2s linear infinite;-ms-animation:buffering-stripes 2s linear infinite;-o-animation:buffering-stripes 2s linear infinite;animation:buffering-stripes 2s linear infinite}@-webkit-keyframes buffering-stripes{from{background-position:0 0}to{background-position:30px 0}}@-moz-keyframes buffering-stripes{from{background-position:0 0}to{background-position:30px 0}}@-ms-keyframes buffering-stripes{from{background-position:0 0}to{background-position:30px 0}}@-o-keyframes buffering-stripes{from{background-position:0 0}to{background-position:30px 0}}@keyframes buffering-stripes{from{background-position:0 0}to{background-position:30px 0}}.mejs-controls .mejs-time-rail .mejs-time-loaded{background:#3caac8;background:rgba(60,170,200,0.8);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(44,124,145,0.8)),to(rgba(78,183,212,0.8)));background:-webkit-linear-gradient(top,rgba(44,124,145,0.8),rgba(78,183,212,0.8));background:-moz-linear-gradient(top,rgba(44,124,145,0.8),rgba(78,183,212,0.8));background:-o-linear-gradient(top,rgba(44,124,145,0.8),rgba(78,183,212,0.8));background:-ms-linear-gradient(top,rgba(44,124,145,0.8),rgba(78,183,212,0.8));background:linear-gradient(rgba(44,124,145,0.8),rgba(78,183,212,0.8));width:0}.mejs-controls .mejs-time-rail .mejs-time-current{width:0;background:#fff;background:rgba(255,255,255,0.8);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(255,255,255,0.9)),to(rgba(200,200,200,0.8)));background:-webkit-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-moz-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-o-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-ms-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:linear-gradient(rgba(255,255,255,0.9),rgba(200,200,200,0.8))}.mejs-controls .mejs-time-rail .mejs-time-handle{display:none;position:absolute;margin:0;width:10px;background:#fff;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;cursor:pointer;border:solid 2px #333;top:-2px;text-align:center}.mejs-controls .mejs-time-rail .mejs-time-float{position:absolute;display:none;background:#eee;width:36px;height:17px;border:solid 1px #333;top:-26px;margin-left:-18px;text-align:center;color:#111}.mejs-controls .mejs-time-rail .mejs-time-float-current{margin:2px;width:30px;display:block;text-align:center;left:0}.mejs-controls .mejs-time-rail .mejs-time-float-corner{position:absolute;display:block;width:0;height:0;line-height:0;border:solid 5px #eee;border-color:#eee transparent transparent transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;top:15px;left:13px}.mejs-controls .mejs-fullscreen-button button{background-position:-32px 0}.mejs-controls .mejs-unfullscreen button{background-position:-32px -16px}.mejs-controls .mejs-mute button{background-position:-16px -16px}.mejs-controls .mejs-unmute button{background-position:-16px 0}.mejs-controls .mejs-volume-button{position:relative}.mejs-controls .mejs-volume-button .mejs-volume-slider{display:none;height:115px;width:25px;background:url(background.png);background:rgba(50,50,50,0.7);-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;top:-115px;left:0;z-index:1;position:absolute;margin:0}.mejs-controls .mejs-volume-button:hover{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-total{position:absolute;left:11px;top:8px;width:2px;height:100px;background:#ddd;background:rgba(255,255,255,0.5);margin:0}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-current{position:absolute;left:11px;top:8px;width:2px;height:100px;background:#ddd;background:rgba(255,255,255,0.9);margin:0}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-handle{position:absolute;left:4px;top:-3px;width:16px;height:6px;background:#ddd;background:rgba(255,255,255,0.9);cursor:N-resize;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;margin:0}.mejs-controls div.mejs-horizontal-volume-slider{height:26px;width:60px;position:relative}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total{position:absolute;left:0;top:11px;width:50px;height:8px;margin:0;padding:0;font-size:1px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;background:#333;background:rgba(50,50,50,0.8);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(30,30,30,0.8)),to(rgba(60,60,60,0.8)));background:-webkit-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-moz-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-o-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-ms-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:linear-gradient(rgba(30,30,30,0.8),rgba(60,60,60,0.8))}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current{position:absolute;left:0;top:11px;width:50px;height:8px;margin:0;padding:0;font-size:1px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;background:#fff;background:rgba(255,255,255,0.8);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(255,255,255,0.9)),to(rgba(200,200,200,0.8)));background:-webkit-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-moz-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-o-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-ms-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:linear-gradient(rgba(255,255,255,0.9),rgba(200,200,200,0.8))}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-handle{display:none}.mejs-controls .mejs-captions-button{position:relative}.mejs-controls .mejs-captions-button button{background-position:-48px 0}.mejs-controls .mejs-captions-button .mejs-captions-selector{visibility:hidden;position:absolute;bottom:26px;right:-10px;width:130px;height:100px;background:url(background.png);background:rgba(50,50,50,0.7);border:solid 1px transparent;padding:10px;overflow:hidden;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mejs-controls .mejs-captions-button .mejs-captions-selector ul{margin:0;padding:0;display:block;list-style-type:none!important;overflow:hidden}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li{margin:0 0 6px 0;padding:0;list-style-type:none!important;display:block;color:#fff;overflow:hidden}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li input{clear:both;float:left;margin:3px 3px 0 5px}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li label{width:100px;float:left;padding:4px 0 0 0;line-height:15px;font-family:helvetica,arial;font-size:10px}.mejs-controls .mejs-captions-button .mejs-captions-translations{font-size:10px;margin:0 0 5px 0}.mejs-chapters{position:absolute;top:0;left:0;-xborder-right:solid 1px #fff;width:10000px;z-index:1}.mejs-chapters .mejs-chapter{position:absolute;float:left;background:#222;background:rgba(0,0,0,0.7);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(50,50,50,0.7)),to(rgba(0,0,0,0.7)));background:-webkit-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-moz-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-o-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-ms-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:linear-gradient(rgba(50,50,50,0.7),rgba(0,0,0,0.7));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,startColorstr=#323232,endColorstr=#000000);overflow:hidden;border:0}.mejs-chapters .mejs-chapter .mejs-chapter-block{font-size:11px;color:#fff;padding:5px;display:block;border-right:solid 1px #333;border-bottom:solid 1px #333;cursor:pointer}.mejs-chapters .mejs-chapter .mejs-chapter-block-last{border-right:0}.mejs-chapters .mejs-chapter .mejs-chapter-block:hover{background:#666;background:rgba(102,102,102,0.7);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(102,102,102,0.7)),to(rgba(50,50,50,0.6)));background:-webkit-linear-gradient(top,rgba(102,102,102,0.7),rgba(50,50,50,0.6));background:-moz-linear-gradient(top,rgba(102,102,102,0.7),rgba(50,50,50,0.6));background:-o-linear-gradient(top,rgba(102,102,102,0.7),rgba(50,50,50,0.6));background:-ms-linear-gradient(top,rgba(102,102,102,0.7),rgba(50,50,50,0.6));background:linear-gradient(rgba(102,102,102,0.7),rgba(50,50,50,0.6));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,startColorstr=#666666,endColorstr=#323232)}.mejs-chapters .mejs-chapter .mejs-chapter-block .ch-title{font-size:12px;font-weight:bold;display:block;white-space:nowrap;text-overflow:ellipsis;margin:0 0 3px 0;line-height:12px}.mejs-chapters .mejs-chapter .mejs-chapter-block .ch-timespan{font-size:12px;line-height:12px;margin:3px 0 4px 0;display:block;white-space:nowrap;text-overflow:ellipsis}.mejs-captions-layer{position:absolute;bottom:0;left:0;text-align:center;line-height:22px;font-size:12px;color:#fff}.mejs-captions-layer a{color:#fff;text-decoration:underline}.mejs-captions-layer[lang=ar]{font-size:20px;font-weight:normal}.mejs-captions-position{position:absolute;width:100%;bottom:15px;left:0}.mejs-captions-position-hover{bottom:45px}.mejs-captions-text{padding:3px 5px;background:url(background.png);background:rgba(20,20,20,0.8)}.mejs-clear{clear:both}.me-cannotplay a{color:#fff;font-weight:bold}.me-cannotplay span{padding:15px;display:block}.mejs-controls .mejs-loop-off button{background-position:-64px -16px}.mejs-controls .mejs-loop-on button{background-position:-64px 0}.mejs-controls .mejs-backlight-off button{background-position:-80px -16px}.mejs-controls .mejs-backlight-on button{background-position:-80px 0}.mejs-controls .mejs-picturecontrols-button{background-position:-96px 0}.mejs-contextmenu{position:absolute;width:150px;padding:10px;border-radius:4px;top:0;left:0;background:#fff;border:solid 1px #999;z-index:1001}.mejs-contextmenu .mejs-contextmenu-separator{height:1px;font-size:0;margin:5px 6px;background:#333}.mejs-contextmenu .mejs-contextmenu-item{font-family:Helvetica,Arial;font-size:12px;padding:4px 6px;cursor:pointer;color:#333}.mejs-contextmenu .mejs-contextmenu-item:hover{background:#2c7c91;color:#fff}.mejs-controls .mejs-sourcechooser-button{position:relative}.mejs-controls .mejs-sourcechooser-button button{background-position:-128px 0}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector{visibility:hidden;position:absolute;bottom:26px;right:-10px;width:130px;height:100px;background:url(background.png);background:rgba(50,50,50,0.7);border:solid 1px transparent;padding:10px;overflow:hidden;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul{margin:0;padding:0;display:block;list-style-type:none!important;overflow:hidden}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul li{margin:0 0 6px 0;padding:0;list-style-type:none!important;display:block;color:#fff;overflow:hidden}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul li input{clear:both;float:left;margin:3px 3px 0 5px}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul li label{width:100px;float:left;padding:4px 0 0 0;line-height:15px;font-family:helvetica,arial;font-size:10px}.mejs-postroll-layer{position:absolute;bottom:0;left:0;width:100%;height:100%;background:url(background.png);background:rgba(50,50,50,0.7);z-index:1000;overflow:hidden}.mejs-postroll-layer-content{width:100%;height:100%}.mejs-postroll-close{position:absolute;right:0;top:0;background:url(background.png);background:rgba(50,50,50,0.7);color:#fff;padding:4px;z-index:100;cursor:pointer}2 No newline at end of file 1 .mejs-container{position:relative;background:#000;font-family:Helvetica,Arial;text-align:left;vertical-align:top;text-indent:0;}.me-plugin{position:absolute;}.mejs-embed,.mejs-embed body{width:100%;height:100%;margin:0;padding:0;background:#000;overflow:hidden;}.mejs-container-fullscreen{position:fixed;left:0;top:0;right:0;bottom:0;overflow:hidden;z-index:1000;}.mejs-container-fullscreen .mejs-mediaelement,.mejs-container-fullscreen video{width:100%;height:100%;}.mejs-background{position:absolute;top:0;left:0;}.mejs-mediaelement{position:absolute;top:0;left:0;width:100%;height:100%;}.mejs-poster{position:absolute;top:0;left:0;}.mejs-poster img{border:0;padding:0;border:0;display:block;}.mejs-overlay{position:absolute;top:0;left:0;}.mejs-overlay-play{cursor:pointer;}.mejs-overlay-button{position:absolute;top:50%;left:50%;width:100px;height:100px;margin:-50px 0 0 -50px;background:url(bigplay.svg) no-repeat;}.no-svg .mejs-overlay-button{background-image:url(bigplay.png);}.mejs-overlay:hover .mejs-overlay-button{background-position:0 -100px;}.mejs-overlay-loading{position:absolute;top:50%;left:50%;width:80px;height:80px;margin:-40px 0 0 -40px;background:#333;background:url(background.png);background:rgba(0,0,0,0.9);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(50,50,50,0.9)),to(rgba(0,0,0,0.9)));background:-webkit-linear-gradient(top,rgba(50,50,50,0.9),rgba(0,0,0,0.9));background:-moz-linear-gradient(top,rgba(50,50,50,0.9),rgba(0,0,0,0.9));background:-o-linear-gradient(top,rgba(50,50,50,0.9),rgba(0,0,0,0.9));background:-ms-linear-gradient(top,rgba(50,50,50,0.9),rgba(0,0,0,0.9));background:linear-gradient(rgba(50,50,50,0.9),rgba(0,0,0,0.9));}.mejs-overlay-loading span{display:block;width:80px;height:80px;background:transparent url(loading.gif) 50% 50% no-repeat;}.mejs-container .mejs-controls{position:absolute;background:none;list-style-type:none;margin:0;padding:0;bottom:0;left:0;background:url(background.png);background:rgba(0,0,0,0.7);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(50,50,50,0.7)),to(rgba(0,0,0,0.7)));background:-webkit-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-moz-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-o-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-ms-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:linear-gradient(rgba(50,50,50,0.7),rgba(0,0,0,0.7));height:30px;width:100%;}.mejs-container .mejs-controls div{list-style-type:none;background-image:none;display:block;float:left;margin:0;padding:0;width:26px;height:26px;font-size:11px;line-height:11px;background:0;font-family:Helvetica,Arial;border:0;}.mejs-controls .mejs-button button{cursor:pointer;display:block;font-size:0;line-height:0;text-decoration:none;margin:7px 5px;padding:0;position:absolute;height:16px;width:16px;border:0;background:transparent url(controls.svg) no-repeat;}.no-svg .mejs-controls .mejs-button button{background-image:url(controls.png);}.mejs-controls .mejs-button button:focus{outline:solid 1px yellow;}.mejs-container .mejs-controls .mejs-time{color:#fff;display:block;height:17px;width:auto;padding:8px 3px 0 3px;overflow:hidden;text-align:center;padding:auto 4px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;}.mejs-container .mejs-controls .mejs-time span{font-size:11px;color:#fff;line-height:12px;display:block;float:left;margin:1px 2px 0 0;width:auto;}.mejs-controls .mejs-play button{background-position:0 0;}.mejs-controls .mejs-pause button{background-position:0 -16px;}.mejs-controls .mejs-stop button{background-position:-112px 0;}.mejs-controls div.mejs-time-rail{width:200px;padding-top:5px;}.mejs-controls .mejs-time-rail span{display:block;position:absolute;width:180px;height:10px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;cursor:pointer;}.mejs-controls .mejs-time-rail .mejs-time-total{margin:5px;background:#333;background:rgba(50,50,50,0.8);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(30,30,30,0.8)),to(rgba(60,60,60,0.8)));background:-webkit-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-moz-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-o-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-ms-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:linear-gradient(rgba(30,30,30,0.8),rgba(60,60,60,0.8));}.mejs-controls .mejs-time-rail .mejs-time-buffering{width:100%;background-image:-o-linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-ms-linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);-webkit-background-size:15px 15px;-moz-background-size:15px 15px;-o-background-size:15px 15px;background-size:15px 15px;-webkit-animation:buffering-stripes 2s linear infinite;-moz-animation:buffering-stripes 2s linear infinite;-ms-animation:buffering-stripes 2s linear infinite;-o-animation:buffering-stripes 2s linear infinite;animation:buffering-stripes 2s linear infinite;}@-webkit-keyframes buffering-stripes{from{background-position:0 0;}to{background-position:30px 0;}}@-moz-keyframes buffering-stripes{from{background-position:0 0;}to{background-position:30px 0;}}@-ms-keyframes buffering-stripes{from{background-position:0 0;}to{background-position:30px 0;}}@-o-keyframes buffering-stripes{from{background-position:0 0;}to{background-position:30px 0;}}@keyframes buffering-stripes{from{background-position:0 0;}to{background-position:30px 0;}}.mejs-controls .mejs-time-rail .mejs-time-loaded{background:#3caac8;background:rgba(60,170,200,0.8);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(44,124,145,0.8)),to(rgba(78,183,212,0.8)));background:-webkit-linear-gradient(top,rgba(44,124,145,0.8),rgba(78,183,212,0.8));background:-moz-linear-gradient(top,rgba(44,124,145,0.8),rgba(78,183,212,0.8));background:-o-linear-gradient(top,rgba(44,124,145,0.8),rgba(78,183,212,0.8));background:-ms-linear-gradient(top,rgba(44,124,145,0.8),rgba(78,183,212,0.8));background:linear-gradient(rgba(44,124,145,0.8),rgba(78,183,212,0.8));width:0;}.mejs-controls .mejs-time-rail .mejs-time-current{width:0;background:#fff;background:rgba(255,255,255,0.8);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(255,255,255,0.9)),to(rgba(200,200,200,0.8)));background:-webkit-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-moz-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-o-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-ms-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:linear-gradient(rgba(255,255,255,0.9),rgba(200,200,200,0.8));}.mejs-controls .mejs-time-rail .mejs-time-handle{display:none;position:absolute;margin:0;width:10px;background:#fff;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;cursor:pointer;border:solid 2px #333;top:-2px;text-align:center;}.mejs-controls .mejs-time-rail .mejs-time-float{position:absolute;display:none;background:#eee;width:36px;height:17px;border:solid 1px #333;top:-26px;margin-left:-18px;text-align:center;color:#111;}.mejs-controls .mejs-time-rail .mejs-time-float-current{margin:2px;width:30px;display:block;text-align:center;left:0;}.mejs-controls .mejs-time-rail .mejs-time-float-corner{position:absolute;display:block;width:0;height:0;line-height:0;border:solid 5px #eee;border-color:#eee transparent transparent transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;top:15px;left:13px;}.mejs-long-video .mejs-controls .mejs-time-rail .mejs-time-float{width:48px;}.mejs-long-video .mejs-controls .mejs-time-rail .mejs-time-float-current{width:44px;}.mejs-long-video .mejs-controls .mejs-time-rail .mejs-time-float-corner{left:18px;}.mejs-controls .mejs-fullscreen-button button{background-position:-32px 0;}.mejs-controls .mejs-unfullscreen button{background-position:-32px -16px;}.mejs-controls .mejs-mute button{background-position:-16px -16px;}.mejs-controls .mejs-unmute button{background-position:-16px 0;}.mejs-controls .mejs-volume-button{position:relative;}.mejs-controls .mejs-volume-button .mejs-volume-slider{display:none;height:115px;width:25px;background:url(background.png);background:rgba(50,50,50,0.7);-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;top:-115px;left:0;z-index:1;position:absolute;margin:0;}.mejs-controls .mejs-volume-button:hover{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-total{position:absolute;left:11px;top:8px;width:2px;height:100px;background:#ddd;background:rgba(255,255,255,0.5);margin:0;}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-current{position:absolute;left:11px;top:8px;width:2px;height:100px;background:#ddd;background:rgba(255,255,255,0.9);margin:0;}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-handle{position:absolute;left:4px;top:-3px;width:16px;height:6px;background:#ddd;background:rgba(255,255,255,0.9);cursor:N-resize;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;margin:0;}.mejs-controls div.mejs-horizontal-volume-slider{height:26px;width:60px;position:relative;}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total{position:absolute;left:0;top:11px;width:50px;height:8px;margin:0;padding:0;font-size:1px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;background:#333;background:rgba(50,50,50,0.8);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(30,30,30,0.8)),to(rgba(60,60,60,0.8)));background:-webkit-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-moz-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-o-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-ms-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:linear-gradient(rgba(30,30,30,0.8),rgba(60,60,60,0.8));}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current{position:absolute;left:0;top:11px;width:50px;height:8px;margin:0;padding:0;font-size:1px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;background:#fff;background:rgba(255,255,255,0.8);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(255,255,255,0.9)),to(rgba(200,200,200,0.8)));background:-webkit-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-moz-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-o-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-ms-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:linear-gradient(rgba(255,255,255,0.9),rgba(200,200,200,0.8));}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-handle{display:none;}.mejs-controls .mejs-captions-button{position:relative;}.mejs-controls .mejs-captions-button button{background-position:-48px 0;}.mejs-controls .mejs-captions-button .mejs-captions-selector{visibility:hidden;position:absolute;bottom:26px;right:-10px;width:130px;height:100px;background:url(background.png);background:rgba(50,50,50,0.7);border:solid 1px transparent;padding:10px;overflow:hidden;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul{margin:0;padding:0;display:block;list-style-type:none!important;overflow:hidden;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li{margin:0 0 6px 0;padding:0;list-style-type:none!important;display:block;color:#fff;overflow:hidden;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li input{clear:both;float:left;margin:3px 3px 0 5px;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li label{width:100px;float:left;padding:4px 0 0 0;line-height:15px;font-family:helvetica,arial;font-size:10px;}.mejs-controls .mejs-captions-button .mejs-captions-translations{font-size:10px;margin:0 0 5px 0;}.mejs-chapters{position:absolute;top:0;left:0;-xborder-right:solid 1px #fff;width:10000px;z-index:1;}.mejs-chapters .mejs-chapter{position:absolute;float:left;background:#222;background:rgba(0,0,0,0.7);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(50,50,50,0.7)),to(rgba(0,0,0,0.7)));background:-webkit-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-moz-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-o-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-ms-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:linear-gradient(rgba(50,50,50,0.7),rgba(0,0,0,0.7));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,startColorstr=#323232,endColorstr=#000000);overflow:hidden;border:0;}.mejs-chapters .mejs-chapter .mejs-chapter-block{font-size:11px;color:#fff;padding:5px;display:block;border-right:solid 1px #333;border-bottom:solid 1px #333;cursor:pointer;}.mejs-chapters .mejs-chapter .mejs-chapter-block-last{border-right:none;}.mejs-chapters .mejs-chapter .mejs-chapter-block:hover{background:#666;background:rgba(102,102,102,0.7);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(102,102,102,0.7)),to(rgba(50,50,50,0.6)));background:-webkit-linear-gradient(top,rgba(102,102,102,0.7),rgba(50,50,50,0.6));background:-moz-linear-gradient(top,rgba(102,102,102,0.7),rgba(50,50,50,0.6));background:-o-linear-gradient(top,rgba(102,102,102,0.7),rgba(50,50,50,0.6));background:-ms-linear-gradient(top,rgba(102,102,102,0.7),rgba(50,50,50,0.6));background:linear-gradient(rgba(102,102,102,0.7),rgba(50,50,50,0.6));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,startColorstr=#666666,endColorstr=#323232);}.mejs-chapters .mejs-chapter .mejs-chapter-block .ch-title{font-size:12px;font-weight:bold;display:block;white-space:nowrap;text-overflow:ellipsis;margin:0 0 3px 0;line-height:12px;}.mejs-chapters .mejs-chapter .mejs-chapter-block .ch-timespan{font-size:12px;line-height:12px;margin:3px 0 4px 0;display:block;white-space:nowrap;text-overflow:ellipsis;}.mejs-captions-layer{position:absolute;bottom:0;left:0;text-align:center;line-height:22px;font-size:12px;color:#fff;}.mejs-captions-layer a{color:#fff;text-decoration:underline;}.mejs-captions-layer[lang=ar]{font-size:20px;font-weight:normal;}.mejs-captions-position{position:absolute;width:100%;bottom:15px;left:0;}.mejs-captions-position-hover{bottom:45px;}.mejs-captions-text{padding:3px 5px;background:url(background.png);background:rgba(20,20,20,0.8);}.mejs-clear{clear:both;}.me-cannotplay a{color:#fff;font-weight:bold;}.me-cannotplay span{padding:15px;display:block;}.mejs-controls .mejs-loop-off button{background-position:-64px -16px;}.mejs-controls .mejs-loop-on button{background-position:-64px 0;}.mejs-controls .mejs-backlight-off button{background-position:-80px -16px;}.mejs-controls .mejs-backlight-on button{background-position:-80px 0;}.mejs-controls .mejs-picturecontrols-button{background-position:-96px 0;}.mejs-contextmenu{position:absolute;width:150px;padding:10px;border-radius:4px;top:0;left:0;background:#fff;border:solid 1px #999;z-index:1001;}.mejs-contextmenu .mejs-contextmenu-separator{height:1px;font-size:0;margin:5px 6px;background:#333;}.mejs-contextmenu .mejs-contextmenu-item{font-family:Helvetica,Arial;font-size:12px;padding:4px 6px;cursor:pointer;color:#333;}.mejs-contextmenu .mejs-contextmenu-item:hover{background:#2C7C91;color:#fff;}.mejs-controls .mejs-sourcechooser-button{position:relative;}.mejs-controls .mejs-sourcechooser-button button{background-position:-128px 0;}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector{visibility:hidden;position:absolute;bottom:26px;right:-10px;width:130px;height:100px;background:url(background.png);background:rgba(50,50,50,0.7);border:solid 1px transparent;padding:10px;overflow:hidden;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul{margin:0;padding:0;display:block;list-style-type:none!important;overflow:hidden;}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul li{margin:0 0 6px 0;padding:0;list-style-type:none!important;display:block;color:#fff;overflow:hidden;}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul li input{clear:both;float:left;margin:3px 3px 0 5px;}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul li label{width:100px;float:left;padding:4px 0 0 0;line-height:15px;font-family:helvetica,arial;font-size:10px;}.mejs-postroll-layer{position:absolute;bottom:0;left:0;width:100%;height:100%;background:url(background.png);background:rgba(50,50,50,0.7);z-index:1000;overflow:hidden;}.mejs-postroll-layer-content{width:100%;height:100%;}.mejs-postroll-close{position:absolute;right:0;top:0;background:url(background.png);background:rgba(50,50,50,0.7);color:#fff;padding:4px;z-index:100;cursor:pointer;} 2 No newline at end of file