Version Description
- October 28, 2014 =
- Added H.264 HTML5 video resolution switcher for the Video.js player. Automatically selects the appropriate resolution for the size of the displayed video and allows manual user switching on desktop computers.
- Added option to set videos to automatically fill their containers.
- Added buttons to manually set other videos in the media library as alternate formats for the current video.
- Added option to encode a custom resolution.
- Added option to replace original video with a lower-resolution H.264 video, WEBM or OGV.
- Added buttons to generate thumbnails and encode additional formats for all previously uploaded videos.
- Added plugin admin scripts to the frontend when Insert Media button is loaded. Works with bbPress now.
- Added option to encode 64 and 32 kbps audio.
- Added option to set a different application path for qt-faststart or MP4Box.
- Added option to disable stdin during FFMPEG encoding. Particularly useful for IIS users.
- Updated Video.js to version 4.9.1
- Changed download link to a forced download for videos in the media library. No right-clicking necessary.
- Changed pop-up video gallery to use inline code rather than an AJAX query.
- Changed embedded video IDs to allow the same video to be embedded multiple times on a page.
- Changed volume slider on plugin settings page to drop-down menu to fix settings save errors in Windows.
- Changed 480p video format label to 360p to accurately reflect resolution of 16:9 videos. Format has always been 480p only for 4:3 videos.
- Changed AAC encoder preference to libfdk_aac > libfaac > Native FFmpeg AAC encoder (aac) > libvo_aacenc.
- Restored display of moov atom fix process in FFMPEG test output.
- Fixed bug that made pop-up video windows 0 pixels wide in iOS 8.
- Fixed bug that couldn't find video attachements that have been redirected to a CDN.
- Fixed bug that quickly faded out the end overlay image in IE.
- Fixed bug that prevented replacing encoded videos if there were any other videos in the queue.
- Fixed bug that left the GUID as the original filename if replacing the video with an mp4 changed the extension.
- Fixed bug that incorrectly reported all encoding fps values over 99 as "10".
- Fixed bug that didn't recognize videos had completed encoding if there were audio frames left in the queue.
- Fixed bug that left title overlay on iOS videos using the WordPress Default player.
- Fixed bug that made video galleries display as inline-block when the inline video option was disabled.
Download this release
Release Info
Developer | kylegilman |
Plugin | Video Embed & Thumbnail Generator |
Version | 4.4 |
Comparing to | |
See all releases |
Code changes from version 4.3.5 to 4.4
- css/kgvid_styles.css +34 -5
- css/video-embed-thumbnail-generator_admin.css +37 -5
- js/kgvid_video_embed.js +140 -84
- js/kgvid_video_plugin_admin.js +146 -18
- readme.txt +41 -10
- video-embed-thumbnail-generator.php +837 -349
- video-js/lang/de.js +21 -21
- video-js/lang/es.js +21 -21
- video-js/lang/fr.js +13 -13
- video-js/lang/it.js +26 -0
- video-js/lang/ja.js +26 -0
- video-js/lang/ko.js +26 -0
- video-js/lang/pt-BR.js +26 -0
- video-js/video-js.css +2 -2
- video-js/video-js.swf +0 -0
- video-js/video-quality-selector-license.txt +20 -0
- video-js/video-quality-selector.js +383 -0
- video-js/video.js +151 -145
css/kgvid_styles.css
CHANGED
@@ -4,6 +4,11 @@
|
|
4 |
max-width: 100%
|
5 |
}
|
6 |
|
|
|
|
|
|
|
|
|
|
|
7 |
.kgvid_wrapper_auto_left {
|
8 |
margin-left: auto;
|
9 |
}
|
@@ -26,11 +31,6 @@
|
|
26 |
margin: 1em 0 0 1em;
|
27 |
}
|
28 |
|
29 |
-
.kgvid_gallerywrapper {
|
30 |
-
display: inline-block;
|
31 |
-
max-width: 100%;
|
32 |
-
}
|
33 |
-
|
34 |
.kgvid_textalign_left {
|
35 |
text-align:left;
|
36 |
}
|
@@ -272,3 +272,32 @@ img.kgvid_ios_novideo {
|
|
272 |
#kgvid-simplemodal-container a.modalCloseImg:hover, #kgvid-simplemodal-container .kgvid_gallery_nav:hover {
|
273 |
background-color: #555;
|
274 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
max-width: 100%
|
5 |
}
|
6 |
|
7 |
+
.kgvid_gallerywrapper {
|
8 |
+
display: block;
|
9 |
+
max-width: 100%;
|
10 |
+
}
|
11 |
+
|
12 |
.kgvid_wrapper_auto_left {
|
13 |
margin-left: auto;
|
14 |
}
|
31 |
margin: 1em 0 0 1em;
|
32 |
}
|
33 |
|
|
|
|
|
|
|
|
|
|
|
34 |
.kgvid_textalign_left {
|
35 |
text-align:left;
|
36 |
}
|
272 |
#kgvid-simplemodal-container a.modalCloseImg:hover, #kgvid-simplemodal-container .kgvid_gallery_nav:hover {
|
273 |
background-color: #555;
|
274 |
}
|
275 |
+
|
276 |
+
/* video-quality-selector Video.js plugin styles */
|
277 |
+
|
278 |
+
.vjs-res-button span.vjs-control-text {
|
279 |
+
display: none;
|
280 |
+
}
|
281 |
+
|
282 |
+
.vjs-res-button:before {
|
283 |
+
content: "\e600"; /* Gear icon */
|
284 |
+
}
|
285 |
+
|
286 |
+
|
287 |
+
/* Don't show hover effects on title */
|
288 |
+
ul li.vjs-menu-title.vjs-res-menu-title:hover {
|
289 |
+
cursor: default;
|
290 |
+
background-color: transparent;
|
291 |
+
color: #CCC;
|
292 |
+
|
293 |
+
-moz-box-shadow: none;
|
294 |
+
-webkit-box-shadow: none;
|
295 |
+
box-shadow: none;
|
296 |
+
}
|
297 |
+
|
298 |
+
/* Needed to keep text visible in video.js 4.9 */
|
299 |
+
.vjs-res-button .vjs-control-text {
|
300 |
+
width: auto;
|
301 |
+
height: auto;
|
302 |
+
clip: auto;
|
303 |
+
}
|
css/video-embed-thumbnail-generator_admin.css
CHANGED
@@ -1,3 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
.kgvid_meter, .meter_finished {
|
2 |
height: 14px;
|
3 |
width: 125px;
|
@@ -66,7 +74,7 @@
|
|
66 |
color: white;
|
67 |
font-size: 80%;
|
68 |
position:relative;
|
69 |
-
top: -
|
70 |
}
|
71 |
|
72 |
.kgvid_cancel_button {
|
@@ -111,14 +119,31 @@ div.kgvid_cancel_button input {
|
|
111 |
font-size: 1pt;
|
112 |
}
|
113 |
|
114 |
-
.
|
115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
}
|
117 |
|
118 |
.compat-item .field input {
|
119 |
width: auto;
|
120 |
}
|
121 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
#poststuff .nav-tab-wrapper.kgvid-tabs {
|
123 |
margin-top: 0;
|
124 |
padding: 0;
|
@@ -304,9 +329,7 @@ font-weight: normal;
|
|
304 |
a.kgvid_delete-format {
|
305 |
color: #BC0B0B !important;
|
306 |
text-decoration: none;
|
307 |
-
margin-left: 15px;
|
308 |
display: block;
|
309 |
-
margin-bottom: -10px;
|
310 |
}
|
311 |
|
312 |
a.kgvid_delete-format:hover {
|
@@ -553,3 +576,12 @@ td.media-icon img {
|
|
553 |
.attachment-preview.type-video .thumbnail {
|
554 |
z-index: 0;
|
555 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.compat-attachment-fields {
|
2 |
+
color: #666;
|
3 |
+
}
|
4 |
+
|
5 |
+
.kgvid_meter {
|
6 |
+
text-indent: 0px;
|
7 |
+
}
|
8 |
+
|
9 |
.kgvid_meter, .meter_finished {
|
10 |
height: 14px;
|
11 |
width: 125px;
|
74 |
color: white;
|
75 |
font-size: 80%;
|
76 |
position:relative;
|
77 |
+
top: -4px;
|
78 |
}
|
79 |
|
80 |
.kgvid_cancel_button {
|
119 |
font-size: 1pt;
|
120 |
}
|
121 |
|
122 |
+
.kgvid_encoding_small_text {
|
123 |
+
text-indent: 0px;
|
124 |
+
display: block;
|
125 |
+
margin-left: -30px;
|
126 |
+
}
|
127 |
+
|
128 |
+
.media-frame .compat-item .field {
|
129 |
+
width: 90%;
|
130 |
}
|
131 |
|
132 |
.compat-item .field input {
|
133 |
width: auto;
|
134 |
}
|
135 |
|
136 |
+
.compat-item .kgvid_checkboxes_section ul li {
|
137 |
+
margin-bottom: 10pt;
|
138 |
+
line-height: 16pt;
|
139 |
+
padding-left: 30px;
|
140 |
+
text-indent: -30px;
|
141 |
+
}
|
142 |
+
|
143 |
+
.kgvid_format_meta {
|
144 |
+
text-indent: 0px;
|
145 |
+
}
|
146 |
+
|
147 |
#poststuff .nav-tab-wrapper.kgvid-tabs {
|
148 |
margin-top: 0;
|
149 |
padding: 0;
|
329 |
a.kgvid_delete-format {
|
330 |
color: #BC0B0B !important;
|
331 |
text-decoration: none;
|
|
|
332 |
display: block;
|
|
|
333 |
}
|
334 |
|
335 |
a.kgvid_delete-format:hover {
|
576 |
.attachment-preview.type-video .thumbnail {
|
577 |
z-index: 0;
|
578 |
}
|
579 |
+
|
580 |
+
.compat-item .kgvid_encode_checkbox_button {
|
581 |
+
font-size: 80%;
|
582 |
+
padding: 0px 4px;
|
583 |
+
height: 24px;
|
584 |
+
line-height: 21px;
|
585 |
+
text-indent: 0;
|
586 |
+
margin-left: 5px;
|
587 |
+
}
|
js/kgvid_video_embed.js
CHANGED
@@ -2,11 +2,14 @@ kgvid_video_vars = {};
|
|
2 |
|
3 |
jQuery(document).ready(function() {
|
4 |
|
5 |
-
jQuery('.kgvid_videodiv').each(function(){ //
|
6 |
var id = jQuery(this).data('id');
|
7 |
var video_variable_name = 'kgvid_video_vars_'+id;
|
8 |
kgvid_video_vars[id] = eval(video_variable_name);
|
|
|
9 |
|
|
|
|
|
10 |
if ( kgvid_video_vars[id].player_type == "Strobe Media Playback" ) {
|
11 |
swfobject.embedSWF(kgvid_video_vars[id].swfurl, 'video_'+id, kgvid_video_vars[id].width, kgvid_video_vars[id].height, '10.1.0', kgvid_video_vars[id].expressinstallswfurl, kgvid_video_vars[id].flashvars, kgvid_video_vars[id].params);
|
12 |
}
|
@@ -38,8 +41,10 @@ function kgvid_SetVideo(id) { //for galleries
|
|
38 |
var width = jQuery('#kgvid_video_gallery_thumb_'+id).data('width');
|
39 |
var height = jQuery('#kgvid_video_gallery_thumb_'+id).data('height');
|
40 |
var aspect_ratio = Math.round(height/width*1000)/1000
|
41 |
-
|
42 |
-
|
|
|
|
|
43 |
height = Math.round(width * aspect_ratio);
|
44 |
}
|
45 |
var frame_height = height;
|
@@ -84,54 +89,51 @@ function kgvid_SetVideo(id) { //for galleries
|
|
84 |
jQuery('#simplemodal-data').prepend('<div id="kgvid_popup_video_holder_'+id+'"></div>');
|
85 |
|
86 |
//load the video player embed code
|
87 |
-
jQuery.post(kgvid_ajax_object.ajaxurl, {
|
88 |
-
action: 'kgvid_set_gallery_video',
|
89 |
-
security: kgvid_ajax_object.ajax_nonce,
|
90 |
-
video_id: id
|
91 |
-
}, function(data) {
|
92 |
|
93 |
-
|
94 |
|
95 |
-
|
96 |
-
|
97 |
|
98 |
-
|
99 |
|
100 |
-
|
101 |
-
|
102 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
|
104 |
-
kgvid_setup_video(id);
|
105 |
-
jQuery.modal.setContainerDimensions();
|
106 |
-
dialog.wrap.css('overflow', 'hidden'); //disable scroll bars
|
107 |
-
if ( meta > 0 ) { jQuery('#kgvid-simplemodal-container').css('color','white'); } //show text if there's anything to see below the video
|
108 |
-
|
109 |
-
if ( video_vars.player_type == "Video.js" ) {
|
110 |
-
videojs('video_'+id).load();
|
111 |
-
videojs('video_'+id).play();
|
112 |
-
}//end if Video.js
|
113 |
-
|
114 |
-
if ( video_vars.player_type == "WordPress Default" ) {
|
115 |
-
jQuery('#kgvid_'+id+'_wrapper video').mediaelementplayer({
|
116 |
-
success: function(mediaElement, domObject) {
|
117 |
-
if (mediaElement.pluginType == 'flash' || mediaElement.pluginType == 'silverlight') {
|
118 |
-
mediaElement.addEventListener('canplay', function() {
|
119 |
-
// Player is ready
|
120 |
-
mediaElement.play();
|
121 |
-
}, false);
|
122 |
-
|
123 |
-
mediaElement.addEventListener('ended', function() {
|
124 |
-
if ( jQuery('#kgvid_video_gallery_thumb_'+id).data('gallery_end') != "" && jQuery('#kgvid_video_gallery_thumb_'+id).data('gallery_end') != null ) {
|
125 |
-
kgvid_video_gallery_end_action(id, jQuery('#kgvid_video_gallery_thumb_'+id).data('gallery_end'));
|
126 |
-
}
|
127 |
-
}, false);
|
128 |
-
}//end if flash or silverlight
|
129 |
-
else { mediaElement.play(); }
|
130 |
-
}
|
131 |
-
});
|
132 |
-
}//end if WordPress Default
|
133 |
-
}//end check to make sure video still needs to load
|
134 |
-
},"json"); //end .post
|
135 |
}, //end onShow function
|
136 |
onClose: function(dialog) {
|
137 |
|
@@ -147,9 +149,6 @@ function kgvid_SetVideo(id) { //for galleries
|
|
147 |
jwplayer(jQuery('#kgvid_'+id+'_wrapper .jwplayer').attr('id')).stop();
|
148 |
}
|
149 |
}
|
150 |
-
try{
|
151 |
-
delete kgvid_video_vars[id];
|
152 |
-
}catch(e){} //gets around error thrown in IE 8
|
153 |
|
154 |
jQuery(window).off('resize', kgvid_resize_video(id));
|
155 |
|
@@ -229,7 +228,7 @@ function kgvid_setup_video(id) {
|
|
229 |
'background-image':'url('+video_vars.endofvideooverlay+')'
|
230 |
}).fadeIn();
|
231 |
|
232 |
-
player.on('timeupdate', kgvid_timeupdate);
|
233 |
|
234 |
}
|
235 |
if ( jQuery('#kgvid_video_gallery_thumb_'+id).data('gallery_end') != "" && jQuery('#kgvid_video_gallery_thumb_'+id).data('gallery_end') != null ) {
|
@@ -264,18 +263,33 @@ function kgvid_setup_video(id) {
|
|
264 |
}
|
265 |
}
|
266 |
|
267 |
-
if (
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
}
|
272 |
-
|
273 |
-
|
274 |
-
jQuery('#video_'+id
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
275 |
}
|
276 |
|
277 |
});
|
278 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
279 |
} //end if Video.js
|
280 |
|
281 |
if ( video_vars.player_type == "Strobe Media Playback" || video_vars.player_type == "WordPress Default" ) {
|
@@ -283,11 +297,9 @@ function kgvid_setup_video(id) {
|
|
283 |
jQuery('#video_'+id+'_div').hover(
|
284 |
function(){
|
285 |
jQuery('#video_'+id+'_meta').addClass('kgvid_video_meta_hover');
|
286 |
-
//jQuery('#video_'+id+'_watermark').fadeOut(100);
|
287 |
},
|
288 |
function(){
|
289 |
jQuery('#video_'+id+'_meta').removeClass('kgvid_video_meta_hover');
|
290 |
-
//setTimeout(function(){jQuery('#video_'+id+'_watermark').fadeIn('slow');},3000);
|
291 |
}
|
292 |
);
|
293 |
} //end if Strobe Media Playback
|
@@ -302,7 +314,7 @@ function kgvid_setup_video(id) {
|
|
302 |
jQuery('#video_'+id+'_div .mejs-container').append(jQuery('#video_'+id+'_watermark'));
|
303 |
});
|
304 |
|
305 |
-
|
306 |
jQuery('#video_'+id+'_meta').removeClass('kgvid_video_meta_hover');
|
307 |
kgvid_video_counter(id, 'play');
|
308 |
});
|
@@ -387,25 +399,42 @@ function kgvid_resize_all_videos() {
|
|
387 |
|
388 |
function kgvid_resize_video(id) {
|
389 |
|
|
|
|
|
|
|
|
|
390 |
if ( kgvid_video_vars.hasOwnProperty(id) ) {
|
391 |
var video_vars = kgvid_video_vars[id];
|
392 |
var set_width = video_vars.width;
|
393 |
var set_height = video_vars.height;
|
394 |
-
var iOS = ( navigator.userAgent.match(/(iPad|iPhone|iPod)/i) ? true : false );
|
395 |
-
if ( iOS ) { video_vars.player_type = "iOS"; }
|
396 |
var aspect_ratio = Math.round(set_height/set_width*1000)/1000
|
397 |
var reference_div = jQuery('#kgvid_'+id+'_wrapper').parent();
|
398 |
if ( reference_div.is('body') ) { parent_width = window.innerWidth; }
|
399 |
-
if ( reference_div.
|
400 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
401 |
if ( parent_width < set_width ) { set_width = parent_width; }
|
402 |
|
403 |
-
if ( set_width != 0 ) {
|
404 |
|
405 |
jQuery('#kgvid_'+id+'_wrapper').width(set_width);
|
406 |
var set_height = Math.round(set_width * aspect_ratio);
|
407 |
-
|
408 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
409 |
if ( set_width < 500 ) {
|
410 |
var scale = Math.round(100*set_width/500)/100;
|
411 |
jQuery('#kgvid_'+id+'_wrapper .vjs-big-play-button').css('-webkit-transform','scale('+scale+')').css('-o-transform','scale('+scale+')').css('-ms-transform','scale('+scale+')').css('transform','scale('+scale+')');
|
@@ -420,6 +449,38 @@ function kgvid_resize_video(id) {
|
|
420 |
}
|
421 |
}
|
422 |
else { jQuery('#kgvid_'+id+'_wrapper .vjs-big-play-button').removeAttr('style'); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
423 |
}
|
424 |
if ( video_vars.player_type == "Strobe Media Playback" ) {
|
425 |
jQuery('#video_'+id+'_div').height(set_height);
|
@@ -430,23 +491,18 @@ function kgvid_resize_video(id) {
|
|
430 |
jQuery('#kgvid_'+id+'_wrapper').find('.wp-video').attr('style', 'width:'+set_width+'px; height:'+set_height+'px;');
|
431 |
}
|
432 |
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
jQuery('#kgvid_'+id+'_wrapper').find('.wp-video-shortcode').width(set_width).height(set_height);
|
439 |
-
|
440 |
-
}
|
441 |
|
442 |
}
|
443 |
-
|
444 |
-
var meta = jQuery('#kgvid_video_gallery_thumb_'+id).data('meta');
|
445 |
-
var extra_meta_height = Math.round(20*meta);
|
446 |
-
jQuery('#kgvid-simplemodal-container').width(parseInt(set_width)+10);
|
447 |
-
jQuery('#kgvid-simplemodal-container').height(parseInt(set_height)+10+extra_meta_height);
|
448 |
-
jQuery('.simplemodal-wrap').css('overflow', 'hidden');
|
449 |
}
|
|
|
|
|
|
|
450 |
}
|
451 |
|
452 |
function kgvid_strobemedia_callback(id) {
|
@@ -485,10 +541,10 @@ function kgvid_video_counter(id, event) {
|
|
485 |
if (typeof _gaq != 'undefined') { _gaq.push(['_trackEvent', 'Videos', kgvidL10n_frontend.completeview, title]); }
|
486 |
}
|
487 |
if ( changed == true ) {
|
488 |
-
jQuery.post(
|
489 |
action: 'kgvid_count_play',
|
490 |
-
security:
|
491 |
-
post_id:
|
492 |
video_event: event
|
493 |
}, function(data) {
|
494 |
if ( event == "play" ) { jQuery('#video_'+id+'_viewcount').html(data+' views'); }
|
2 |
|
3 |
jQuery(document).ready(function() {
|
4 |
|
5 |
+
jQuery('.kgvid_videodiv, .kgvid_video_gallery_thumb').each(function(){ //read variables into array
|
6 |
var id = jQuery(this).data('id');
|
7 |
var video_variable_name = 'kgvid_video_vars_'+id;
|
8 |
kgvid_video_vars[id] = eval(video_variable_name);
|
9 |
+
});
|
10 |
|
11 |
+
jQuery('.kgvid_videodiv').each(function(){ //setup individual videos
|
12 |
+
var id = jQuery(this).data('id');
|
13 |
if ( kgvid_video_vars[id].player_type == "Strobe Media Playback" ) {
|
14 |
swfobject.embedSWF(kgvid_video_vars[id].swfurl, 'video_'+id, kgvid_video_vars[id].width, kgvid_video_vars[id].height, '10.1.0', kgvid_video_vars[id].expressinstallswfurl, kgvid_video_vars[id].flashvars, kgvid_video_vars[id].params);
|
15 |
}
|
41 |
var width = jQuery('#kgvid_video_gallery_thumb_'+id).data('width');
|
42 |
var height = jQuery('#kgvid_video_gallery_thumb_'+id).data('height');
|
43 |
var aspect_ratio = Math.round(height/width*1000)/1000
|
44 |
+
var window_width = window.outerWidth;
|
45 |
+
if ( window.outerWidth == 0 ) { window_width = window.innerWidth; }
|
46 |
+
if ( width > window_width ) {
|
47 |
+
width = window_width-60;
|
48 |
height = Math.round(width * aspect_ratio);
|
49 |
}
|
50 |
var frame_height = height;
|
89 |
jQuery('#simplemodal-data').prepend('<div id="kgvid_popup_video_holder_'+id+'"></div>');
|
90 |
|
91 |
//load the video player embed code
|
|
|
|
|
|
|
|
|
|
|
92 |
|
93 |
+
if ( jQuery('#kgvid_popup_video_holder_'+id).length == 1 ) { //make sure the user hasn't moved on to another video
|
94 |
|
95 |
+
var video_vars = kgvid_video_vars[id];
|
96 |
+
var popup_code = eval('kgvid_video_popup_code_'+id);
|
97 |
|
98 |
+
jQuery('#kgvid_popup_video_holder_'+id).html(popup_code);
|
99 |
|
100 |
+
if ( kgvid_video_vars[id].player_type == "Strobe Media Playback" ) {
|
101 |
+
swfobject.embedSWF(kgvid_video_vars[id].swfurl, 'video_'+id, kgvid_video_vars[id].width, kgvid_video_vars[id].height, '10.1.0', kgvid_video_vars[id].expressinstallswfurl, kgvid_video_vars[id].flashvars, kgvid_video_vars[id].params);
|
102 |
+
}
|
103 |
+
|
104 |
+
jQuery.modal.setContainerDimensions();
|
105 |
+
kgvid_setup_video(id);
|
106 |
+
jQuery.modal.setPosition();
|
107 |
+
|
108 |
+
dialog.wrap.css('overflow', 'hidden'); //disable scroll bars
|
109 |
+
if ( meta > 0 ) { jQuery('#kgvid-simplemodal-container').css('color','white'); } //show text if there's anything to see below the video
|
110 |
+
|
111 |
+
if ( video_vars.player_type == "Video.js" ) {
|
112 |
+
videojs('video_'+id).load();
|
113 |
+
videojs('video_'+id).play();
|
114 |
+
}//end if Video.js
|
115 |
+
|
116 |
+
if ( video_vars.player_type == "WordPress Default" ) {
|
117 |
+
jQuery('#kgvid_'+id+'_wrapper video').mediaelementplayer({
|
118 |
+
success: function(mediaElement, domObject) {
|
119 |
+
if (mediaElement.pluginType == 'flash' || mediaElement.pluginType == 'silverlight') {
|
120 |
+
mediaElement.addEventListener('canplay', function() {
|
121 |
+
// Player is ready
|
122 |
+
mediaElement.play();
|
123 |
+
}, false);
|
124 |
+
|
125 |
+
mediaElement.addEventListener('ended', function() {
|
126 |
+
if ( jQuery('#kgvid_video_gallery_thumb_'+id).data('gallery_end') != "" && jQuery('#kgvid_video_gallery_thumb_'+id).data('gallery_end') != null ) {
|
127 |
+
kgvid_video_gallery_end_action(id, jQuery('#kgvid_video_gallery_thumb_'+id).data('gallery_end'));
|
128 |
+
}
|
129 |
+
}, false);
|
130 |
+
}//end if flash or silverlight
|
131 |
+
else { mediaElement.play(); }
|
132 |
+
}
|
133 |
+
});
|
134 |
+
}//end if WordPress Default
|
135 |
+
}//end check to make sure video still needs to load
|
136 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
}, //end onShow function
|
138 |
onClose: function(dialog) {
|
139 |
|
149 |
jwplayer(jQuery('#kgvid_'+id+'_wrapper .jwplayer').attr('id')).stop();
|
150 |
}
|
151 |
}
|
|
|
|
|
|
|
152 |
|
153 |
jQuery(window).off('resize', kgvid_resize_video(id));
|
154 |
|
228 |
'background-image':'url('+video_vars.endofvideooverlay+')'
|
229 |
}).fadeIn();
|
230 |
|
231 |
+
setTimeout(function() { player.on('timeupdate', kgvid_timeupdate); }, 500);
|
232 |
|
233 |
}
|
234 |
if ( jQuery('#kgvid_video_gallery_thumb_'+id).data('gallery_end') != "" && jQuery('#kgvid_video_gallery_thumb_'+id).data('gallery_end') != null ) {
|
263 |
}
|
264 |
}
|
265 |
|
266 |
+
if ( jQuery('#video_'+id).hasClass('vjs-fullscreen') ) {
|
267 |
+
var resolutions = player.availableRes;
|
268 |
+
var highest_res = Object.keys(resolutions)[Object.keys(resolutions).length - 1];
|
269 |
+
player.changeRes(highest_res);
|
270 |
}
|
271 |
+
|
272 |
+
if ( fullScreenApi.supportsFullScreen == false ) {
|
273 |
+
if ( jQuery('#video_'+id).hasClass('vjs-fullscreen') ) {
|
274 |
+
jQuery('#video_'+id+'_meta').hide();
|
275 |
+
jQuery('#video_'+id+'_watermark img').css('position', 'fixed');
|
276 |
+
}
|
277 |
+
else {
|
278 |
+
jQuery('#video_'+id+'_meta').show();
|
279 |
+
jQuery('#video_'+id+'_watermark img').css('position', 'absolute');
|
280 |
+
}
|
281 |
}
|
282 |
|
283 |
});
|
284 |
|
285 |
+
player.on( 'changeRes', function() {
|
286 |
+
if ( jQuery('#video_'+id).hasClass('vjs-has-started') == false ) {
|
287 |
+
var poster = jQuery('#video_'+id+' video').attr('poster');
|
288 |
+
jQuery('#video_'+id+' video').removeAttr('poster'); //prevents poster from showing during resolution switch
|
289 |
+
player.on ( 'ended', function() { jQuery('#video_'+id+' video').attr('poster', poster); } );
|
290 |
+
}
|
291 |
+
});
|
292 |
+
|
293 |
} //end if Video.js
|
294 |
|
295 |
if ( video_vars.player_type == "Strobe Media Playback" || video_vars.player_type == "WordPress Default" ) {
|
297 |
jQuery('#video_'+id+'_div').hover(
|
298 |
function(){
|
299 |
jQuery('#video_'+id+'_meta').addClass('kgvid_video_meta_hover');
|
|
|
300 |
},
|
301 |
function(){
|
302 |
jQuery('#video_'+id+'_meta').removeClass('kgvid_video_meta_hover');
|
|
|
303 |
}
|
304 |
);
|
305 |
} //end if Strobe Media Playback
|
314 |
jQuery('#video_'+id+'_div .mejs-container').append(jQuery('#video_'+id+'_watermark'));
|
315 |
});
|
316 |
|
317 |
+
jQuery('#video_'+id+'_div .wp-video').one('click', function kgvid_play_start(){
|
318 |
jQuery('#video_'+id+'_meta').removeClass('kgvid_video_meta_hover');
|
319 |
kgvid_video_counter(id, 'play');
|
320 |
});
|
399 |
|
400 |
function kgvid_resize_video(id) {
|
401 |
|
402 |
+
if ( typeof kgvid_resize_video.counter == 'undefined' ) {
|
403 |
+
kgvid_resize_video.counter = 0;
|
404 |
+
}
|
405 |
+
|
406 |
if ( kgvid_video_vars.hasOwnProperty(id) ) {
|
407 |
var video_vars = kgvid_video_vars[id];
|
408 |
var set_width = video_vars.width;
|
409 |
var set_height = video_vars.height;
|
|
|
|
|
410 |
var aspect_ratio = Math.round(set_height/set_width*1000)/1000
|
411 |
var reference_div = jQuery('#kgvid_'+id+'_wrapper').parent();
|
412 |
if ( reference_div.is('body') ) { parent_width = window.innerWidth; }
|
413 |
+
if ( reference_div.attr('id') == 'kgvid_popup_video_holder_'+id ) { //if it's a pop-up video
|
414 |
+
var window_width = jQuery(window).width();
|
415 |
+
var window_height = jQuery(window).height();
|
416 |
+
parent_width = window_width-40;
|
417 |
+
}
|
418 |
+
else {
|
419 |
+
parent_width = reference_div.width();
|
420 |
+
if ( video_vars['fullwidth'] == 'true' ) { set_width = parent_width; }
|
421 |
+
}
|
422 |
if ( parent_width < set_width ) { set_width = parent_width; }
|
423 |
|
424 |
+
if ( set_width != 0 && set_width < 30000 ) {
|
425 |
|
426 |
jQuery('#kgvid_'+id+'_wrapper').width(set_width);
|
427 |
var set_height = Math.round(set_width * aspect_ratio);
|
428 |
+
|
429 |
+
if ( reference_div.attr('id') == 'kgvid_popup_video_holder_'+id && set_height > window_height-60 ) {
|
430 |
+
set_height = window_height-60;
|
431 |
+
set_width = Math.round(set_height / aspect_ratio);
|
432 |
+
}
|
433 |
+
|
434 |
+
if ( video_vars.player_type == "Video.js" && eval('videojs.players.video_'+id) != null ) {
|
435 |
+
var player = videojs('video_'+id);
|
436 |
+
player.width(set_width).height(set_height);
|
437 |
+
|
438 |
if ( set_width < 500 ) {
|
439 |
var scale = Math.round(100*set_width/500)/100;
|
440 |
jQuery('#kgvid_'+id+'_wrapper .vjs-big-play-button').css('-webkit-transform','scale('+scale+')').css('-o-transform','scale('+scale+')').css('-ms-transform','scale('+scale+')').css('transform','scale('+scale+')');
|
449 |
}
|
450 |
}
|
451 |
else { jQuery('#kgvid_'+id+'_wrapper .vjs-big-play-button').removeAttr('style'); }
|
452 |
+
|
453 |
+
if ( video_vars.auto_res == 'true' && player.availableRes !== undefined ) {
|
454 |
+
var resolutions = player.availableRes;
|
455 |
+
var resNumbers = [];
|
456 |
+
jQuery.each(resolutions, function(){
|
457 |
+
if ( this[0] != undefined && !isNaN(parseInt(this[0]['data-res'])) ) {
|
458 |
+
resNumbers.push(parseInt(this[0]['data-res']));
|
459 |
+
}
|
460 |
+
});
|
461 |
+
var current_resolution = parseInt(player.getCurrentRes());
|
462 |
+
|
463 |
+
if ( !isNaN(current_resolution) ) {
|
464 |
+
if ( window.devicePixelRatio != undefined ) { var pixel_height = set_height * window.devicePixelRatio; } //don't shortchange retina displays
|
465 |
+
else { pixel_height = set_height; }
|
466 |
+
var res_options = jQuery.map(resNumbers, function(n) {
|
467 |
+
if ( n >= pixel_height ) { return n; }
|
468 |
+
});
|
469 |
+
var set_res = Math.min.apply(Math,res_options);
|
470 |
+
if ( set_res != current_resolution && !jQuery('#video_'+id).hasClass('vjs-fullscreen') ) {
|
471 |
+
player.changeRes(set_res+'p');
|
472 |
+
}
|
473 |
+
if ( jQuery('#video_'+id).hasClass('vjs-has-started') == false ) {
|
474 |
+
if ( player.muted() == true ) { player.muted(false); player.muted(true); } // reset volume and mute otherwise player doesn't display properly
|
475 |
+
if ( player.volume() != 1 ) {
|
476 |
+
var current_volume = player.volume();
|
477 |
+
player.volume(1);
|
478 |
+
player.volume(current_volume);
|
479 |
+
}
|
480 |
+
}
|
481 |
+
}
|
482 |
+
}
|
483 |
+
|
484 |
}
|
485 |
if ( video_vars.player_type == "Strobe Media Playback" ) {
|
486 |
jQuery('#video_'+id+'_div').height(set_height);
|
491 |
jQuery('#kgvid_'+id+'_wrapper').find('.wp-video').attr('style', 'width:'+set_width+'px; height:'+set_height+'px;');
|
492 |
}
|
493 |
|
494 |
+
var meta = jQuery('#kgvid_video_gallery_thumb_'+id).data('meta');
|
495 |
+
var extra_meta_height = Math.round(20*meta);
|
496 |
+
jQuery('#kgvid-simplemodal-container').width(parseInt(set_width)+10);
|
497 |
+
jQuery('#kgvid-simplemodal-container').height(parseInt(set_height)+10+extra_meta_height);
|
498 |
+
jQuery('.simplemodal-wrap').css('overflow', 'hidden');
|
|
|
|
|
|
|
499 |
|
500 |
}
|
501 |
+
else if ( kgvid_resize_video.counter < 3 ) { setTimeout(function() { kgvid_resize_video(id); }, 250); } //if it's a wacky result, wait 1/4 second
|
|
|
|
|
|
|
|
|
|
|
502 |
}
|
503 |
+
|
504 |
+
++kgvid_resize_video.counter;
|
505 |
+
|
506 |
}
|
507 |
|
508 |
function kgvid_strobemedia_callback(id) {
|
541 |
if (typeof _gaq != 'undefined') { _gaq.push(['_trackEvent', 'Videos', kgvidL10n_frontend.completeview, title]); }
|
542 |
}
|
543 |
if ( changed == true ) {
|
544 |
+
jQuery.post(kgvidL10n_frontend.ajaxurl, {
|
545 |
action: 'kgvid_count_play',
|
546 |
+
security: kgvidL10n_frontend.ajax_nonce,
|
547 |
+
post_id: video_vars.attachment_id,
|
548 |
video_event: event
|
549 |
}, function(data) {
|
550 |
if ( event == "play" ) { jQuery('#video_'+id+'_viewcount').html(data+' views'); }
|
js/kgvid_video_plugin_admin.js
CHANGED
@@ -511,7 +511,7 @@ function kgvid_enqueue_video_encode(postID) {
|
|
511 |
page = "queue";
|
512 |
}
|
513 |
|
514 |
-
var formats = new Array("fullres", "1080", "720", "mobile", "ogg", "webm");
|
515 |
var kgvid_encode = new Object();
|
516 |
jQuery.each(formats, function(key,formats) {
|
517 |
kgvid_encode[formats] = "";
|
@@ -525,7 +525,7 @@ function kgvid_enqueue_video_encode(postID) {
|
|
525 |
jQuery(encodeprogressplaceholderid).empty();
|
526 |
jQuery(encodeplaceholderid).append('<strong>'+kgvidL10n.loading+'</strong>');
|
527 |
|
528 |
-
jQuery.post(ajaxurl, { action:"kgvid_callffmpeg", security: kgflashmediaplayersecurity, movieurl: attachmentURL, ffmpeg_action: 'enqueue', encodeformats: kgvid_encode, attachmentID: postID, parent_id: parent_post_id
|
529 |
|
530 |
jQuery(encodeplaceholderid).empty();
|
531 |
jQuery(encodeprogressplaceholderid).empty();
|
@@ -663,7 +663,6 @@ function kgvid_insert_shortcode() {
|
|
663 |
shortcode += titlecode + '<span itemprop="name">' + document.getElementById('videotitle').value + '</span>' + endtitlecode + '<br />';
|
664 |
}
|
665 |
if (url !="") {
|
666 |
-
console.log(basename);
|
667 |
shortcode += ' [KGVID';
|
668 |
if (document.getElementById('attachments-'+basename+'-kgflashmediaplayer-poster').value !="") { shortcode += ' poster="' + document.getElementById('attachments-'+basename+'-kgflashmediaplayer-poster').value + '"'; }
|
669 |
if (document.getElementById('attachments-'+basename+'-kgflashmediaplayer-width').value !="") { shortcode += ' width="' + document.getElementById('attachments-'+basename+'-kgflashmediaplayer-width').value + '"'; }
|
@@ -716,6 +715,9 @@ function kgvid_delete_video(movieurl, postID, format, childID, blogID) {
|
|
716 |
|
717 |
jQuery.post(ajaxurl, { action: "kgvid_delete_video", security: kgflashmediaplayersecurity, movieurl: movieurl, postid: postID, format: format, childid: childID, blogid: blogID }, function(data) {
|
718 |
jQuery('#attachments-'+postID+'-kgflashmediaplayer-encode'+format).change();
|
|
|
|
|
|
|
719 |
}, "json" );
|
720 |
|
721 |
}
|
@@ -876,6 +878,15 @@ function kgvid_save_plugin_settings(input_obj) {
|
|
876 |
}
|
877 |
|
878 |
if ( jQuery('#app_path').data('ffmpeg_exists') == "on" && jQuery(input_obj).hasClass('affects_ffmpeg') == true && jQuery('#ffmpeg_output').length != 0 ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
879 |
jQuery('#ffmpeg_output').html(kgvidL10n.runningtest);
|
880 |
jQuery('#ffmpeg_h264_sample').html(data.encode_string);
|
881 |
jQuery('#ffmpeg_watermark_example').slideUp('slow');
|
@@ -927,19 +938,6 @@ function kgvid_embeddable_switch(checked) {
|
|
927 |
|
928 |
function kgvid_switch_settings_tab(tab) {
|
929 |
|
930 |
-
if ( tab == "general" ) {
|
931 |
-
|
932 |
-
var playback_option = jQuery('#embed_method').val();
|
933 |
-
|
934 |
-
jQuery("#general_tab").addClass("nav-tab-active");
|
935 |
-
jQuery("#encoding_tab").removeClass("nav-tab-active");
|
936 |
-
jQuery('h3:eq(0), h3:eq(2)').show();
|
937 |
-
jQuery('table:eq(0), table:eq(1), table:eq(3)').show();
|
938 |
-
jQuery(".kgvid_setting_nearvid").show();
|
939 |
-
jQuery('h3:eq(3)').hide();
|
940 |
-
jQuery('table:eq(4)').hide();
|
941 |
-
}
|
942 |
-
|
943 |
if ( tab == "encoding" ) {
|
944 |
|
945 |
jQuery("#general_tab").removeClass("nav-tab-active");
|
@@ -964,6 +962,20 @@ function kgvid_switch_settings_tab(tab) {
|
|
964 |
}
|
965 |
}
|
966 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
967 |
kgvid_hide_plugin_settings();
|
968 |
if ( jQuery('#video_app').length > 0 ) { kgvid_hide_ffmpeg_settings(); }
|
969 |
|
@@ -990,10 +1002,14 @@ function kgvid_hide_plugin_settings() {
|
|
990 |
|
991 |
if ( playback_option == "WordPress Default" || playback_option == "JW Player" ) {
|
992 |
jQuery('#js_skin').parents().eq(1).hide();
|
|
|
|
|
993 |
}
|
994 |
|
995 |
if ( playback_option == "Video.js" || playback_option == "Strobe Media Playback" ) {
|
996 |
jQuery('#js_skin').parents().eq(1).show();
|
|
|
|
|
997 |
}
|
998 |
|
999 |
if ( playback_option == "JW Player" ) {
|
@@ -1007,6 +1023,20 @@ function kgvid_hide_plugin_settings() {
|
|
1007 |
|
1008 |
}
|
1009 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1010 |
if ( ffmpeg_exists == "notinstalled" ) {
|
1011 |
jQuery(".kgvid_video_app_required").addClass("kgvid_thumbnail_overlay");
|
1012 |
jQuery(".kgvid_video_app_required").attr('title', kgvidL10n.ffmpegrequired);
|
@@ -1085,6 +1115,42 @@ function kgvid_switch_parents() {
|
|
1085 |
}
|
1086 |
}
|
1087 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1088 |
function kgvid_check_cms_progress(total, cms_type) {
|
1089 |
var kgflashmediaplayersecurity = document.getElementById("kgvid_settings_security").value;
|
1090 |
var interval = jQuery( '#wpbody-content' ).data(cms_type+'_interval');
|
@@ -1141,7 +1207,7 @@ function kgvid_pick_image(button) {
|
|
1141 |
// When an image is selected, run a callback.
|
1142 |
frame.on( 'select', function() {
|
1143 |
// Grab the selected attachment.
|
1144 |
-
var attachment = frame.state().get('selection').first()
|
1145 |
jQuery('#'+$el.data('change')).val(attachment.attributes.url);
|
1146 |
if ( $el.data('change').substr(-25) == "kgflashmediaplayer-poster" ) { jQuery('#'+$el.data('change').slice(0, -25)+'thumbnailplaceholder').html('<div class="kgvid_thumbnail_box kgvid_chosen_thumbnail_box"><img width="200" src="'+attachment.attributes.url+'"></div>'); }
|
1147 |
jQuery('#'+$el.data('change')).change();
|
@@ -1185,7 +1251,7 @@ function kgvid_pick_attachment(button) {
|
|
1185 |
// When an image is selected, run a callback.
|
1186 |
frame.on( 'select', function() {
|
1187 |
// Grab the selected attachment.
|
1188 |
-
var attachment = frame.state().get('selection').first()
|
1189 |
jQuery('#'+$el.data('change')).val(attachment.attributes.url);
|
1190 |
jQuery('#'+$el.data('change')).change();
|
1191 |
});
|
@@ -1195,6 +1261,68 @@ function kgvid_pick_attachment(button) {
|
|
1195 |
|
1196 |
}
|
1197 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1198 |
function kgvid_media_library_icon_overlay() {
|
1199 |
var thumbnails = jQuery('.attachment-80x60, .attachment-preview.type-video .icon');
|
1200 |
jQuery.each(thumbnails, function(key, value) {
|
511 |
page = "queue";
|
512 |
}
|
513 |
|
514 |
+
var formats = new Array("fullres", "1080", "720", "mobile", "ogg", "webm", "custom");
|
515 |
var kgvid_encode = new Object();
|
516 |
jQuery.each(formats, function(key,formats) {
|
517 |
kgvid_encode[formats] = "";
|
525 |
jQuery(encodeprogressplaceholderid).empty();
|
526 |
jQuery(encodeplaceholderid).append('<strong>'+kgvidL10n.loading+'</strong>');
|
527 |
|
528 |
+
jQuery.post(ajaxurl, { action:"kgvid_callffmpeg", security: kgflashmediaplayersecurity, movieurl: attachmentURL, ffmpeg_action: 'enqueue', encodeformats: kgvid_encode, attachmentID: postID, parent_id: parent_post_id }, function(data) {
|
529 |
|
530 |
jQuery(encodeplaceholderid).empty();
|
531 |
jQuery(encodeprogressplaceholderid).empty();
|
663 |
shortcode += titlecode + '<span itemprop="name">' + document.getElementById('videotitle').value + '</span>' + endtitlecode + '<br />';
|
664 |
}
|
665 |
if (url !="") {
|
|
|
666 |
shortcode += ' [KGVID';
|
667 |
if (document.getElementById('attachments-'+basename+'-kgflashmediaplayer-poster').value !="") { shortcode += ' poster="' + document.getElementById('attachments-'+basename+'-kgflashmediaplayer-poster').value + '"'; }
|
668 |
if (document.getElementById('attachments-'+basename+'-kgflashmediaplayer-width').value !="") { shortcode += ' width="' + document.getElementById('attachments-'+basename+'-kgflashmediaplayer-width').value + '"'; }
|
715 |
|
716 |
jQuery.post(ajaxurl, { action: "kgvid_delete_video", security: kgflashmediaplayersecurity, movieurl: movieurl, postid: postID, format: format, childid: childID, blogid: blogID }, function(data) {
|
717 |
jQuery('#attachments-'+postID+'-kgflashmediaplayer-encode'+format).change();
|
718 |
+
if ( pagenow == 'settings_page_kgvid_network_video_encoding_queue-network' || pagenow == 'tools_page_kgvid_video_encoding_queue' ) { page = 'queue'; }
|
719 |
+
else { page = 'attachment'; }
|
720 |
+
kgvid_redraw_encode_checkboxes(movieurl, postID, page, blogID);
|
721 |
}, "json" );
|
722 |
|
723 |
}
|
878 |
}
|
879 |
|
880 |
if ( jQuery('#app_path').data('ffmpeg_exists') == "on" && jQuery(input_obj).hasClass('affects_ffmpeg') == true && jQuery('#ffmpeg_output').length != 0 ) {
|
881 |
+
|
882 |
+
if ( jQuery('.kgvid_custom_format').filter(function() { return jQuery(this).val(); }).length == 0 ) { //if there's no custom format anymore
|
883 |
+
if ( jQuery('#sample_format').val() == 'custom' ) { jQuery('#sample_format').val('mobile'); }
|
884 |
+
jQuery('#sample_format').find('option[value="custom"]').remove();
|
885 |
+
}
|
886 |
+
else {
|
887 |
+
if ( jQuery('#sample_format').find('option[value="custom"]').length == 0 ) { jQuery('#sample_format').append('<option value="custom">'+kgvidL10n.custom+'</option>'); }
|
888 |
+
}
|
889 |
+
|
890 |
jQuery('#ffmpeg_output').html(kgvidL10n.runningtest);
|
891 |
jQuery('#ffmpeg_h264_sample').html(data.encode_string);
|
892 |
jQuery('#ffmpeg_watermark_example').slideUp('slow');
|
938 |
|
939 |
function kgvid_switch_settings_tab(tab) {
|
940 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
941 |
if ( tab == "encoding" ) {
|
942 |
|
943 |
jQuery("#general_tab").removeClass("nav-tab-active");
|
962 |
}
|
963 |
}
|
964 |
|
965 |
+
else { //General tab
|
966 |
+
|
967 |
+
var playback_option = jQuery('#embed_method').val();
|
968 |
+
|
969 |
+
jQuery("#general_tab").addClass("nav-tab-active");
|
970 |
+
jQuery("#encoding_tab").removeClass("nav-tab-active");
|
971 |
+
jQuery('h3:eq(0), h3:eq(2)').show();
|
972 |
+
jQuery('table:eq(0), table:eq(1), table:eq(3)').show();
|
973 |
+
jQuery(".kgvid_setting_nearvid").show();
|
974 |
+
jQuery('h3:eq(3)').hide();
|
975 |
+
jQuery('table:eq(4)').hide();
|
976 |
+
|
977 |
+
}
|
978 |
+
|
979 |
kgvid_hide_plugin_settings();
|
980 |
if ( jQuery('#video_app').length > 0 ) { kgvid_hide_ffmpeg_settings(); }
|
981 |
|
1002 |
|
1003 |
if ( playback_option == "WordPress Default" || playback_option == "JW Player" ) {
|
1004 |
jQuery('#js_skin').parents().eq(1).hide();
|
1005 |
+
jQuery('#chromecast').parents().eq(1).hide();
|
1006 |
+
jQuery('#auto_res').parents().eq(1).hide();
|
1007 |
}
|
1008 |
|
1009 |
if ( playback_option == "Video.js" || playback_option == "Strobe Media Playback" ) {
|
1010 |
jQuery('#js_skin').parents().eq(1).show();
|
1011 |
+
jQuery('#chromecast').parents().eq(1).show();
|
1012 |
+
jQuery('#auto_res').parents().eq(1).show();
|
1013 |
}
|
1014 |
|
1015 |
if ( playback_option == "JW Player" ) {
|
1023 |
|
1024 |
}
|
1025 |
|
1026 |
+
if ( encoding_tab ) {
|
1027 |
+
|
1028 |
+
var moov = jQuery('#moov').val();
|
1029 |
+
|
1030 |
+
if ( moov == 'none' || moov == 'movflag' ) {
|
1031 |
+
jQuery('#moov_path_p').hide();
|
1032 |
+
}
|
1033 |
+
else {
|
1034 |
+
jQuery('.kgvid_moov_option').html(moov);
|
1035 |
+
jQuery('#moov_path_p').show();
|
1036 |
+
}
|
1037 |
+
|
1038 |
+
}
|
1039 |
+
|
1040 |
if ( ffmpeg_exists == "notinstalled" ) {
|
1041 |
jQuery(".kgvid_video_app_required").addClass("kgvid_thumbnail_overlay");
|
1042 |
jQuery(".kgvid_video_app_required").attr('title', kgvidL10n.ffmpegrequired);
|
1115 |
}
|
1116 |
}
|
1117 |
|
1118 |
+
function kgvid_auto_generate_old(type) {
|
1119 |
+
|
1120 |
+
var kgflashmediaplayersecurity = document.getElementById("kgvid_settings_security").value;
|
1121 |
+
|
1122 |
+
jQuery.post(ajaxurl, { action: "kgvid_get_generating_old", type: type, security: kgflashmediaplayersecurity }, function(count) {
|
1123 |
+
|
1124 |
+
if ( count > 0 ) {
|
1125 |
+
|
1126 |
+
if ( type == 'thumbs' ) { var set_for_sure = confirm(kgvidL10n.autothumbnailwarning+count+"\n\n "+kgvidL10n.cancel_ok); }
|
1127 |
+
if ( type == 'encode' ) { var set_for_sure = confirm(kgvidL10n.autoencodewarning+"\n\n "+kgvidL10n.cancel_ok); }
|
1128 |
+
|
1129 |
+
if ( set_for_sure == true ) {
|
1130 |
+
|
1131 |
+
jQuery('#generate_old_'+type+'_button').parent().append('<div id="generating_old_'+type+'_meter" class="kgvid_meter"><div class="kgvid_meter_bar" style="width:0%;"><div class="kgvid_meter_text"></div></div></div><span id="generating_old_'+type+'_status"> '+kgvidL10n.processing+'</span>');
|
1132 |
+
|
1133 |
+
jQuery.post(ajaxurl, { action: "kgvid_generating_old", type: type, security: kgflashmediaplayersecurity });
|
1134 |
+
var interval = setInterval(function(){kgvid_check_cms_progress(count, 'generating_old_'+type)}, 1000);
|
1135 |
+
jQuery( '#wpbody-content' ).data('generating_old_'+type+'_interval', interval);
|
1136 |
+
|
1137 |
+
}// end if sure
|
1138 |
+
|
1139 |
+
}//end if count
|
1140 |
+
else { alert(kgvidL10n.nothumbstomake); }
|
1141 |
+
|
1142 |
+
}, "text" );
|
1143 |
+
|
1144 |
+
}
|
1145 |
+
|
1146 |
+
function kgvid_add_old_videos_to_queue() {
|
1147 |
+
|
1148 |
+
var kgflashmediaplayersecurity = document.getElementById("kgvid_settings_security").value;
|
1149 |
+
|
1150 |
+
|
1151 |
+
|
1152 |
+
}
|
1153 |
+
|
1154 |
function kgvid_check_cms_progress(total, cms_type) {
|
1155 |
var kgflashmediaplayersecurity = document.getElementById("kgvid_settings_security").value;
|
1156 |
var interval = jQuery( '#wpbody-content' ).data(cms_type+'_interval');
|
1207 |
// When an image is selected, run a callback.
|
1208 |
frame.on( 'select', function() {
|
1209 |
// Grab the selected attachment.
|
1210 |
+
var attachment = frame.state().get('selection').first();
|
1211 |
jQuery('#'+$el.data('change')).val(attachment.attributes.url);
|
1212 |
if ( $el.data('change').substr(-25) == "kgflashmediaplayer-poster" ) { jQuery('#'+$el.data('change').slice(0, -25)+'thumbnailplaceholder').html('<div class="kgvid_thumbnail_box kgvid_chosen_thumbnail_box"><img width="200" src="'+attachment.attributes.url+'"></div>'); }
|
1213 |
jQuery('#'+$el.data('change')).change();
|
1251 |
// When an image is selected, run a callback.
|
1252 |
frame.on( 'select', function() {
|
1253 |
// Grab the selected attachment.
|
1254 |
+
var attachment = frame.state().get('selection').first();
|
1255 |
jQuery('#'+$el.data('change')).val(attachment.attributes.url);
|
1256 |
jQuery('#'+$el.data('change')).change();
|
1257 |
});
|
1261 |
|
1262 |
}
|
1263 |
|
1264 |
+
function kgvid_pick_format(button, parentID, mime, format, movieurl) {
|
1265 |
+
|
1266 |
+
var frame;
|
1267 |
+
|
1268 |
+
jQuery( function() {
|
1269 |
+
|
1270 |
+
// Build the choose from library frame.
|
1271 |
+
|
1272 |
+
var $el = jQuery(button);
|
1273 |
+
event.preventDefault();
|
1274 |
+
|
1275 |
+
// If the media frame already exists, reopen it.
|
1276 |
+
if ( frame ) {
|
1277 |
+
frame.open();
|
1278 |
+
return;
|
1279 |
+
}
|
1280 |
+
|
1281 |
+
// Create the media frame.
|
1282 |
+
frame = wp.media.frames.customHeader = wp.media({
|
1283 |
+
// Set the title of the modal.
|
1284 |
+
title: $el.data('choose'),
|
1285 |
+
|
1286 |
+
// Tell the modal to show only videos matching the mime type.
|
1287 |
+
library: {
|
1288 |
+
type: mime
|
1289 |
+
},
|
1290 |
+
|
1291 |
+
// Customize the submit button.
|
1292 |
+
button: {
|
1293 |
+
// Set the text of the button.
|
1294 |
+
text: $el.data('update'),
|
1295 |
+
close: true
|
1296 |
+
}
|
1297 |
+
});
|
1298 |
+
|
1299 |
+
// When an image is selected, run a callback.
|
1300 |
+
frame.on( 'select', function() {
|
1301 |
+
// Grab the selected attachment.
|
1302 |
+
var video = frame.state().get('selection').first();
|
1303 |
+
var kgflashmediaplayersecurity = document.getElementsByName('attachments['+parentID+'][kgflashmediaplayer-security]')[0].value;
|
1304 |
+
|
1305 |
+
jQuery.post(ajaxurl, { action:"kgvid_update_child_format", security: kgflashmediaplayersecurity, parent_id: parentID, video_id: video.id, format: format }, function(data) {
|
1306 |
+
kgvid_redraw_encode_checkboxes(movieurl, parentID, 'attachment');
|
1307 |
+
}, "json");
|
1308 |
+
|
1309 |
+
});
|
1310 |
+
|
1311 |
+
frame.open();
|
1312 |
+
});
|
1313 |
+
|
1314 |
+
}
|
1315 |
+
|
1316 |
+
function kgvid_clear_video(movieurl, postID, video_id, blog_id) {
|
1317 |
+
|
1318 |
+
var kgflashmediaplayersecurity = document.getElementsByName('attachments['+postID+'][kgflashmediaplayer-security]')[0].value;
|
1319 |
+
|
1320 |
+
jQuery.post(ajaxurl, { action:"kgvid_clear_child_format", security: kgflashmediaplayersecurity, video_id: video_id, blog_id: blog_id }, function(data) {
|
1321 |
+
kgvid_redraw_encode_checkboxes(movieurl, postID, 'attachment');
|
1322 |
+
}, "json");
|
1323 |
+
|
1324 |
+
}
|
1325 |
+
|
1326 |
function kgvid_media_library_icon_overlay() {
|
1327 |
var thumbnails = jQuery('.attachment-80x60, .attachment-preview.type-video .icon');
|
1328 |
jQuery.each(thumbnails, function(key, value) {
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== Video Embed & Thumbnail Generator ===
|
2 |
Contributors: kylegilman
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=kylegilman@gmail.com&item_name=Video%20Embed%20And%20Thumbnail%20Generator%20Plugin%20Donation
|
4 |
-
Tags: video, video player, video gallery, html5, shortcode, thumbnail, preview, poster, ffmpeg, libav, embed, mobile, webm, ogg, h.264, h264, responsive, mp4, jwplayer
|
5 |
Requires at least: 3.5
|
6 |
Tested up to: 4.0
|
7 |
-
Stable tag: 4.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -25,7 +25,7 @@ You have the option to use a few different video players:
|
|
25 |
|
26 |
<em>The Strobe Media Playback option hasn't been updated since 2011 and is not recommended, but I'm keeping it around for longtime users of this plugin who don't want to change. Most features of the plugin will work when using Strobe Media Playback, but new features will not be tested with it. Selecting Strobe Media Playback will default to a Flash video player if you're using a Flash-compatible file (flv, f4v, mp4, mov, or m4v). Otherwise it will use the Video.js player as a fallback.</em>
|
27 |
|
28 |
-
No matter which player you use, the video will resize on the fly to fit the container it's in. There is no need to use FitVids.js and in fact FitVids.js will break playback for some players.
|
29 |
|
30 |
You can also use the plugin to create a popup video gallery. The shortcode uses options similar to the WordPress image gallery shortcode. In its simplest form use the code `[KGVID gallery="true"]` to create a gallery of all videos attached to the post. Thumbnail size and video popup size can be set on the plugin settings page or in the shortcode.
|
31 |
|
@@ -35,27 +35,27 @@ If you know which frame you want to use for your thumbnail, click "Choose from v
|
|
35 |
|
36 |
After you select a thumbnail it will be registered in the Wordpress Media Library and added to the video's attachments. Unused thumbnails will be deleted.
|
37 |
|
38 |
-
In the plugin settings you can set the default maximum width and height based on the dimensions of your particular template and those values will be filled in when you open the window. If you generate thumbnails, the video display dimensions will be adjusted automatically to match the size and aspect ratio of the video file. You can make further adjustments if you want.
|
39 |
|
40 |
You can add subtitle and caption tracks by choosing properly formatted WebVTT files from the media library or entering a URL directly. Enter the two-letter language code and the label text that will be shown to users. Currently the Video.js and WordPress default players do not work with the "default" attribute but I will add the option to turn a text track on by default if that changes in the future. The WordPress default player does not differentiate between captions and subtitles, but Video.js will show a different icon depending on the selection.
|
41 |
|
42 |
-
I highly recommend using <a href="http://handbrake.fr/">Handbrake</a> to make a file with H.264 video and AAC audio in an MP4 container. If you're encoding with Handbrake make sure that "Web Optimized" is checked. Using Apple's Compressor, the "Streaming" setting should be "Fast Start" (not Fast Start - Compressed Header).
|
43 |
|
44 |
-
The plugin can use FFMPEG or LIBAV to encode videos and make thumbnails if you have one of them installed on your server. You can
|
45 |
|
46 |
By default the plugin looks for FFMPEG in `/usr/local/bin` but if the application is installed in a different place on your server, you can point it to the correct place in the plugin settings. Users running WordPress on Windows servers should try using Linux-style paths (with forward slashes instead of backslashes and a forward slash `/` instead of `C:\`).
|
47 |
|
48 |
-
If you have the proper libraries installed, you can choose to replace your uploaded video with
|
49 |
|
50 |
The files will encode in the background and will take some time to complete, depending on your server setup and the length and size of your video. The plugin adds a Video Encode Queue menu to the Tools menu. You will see encoding progress, the option to cancel an encoding job, and you should get an error message if something goes wrong. Users on Windows servers may get inconsistent results with the encoding queue.
|
51 |
|
52 |
-
Encoded H.264 files can be fixed for streaming using "movflags faststart" introduced in recent versions of FFMPEG/LIBAV, or qt-faststart or MP4Box if you have one of them installed
|
53 |
|
54 |
-
If you want to make
|
55 |
|
56 |
If you want to make it easier for users to save your videos to their computers, you can choose to include a link by checking the "Generate Download Link Below Video" button.
|
57 |
|
58 |
-
Sometimes for various reasons you might need to embed video files that are not saved in the Wordpress Media Library. Maybe your file is too large to upload through the media upload form (if it is, I suggest the excellent "Add From Server" plugin), or maybe it's hosted on another server. Either way, you can use the tab "Embed Video From URL" in the Add Media window. Just enter the Video URL manually, and all other steps are the same as the Media Library options. The plugin will look for alternate encoded files in the same directory as the original, but this takes a long time when the video is on another server so it will only check for them once.
|
59 |
|
60 |
To embed videos on other sites you can use code like this.
|
61 |
|
@@ -84,6 +84,7 @@ I'm not really a software developer. I'm just a film editor with some time on hi
|
|
84 |
* `endofvideooverlay="http://www.example.com/end_image.jpg` sets the image shown when the video ends.
|
85 |
* `width="xxx"`
|
86 |
* `height="xxx"`
|
|
|
87 |
* `align="left/right/center"`
|
88 |
* `inline="true/false"` allow other content on the same line as the video
|
89 |
* `volume="0.x"` pre-sets the volume for unusually loud videos. Value between 0 and 1.
|
@@ -100,6 +101,7 @@ I'm not really a software developer. I'm just a film editor with some time on hi
|
|
100 |
* `downloadlink="true/false"` generates a link below the video to make it easier for users to save the video file to their computers.
|
101 |
* `right_click="true/false"` allow or disable right-clicking on the video player.
|
102 |
* `resize="true/false"` allow or disable responsive resizing.
|
|
|
103 |
|
104 |
= These options will add a subtitle/caption track =
|
105 |
|
@@ -221,6 +223,35 @@ Enter the username & password in the plugin settings "FFMPEG Settings" tab, or u
|
|
221 |
|
222 |
== Changelog ==
|
223 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
224 |
= 4.3.5 - September 17, 2014 =
|
225 |
* Fixed responsive height for videos using WordPress Default player.
|
226 |
* Better fix for bug that prevented choosing thumbnails from the small video player in the new media library popup window in WordPress 4.0.
|
1 |
=== Video Embed & Thumbnail Generator ===
|
2 |
Contributors: kylegilman
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=kylegilman@gmail.com&item_name=Video%20Embed%20And%20Thumbnail%20Generator%20Plugin%20Donation
|
4 |
+
Tags: video, video player, video gallery, html5, shortcode, thumbnail, preview, poster, ffmpeg, libav, embed, mobile, webm, ogg, h.264, h264, responsive, mp4, jwplayer, resolution
|
5 |
Requires at least: 3.5
|
6 |
Tested up to: 4.0
|
7 |
+
Stable tag: 4.4
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
25 |
|
26 |
<em>The Strobe Media Playback option hasn't been updated since 2011 and is not recommended, but I'm keeping it around for longtime users of this plugin who don't want to change. Most features of the plugin will work when using Strobe Media Playback, but new features will not be tested with it. Selecting Strobe Media Playback will default to a Flash video player if you're using a Flash-compatible file (flv, f4v, mp4, mov, or m4v). Otherwise it will use the Video.js player as a fallback.</em>
|
27 |
|
28 |
+
No matter which player you use, the video will resize on the fly to fit the container it's in. There is no need to use FitVids.js and in fact FitVids.js will break playback for some players. If you provide multiple H.264 resolutions, the Video.js player can automatically select the one closest to the size of the player and provide a button for users to select the resolution manually. Because the player uses native controls on mobile devices, the manual resolution button is only available on desktop browsers.
|
29 |
|
30 |
You can also use the plugin to create a popup video gallery. The shortcode uses options similar to the WordPress image gallery shortcode. In its simplest form use the code `[KGVID gallery="true"]` to create a gallery of all videos attached to the post. Thumbnail size and video popup size can be set on the plugin settings page or in the shortcode.
|
31 |
|
35 |
|
36 |
After you select a thumbnail it will be registered in the Wordpress Media Library and added to the video's attachments. Unused thumbnails will be deleted.
|
37 |
|
38 |
+
In the plugin settings you can set the default maximum video width and height based on the dimensions of your particular template and those values will be filled in when you open the window. If you generate thumbnails, the video display dimensions will be adjusted automatically to match the size and aspect ratio of the video file. You can make further adjustments if you want. There are options to always fill the width of the template or to always set videos to the maximum width setting regardless of their resolution.
|
39 |
|
40 |
You can add subtitle and caption tracks by choosing properly formatted WebVTT files from the media library or entering a URL directly. Enter the two-letter language code and the label text that will be shown to users. Currently the Video.js and WordPress default players do not work with the "default" attribute but I will add the option to turn a text track on by default if that changes in the future. The WordPress default player does not differentiate between captions and subtitles, but Video.js will show a different icon depending on the selection.
|
41 |
|
42 |
+
I highly recommend using <a href="http://handbrake.fr/">Handbrake</a> to make a file with H.264 video and AAC audio in an MP4 container before uploading. If you're encoding with Handbrake make sure that "Web Optimized" is checked. Using Apple's Compressor, the "Streaming" setting should be "Fast Start" (not Fast Start - Compressed Header).
|
43 |
|
44 |
+
The plugin can use FFMPEG or LIBAV to encode videos and make thumbnails if you have one of them installed on your server. You can choose to generate thumbnails and alternate video formats automatically whenever a new video is uploaded to the media library, and there are buttons to generate thumbnails and alternate video formats for every video already in the media library.
|
45 |
|
46 |
By default the plugin looks for FFMPEG in `/usr/local/bin` but if the application is installed in a different place on your server, you can point it to the correct place in the plugin settings. Users running WordPress on Windows servers should try using Linux-style paths (with forward slashes instead of backslashes and a forward slash `/` instead of `C:\`).
|
47 |
|
48 |
+
If you have the proper libraries installed on your server, you can choose to replace your uploaded video with your preferred format, and generate as many as six additional formats depending on your original source. 1080p, 720p, and 360p H.264, same resolution WEBM and OGV, and a custom format. Different browsers have different playback capabilities. Most desktop browsers can play H.264, and all modern mobile devices can play at least 360p H.264. If you create multiple H.264 resolutions, the highest resolution supported by the device will be served up automatically. The plugin will not upconvert your video, so if you upload a 720p video, it will not waste your time creating a 1080p version. There was a time when it seemed like a good idea to provide OGV or WEBM for some desktop browsers, but Firefox supports H.264 playback in Windows & Linux now and will support it in Mac OS starting in November 2014. I no longer recommend encoding OGV or WEBM unless you expect a large number of no-Flash sticklers visiting your site, or if you're making an open source principled stand against H.264. However, your needs may vary.
|
49 |
|
50 |
The files will encode in the background and will take some time to complete, depending on your server setup and the length and size of your video. The plugin adds a Video Encode Queue menu to the Tools menu. You will see encoding progress, the option to cancel an encoding job, and you should get an error message if something goes wrong. Users on Windows servers may get inconsistent results with the encoding queue.
|
51 |
|
52 |
+
Encoded H.264 files can be fixed for streaming using "movflags faststart" introduced in recent versions of FFMPEG/LIBAV, or qt-faststart or MP4Box if you have one of them installed on your server and select it in the plugin settings. Without one of these options enabled, FFMPEG/LIBAV will place moov atoms at the end of H.264 encoded files, which in some cases forces the entire file to download before playback can start.
|
53 |
|
54 |
+
If you want to make OGV, WEBM, or H.264 files available and can't use the FFMPEG encode button, you can upload your own files to the same directory as the original and the plugin will automatically find them. For example, if your main file is awesomevid.mp4, the plugin will look for awesomevid-1080.mp4, awesomevid-720.mp4, awesomevid-360.mp4, awesomevid.webm and awesomevid.ogv as well. If your videos don't conform to that naming structure, you can manually assign them from the media library. No matter what format your original video is, you can use it in the shortcode and the plugin will attempt to find all compatible formats related to it. For example, you might have an AVI called awesomevid.avi which is not compatible with any browser, but if you have other formats encoded already, `[KGVID]http://yoursite.com/awesomevid.avi[/KGVID]` will ignore the incompatible AVI file, but find those other formats and embed them.
|
55 |
|
56 |
If you want to make it easier for users to save your videos to their computers, you can choose to include a link by checking the "Generate Download Link Below Video" button.
|
57 |
|
58 |
+
Sometimes for various reasons you might need to embed video files that are not saved in the Wordpress Media Library. Maybe your file is too large to upload through the media upload form (if it is, I suggest the excellent "<a href='https://wordpress.org/plugins/add-from-server/'>Add From Server</a>" plugin), or maybe it's hosted on another server. Either way, you can use the tab "Embed Video From URL" in the Add Media window. Just enter the Video URL manually, and all other steps are the same as the Media Library options. The plugin will look for alternate encoded files in the same directory as the original, but this takes a long time when the video is on another server so it will only check for them once.
|
59 |
|
60 |
To embed videos on other sites you can use code like this.
|
61 |
|
84 |
* `endofvideooverlay="http://www.example.com/end_image.jpg` sets the image shown when the video ends.
|
85 |
* `width="xxx"`
|
86 |
* `height="xxx"`
|
87 |
+
* `fullwidth="true/false"` set video to always expand to fill its container.`
|
88 |
* `align="left/right/center"`
|
89 |
* `inline="true/false"` allow other content on the same line as the video
|
90 |
* `volume="0.x"` pre-sets the volume for unusually loud videos. Value between 0 and 1.
|
101 |
* `downloadlink="true/false"` generates a link below the video to make it easier for users to save the video file to their computers.
|
102 |
* `right_click="true/false"` allow or disable right-clicking on the video player.
|
103 |
* `resize="true/false"` allow or disable responsive resizing.
|
104 |
+
* `auto_res="true/false"` let the plugin select the best resolution for the size of the player.
|
105 |
|
106 |
= These options will add a subtitle/caption track =
|
107 |
|
223 |
|
224 |
== Changelog ==
|
225 |
|
226 |
+
= 4.4 - October 28, 2014 =
|
227 |
+
* Added H.264 HTML5 video resolution switcher for the Video.js player. Automatically selects the appropriate resolution for the size of the displayed video and allows manual user switching on desktop computers.
|
228 |
+
* Added option to set videos to automatically fill their containers.
|
229 |
+
* Added buttons to manually set other videos in the media library as alternate formats for the current video.
|
230 |
+
* Added option to encode a custom resolution.
|
231 |
+
* Added option to replace original video with a lower-resolution H.264 video, WEBM or OGV.
|
232 |
+
* Added buttons to generate thumbnails and encode additional formats for all previously uploaded videos.
|
233 |
+
* Added plugin admin scripts to the frontend when Insert Media button is loaded. Works with bbPress now.
|
234 |
+
* Added option to encode 64 and 32 kbps audio.
|
235 |
+
* Added option to set a different application path for qt-faststart or MP4Box.
|
236 |
+
* Added option to disable stdin during FFMPEG encoding. Particularly useful for IIS users.
|
237 |
+
* Updated Video.js to version 4.9.1
|
238 |
+
* Changed download link to a forced download for videos in the media library. No right-clicking necessary.
|
239 |
+
* Changed pop-up video gallery to use inline code rather than an AJAX query.
|
240 |
+
* Changed embedded video IDs to allow the same video to be embedded multiple times on a page.
|
241 |
+
* Changed volume slider on plugin settings page to drop-down menu to fix settings save errors in Windows.
|
242 |
+
* Changed 480p video format label to 360p to accurately reflect resolution of 16:9 videos. Format has always been 480p only for 4:3 videos.
|
243 |
+
* Changed AAC encoder preference to libfdk_aac > libfaac > Native FFmpeg AAC encoder (aac) > libvo_aacenc.
|
244 |
+
* Restored display of moov atom fix process in FFMPEG test output.
|
245 |
+
* Fixed bug that made pop-up video windows 0 pixels wide in iOS 8.
|
246 |
+
* Fixed bug that couldn't find video attachements that have been redirected to a CDN.
|
247 |
+
* Fixed bug that quickly faded out the end overlay image in IE.
|
248 |
+
* Fixed bug that prevented replacing encoded videos if there were any other videos in the queue.
|
249 |
+
* Fixed bug that left the GUID as the original filename if replacing the video with an mp4 changed the extension.
|
250 |
+
* Fixed bug that incorrectly reported all encoding fps values over 99 as "10".
|
251 |
+
* Fixed bug that didn't recognize videos had completed encoding if there were audio frames left in the queue.
|
252 |
+
* Fixed bug that left title overlay on iOS videos using the WordPress Default player.
|
253 |
+
* Fixed bug that made video galleries display as inline-block when the inline video option was disabled.
|
254 |
+
|
255 |
= 4.3.5 - September 17, 2014 =
|
256 |
* Fixed responsive height for videos using WordPress Default player.
|
257 |
* Better fix for bug that prevented choosing thumbnails from the small video player in the new media library popup window in WordPress 4.0.
|
video-embed-thumbnail-generator.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Video Embed & Thumbnail Generator
|
4 |
Plugin URI: http://www.kylegilman.net/2011/01/18/video-embed-thumbnail-generator-wordpress-plugin/
|
5 |
Description: Generates thumbnails, HTML5-compliant videos, and embed codes for locally hosted videos. Requires FFMPEG or LIBAV for encoding.
|
6 |
-
Version: 4.
|
7 |
Author: Kyle Gilman
|
8 |
Author URI: http://www.kylegilman.net/
|
9 |
Text Domain: video-embed-thumbnail-generator
|
@@ -37,6 +37,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
37 |
Website: http://www.kathyisawesome.com/
|
38 |
7) Includes code adapted from Jean-Marc Amiaud's "Replace WordPress default media icon with preview image"
|
39 |
Website: http://www.amiaud.org/tag/video/
|
|
|
|
|
|
|
|
|
40 |
|
41 |
=Translators=
|
42 |
Spanish: Andrew Kurtis, Webhostinghub http://www.webhostinghub.com/
|
@@ -54,22 +58,30 @@ function kgvid_default_options_fn() {
|
|
54 |
$edit_others_capable = kgvid_check_if_capable('edit_others_posts');
|
55 |
|
56 |
$options = array(
|
57 |
-
"version" => 4.
|
58 |
"embed_method" => "Video.js",
|
59 |
"jw_player_id" => "",
|
60 |
"template" => false,
|
61 |
"template_gentle" => "on",
|
|
|
62 |
"encode_fullres" => false,
|
63 |
"encode_1080" => "on",
|
64 |
"encode_720" => "on",
|
65 |
"encode_mobile" => "on",
|
66 |
"encode_webm" => false,
|
67 |
"encode_ogg" => false,
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
"app_path" => "/usr/local/bin",
|
69 |
"video_app" => "ffmpeg",
|
70 |
"ffmpeg_exists" =>"notchecked",
|
71 |
"video_bitrate_flag" => false,
|
72 |
"ffmpeg_vpre" => false,
|
|
|
73 |
"moov" => "none",
|
74 |
"generate_thumbs" => 4,
|
75 |
"featured" => "on",
|
@@ -88,6 +100,7 @@ function kgvid_default_options_fn() {
|
|
88 |
"width" => "640",
|
89 |
"height" => "360",
|
90 |
"minimum_width" => false,
|
|
|
91 |
"gallery_width" => "960",
|
92 |
"gallery_height" => "540",
|
93 |
"gallery_thumb" => "250",
|
@@ -126,6 +139,7 @@ function kgvid_default_options_fn() {
|
|
126 |
"auto_thumb_position" => 50,
|
127 |
"right_click" => "on",
|
128 |
"resize" => "on",
|
|
|
129 |
"capabilities" => array(
|
130 |
"make_video_thumbnails" => $upload_capable,
|
131 |
"encode_videos" => $upload_capable,
|
@@ -209,23 +223,29 @@ function kgvid_save_encode_queue($video_encode_queue) {
|
|
209 |
|
210 |
}
|
211 |
|
212 |
-
function kgvid_video_formats() {
|
|
|
|
|
213 |
|
214 |
$video_formats = array(
|
215 |
"fullres" => array(
|
216 |
-
"name" => __("
|
217 |
-
"
|
218 |
-
"
|
|
|
219 |
"type" => "h264",
|
|
|
220 |
"mime" => "video/mp4",
|
221 |
"suffix" => "-fullres.mp4",
|
222 |
"vcodec" => "libx264"
|
223 |
),
|
224 |
"1080" => array(
|
225 |
"name" => "1080p H.264",
|
|
|
226 |
"width" => 1920,
|
227 |
"height" => 1080,
|
228 |
"type" => "h264",
|
|
|
229 |
"mime" => "video/mp4",
|
230 |
"suffix" => "-1080.mp4",
|
231 |
"old_suffix" => "-1080.m4v",
|
@@ -233,43 +253,109 @@ function kgvid_video_formats() {
|
|
233 |
),
|
234 |
"720" => array(
|
235 |
"name" => "720p H.264",
|
|
|
236 |
"width" => 1280,
|
237 |
"height" => 720,
|
238 |
"type" => "h264",
|
|
|
239 |
"mime" => "video/mp4",
|
240 |
"suffix" => "-720.mp4",
|
241 |
"old_suffix" => "-720.m4v",
|
242 |
"vcodec" => "libx264"
|
243 |
),
|
244 |
"mobile" => array(
|
245 |
-
"name" => "
|
|
|
246 |
"width" => 640,
|
247 |
"height" => 480,
|
248 |
"type" => "h264",
|
249 |
-
"
|
|
|
250 |
"mime" => "video/mp4",
|
251 |
"old_suffix" => "-ipod.m4v",
|
252 |
"vcodec" => "libx264"
|
253 |
),
|
254 |
"webm" => array(
|
255 |
"name" => "WEBM",
|
256 |
-
"
|
257 |
-
"
|
|
|
258 |
"type" => "webm",
|
|
|
259 |
"mime" => "video/webm",
|
260 |
"suffix" => ".webm",
|
261 |
"vcodec" => "libvpx",
|
262 |
),
|
263 |
"ogg" => array(
|
264 |
"name" => "OGV",
|
265 |
-
"
|
266 |
-
"
|
|
|
267 |
"type" => "ogv",
|
|
|
268 |
"mime" => "video/ogg",
|
269 |
"suffix" => ".ogv",
|
270 |
"vcodec" => "libtheora"
|
271 |
)
|
272 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
273 |
return $video_formats;
|
274 |
|
275 |
}
|
@@ -440,7 +526,7 @@ function kgvid_set_capabilities($capabilities) {
|
|
440 |
|
441 |
function kgvid_aac_encoders() {
|
442 |
|
443 |
-
$aac_array = array("libfdk_aac", "libfaac", "
|
444 |
return $aac_array;
|
445 |
|
446 |
}
|
@@ -511,6 +597,33 @@ function kgvid_rrmdir($dir) {
|
|
511 |
}
|
512 |
}
|
513 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
514 |
function kgvid_check_for_shortcode_in_content() {
|
515 |
global $post;
|
516 |
$pattern = get_shortcode_regex();
|
@@ -650,10 +763,8 @@ function kgvid_check_ffmpeg_exists($options, $save) {
|
|
650 |
function kgvid_set_video_dimensions($id, $gallery = false) {
|
651 |
|
652 |
$options = kgvid_get_options();
|
653 |
-
$
|
654 |
-
$
|
655 |
-
|
656 |
-
$video_meta = get_post_meta( $id, '_wp_attachment_metadata', true);
|
657 |
|
658 |
if ( is_array($video_meta) && array_key_exists('width', $video_meta) ) { $widthactual = $video_meta['width']; }
|
659 |
else { $widthactual = get_post_meta($id, "_kgflashmediaplayer-actualwidth", true); }
|
@@ -683,18 +794,23 @@ function kgvid_set_video_dimensions($id, $gallery = false) {
|
|
683 |
|
684 |
}
|
685 |
|
686 |
-
function
|
687 |
|
688 |
-
if (
|
689 |
-
|
690 |
-
$h264_movie_height = strval(round(floatval($movie_info['height']) / floatval($movie_info['width']) * $h264_movie_width));
|
691 |
-
if ( intval($h264_movie_height) > $format_stats['height'] ) { $h264_movie_height = $format_stats['height']; }
|
692 |
-
$h264_movie_width = strval(round(floatval($movie_info['width']) / floatval($movie_info['height']) * $h264_movie_height));
|
693 |
|
694 |
-
if ($
|
695 |
-
|
|
|
|
|
696 |
|
697 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
698 |
return $arr;
|
699 |
|
700 |
}
|
@@ -707,10 +823,12 @@ function kgvid_encodevideo_info($movieurl, $postID) {
|
|
707 |
$video_formats = kgvid_video_formats();
|
708 |
$sanitized_url = kgvid_sanitize_url($movieurl);
|
709 |
$movieurl = $sanitized_url['movieurl'];
|
|
|
710 |
|
711 |
$encodevideo_info['moviefilebasename'] = $sanitized_url['basename'];
|
712 |
-
|
713 |
$encodevideo_info['encodepath'] = $uploads['path'];
|
|
|
|
|
714 |
if ( get_post_type($postID) == "attachment" ) { //if it's an attachment, not from URL
|
715 |
$moviefile = get_attached_file($postID);
|
716 |
$path_parts = pathinfo($moviefile);
|
@@ -723,7 +841,7 @@ function kgvid_encodevideo_info($movieurl, $postID) {
|
|
723 |
'post_mime_type' => 'video'
|
724 |
);
|
725 |
}
|
726 |
-
|
727 |
|
728 |
$url_parts = parse_url($uploads['url']);
|
729 |
if ( is_array($url_parts) && array_key_exists('host', $url_parts) && strpos($movieurl, $url_parts['host']) !== false ) { //if we're on the same server
|
@@ -754,8 +872,8 @@ function kgvid_encodevideo_info($movieurl, $postID) {
|
|
754 |
|
755 |
foreach ( $video_formats as $format => $format_stats ) { //loop through each format
|
756 |
|
757 |
-
$encodevideo_info[$format
|
758 |
-
$encodevideo_info[$format
|
759 |
|
760 |
//start with the new database info before checking other locations
|
761 |
|
@@ -764,12 +882,20 @@ function kgvid_encodevideo_info($movieurl, $postID) {
|
|
764 |
$mime_type = get_post_mime_type($child->ID);
|
765 |
$wp_attached_file = get_post_meta($child->ID, '_wp_attached_file', true);
|
766 |
$wp_file_info = pathinfo($wp_attached_file);
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
$encodevideo_info[$format
|
771 |
-
$encodevideo_info[$format
|
772 |
-
$encodevideo_info[$format
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
773 |
continue 2; //skip rest of children loop and format loop
|
774 |
}
|
775 |
}
|
@@ -791,14 +917,20 @@ function kgvid_encodevideo_info($movieurl, $postID) {
|
|
791 |
'filepath' => $uploads['basedir']."/html5encodes/".$encodevideo_info['moviefilebasename'].$old_suffix ),
|
792 |
);
|
793 |
if ( !array_key_exists('old_suffix', $format_stats) ) { unset($potential_locations['same_directory_old_suffix']); }
|
|
|
|
|
|
|
|
|
|
|
|
|
794 |
|
795 |
foreach ( $potential_locations as $name => $location ) {
|
796 |
|
797 |
if ( file_exists($location['filepath']) ) {
|
798 |
-
$encodevideo_info[$format
|
799 |
-
$encodevideo_info[$format
|
800 |
-
$encodevideo_info[$format
|
801 |
-
if ( is_writable($location['filepath']) ) { $encodevideo_info[$format
|
802 |
break;
|
803 |
}
|
804 |
elseif ( !$encodevideo_info['sameserver'] && $name != "html5encodes" ) { //last resort if it's not on the same server, check url_exists
|
@@ -806,9 +938,9 @@ function kgvid_encodevideo_info($movieurl, $postID) {
|
|
806 |
$already_checked_url = get_post_meta($postID, '_kgflashmediaplayer-'.$sanitized_url['singleurl_id'].'-'.$format, true);
|
807 |
if ( empty($already_checked_url) ) {
|
808 |
if ( kgvid_url_exists(esc_url_raw(str_replace(" ", "%20", $location['url']))) ) {
|
809 |
-
$encodevideo_info[$format
|
810 |
-
$encodevideo_info[$format
|
811 |
-
update_post_meta($postID, '_kgflashmediaplayer-'.$sanitized_url['singleurl_id'].'-'.$format, $encodevideo_info[$format
|
812 |
}
|
813 |
else {
|
814 |
update_post_meta($postID, '_kgflashmediaplayer-'.$sanitized_url['singleurl_id'].'-'.$format, 'not found');
|
@@ -816,17 +948,16 @@ function kgvid_encodevideo_info($movieurl, $postID) {
|
|
816 |
}
|
817 |
else { //url already checked
|
818 |
if ( substr($already_checked_url, 0, 4) == 'http' ) { //if it smells like a URL...
|
819 |
-
$encodevideo_info[$format
|
820 |
-
$encodevideo_info[$format
|
821 |
}
|
822 |
}
|
823 |
}//end if not on same server
|
824 |
}//end potential locations loop
|
825 |
|
826 |
-
|
827 |
-
|
828 |
-
$encodevideo_info[$format
|
829 |
-
$encodevideo_info[$format.'filepath'] = $uploads['path'].'/'.$encodevideo_info['moviefilebasename'].$format_stats['suffix'];
|
830 |
}
|
831 |
|
832 |
}//end format loop
|
@@ -852,7 +983,7 @@ function kgvid_get_video_dimensions($video = false) {
|
|
852 |
$video_id = kgvid_url_to_id($video);
|
853 |
if ( $video_id ) {
|
854 |
$video_path = get_attached_file($video_id);
|
855 |
-
$video = $video_path;
|
856 |
}
|
857 |
else { //not in the database
|
858 |
if ( !empty($options['htaccess_login']) && strpos($video, 'http://') === 0 ) {
|
@@ -929,8 +1060,8 @@ function kgvid_generate_flashvars($content, $query_atts, $encodevideo_info, $id)
|
|
929 |
$flash_source_found = false;
|
930 |
$video_formats = kgvid_video_formats();
|
931 |
foreach ($video_formats as $format => $format_stats) { //check if there's an H.264 format available and pick the highest quality one
|
932 |
-
if ( $encodevideo_info[$format
|
933 |
-
$flashvars['src'] = urlencode(trim($encodevideo_info[$format
|
934 |
$flash_source_found = true;
|
935 |
break;
|
936 |
}
|
@@ -1027,7 +1158,10 @@ function kgvid_generate_encode_string($input, $output, $movie_info, $format, $wi
|
|
1027 |
if ( strpos($options['ffmpeg_watermark']['url'], 'http://') === 0 ) {
|
1028 |
$watermark_id = false;
|
1029 |
$watermark_id = kgvid_url_to_id($options['ffmpeg_watermark']['url']);
|
1030 |
-
if ( $watermark_id ) {
|
|
|
|
|
|
|
1031 |
}
|
1032 |
|
1033 |
$watermark_input = '-i "'.$options['ffmpeg_watermark']['url'].'" ';
|
@@ -1071,7 +1205,7 @@ function kgvid_generate_encode_string($input, $output, $movie_info, $format, $wi
|
|
1071 |
|
1072 |
}
|
1073 |
else { //if it's not H.264 the settings are basically the same
|
1074 |
-
$ffmpeg_options = "-acodec libvorbis -".$audio_bitrate_flag." ".$options['audio_bitrate']."k -vcodec ".$video_formats[$format]['vcodec'];
|
1075 |
if ( $video_formats[$format]['type'] == 'webm' && $options['rate_control'] == "crf" ) {
|
1076 |
$ffmpeg_options .= " -".$video_bitrate_flag." ".round(floatval($options['bitrate_multiplier'])*1.25*$width*$height*30/1024)."k"; //set a max bitrate 25% larger than the ABR. Otherwise libvpx goes way too low.
|
1077 |
}
|
@@ -1084,8 +1218,12 @@ function kgvid_generate_encode_string($input, $output, $movie_info, $format, $wi
|
|
1084 |
if ( !empty($options['htaccess_login']) && strpos($input, 'http://') === 0 ) {
|
1085 |
$input = substr_replace($input, $options['htaccess_login'].':'.$options['htaccess_password'].'@', 7, 0);
|
1086 |
}
|
|
|
|
|
|
|
|
|
1087 |
$encode_string = array();
|
1088 |
-
$encode_string[1] = $nice.$options['app_path']."/".$options['video_app'].' -y -i "'.$input.'" '.$watermark_input.$ffmpeg_options.$rate_control_flag.$rotate." -threads ".$options['threads'];
|
1089 |
$encode_string[2] = $watermark_filter;
|
1090 |
$encode_string[3] = ' "'.$output.'"';
|
1091 |
|
@@ -1158,7 +1296,7 @@ function kgvid_video_embed_enqueue_scripts() {
|
|
1158 |
|
1159 |
//Video.js styles
|
1160 |
if ( $options['embed_method'] == "Video.js" || $options['embed_method'] == "Strobe Media Playback" ) {
|
1161 |
-
wp_enqueue_style( 'video-js', plugins_url("", __FILE__).'/video-js/video-js.css', '', '4.
|
1162 |
wp_enqueue_style( 'video-js-kg-skin', plugins_url("", __FILE__).'/video-js/kg-video-js-skin.css', '', $options['version'] );
|
1163 |
}
|
1164 |
|
@@ -1168,7 +1306,10 @@ function kgvid_video_embed_enqueue_scripts() {
|
|
1168 |
}
|
1169 |
add_action('wp_enqueue_scripts', 'kgvid_video_embed_enqueue_scripts', 12);
|
1170 |
|
|
|
|
|
1171 |
function enqueue_kgvid_script() { //loads plugin-related scripts in the admin area
|
|
|
1172 |
$options = kgvid_get_options();
|
1173 |
|
1174 |
wp_enqueue_script( 'kgvid_video_plugin_admin', plugins_url('/js/kgvid_video_plugin_admin.js', __FILE__), array('jquery'), $options['version'], true );
|
@@ -1193,6 +1334,9 @@ function enqueue_kgvid_script() { //loads plugin-related scripts in the admin ar
|
|
1193 |
'runningtest' => __('Running test...', 'video-embed-thumbnail-generator'),
|
1194 |
'ffmpegrequired' => __('FFMPEG or LIBAV required for these functions.', 'video-embed-thumbnail-generator'),
|
1195 |
'featuredwarning' => __("You are about to set all existing video thumbnails previously generated by this plugin as the featured images for their posts. There is no 'undo' button, so proceed at your own risk.", 'video-embed-thumbnail-generator'),
|
|
|
|
|
|
|
1196 |
'cancel_ok' => __("'Cancel' to stop, 'OK' to proceed.", 'video-embed-thumbnail-generator'),
|
1197 |
'processing' => __('Processing...', 'video-embed-thumbnail-generator'),
|
1198 |
'parentwarning_posts' => __("You are about to set all existing video thumbnails previously generated by this plugin as attachments of their posts rather than their associated videos. Proceed at your own risk.", 'video-embed-thumbnail-generator'),
|
@@ -1206,21 +1350,13 @@ function enqueue_kgvid_script() { //loads plugin-related scripts in the admin ar
|
|
1206 |
'settracksource' => __('Set as track source', 'video-embed-thumbnail-generator'),
|
1207 |
'choosefromlibrary' => __('Choose from Library', 'video-embed-thumbnail-generator'),
|
1208 |
'languagecode' => __('Language code:', 'video-embed-thumbnail-generator'),
|
1209 |
-
'label' => _x('Label:', 'noun', 'video-embed-thumbnail-generator')
|
|
|
1210 |
) );
|
1211 |
|
1212 |
}
|
1213 |
add_action('admin_enqueue_scripts', 'enqueue_kgvid_script');
|
1214 |
-
|
1215 |
-
function kgvid_admin_print_scripts() {
|
1216 |
-
$screen = get_current_screen();
|
1217 |
-
|
1218 |
-
if ( $screen->base == "upload" ) {
|
1219 |
-
echo '<script type="text/javascript">jQuery(document).ready(kgvid_media_library_icon_overlay());</script>'."\n";
|
1220 |
-
}
|
1221 |
-
|
1222 |
-
}
|
1223 |
-
add_action('admin_print_footer_scripts', 'kgvid_admin_print_scripts');
|
1224 |
|
1225 |
function kgvid_video_embed_print_scripts() {
|
1226 |
|
@@ -1230,21 +1366,6 @@ function kgvid_video_embed_print_scripts() {
|
|
1230 |
$pattern = get_shortcode_regex();
|
1231 |
$options = kgvid_get_options();
|
1232 |
|
1233 |
-
wp_register_script( 'kgvid_video_embed', plugins_url("/js/kgvid_video_embed.js", __FILE__), array('jquery'), $options['version'], true );
|
1234 |
-
wp_register_script( 'video-js', plugins_url("", __FILE__).'/video-js/video.js', '', '4.8.1', true );
|
1235 |
-
//wp_register_script( 'video-js-resolutions', plugins_url("", __FILE__).'/video-js/resolutions/video-js-resolutions.js', array('video-js'), $options['version'], true );
|
1236 |
-
//wp_register_script( 'video-quality-selector', plugins_url("", __FILE__).'/video-js/video-quality-selector/video-quality-selector.js', array('video-js'), $options['version'], true );
|
1237 |
-
wp_register_script( 'simplemodal', plugins_url("/js/jquery.simplemodal.1.4.5.min.js", __FILE__), '', '1.4.5', true );
|
1238 |
-
|
1239 |
-
wp_localize_script( 'kgvid_video_embed', 'kgvid_ajax_object', array( 'ajaxurl' => admin_url( 'admin-ajax.php', is_ssl() ? 'admin' : 'http' ), 'ajax_nonce' => wp_create_nonce('kgvid_frontend_nonce') ) ); // setting ajaxurl
|
1240 |
-
|
1241 |
-
wp_localize_script( 'kgvid_video_embed', 'kgvidL10n_frontend', array(
|
1242 |
-
'playstart' => _x("Play Start", 'noun for Google Analytics event', 'video-embed-thumbnail-generator'),
|
1243 |
-
'completeview' => _x("Complete View", 'noun for Google Analytics event', 'video-embed-thumbnail-generator'),
|
1244 |
-
'next' => _x("Next", 'button text to play next video', 'video-embed-thumbnail-generator'),
|
1245 |
-
'previous' => _x("Previous", 'button text to play previous video', 'video-embed-thumbnail-generator')
|
1246 |
-
) );
|
1247 |
-
|
1248 |
echo '<script type="text/javascript">document.createElement(\'video\');document.createElement(\'audio\');</script>'."\n";
|
1249 |
|
1250 |
if ( !empty($posts) && is_array($posts) ) {
|
@@ -1275,9 +1396,26 @@ function kgvid_video_embed_print_scripts() {
|
|
1275 |
}
|
1276 |
add_action('wp_head', 'kgvid_video_embed_print_scripts', 99);
|
1277 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1278 |
function kgvid_print_videojs_footer() { //called by the shortcode if Video.js is used
|
1279 |
|
1280 |
-
echo '<script type="text/javascript">if(typeof videojs !== "undefined") { videojs.options.flash.swf = "'.plugins_url("", __FILE__).'/video-js/video-js.swf?4.
|
1281 |
|
1282 |
}
|
1283 |
|
@@ -1295,6 +1433,7 @@ function kgvid_shortcode_atts($atts) {
|
|
1295 |
'videos' => -1,
|
1296 |
'width' => $options['width'],
|
1297 |
'height' => $options['height'],
|
|
|
1298 |
'align' => $options['align'],
|
1299 |
'controlbar' => $options['controlbar_style'],
|
1300 |
'autohide' => $options['autohide'],
|
@@ -1329,6 +1468,7 @@ function kgvid_shortcode_atts($atts) {
|
|
1329 |
'downloadlink' => $options['downloadlink'],
|
1330 |
'right_click' => $options['right_click'],
|
1331 |
'resize' => $options['resize'],
|
|
|
1332 |
'track_kind' => 'subtitles',
|
1333 |
'track_srclang' => substr(get_bloginfo('language'), 0, 2),
|
1334 |
'track_src' => '',
|
@@ -1350,7 +1490,22 @@ function kgvid_shortcode_atts($atts) {
|
|
1350 |
|
1351 |
$query_atts = shortcode_atts($default_atts, $atts, 'KGVID');
|
1352 |
|
1353 |
-
$checkbox_convert = array (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1354 |
foreach ( $checkbox_convert as $query ) {
|
1355 |
if ( $query_atts[$query] == "on" ) { $query_atts[$query] = "true"; }
|
1356 |
if ( $query_atts[$query] == false ) { $query_atts[$query] = "false"; }
|
@@ -1368,6 +1523,9 @@ function kgvid_shortcode_atts($atts) {
|
|
1368 |
function KGVID_shortcode($atts, $content = ''){
|
1369 |
|
1370 |
global $content_width;
|
|
|
|
|
|
|
1371 |
$content_width_save = $content_width;
|
1372 |
|
1373 |
$code = "";
|
@@ -1375,16 +1533,7 @@ function KGVID_shortcode($atts, $content = ''){
|
|
1375 |
|
1376 |
$options = kgvid_get_options();
|
1377 |
|
1378 |
-
|
1379 |
-
wp_enqueue_script( 'video-js' );
|
1380 |
-
add_action('wp_footer', 'kgvid_print_videojs_footer', 99);
|
1381 |
-
}
|
1382 |
-
|
1383 |
-
if ( $options['embed_method'] == "Strobe Media Playback" ) {
|
1384 |
-
wp_enqueue_script( 'swfobject' );
|
1385 |
-
}
|
1386 |
-
|
1387 |
-
wp_enqueue_script( 'kgvid_video_embed' );
|
1388 |
|
1389 |
if ( in_the_loop() ) { $post_ID = get_the_ID(); }
|
1390 |
else { $post_ID = 1; }
|
@@ -1393,14 +1542,7 @@ function KGVID_shortcode($atts, $content = ''){
|
|
1393 |
|
1394 |
if ( $query_atts["gallery"] != "true" ) { //if this is not a pop-up gallery
|
1395 |
|
1396 |
-
$
|
1397 |
-
'mobile' => '480p',
|
1398 |
-
'720' => '720p',
|
1399 |
-
'1080' => '1080p',
|
1400 |
-
'original' => 'Full',
|
1401 |
-
'webm' => 'WEBM',
|
1402 |
-
'ogg' => 'OGV'
|
1403 |
-
);
|
1404 |
|
1405 |
if ( empty($content) ) {
|
1406 |
if ( !empty($query_atts["id"]) ) {
|
@@ -1437,10 +1579,13 @@ function KGVID_shortcode($atts, $content = ''){
|
|
1437 |
|
1438 |
foreach ( $id_array as $id ) { //loop through videos
|
1439 |
|
|
|
|
|
1440 |
$query_atts = kgvid_shortcode_atts($atts); //reset values so they can be different with multiple videos
|
1441 |
$content = $original_content;
|
1442 |
$sources = array();
|
1443 |
$mp4already = false;
|
|
|
1444 |
|
1445 |
$compatible = array("flv", "f4v", "mp4", "mov", "m4v", "ogv", "ogg", "webm");
|
1446 |
$h264compatible = array("mp4", "mov", "m4v");
|
@@ -1452,12 +1597,10 @@ function KGVID_shortcode($atts, $content = ''){
|
|
1452 |
if ( $content == false ) { echo "Invalid video ID"; continue; }
|
1453 |
}
|
1454 |
|
1455 |
-
$div_suffix = $id;
|
1456 |
$encodevideo_info = kgvid_encodevideo_info($content, $id);
|
1457 |
$attachment_info = get_post( $id );
|
1458 |
|
1459 |
$dimensions = kgvid_set_video_dimensions($id);
|
1460 |
-
$video_format_labels['original'] = $dimensions['actualheight'].'p';
|
1461 |
|
1462 |
if ( empty($atts['width']) ) {
|
1463 |
$query_atts['width'] = $dimensions['width'];
|
@@ -1484,7 +1627,7 @@ function KGVID_shortcode($atts, $content = ''){
|
|
1484 |
$countable = true;
|
1485 |
}
|
1486 |
else { //video is not in the database
|
1487 |
-
|
1488 |
$encodevideo_info = kgvid_encodevideo_info($content, $post_ID); //send the id of the post the video's embedded in
|
1489 |
if ( $query_atts['title'] == "true" ) {
|
1490 |
$query_atts['title'] = "false";
|
@@ -1507,15 +1650,22 @@ function KGVID_shortcode($atts, $content = ''){
|
|
1507 |
$mime_type = $mime_type_check['type'];
|
1508 |
}
|
1509 |
|
1510 |
-
$video_formats = kgvid_video_formats();
|
1511 |
unset($video_formats['fullres']);
|
1512 |
-
$video_formats = array('original' => array( "type" => $format_type, "mime" => $mime_type, "name" => "Full" ) ) + $video_formats;
|
1513 |
|
1514 |
if ( in_array($mime_type_check['ext'], $compatible) ) {
|
1515 |
-
|
1516 |
-
$encodevideo_info["
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1517 |
}
|
1518 |
-
else { $encodevideo_info["
|
1519 |
|
1520 |
if($query_atts["endofvideooverlaysame"] == "true") { $query_atts["endofvideooverlay"] = $query_atts["poster"]; }
|
1521 |
|
@@ -1576,16 +1726,16 @@ function KGVID_shortcode($atts, $content = ''){
|
|
1576 |
$wp_shortcode = "[video ";
|
1577 |
$sources_hack = "";
|
1578 |
foreach ($video_formats as $format => $format_stats) {
|
1579 |
-
if ( $format != "original" && $encodevideo_info[$format
|
1580 |
-
if ( $encodevideo_info[$format
|
1581 |
if ( $format_stats['type'] != "h264" || !$mp4already ) {
|
1582 |
-
$shortcode_type = wp_check_filetype( $encodevideo_info[$format
|
1583 |
-
$sources[$format] = $shortcode_type['ext'].'="'.$encodevideo_info[$format
|
1584 |
if ( $format_stats['type'] == "h264" ) { //WordPress built-in shortcode doesn't support multiple videos of the same type but we'll hack it in later
|
1585 |
$mp4already = true;
|
1586 |
}
|
1587 |
}
|
1588 |
-
else { $sources_hack .= '<source type="'.$format_stats['mime'].'" src="'.esc_attr($encodevideo_info[$format
|
1589 |
}
|
1590 |
}
|
1591 |
|
@@ -1614,14 +1764,23 @@ function KGVID_shortcode($atts, $content = ''){
|
|
1614 |
|
1615 |
if ( class_exists('JWP6_Shortcode') ) {
|
1616 |
|
1617 |
-
|
1618 |
-
|
1619 |
-
if ( $encodevideo_info[$format
|
1620 |
-
|
1621 |
-
if (
|
1622 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1623 |
}
|
1624 |
}
|
|
|
1625 |
|
1626 |
$jw_tracks = array();
|
1627 |
if ( !empty($track_option[0]['src']) ) {
|
@@ -1670,23 +1829,32 @@ function KGVID_shortcode($atts, $content = ''){
|
|
1670 |
if ( $options['embed_method'] == "Video.js" || $options['embed_method'] == "Strobe Media Playback" ) {
|
1671 |
|
1672 |
$enable_resolutions_plugin = false;
|
1673 |
-
|
1674 |
foreach ($video_formats as $format => $format_stats) {
|
1675 |
-
if ( $format != "original" && $encodevideo_info[$format
|
1676 |
-
if ( $encodevideo_info[$format
|
1677 |
|
1678 |
-
|
1679 |
-
|
1680 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1681 |
if ( $mp4already ) { //there is more than one resolution available
|
1682 |
-
wp_enqueue_script( 'video-js-
|
1683 |
$enable_resolutions_plugin = true;
|
1684 |
}
|
1685 |
$mp4already = true;
|
1686 |
-
}
|
1687 |
-
$sources[$
|
|
|
1688 |
}
|
|
|
1689 |
}
|
|
|
1690 |
|
1691 |
$code .= '<video id="video_'.$div_suffix.'" ';
|
1692 |
if ( $query_atts["loop"] == 'true') { $code .= 'loop '; }
|
@@ -1695,7 +1863,9 @@ function KGVID_shortcode($atts, $content = ''){
|
|
1695 |
$code .= 'preload="'.$options['preload'].'" ';
|
1696 |
if ( $query_atts["poster"] != '' ) { $code .= 'poster="'.esc_attr($query_atts["poster"]).'" '; }
|
1697 |
$code .= 'width="'.$query_atts["width"].'" height="'.esc_attr($query_atts["height"]).'"';
|
1698 |
-
$code .= ' class="fitvidsignore '.esc_attr('video-js '.$options['js_skin']).'" data-setup=\'{
|
|
|
|
|
1699 |
$code .= ">\n";
|
1700 |
|
1701 |
$code .= implode("", $sources); //add the <source> tags created earlier
|
@@ -1717,7 +1887,15 @@ function KGVID_shortcode($atts, $content = ''){
|
|
1717 |
$code .= '<div class="kgvid-caption" id="video_'.$div_suffix.'_caption">'.$query_atts['caption'];
|
1718 |
if ( $query_atts['downloadlink'] == "true" ) {
|
1719 |
if ( !empty($query_atts['caption']) ) { $code .= '<br>'; }
|
1720 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1721 |
}
|
1722 |
$code .= '</div>';
|
1723 |
}
|
@@ -1746,9 +1924,11 @@ function KGVID_shortcode($atts, $content = ''){
|
|
1746 |
|
1747 |
$video_variables = array(
|
1748 |
'id' => $div_suffix,
|
|
|
1749 |
'player_type' => $options['embed_method'],
|
1750 |
'width' => $query_atts['width'],
|
1751 |
'height' => $query_atts['height'],
|
|
|
1752 |
'countable' => $countable,
|
1753 |
'autoplay' => $query_atts['autoplay'],
|
1754 |
'set_volume' => $query_atts['volume'],
|
@@ -1756,6 +1936,7 @@ function KGVID_shortcode($atts, $content = ''){
|
|
1756 |
'meta' => $kgvid_meta,
|
1757 |
'endofvideooverlay' => $query_atts['endofvideooverlay'],
|
1758 |
'resize' => $query_atts['resize'],
|
|
|
1759 |
'right_click' => $query_atts['right_click']
|
1760 |
);
|
1761 |
|
@@ -1772,15 +1953,26 @@ function KGVID_shortcode($atts, $content = ''){
|
|
1772 |
|
1773 |
} //if Strobe Media
|
1774 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1775 |
wp_localize_script( 'kgvid_video_embed', 'kgvid_video_vars_'.$div_suffix, $video_variables ); //add video variables in footer
|
1776 |
|
|
|
|
|
1777 |
} //end id_array loop
|
1778 |
|
1779 |
} //if not gallery
|
1780 |
|
1781 |
else { //if gallery
|
1782 |
|
1783 |
-
wp_enqueue_script( 'simplemodal' );
|
1784 |
|
1785 |
static $kgvid_gallery_id = 0;
|
1786 |
|
@@ -1803,6 +1995,7 @@ function KGVID_shortcode($atts, $content = ''){
|
|
1803 |
if ( $query_atts['align'] == "left" ) { $aligncode = ' kgvid_textalign_left'; }
|
1804 |
if ( $query_atts['align'] == "center" ) { $aligncode = ' kgvid_textalign_center'; }
|
1805 |
if ( $query_atts['align'] == "right" ) { $aligncode = ' kgvid_textalign_right'; }
|
|
|
1806 |
$div_suffix = substr(uniqid(rand(), true),0,4);
|
1807 |
$code .= '<div class="kgvid_gallerywrapper'.$aligncode.'" id="kgvid_gallery_'.$kgvid_gallery_id.'">';
|
1808 |
foreach ( $attachments as $attachment ) {
|
@@ -1843,8 +2036,17 @@ function KGVID_shortcode($atts, $content = ''){
|
|
1843 |
|
1844 |
$dimensions = kgvid_set_video_dimensions($attachment->ID, true);
|
1845 |
|
1846 |
-
$code .= '<div class="kgvid_video_gallery_thumb" id="
|
1847 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1848 |
|
1849 |
$code .= '</div>'; //end wrapper div
|
1850 |
|
@@ -1866,6 +2068,49 @@ function kgvid_no_texturize_shortcode($shortcodes){
|
|
1866 |
}
|
1867 |
add_filter( 'no_texturize_shortcodes', 'kgvid_no_texturize_shortcode' );
|
1868 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1869 |
function kgvid_ajax_generate_encode_checkboxes() {
|
1870 |
|
1871 |
check_ajax_referer( 'video-embed-thumbnail-generator-nonce', 'security' );
|
@@ -1906,6 +2151,7 @@ function kgvid_generate_encode_checkboxes($movieurl, $post_id, $page, $blog_id =
|
|
1906 |
$actualheight = "1081";
|
1907 |
$rotated = false;
|
1908 |
$encodevideo_info = array();
|
|
|
1909 |
|
1910 |
if ( !empty($movieurl) ) {
|
1911 |
|
@@ -1915,14 +2161,16 @@ function kgvid_generate_encode_checkboxes($movieurl, $post_id, $page, $blog_id =
|
|
1915 |
$sanitized_url = kgvid_sanitize_url($movieurl);
|
1916 |
$movieurl = $sanitized_url['movieurl'];
|
1917 |
if ( get_post_type($post_id) == "attachment" ) { //if the video is in the database
|
|
|
1918 |
$post_mime_type = get_post_mime_type($post_id);
|
1919 |
$dimensions = kgvid_set_video_dimensions($post_id);
|
1920 |
$actualwidth = $dimensions['actualwidth'];
|
1921 |
$actualheight = $dimensions['actualheight'];
|
1922 |
$rotated = get_post_meta($post_id, "_kgflashmediaplayer-rotate", true);
|
|
|
1923 |
}
|
1924 |
else { //video's not in the database
|
1925 |
-
|
1926 |
unset($video_formats['fullres']);
|
1927 |
|
1928 |
$post_mime_type = "video/".pathinfo($movieurl, PATHINFO_EXTENSION);
|
@@ -1952,6 +2200,9 @@ function kgvid_generate_encode_checkboxes($movieurl, $post_id, $page, $blog_id =
|
|
1952 |
else {
|
1953 |
$encode_disabled = ' disabled title="'.__('Please enter a valid video URL', 'video-embed-thumbnail-generator').'"';
|
1954 |
unset($video_formats['fullres']);
|
|
|
|
|
|
|
1955 |
}
|
1956 |
|
1957 |
if ( $options['ffmpeg_exists'] == "notinstalled" ) {
|
@@ -1964,7 +2215,20 @@ function kgvid_generate_encode_checkboxes($movieurl, $post_id, $page, $blog_id =
|
|
1964 |
foreach ($video_encode_queue as $video_key => $video_entry) {
|
1965 |
if ( $video_entry['movieurl'] == $movieurl ) {
|
1966 |
foreach ( $video_entry['encode_formats'] as $format => $value ) {
|
1967 |
-
if ( array_key_exists($format, $video_formats)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1968 |
$video_formats[$format]['status'] = $value['status'];
|
1969 |
}
|
1970 |
}
|
@@ -1974,20 +2238,24 @@ function kgvid_generate_encode_checkboxes($movieurl, $post_id, $page, $blog_id =
|
|
1974 |
}
|
1975 |
}
|
1976 |
|
1977 |
-
$checkboxes = '<div id="attachments-'.$post_id.'-kgflashmediaplayer-encodeboxes">';
|
1978 |
|
1979 |
foreach ( $video_formats as $format => $format_stats ) {
|
|
|
1980 |
if ( strpos($post_mime_type, $format) !== false ) { continue; } //skip webm or ogv checkbox if the video is webm or ogv
|
|
|
1981 |
$encodeset[$format] = "";
|
1982 |
$checked[$format] = "";
|
1983 |
$meta[$format] = "";
|
1984 |
$disabled[$format] = "";
|
1985 |
$child_id[$format] = "";
|
1986 |
|
|
|
|
|
1987 |
if ( !array_key_exists('status', $format_stats) ) { $format_stats['status'] = "notchecked"; } //if this video isn't in the queue
|
1988 |
|
1989 |
-
if (
|
1990 |
-
if ( $encodeset[$format] == "" ) { $encodeset[$format] = $options['encode_'.$format]; }
|
1991 |
|
1992 |
if ( $format_stats['status'] == "lowres" ||
|
1993 |
(
|
@@ -2010,22 +2278,41 @@ function kgvid_generate_encode_checkboxes($movieurl, $post_id, $page, $blog_id =
|
|
2010 |
}
|
2011 |
|
2012 |
if ( !empty($encodevideo_info) ) {
|
2013 |
-
if ( $encodevideo_info[$format
|
|
|
|
|
|
|
|
|
|
|
|
|
2014 |
if ( $format_stats['status'] != "encoding" ) { // not currently encoding
|
2015 |
-
if ( $format_stats['status'] == "notchecked" ) {
|
|
|
|
|
|
|
2016 |
if ( $format_stats['status'] != "canceling" ) {
|
2017 |
-
|
2018 |
-
if ( $encodevideo_info[$format
|
2019 |
&& current_user_can('encode_videos')
|
2020 |
&& $format != "fullres" ) {
|
2021 |
-
|
|
|
|
|
|
|
|
|
|
|
2022 |
}
|
2023 |
}
|
2024 |
$disabled[$format] = ' disabled title="Format already exists"';
|
2025 |
$checked[$format] = '';
|
2026 |
}
|
2027 |
}
|
2028 |
-
else {
|
|
|
|
|
|
|
|
|
|
|
2029 |
}
|
2030 |
|
2031 |
if ( $format_stats['status'] == "encoding" ) {
|
@@ -2048,9 +2335,16 @@ function kgvid_generate_encode_checkboxes($movieurl, $post_id, $page, $blog_id =
|
|
2048 |
$something_to_encode = false;
|
2049 |
}
|
2050 |
|
2051 |
-
$checkboxes .= "\n\t\t\t".'<input type="checkbox" id="attachments-'.$post_id.'-kgflashmediaplayer-encode'.$format.'" name="attachments['.$post_id.'][kgflashmediaplayer-encode'.$format.']" '.$checked[$format].' '.$ffmpeg_disabled_text.$disabled[$format].'> <label for="attachments-'.$post_id.'-kgflashmediaplayer-encode'.$format.'">'.$format_stats['name'].'</label> <span id="attachments-'.$post_id.'-kgflashmediaplayer-meta'.$format.'">'.$meta[$format].'</span
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2052 |
|
2053 |
-
}
|
2054 |
if ( $something_to_encode == false ) {
|
2055 |
$encode_disabled = ' disabled title="'.__('Nothing to encode', 'video-embed-thumbnail-generator').'" style="display:none;"';
|
2056 |
}
|
@@ -2059,7 +2353,7 @@ function kgvid_generate_encode_checkboxes($movieurl, $post_id, $page, $blog_id =
|
|
2059 |
$button_text = _x('Update', 'Button text', 'video-embed-thumbnail-generator');
|
2060 |
$checkboxes .= "\n\t\t\t".'<input type="hidden" name="attachments['.$post_id.'][kgflashmediaplayer-url]" value="'.$movieurl.'">';
|
2061 |
}
|
2062 |
-
else { $button_text = _x('Encode', 'Button text', 'video-embed-thumbnail-generator'); }
|
2063 |
|
2064 |
|
2065 |
$checkboxes .= '<input type="button" id="attachments-'.$post_id.'-kgflashmediaplayer-encode" name="attachments['.$post_id.'][kgflashmediaplayer-encode]" class="button-secondary" value="'.$button_text.'" onclick="kgvid_enqueue_video_encode(\''.$post_id.'\');" '.$ffmpeg_disabled_text.$encode_disabled.'/><div style="display:block;" id="attachments-'.$post_id.'-encodeplaceholder"></div>';
|
@@ -2068,11 +2362,10 @@ function kgvid_generate_encode_checkboxes($movieurl, $post_id, $page, $blog_id =
|
|
2068 |
$checkboxes .= '<small><em>'.__('Generates additional video formats compatible with most mobile & HTML5-compatible browsers', 'video-embed-thumbnail-generator').'</em></small>';
|
2069 |
}
|
2070 |
|
2071 |
-
|
2072 |
if ( $video_queued == true ) {
|
2073 |
while ( count($video_formats) > 0 ) {
|
2074 |
$last_format = array_pop( $video_formats );
|
2075 |
-
if ( $last_format['status'] != "notchecked" ) { break; } //get the final queued format
|
2076 |
}
|
2077 |
|
2078 |
if ( !$encoding_now && ($last_format['status'] == "queued" || $last_format['status'] == "canceling") ) {
|
@@ -2132,16 +2425,21 @@ function kgvid_generate_queue_table( $scope = 'site' ) {
|
|
2132 |
foreach ( $video_encode_queue as $order => $video_entry ) {
|
2133 |
$html .= "\t<tr id='tr_".$video_entry['attachmentID']."'";
|
2134 |
foreach ( $video_formats as $format => $format_stats ) {
|
2135 |
-
|
2136 |
-
|
2137 |
-
|
2138 |
-
|
2139 |
-
|
2140 |
-
|
2141 |
-
|
2142 |
-
|
2143 |
-
|
2144 |
-
|
|
|
|
|
|
|
|
|
|
|
2145 |
}
|
2146 |
}
|
2147 |
|
@@ -2405,8 +2703,8 @@ function kgvid_settings_page() {
|
|
2405 |
|| ( function_exists( 'is_plugin_active_for_network' ) && is_plugin_active_for_network( plugin_basename(__FILE__) ) && $options['ffmpeg_exists'] == "on" && is_array($network_options) && (is_super_admin() || $network_options['superadmin_only_ffmpeg_settings'] == false) )
|
2406 |
) { ?>
|
2407 |
<h2 class="nav-tab-wrapper">
|
2408 |
-
<a href="#" id="general_tab" class="nav-tab" onclick="kgvid_switch_settings_tab('general');"><?php _ex('General', 'Adjective, tab title', 'video-embed-thumbnail-generator') ?></a>
|
2409 |
-
<a href="#" id="encoding_tab" class="nav-tab" onclick="kgvid_switch_settings_tab('encoding');"><?php printf( _x('%s Settings', 'FFMPEG Settings, tab title', 'video-embed-thumbnail-generator'), "<span class='video_app_name'>".strtoupper($video_app)."</span>" ); ?></a>
|
2410 |
</h2>
|
2411 |
<?php } ?>
|
2412 |
<form method="post" action="options.php">
|
@@ -2425,7 +2723,7 @@ function kgvid_settings_page() {
|
|
2425 |
</div>
|
2426 |
<script type='text/javascript'>
|
2427 |
jQuery(document).ready(function() {
|
2428 |
-
kgvid_switch_settings_tab('
|
2429 |
jQuery('form :input').change(function() {
|
2430 |
kgvid_save_plugin_settings(this);
|
2431 |
});
|
@@ -2554,6 +2852,7 @@ function kgvid_video_embed_options_init() {
|
|
2554 |
add_settings_field('browser_thumbnails', __('Enable in-browser thumbnails:', 'video-embed-thumbnail-generator'), 'kgvid_browser_thumbnails_callback', __FILE__, 'kgvid_video_embed_encode_settings', array( 'label_for' => 'browser_thumbnails' ) );
|
2555 |
add_settings_field('encode_formats', __('Default video encode formats:', 'video-embed-thumbnail-generator'), 'kgvid_encode_formats_callback', __FILE__, 'kgvid_video_embed_encode_settings');
|
2556 |
add_settings_field('automatic', __('Do automatically on upload:', 'video-embed-thumbnail-generator'), 'kgvid_automatic_callback', __FILE__, 'kgvid_video_embed_encode_settings', array( 'label_for' => 'auto_encode' ) );
|
|
|
2557 |
add_settings_field('htaccess', __('htaccess login:', 'video-embed-thumbnail-generator'), 'kgvid_htaccess_callback', __FILE__, 'kgvid_video_embed_encode_settings', array( 'label_for' => 'htaccess_username' ) );
|
2558 |
add_settings_field('ffmpeg_watermark', __('Add watermark to encoded files:', 'video-embed-thumbnail-generator'), 'kgvid_ffmpeg_watermark_callback', __FILE__, 'kgvid_video_embed_encode_settings', array( 'label_for' => 'ffmpeg_watermark' ) );
|
2559 |
if ( !is_plugin_active_for_network( plugin_basename(__FILE__) ) ) {
|
@@ -2666,7 +2965,8 @@ add_action('admin_init', 'kgvid_video_embed_options_init' );
|
|
2666 |
|
2667 |
function kgvid_resize_callback() {
|
2668 |
$options = kgvid_get_options();
|
2669 |
-
echo "<input ".checked( $options['resize'], "on", false )." id='resize' name='kgvid_video_embed_options[resize]' type='checkbox' /> <label for='resize'>".__('Make video player responsive.', 'video-embed-thumbnail-generator')."</label
|
|
|
2670 |
}
|
2671 |
|
2672 |
function kgvid_inline_callback() {
|
@@ -2676,8 +2976,9 @@ add_action('admin_init', 'kgvid_video_embed_options_init' );
|
|
2676 |
|
2677 |
function kgvid_dimensions_callback() {
|
2678 |
$options = kgvid_get_options();
|
2679 |
-
echo __('Width:', 'video-embed-thumbnail-generator')." <input class='small-text affects_player' id='width' name='kgvid_video_embed_options[width]' type='text' value='".$options['width']."' /> ".__('Height:', 'video-embed-thumbnail-generator')." <input class='small-text affects_player' id='height' name='kgvid_video_embed_options[height]' type='text' value='".$options['height']."' />
|
2680 |
-
echo "<input ".checked( $options['minimum_width'], "on", false )." id='minimum_width' name='kgvid_video_embed_options[minimum_width]' type='checkbox' /> <label for='minimum_width'>".__('Enlarge lower resolution videos to max width.', 'video-embed-thumbnail-generator')."</label> <a class='kgvid_tooltip wp-ui-text-highlight' href='javascript:void(0);'><span class='kgvid_tooltip_classic'>".__('Usually if a video\'s resolution is less than the max width, the video player is set to the actual width of the video. Enabling this will always set the same width regardless of the quality of the video. When necessary you can override by setting the dimensions manually.', 'video-embed-thumbnail-generator')."</span></a
|
|
|
2681 |
}
|
2682 |
|
2683 |
function kgvid_gallery_dimensions_callback() {
|
@@ -2731,9 +3032,17 @@ add_action('admin_init', 'kgvid_video_embed_options_init' );
|
|
2731 |
|
2732 |
function kgvid_audio_callback() {
|
2733 |
$options = kgvid_get_options();
|
2734 |
-
|
2735 |
-
|
2736 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2737 |
|
2738 |
}
|
2739 |
|
@@ -2946,13 +3255,39 @@ margin-right: 10px;' onchange='document.getElementById(\"volume_number\").value=
|
|
2946 |
|
2947 |
function kgvid_encode_formats_callback() {
|
2948 |
$options = kgvid_get_options();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2949 |
echo "<div class='kgvid_video_app_required'>";
|
2950 |
-
echo "<input ".checked( $options['encode_fullres'], "on", false )." id='encode_fullres' name='kgvid_video_embed_options[encode_fullres]' type='checkbox' /> <label for='encode_fullres'>".__('Replace original with
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2951 |
echo "<input ".checked( $options['encode_1080'], "on", false )." id='encode_1080' name='kgvid_video_embed_options[encode_1080]' type='checkbox' /> <label for='encode_1080'>1080p H.264 <small><em>".__('(iPhone 4s+, iPad 2+, modern Android, Windows Phone 8, Chrome, Safari, IE 9+, Firefox Windows)', 'video-embed-thumbnail-generator')."</em></small></label><br />";
|
2952 |
echo "<input ".checked( $options['encode_720'], "on", false )." id='encode_720' name='kgvid_video_embed_options[encode_720]' type='checkbox' /> <label for='encode_720'>720p H.264 <small><em>".__('(iPhone 4+, iPad, most Android, Chrome, Safari, IE 9+, Firefox Windows)', 'video-embed-thumbnail-generator')."</em></small></label><br />";
|
2953 |
-
echo "<input ".checked( $options['encode_mobile'], "on", false )." id='encode_mobile' name='kgvid_video_embed_options[encode_mobile]' type='checkbox' /> <label for='encode_mobile'>
|
2954 |
echo "<input ".checked( $options['encode_webm'], "on", false )." id='encode_webm' name='kgvid_video_embed_options[encode_webm]' type='checkbox' /> <label for='encode_webm'>WEBM <small><em>(Firefox, Chrome, Android 2.3+, Opera)</em></small></label><br />";
|
2955 |
-
echo "<input ".checked( $options['encode_ogg'], "on", false )." id='encode_ogg' name='kgvid_video_embed_options[encode_ogg]' type='checkbox' /> <label for='encode_ogg'>OGV <small><em>(Firefox, Chrome, Android 2.3+, Opera)</em></small></label
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2956 |
echo "</div>\n\t";
|
2957 |
}
|
2958 |
|
@@ -2991,7 +3326,15 @@ margin-right: 10px;' onchange='document.getElementById(\"volume_number\").value=
|
|
2991 |
else { $percentage_select = "<input id='auto_thumb_position' name='kgvid_video_embed_options[auto_thumb_position]' class='small-text' type='text' value='".$options['auto_thumb_position']."' maxlength='3'>"; }
|
2992 |
$auto_thumb_number_input = "<input id='auto_thumb_number' name='kgvid_video_embed_options[auto_thumb_number]' class='small-text' type='text' value='".$options['auto_thumb_number']."' maxlength='3'>";
|
2993 |
$auto_thumb_label = kgvid_generate_auto_thumb_label();
|
2994 |
-
echo "<input ".checked( $options['auto_thumb'], "on", false )." id='auto_thumb' name='kgvid_video_embed_options[auto_thumb]' type='checkbox' /> <label id='auto_thumb_label' for='auto_thumb'>".$auto_thumb_label." </label>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2995 |
echo "</div>\n\t";
|
2996 |
}
|
2997 |
|
@@ -3037,12 +3380,13 @@ margin-right: 10px;' onchange='document.getElementById(\"volume_number\").value=
|
|
3037 |
$options = kgvid_get_options();
|
3038 |
echo "<div class='kgvid_video_app_required'>";
|
3039 |
$items = array(__("none", 'video-embed-thumbnail-generator')=>"none", "movflags faststart"=>"movflag", "qt-faststart"=>"qt-faststart", "MP4Box"=>"MP4Box");
|
3040 |
-
echo "<select id='moov' name='kgvid_video_embed_options[moov]' class='affects_ffmpeg'>";
|
3041 |
foreach($items as $name => $value) {
|
3042 |
$selected = ($options['moov']==$value) ? 'selected="selected"' : '';
|
3043 |
echo "<option value='$value' $selected>$name</option>";
|
3044 |
}
|
3045 |
echo "</select> <a class='kgvid_tooltip wp-ui-text-highlight' href='javascript:void(0);'><span class='kgvid_tooltip_classic'>".sprintf( __('By default %1$s places moov atoms at the end of H.264 encoded files, which forces the entire file to download before playback can start and can prevent Flash players from playing them at all. Since approximately October 2012 %1$s can fix the problem at the end of the encoding process by using the option `movflags faststart`. This is the easiest and fastest way to correct the problem, but older versions of %1$s will not work if you select the movflags option. If you can\'t update to a new version of %1$s, select qt-faststart or MP4Box which will run after encoding is finished if they are installed on your server.', 'video-embed-thumbnail-generator'), "<strong class='video_app_name'>".strtoupper($options['video_app'])."</strong>")."</span></a>";
|
|
|
3046 |
echo "</div>\n\t";
|
3047 |
}
|
3048 |
|
@@ -3096,7 +3440,7 @@ margin-right: 10px;' onchange='document.getElementById(\"volume_number\").value=
|
|
3096 |
echo "</select> ".__('bits per pixel.', 'video-embed-thumbnail-generator')." <a class='kgvid_tooltip wp-ui-text-highlight' href='javascript:void(0);'><span class='kgvid_tooltip_classic'>".__('Default is 0.1', 'video-embed-thumbnail-generator')."</span></a><br />";
|
3097 |
echo "<span class='kgvid_gray_text'>1080p = <span id='1080_bitrate'>".round(floatval($options['bitrate_multiplier'])*1920*1080*30/1024)."</span> kbps<br />";
|
3098 |
echo "720p = <span id='720_bitrate'>".round(floatval($options['bitrate_multiplier'])*1280*720*30/1024)."</span> kbps<br />";
|
3099 |
-
echo "
|
3100 |
echo "</div>\n\t";
|
3101 |
}
|
3102 |
|
@@ -3123,7 +3467,7 @@ margin-right: 10px;' onchange='document.getElementById(\"volume_number\").value=
|
|
3123 |
function kgvid_audio_bitrate_options_callback() {
|
3124 |
$options = kgvid_get_options();
|
3125 |
echo "<div class='kgvid_video_app_required'>";
|
3126 |
-
$items = array(96, 112, 128, 160, 192, 224, 256, 320);
|
3127 |
echo "<select id='audio_bitrate' name='kgvid_video_embed_options[audio_bitrate]' class='affects_ffmpeg'>";
|
3128 |
foreach($items as $item) {
|
3129 |
$selected = ($options['audio_bitrate']==$item) ? 'selected="selected"' : '';
|
@@ -3136,8 +3480,9 @@ margin-right: 10px;' onchange='document.getElementById(\"volume_number\").value=
|
|
3136 |
function kgvid_ffmpeg_options_callback() {
|
3137 |
$options = kgvid_get_options();
|
3138 |
echo "<div class='kgvid_video_app_required'>";
|
3139 |
-
echo "<input class='affects_ffmpeg' onchange='if(jQuery(\"#ffmpeg_vpre\").attr(\"checked\")==\"checked\"){jQuery(\"#video_bitrate_flag\").attr(\"checked\", \"checked\");}' ".checked( $options['video_bitrate_flag'], "on", false )." id='video_bitrate_flag' name='kgvid_video_embed_options[video_bitrate_flag]' type='checkbox' /> <label for='video_bitrate_flag'>".__('Enable legacy FFMPEG "-b" and "-ba" bitrate flags.', 'video-embed-thumbnail-generator')."</label> <a class='kgvid_tooltip wp-ui-text-highlight' href='javascript:void(0);'><span class='kgvid_tooltip_classic'>".__('Enable if your installed version of FFMPEG is old enough that you can\'t use the newer -b:v flags (Dreamhost users must turn this on). It may cause newer versions of FFMPEG to fail.', 'video-embed-thumbnail-generator')."</span></a><br />
|
3140 |
-
<input class='affects_ffmpeg' onchange='if(jQuery(\"#ffmpeg_vpre\").attr(\"checked\")==\"checked\"){jQuery(\"#video_bitrate_flag\").attr(\"checked\", \"checked\");}' ".checked( $options['ffmpeg_vpre'], "on", false )." id='ffmpeg_vpre' name='kgvid_video_embed_options[ffmpeg_vpre]' type='checkbox' /> <label for='ffmpeg_vpre'>".__('Enable legacy FFMPEG parameters.', 'video-embed-thumbnail-generator')."</label> <a class='kgvid_tooltip wp-ui-text-highlight' href='javascript:void(0);'><span class='kgvid_tooltip_classic'>".__('Enable if your installed version of FFMPEG is old enough that libx264 requires additional configuration to operate (Dreamhost users must turn this on). This should help if you can encode WEBM or OGV files but H264/Mobile files fail. It could cause newer versions of FFMPEG to fail.', 'video-embed-thumbnail-generator')."</span></a
|
|
|
3141 |
echo "</div>\n\t";
|
3142 |
}
|
3143 |
|
@@ -3167,16 +3512,13 @@ margin-right: 10px;' onchange='document.getElementById(\"volume_number\").value=
|
|
3167 |
function kgvid_test_ffmpeg_options_callback( $scope = 'site' ) {
|
3168 |
|
3169 |
$options = kgvid_get_options();
|
3170 |
-
$video_formats = kgvid_video_formats();
|
3171 |
$encode_string = "";
|
3172 |
if ( $options['ffmpeg_exists'] == "on" ) {
|
3173 |
|
3174 |
$movie_info = kgvid_get_video_dimensions(plugin_dir_path(__FILE__)."images/sample-video-h264.mp4");
|
3175 |
$uploads = wp_upload_dir();
|
3176 |
-
|
3177 |
-
$encode_dimensions = kgvid_set_h264_encode_dimensions($movie_info, $video_formats[$options['sample_format']]);
|
3178 |
-
}
|
3179 |
-
else { $encode_dimensions = array( 'width' => $movie_info['width'], 'height' => $movie_info['height'] ); }
|
3180 |
$encode_string = kgvid_generate_encode_string(plugin_dir_path(__FILE__)."images/sample-video-h264.mp4", $uploads['path']."/sample-video-h264".$video_formats[$options['sample_format']]['suffix'], $movie_info, $options['sample_format'], $encode_dimensions['width'], $encode_dimensions['height'], '');
|
3181 |
}
|
3182 |
|
@@ -3186,6 +3528,9 @@ margin-right: 10px;' onchange='document.getElementById(\"volume_number\").value=
|
|
3186 |
$display_div = "";
|
3187 |
if ( $options['ffmpeg_exists'] != "on" ) { $display_div = " style='display:none;'"; }
|
3188 |
|
|
|
|
|
|
|
3189 |
$sample_format_select = "<select id='sample_format' name='kgvid_video_embed_options[sample_format]' class='affects_ffmpeg'>";
|
3190 |
foreach ( $video_formats as $format => $format_stats ) {
|
3191 |
$selected = ($options['sample_format']==$format) ? 'selected="selected"' : '';
|
@@ -3372,6 +3717,19 @@ function kgvid_update_settings() {
|
|
3372 |
$options['version'] = 4.304;
|
3373 |
$options['gallery_end'] = "";
|
3374 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3375 |
|
3376 |
if ( $options['version'] != $default_options['version'] ) { $options['version'] = $default_options['version']; }
|
3377 |
if ( $options !== $options_old ) { update_option('kgvid_video_embed_options', $options); }
|
@@ -3441,12 +3799,68 @@ function kgvid_video_embed_options_validate($input) { //validate & sanitize inpu
|
|
3441 |
|
3442 |
$input['titlecode'] = wp_kses_post( $input['titlecode'] );
|
3443 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3444 |
if ( intval($options['auto_thumb_number']) == 1 && intval($input['auto_thumb_number']) > 1 ) {
|
3445 |
$input['auto_thumb_position'] = strval ( round( intval($input['auto_thumb_number']) * (intval($options['auto_thumb_position'])/100) ) );
|
3446 |
if ( $input['auto_thumb_position'] == "0" ) {
|
3447 |
$input['auto_thumb_position'] = "1";
|
3448 |
}
|
3449 |
-
|
3450 |
}
|
3451 |
if ( intval($options['auto_thumb_number']) > 1 && intval($input['auto_thumb_number']) == 1 ) {
|
3452 |
//round to the nearest 25 but not 100
|
@@ -3502,10 +3916,7 @@ function kgvid_ajax_save_settings() {
|
|
3502 |
$movie_info = kgvid_get_video_dimensions(plugin_dir_path(__FILE__)."images/sample-video-h264.mp4");
|
3503 |
$uploads = wp_upload_dir();
|
3504 |
$video_formats = kgvid_video_formats();
|
3505 |
-
|
3506 |
-
$encode_dimensions = kgvid_set_h264_encode_dimensions($movie_info, $video_formats[$validated_options['sample_format']]);
|
3507 |
-
}
|
3508 |
-
else { $encode_dimensions = array( 'width' => $movie_info['width'], 'height' => $movie_info['height'] ); }
|
3509 |
$encode_string = kgvid_generate_encode_string(plugin_dir_path(__FILE__)."images/sample-video-h264.mp4", $uploads['path']."/sample-video-h264".$video_formats[$validated_options['sample_format']]['suffix'], $movie_info, $validated_options['sample_format'], $encode_dimensions['width'], $encode_dimensions['height'], '');
|
3510 |
$auto_thumb_label = kgvid_generate_auto_thumb_label();
|
3511 |
}
|
@@ -3513,7 +3924,7 @@ function kgvid_ajax_save_settings() {
|
|
3513 |
|
3514 |
if ( !empty($wp_settings_errors) ) { $error_message = $wp_settings_errors[0]['message']; }
|
3515 |
|
3516 |
-
if ( strpos($setting, 'capability') !== false || strpos($setting, 'default_capabilities') !== false || strpos($setting, 'ffmpeg_watermark') !== false ) { $validated_options[$setting] = $value; }
|
3517 |
|
3518 |
$arr = array ( "error_message" => $error_message, "validated_value" => $validated_options[$setting], "ffmpeg_exists" => $validated_options['ffmpeg_exists'], "encode_string" => implode('', $encode_string), "app_path" => $validated_options['app_path'], "auto_thumb_label" => $auto_thumb_label );
|
3519 |
echo json_encode($arr);
|
@@ -3539,14 +3950,14 @@ function kgvid_add_attachment_handler($post_id) {
|
|
3539 |
}
|
3540 |
add_action('add_attachment', 'kgvid_add_attachment_handler');
|
3541 |
|
3542 |
-
function kgvid_cron_new_attachment_handler($post_id) {
|
3543 |
|
3544 |
$options = kgvid_get_options();
|
3545 |
|
3546 |
$post = get_post($post_id);
|
3547 |
$movieurl = wp_get_attachment_url($post_id);
|
3548 |
|
3549 |
-
if ( $options['auto_thumb'] == "on" ) {
|
3550 |
|
3551 |
$thumb_output = array();
|
3552 |
$thumb_id = array();
|
@@ -3632,7 +4043,7 @@ function kgvid_cron_new_attachment_handler($post_id) {
|
|
3632 |
|
3633 |
}//end if auto_thumb is on
|
3634 |
|
3635 |
-
if ( $options['auto_encode'] == "on" ) {
|
3636 |
$video_formats = kgvid_video_formats();
|
3637 |
$something_to_encode = false;
|
3638 |
$encode_checked = array();
|
@@ -3667,8 +4078,8 @@ function kgvid_image_attachment_fields_to_edit($form_fields, $post) {
|
|
3667 |
) { //if the attachment is a video with no parent or if it has a parent the parent is not a video and the video doesn't have the externalurl post meta
|
3668 |
|
3669 |
wp_enqueue_media(); //allows using the media modal in the Media Library
|
3670 |
-
wp_enqueue_script('
|
3671 |
-
wp_enqueue_style('video_embed_thumbnail_generator_style');
|
3672 |
|
3673 |
$field_id = kgvid_backwards_compatible($post->ID);
|
3674 |
$movieurl = wp_get_attachment_url($post->ID);
|
@@ -3677,7 +4088,7 @@ function kgvid_image_attachment_fields_to_edit($form_fields, $post) {
|
|
3677 |
$heightsaved = get_post_meta($post->ID, "_kgflashmediaplayer-height", true);
|
3678 |
$video_meta = array();
|
3679 |
$video_aspect = NULL;
|
3680 |
-
$video_meta =
|
3681 |
if ( is_array($video_meta) && array_key_exists('width', $video_meta) && array_key_exists('height', $video_meta) ) { $video_aspect = $video_meta['height']/$video_meta['width']; }
|
3682 |
elseif ( $widthsaved && $heightsaved ) { $video_aspect = intval($heightsaved)/intval($widthsaved); }
|
3683 |
|
@@ -3790,25 +4201,20 @@ display: inline-block;">Loading thumbnail...</span></div>';
|
|
3790 |
$h264compatible = array("mp4", "mov", "m4v");
|
3791 |
if ( $moviefiletype == "mov" || $moviefiletype == "m4v" ) { $moviefiletype = "mp4"; }
|
3792 |
|
3793 |
-
$video_formats =
|
3794 |
-
"original" => $moviefiletype,
|
3795 |
-
"1080" => "mp4",
|
3796 |
-
"720" => "mp4",
|
3797 |
-
"mobile" => "mp4",
|
3798 |
-
"webm" => "webm",
|
3799 |
-
"ogg" => "ogg"
|
3800 |
-
);
|
3801 |
$encodevideo_info = kgvid_encodevideo_info($movieurl, $post->ID);
|
3802 |
if ( in_array($moviefiletype, $h264compatible) ) {
|
3803 |
-
$encodevideo_info["
|
3804 |
-
$encodevideo_info["
|
|
|
3805 |
}
|
3806 |
-
else { $encodevideo_info["
|
3807 |
|
3808 |
$sources = array();
|
3809 |
-
|
3810 |
-
|
3811 |
-
if ( $encodevideo_info[$
|
|
|
3812 |
}
|
3813 |
|
3814 |
if ( $img_editor_works ) {
|
@@ -3872,10 +4278,6 @@ display: inline-block;">Loading thumbnail...</span></div>';
|
|
3872 |
$form_fields["kgflashmediaplayer-encode"]["html"] = $checkboxes['checkboxes'];
|
3873 |
|
3874 |
$track_option = get_post_meta($post->ID, "_kgflashmediaplayer-track", true);
|
3875 |
-
/*if ( !is_array($track_option) ) {
|
3876 |
-
$track_option = array();
|
3877 |
-
$track_option[0] = array ( 'kind' => '', 'srclang' => '', 'src' => '', 'label' => '' );
|
3878 |
-
}*/
|
3879 |
|
3880 |
$tracks_html = '';
|
3881 |
if ( is_array($track_option) ) {
|
@@ -4265,6 +4667,7 @@ function kgvid_video_attachment_fields_to_save($post, $attachment) {
|
|
4265 |
if( isset($attachment['kgflashmediaplayer-poster']) ) {
|
4266 |
|
4267 |
$thumb_url = $attachment['kgflashmediaplayer-poster'];
|
|
|
4268 |
if ( !empty($thumb_url) ) {
|
4269 |
$thumb_id = kgvid_save_thumb($post['ID'], $post['post_title'], $thumb_url);
|
4270 |
if ( $thumb_id ) { update_post_meta($post['ID'], '_kgflashmediaplayer-poster-id', $thumb_id); }
|
@@ -4301,6 +4704,7 @@ function kgvid_video_attachment_fields_to_save($post, $attachment) {
|
|
4301 |
if ( !empty($thumb_id) ) { //always set the video's featured image regardless of the plugin setting
|
4302 |
set_post_thumbnail($post['ID'], $thumb_id);
|
4303 |
}
|
|
|
4304 |
|
4305 |
if( isset($attachment['thumbtime']) ) {update_post_meta($post['ID'], '_kgflashmediaplayer-thumbtime', $attachment['thumbtime']); }
|
4306 |
if( isset($attachment['kgflashmediaplayer-width']) ) { update_post_meta($post['ID'], '_kgflashmediaplayer-width', $attachment['kgflashmediaplayer-width']); }
|
@@ -4610,6 +5014,36 @@ function kgvid_video_attachment_template() {
|
|
4610 |
$content_width = $content_width_save; //reset $content_width
|
4611 |
exit;
|
4612 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4613 |
}
|
4614 |
add_action('template_redirect', 'kgvid_video_attachment_template');
|
4615 |
|
@@ -4674,6 +5108,10 @@ function kgvid_make_thumbs($postID, $movieurl, $numberofthumbs, $i, $iincreaser,
|
|
4674 |
|
4675 |
if ( get_post_type($postID) == "attachment" ) {
|
4676 |
$moviefilepath = get_attached_file($postID);
|
|
|
|
|
|
|
|
|
4677 |
$duration = get_post_meta($postID, '_kgflashmediaplayer-duration', true);
|
4678 |
if ( !$duration ) {
|
4679 |
$movie_info = kgvid_get_video_dimensions($moviefilepath);
|
@@ -4791,7 +5229,7 @@ function kgvid_enqueue_videos($postID, $movieurl, $encode_checked, $parent_id) {
|
|
4791 |
$encode_list = array();
|
4792 |
$embeddable = array("flv", "f4v", "mp4", "mov", "m4v", "ogv", "ogg", "webm");
|
4793 |
$h264extensions = array("mp4", "m4v", "mov");
|
4794 |
-
$video_formats = kgvid_video_formats();
|
4795 |
$sanitized_url = kgvid_sanitize_url($movieurl);
|
4796 |
$movieurl = $sanitized_url['movieurl'];
|
4797 |
|
@@ -4815,7 +5253,7 @@ function kgvid_enqueue_videos($postID, $movieurl, $encode_checked, $parent_id) {
|
|
4815 |
|
4816 |
foreach ( $video_formats as $format => $format_stats ) {
|
4817 |
if ( $encode_checked[$format] == "true" ) {
|
4818 |
-
if ( !$encodevideo_info[$format
|
4819 |
if ( ($format == "1080" && $movie_height <= 1080) || ($format == "720" && $movie_height <= 720) ) {
|
4820 |
$movie_extension = pathinfo($movieurl, PATHINFO_EXTENSION);
|
4821 |
if ( $encode_checked['fullres'] == "true" || in_array($movie_extension, $h264extensions) || $movie_height < intval($format) ) {
|
@@ -5025,8 +5463,9 @@ function kgvid_encode_videos() {
|
|
5025 |
$video = $video_encode_queue[$video_key];
|
5026 |
|
5027 |
$ffmpegPath = $options['app_path']."/".$options['video_app'];
|
|
|
5028 |
if ( get_post_type($video['attachmentID']) == "attachment" ) { $moviefilepath = get_attached_file($video['attachmentID']); }
|
5029 |
-
|
5030 |
$moviefilepath = str_replace(" ", "%20", esc_url_raw($video['movieurl']));
|
5031 |
$moviefilepath = str_replace("https://", "http://", $moviefilepath);
|
5032 |
}
|
@@ -5039,18 +5478,6 @@ function kgvid_encode_videos() {
|
|
5039 |
$serverOS = "";
|
5040 |
$ffmpeg_options = "";
|
5041 |
|
5042 |
-
if ( $options['video_app'] == "avconv" || $options['video_bitrate_flag'] == false ) {
|
5043 |
-
$video_bitrate_flag = "b:v";
|
5044 |
-
$audio_bitrate_flag = "b:a";
|
5045 |
-
$profile_flag = "profile:v";
|
5046 |
-
}
|
5047 |
-
|
5048 |
-
else {
|
5049 |
-
$video_bitrate_flag = "b";
|
5050 |
-
$audio_bitrate_flag = "ab";
|
5051 |
-
$profile_flag = "profile";
|
5052 |
-
}
|
5053 |
-
|
5054 |
$aac_array = kgvid_aac_encoders();
|
5055 |
$aac_available = false;
|
5056 |
foreach ( $aac_array as $aaclib ) { //cycle through available AAC encoders in order of quality
|
@@ -5058,54 +5485,62 @@ function kgvid_encode_videos() {
|
|
5058 |
}
|
5059 |
|
5060 |
foreach( $video_formats as $format => $format_stats ) {
|
5061 |
-
if ( $queued_format == $format && $format_stats['type'] == "h264" ) {
|
5062 |
-
if ( $movie_info['configuration']['libx264'] == "true" && $aac_available ) {
|
5063 |
|
5064 |
-
|
5065 |
|
5066 |
-
|
5067 |
|
5068 |
-
|
|
|
5069 |
|
5070 |
-
|
5071 |
-
|
5072 |
-
|
5073 |
-
|
5074 |
-
|
5075 |
-
|
5076 |
-
|
5077 |
-
|
5078 |
-
|
5079 |
-
$
|
5080 |
-
|
5081 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5082 |
}
|
5083 |
-
$video_encode_queue[$video_key]['encode_formats'][$format]['status'] = "error";
|
5084 |
-
$video_encode_queue[$video_key]['encode_formats'][$format]['lastline'] = $lastline;
|
5085 |
-
$embed_display = __("Missing libraries", 'video-embed-thumbnail-generator');
|
5086 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5087 |
}//if format is chosen for encoding
|
5088 |
-
}//H.264 format loop
|
5089 |
-
|
5090 |
-
if ( $queued_format == "webm" || $queued_format == "ogg" ) { //if it's not H.264 they both work essentially the same
|
5091 |
-
if ( ! $encodevideo_info[$queued_format.'_exists'] || ($encodevideo_info['sameserver'] && filesize($encodevideo_info[$queued_format.'filepath']) < 24576) ) {
|
5092 |
-
if ( $movie_info['configuration']['libvorbis'] == "true" && $movie_info['configuration'][$video_formats[$queued_format]['vcodec']] == "true" ) {
|
5093 |
-
$encode_string = kgvid_generate_encode_string($moviefilepath, $encodevideo_info[$queued_format.'filepath'], $movie_info, $queued_format, $movie_info['width'], $movie_info['height'], $movie_info['rotate']);
|
5094 |
-
$embed_display = sprintf( __('Encoding %s', 'video-embed-thumbnail-generator'), $video_formats[$queued_format]['name'] );
|
5095 |
-
}//if the necessary libraries are enabled
|
5096 |
-
else {
|
5097 |
-
$missing_libraries = array();
|
5098 |
-
if($movie_info['configuration']['libvorbis'] == 'false') { $missing_libraries[] = 'libvorbis'; }
|
5099 |
-
if($movie_info['configuration'][$video_formats[$queued_format]['vcodec']] == 'false') { $missing_libraries[] = $video_formats[$queued_format]['vcodec']; }
|
5100 |
-
$lastline = sprintf( __('%1$s missing library %2$s required for %3$s encoding.', 'video-embed-thumbnail-generator'), strtoupper($options['video_app']), implode(', ', $missing_libraries), $video_formats[$queued_format]['name']);
|
5101 |
-
$video_encode_queue[$video_key]['encode_formats'][$queued_format]['status'] = "error";
|
5102 |
-
$video_encode_queue[$video_key]['encode_formats'][$queued_format]['lastline'] = $lastline;
|
5103 |
-
$embed_display = __("Missing libraries", 'video-embed-thumbnail-generator');
|
5104 |
-
}
|
5105 |
-
}//if file doesn't already exist
|
5106 |
-
else { $embed_display = sprintf( __('%s already encoded.', 'video-embed-thumbnail-generator'), $video_formats[$queued_format]['vcodec'] ); }
|
5107 |
|
5108 |
-
}//
|
5109 |
|
5110 |
if ( !empty($encode_string) ) {
|
5111 |
|
@@ -5135,8 +5570,8 @@ function kgvid_encode_videos() {
|
|
5135 |
$video_encode_queue[$video_key]['encode_formats'][$queued_format] = array (
|
5136 |
'name' => $video_formats[$queued_format]['name'],
|
5137 |
'status' => 'encoding',
|
5138 |
-
'filepath' => $encodevideo_info[$queued_format
|
5139 |
-
'url' => $encodevideo_info[$queued_format
|
5140 |
'logfile' => $logfile,
|
5141 |
'PID' => $processPID,
|
5142 |
'OS' => $serverOS,
|
@@ -5148,7 +5583,6 @@ function kgvid_encode_videos() {
|
|
5148 |
}//end loop
|
5149 |
|
5150 |
kgvid_save_encode_queue($video_encode_queue);
|
5151 |
-
//kgvid_encode_progress($start_encoding, $queued_format, "attachment");
|
5152 |
|
5153 |
} //if there's a format to encode
|
5154 |
|
@@ -5184,7 +5618,7 @@ function kgvid_test_ffmpeg() {
|
|
5184 |
if ( file_exists($uploads['path']."/sample-video-h264".$suffix) ) {
|
5185 |
|
5186 |
if ( $options['moov'] == "qt-faststart" || $options['moov'] == "MP4Box" ) {
|
5187 |
-
$output .= kgvid_fix_moov_atom($uploads['path']."/sample-video-h264".$suffix);
|
5188 |
}
|
5189 |
|
5190 |
if ( $options['ffmpeg_watermark']['url'] != "" ) {
|
@@ -5268,7 +5702,9 @@ function kgvid_encode_progress($video_key, $format, $page) {
|
|
5268 |
if ( is_array($time_matches) && array_key_exists(1, $time_matches) != true ) { //if something other than the regular FFMPEG encoding output check for these
|
5269 |
preg_match('/video:(.*?) /', $lastline, $video_matches);
|
5270 |
preg_match('/libx264 (.*?) /', $lastline, $libx264_matches);
|
|
|
5271 |
}
|
|
|
5272 |
if ( is_array($time_matches) && array_key_exists(1, $time_matches) == true ) { //still encoding
|
5273 |
|
5274 |
if ( strpos($time_matches[1], ':') !== false ) {
|
@@ -5287,7 +5723,7 @@ function kgvid_encode_progress($video_key, $format, $page) {
|
|
5287 |
if ( $percent_done < 20 ) { $percent_done_text = ""; }
|
5288 |
else { $percent_done_text = strval($percent_done)."%"; }
|
5289 |
|
5290 |
-
preg_match('/fps=\s
|
5291 |
if ( is_array($fps_matches) && array_key_exists(1, $fps_matches) == true ) {
|
5292 |
if ( $fps_matches[1] != 0 ) { $fps_match = $fps_matches[1]; }
|
5293 |
else { $fps_match = "10"; }
|
@@ -5301,20 +5737,24 @@ function kgvid_encode_progress($video_key, $format, $page) {
|
|
5301 |
$args = array($video_key, $format, $page);
|
5302 |
wp_schedule_single_event(time()+60, 'kgvid_cron_queue_check', $args);
|
5303 |
|
5304 |
-
$embed_display = '<strong>'.__('Encoding', 'video-embed-thumbnail-generator').'</strong
|
5305 |
|
5306 |
if ( current_user_can('encode_videos') && $pid ) {
|
5307 |
$embed_display .= '<a href="javascript:void(0);" class="kgvid_cancel_button" id="attachments-'.$video_entry["attachmentID"].'-kgflashmediaplayer-cancelencode" onclick="kgvid_cancel_encode('.$pid.', \''.$video_entry["attachmentID"].'\', \''.$video_key.'\', \''.$format.'\');">'.__('Cancel', 'video-embed-thumbnail-generator').'</a>';
|
5308 |
}
|
5309 |
|
5310 |
-
$embed_display .= '<div
|
5311 |
}
|
5312 |
elseif ( time() - $started < 10 || ( file_exists($filepath) && time() - filemtime($filepath) < 10 ) ) { //not enough time has passed, so check again later
|
5313 |
$args = array($video_key, $format, $page);
|
5314 |
$embed_display = '<strong>'.__('Encoding', 'video-embed-thumbnail-generator').'</strong> <script type="text/javascript">percent_timeout = setTimeout(function(){'.$script_function.'}, 1000);</script>';
|
5315 |
wp_schedule_single_event(time()+60, 'kgvid_cron_queue_check', $args);
|
5316 |
}
|
5317 |
-
elseif (
|
|
|
|
|
|
|
|
|
5318 |
|
5319 |
if ( $blog_id ) { switch_to_blog($blog_id); }
|
5320 |
|
@@ -5349,8 +5789,8 @@ function kgvid_encode_progress($video_key, $format, $page) {
|
|
5349 |
$video_id = kgvid_url_to_id($video_encode_queue[$video_key]['encode_formats'][$format]['url']);
|
5350 |
if ( !$video_id ) {
|
5351 |
$wp_filetype = wp_check_filetype(basename($filepath), null );
|
5352 |
-
|
5353 |
-
$title .= " ".$
|
5354 |
|
5355 |
if ( $user_ID == 0 ) {
|
5356 |
$parent_post = get_post($parent_id);
|
@@ -5389,7 +5829,8 @@ function kgvid_encode_progress($video_key, $format, $page) {
|
|
5389 |
$args = array($next_video['video_key'], $next_video['format'], $page);
|
5390 |
wp_schedule_single_event(time()+60, 'kgvid_cron_queue_check', $args);
|
5391 |
}
|
5392 |
-
|
|
|
5393 |
|
5394 |
$new_movie_url = kgvid_replace_video( $video_key, 'fullres' );
|
5395 |
$script_function = 'kgvid_redraw_encode_checkboxes("'.$new_movie_url.'", "'.$video_entry['attachmentID'].'", "'.$page.'")';
|
@@ -5475,15 +5916,16 @@ add_action('wp_ajax_kgvid_encode_progress', 'kgvid_ajax_encode_progress');
|
|
5475 |
function kgvid_replace_video ( $video_key, $format ) {
|
5476 |
|
5477 |
$video_encode_queue = kgvid_get_encode_queue();
|
|
|
5478 |
$encoded_filename = $video_encode_queue[$video_key]['encode_formats'][$format]['filepath'];
|
5479 |
$video_id = $video_encode_queue[$video_key]['attachmentID'];
|
5480 |
|
5481 |
$original_filename = get_attached_file($video_id);
|
5482 |
$path_parts = pathinfo($original_filename);
|
5483 |
-
if ( $path_parts['extension'] !=
|
5484 |
$new_filename = str_replace("-fullres", "", $encoded_filename);
|
5485 |
$sanitized_url = kgvid_sanitize_url($video_encode_queue[$video_key]['movieurl']);
|
5486 |
-
$new_url = $sanitized_url['noextension'].".
|
5487 |
$video_encode_queue[$video_key]['movieurl'] = $new_url;
|
5488 |
global $wpdb;
|
5489 |
$query = $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE `post_content` LIKE '%%%s%%'", $sanitized_url['basename'].".".$path_parts['extension'] ); //find posts that use the old filename
|
@@ -5491,7 +5933,7 @@ function kgvid_replace_video ( $video_key, $format ) {
|
|
5491 |
if ( $results ) {
|
5492 |
foreach ( $results as $result ) {
|
5493 |
$post = get_post($result->ID);
|
5494 |
-
$post->post_content = str_replace($sanitized_url['
|
5495 |
wp_update_post($post);
|
5496 |
}
|
5497 |
}
|
@@ -5519,9 +5961,21 @@ function kgvid_replace_video ( $video_key, $format ) {
|
|
5519 |
|
5520 |
$new_mime = wp_check_filetype( $new_filename );
|
5521 |
$post = get_post($video_id);
|
5522 |
-
$
|
5523 |
-
|
5524 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5525 |
|
5526 |
return $new_url;
|
5527 |
}
|
@@ -5616,9 +6070,11 @@ function kgvid_fix_moov_atom($filepath) {
|
|
5616 |
|
5617 |
$output = "\n".__('Fixing moov atom for streaming', 'video-embed-thumbnail-generator');
|
5618 |
|
|
|
|
|
5619 |
if ( $options['moov'] == 'qt-faststart' && file_exists($filepath) ) {
|
5620 |
$faststart_tmp_file = str_replace('.mp4', '-faststart.mp4', $filepath);
|
5621 |
-
$cmd = escapeshellcmd($options['app_path']."/".$options['moov']." ".$filepath." ".$faststart_tmp_file);
|
5622 |
$output .= "\n".$cmd."\n";
|
5623 |
exec($cmd, $qtfaststart_output, $returnvalue);
|
5624 |
$output .= implode("\n", $qtfaststart_output);
|
@@ -5629,7 +6085,7 @@ function kgvid_fix_moov_atom($filepath) {
|
|
5629 |
}//if qt-faststart is selected
|
5630 |
|
5631 |
if ( $options['moov'] == 'MP4Box' ) {
|
5632 |
-
$cmd = escapeshellcmd($options['app_path']."/".$options['moov']." -inter 500 ".$filepath);
|
5633 |
$output .= "\n".$cmd."\n";
|
5634 |
exec($cmd, $mp4box_output, $returnvalue);
|
5635 |
$output .= implode("\n", $mp4box_output);
|
@@ -5678,8 +6134,8 @@ function kgvid_ajax_delete_video() {
|
|
5678 |
|
5679 |
if ( empty($attachment_id) ) { //if there's no post_meta giving us the attachment to delete
|
5680 |
$encodevideo_info = kgvid_encodevideo_info($movieurl, $post_id);
|
5681 |
-
if ( is_file($encodevideo_info[$format
|
5682 |
-
$deleted = unlink($encodevideo_info[$format
|
5683 |
}
|
5684 |
}
|
5685 |
else {
|
@@ -5909,7 +6365,7 @@ function kgvid_switch_parents() {
|
|
5909 |
|
5910 |
check_ajax_referer( 'video-embed-thumbnail-generator-nonce', 'security' );
|
5911 |
$queue = get_option('kgvid_video_embed_cms_switch');
|
5912 |
-
if ( $queue['switching_parents'] ) {
|
5913 |
$new_parent = 'post';
|
5914 |
if (isset($_POST['parent'])) { $new_parent = $_POST['parent']; }
|
5915 |
|
@@ -5933,6 +6389,93 @@ function kgvid_switch_parents() {
|
|
5933 |
}
|
5934 |
add_action('wp_ajax_kgvid_switch_parents', 'kgvid_switch_parents');
|
5935 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5936 |
function kgvid_update_cms_progress() {
|
5937 |
|
5938 |
check_ajax_referer( 'video-embed-thumbnail-generator-nonce', 'security' );
|
@@ -6043,63 +6586,6 @@ function kgvid_count_play() {
|
|
6043 |
add_action( 'wp_ajax_kgvid_count_play', 'kgvid_count_play' ); // ajax for logged in users
|
6044 |
add_action( 'wp_ajax_nopriv_kgvid_count_play', 'kgvid_count_play' ); // ajax for not logged in users
|
6045 |
|
6046 |
-
function kgvid_set_gallery_video_code() {
|
6047 |
-
|
6048 |
-
check_ajax_referer( 'kgvid_frontend_nonce', 'security' );
|
6049 |
-
$options = kgvid_get_options();
|
6050 |
-
$id = $_POST['video_id'];
|
6051 |
-
$dimensions = kgvid_set_video_dimensions($id, true);
|
6052 |
-
$downloadlink = get_post_meta($id, "_kgflashmediaplayer-downloadlink", true);
|
6053 |
-
|
6054 |
-
$shortcode = '[KGVID autoplay="true" id="'.$id.'" width="'.$dimensions['width'].'" height="'.$dimensions['height'].'"';
|
6055 |
-
if ($downloadlink == "checked") { $shortcode .= ' downloadlink="true"'; }
|
6056 |
-
$shortcode .= '][/KGVID]';
|
6057 |
-
|
6058 |
-
$code = do_shortcode($shortcode);
|
6059 |
-
$width = $dimensions['width'];
|
6060 |
-
$code = preg_replace('/width: (.*?)px/i', "width: ".$width."px", $code); //WordPress thinks we're in the Admin area so it sets the content_width the same every time
|
6061 |
-
$code = preg_replace('/width="(.*?)"/i', 'width='.$width.'"', $code);
|
6062 |
-
$post = get_post($id);
|
6063 |
-
|
6064 |
-
if ( $options['embed_method'] == "JW Player" && !class_exists('JWP6_Shortcode') ) { $options['embed_method'] = "Video.js"; }
|
6065 |
-
|
6066 |
-
$video_variables = array(
|
6067 |
-
'id' => $id,
|
6068 |
-
'player_type' => $options['embed_method'],
|
6069 |
-
'width' => $dimensions['width'],
|
6070 |
-
'height' => $dimensions['height'],
|
6071 |
-
'countable' => "true",
|
6072 |
-
'autoplay' => "true",
|
6073 |
-
'set_volume' => '',
|
6074 |
-
'meta' => "true",
|
6075 |
-
'endofvideooverlay' => $options['endofvideooverlay'],
|
6076 |
-
'resize' => "true",
|
6077 |
-
'right_click' => $options['right_click']
|
6078 |
-
);
|
6079 |
-
|
6080 |
-
if ( $options['embed_method'] == "Strobe Media Playback" ) {
|
6081 |
-
|
6082 |
-
$content = wp_get_attachment_url($id);
|
6083 |
-
$encodevideo_info = kgvid_encodevideo_info($content, $id);
|
6084 |
-
$flash_settings = kgvid_generate_flashvars($content, $video_variables, $encodevideo_info, $id);
|
6085 |
-
|
6086 |
-
$video_variables['swfurl'] = plugins_url('', __FILE__)."/flash/StrobeMediaPlayback.swf";
|
6087 |
-
$video_variables['expressinstallswfurl'] = plugins_url("", __FILE__)."/flash/expressInstall.swf";
|
6088 |
-
$video_variables['flashvars'] = $flash_settings['flashvars'];
|
6089 |
-
$video_variables['params'] = $flash_settings['params'];
|
6090 |
-
|
6091 |
-
} //if Strobe Media
|
6092 |
-
|
6093 |
-
$data = array( 'kgvid_video_vars' => $video_variables, 'code' => $code );
|
6094 |
-
$data = json_encode($data);
|
6095 |
-
echo $data;
|
6096 |
-
die();
|
6097 |
-
|
6098 |
-
}
|
6099 |
-
add_action( 'wp_ajax_kgvid_set_gallery_video', 'kgvid_set_gallery_video_code' ); // ajax for logged in users
|
6100 |
-
add_action( 'wp_ajax_nopriv_kgvid_set_gallery_video', 'kgvid_set_gallery_video_code' ); // ajax for not logged in users
|
6101 |
-
|
6102 |
-
|
6103 |
function kgvid_add_contextual_help_tab() {
|
6104 |
|
6105 |
$false_code = '<code>"false"</code>';
|
@@ -6116,6 +6602,7 @@ function kgvid_add_contextual_help_tab() {
|
|
6116 |
<li><code>endofvideooverlay="http://www.example.com/end_image.jpg</code> '.__('sets the image shown when the video ends.', 'video-embed-thumbnail-generator').'</li>
|
6117 |
<li><code>width="xxx"</code></li>
|
6118 |
<li><code>height="xxx"</code></li>
|
|
|
6119 |
<li><code>align="left/right/center"</code></li>
|
6120 |
<li><code>inline="true/false"</code> '.__('allow other content on the same line as the video', 'video-embed-thumbnail-generator').'</li>
|
6121 |
<li><code>volume="0.x"</code> '.__('pre-sets the volume for unusually loud videos. Value between 0 and 1.', 'video-embed-thumbnail-generator').'</li>
|
@@ -6131,7 +6618,8 @@ function kgvid_add_contextual_help_tab() {
|
|
6131 |
<li><code>description="Description"</code> '.__('Used for metadata only.', 'video-embed-thumbnail-generator').'</li>
|
6132 |
<li><code>downloadlink="true/false"</code> '.__('generates a link below the video to make it easier for users to save the video file to their computers.', 'video-embed-thumbnail-generator').'</li>
|
6133 |
<li><code>right_click="true/false"</code> '.__('allow or disable right-clicking on the video player.', 'video-embed-thumbnail-generator').'</li>
|
6134 |
-
<li><code>resize="true/false"</code> '.__('allow or disable responsive resizing.', 'video-embed-thumbnail-generator').'</li
|
|
|
6135 |
|
6136 |
<p><strong>'.__('These options will add a subtitle/caption track.', 'video-embed-thumbnail-generator').'</strong></p>
|
6137 |
<ul><li><code>track_src="http://www.example.com/subtitles.vtt_.txt"</code> '.__('URL of the WebVTT file.', 'video-embed-thumbnail-generator').'</li>
|
3 |
Plugin Name: Video Embed & Thumbnail Generator
|
4 |
Plugin URI: http://www.kylegilman.net/2011/01/18/video-embed-thumbnail-generator-wordpress-plugin/
|
5 |
Description: Generates thumbnails, HTML5-compliant videos, and embed codes for locally hosted videos. Requires FFMPEG or LIBAV for encoding.
|
6 |
+
Version: 4.4
|
7 |
Author: Kyle Gilman
|
8 |
Author URI: http://www.kylegilman.net/
|
9 |
Text Domain: video-embed-thumbnail-generator
|
37 |
Website: http://www.kathyisawesome.com/
|
38 |
7) Includes code adapted from Jean-Marc Amiaud's "Replace WordPress default media icon with preview image"
|
39 |
Website: http://www.amiaud.org/tag/video/
|
40 |
+
8) Includes Eric Martin's SimpleModal
|
41 |
+
Website: http://www.ericmmartin.com/projects/simplemodal/
|
42 |
+
9) Includes Dominic's Video.js Resolution Selector
|
43 |
+
Website: https://github.com/dominic-p/videojs-resolution-selector
|
44 |
|
45 |
=Translators=
|
46 |
Spanish: Andrew Kurtis, Webhostinghub http://www.webhostinghub.com/
|
58 |
$edit_others_capable = kgvid_check_if_capable('edit_others_posts');
|
59 |
|
60 |
$options = array(
|
61 |
+
"version" => 4.4,
|
62 |
"embed_method" => "Video.js",
|
63 |
"jw_player_id" => "",
|
64 |
"template" => false,
|
65 |
"template_gentle" => "on",
|
66 |
+
"replace_format" => "fullres",
|
67 |
"encode_fullres" => false,
|
68 |
"encode_1080" => "on",
|
69 |
"encode_720" => "on",
|
70 |
"encode_mobile" => "on",
|
71 |
"encode_webm" => false,
|
72 |
"encode_ogg" => false,
|
73 |
+
"encode_custom" => false,
|
74 |
+
"custom_format" => array(
|
75 |
+
'format' => 'h264',
|
76 |
+
'width' => '',
|
77 |
+
'height' => ''
|
78 |
+
),
|
79 |
"app_path" => "/usr/local/bin",
|
80 |
"video_app" => "ffmpeg",
|
81 |
"ffmpeg_exists" =>"notchecked",
|
82 |
"video_bitrate_flag" => false,
|
83 |
"ffmpeg_vpre" => false,
|
84 |
+
"nostdin" => false,
|
85 |
"moov" => "none",
|
86 |
"generate_thumbs" => 4,
|
87 |
"featured" => "on",
|
100 |
"width" => "640",
|
101 |
"height" => "360",
|
102 |
"minimum_width" => false,
|
103 |
+
"fullwidth" => false,
|
104 |
"gallery_width" => "960",
|
105 |
"gallery_height" => "540",
|
106 |
"gallery_thumb" => "250",
|
139 |
"auto_thumb_position" => 50,
|
140 |
"right_click" => "on",
|
141 |
"resize" => "on",
|
142 |
+
"auto_res" => "on",
|
143 |
"capabilities" => array(
|
144 |
"make_video_thumbnails" => $upload_capable,
|
145 |
"encode_videos" => $upload_capable,
|
223 |
|
224 |
}
|
225 |
|
226 |
+
function kgvid_video_formats( $return_replace = false, $return_customs = true ) {
|
227 |
+
|
228 |
+
$options = kgvid_get_options();
|
229 |
|
230 |
$video_formats = array(
|
231 |
"fullres" => array(
|
232 |
+
"name" => __("same resolution H.264", 'video-embed-thumbnail-generator'),
|
233 |
+
"label" => 'Full',
|
234 |
+
"width" => INF,
|
235 |
+
"height" => INF,
|
236 |
"type" => "h264",
|
237 |
+
"extension" => "mp4",
|
238 |
"mime" => "video/mp4",
|
239 |
"suffix" => "-fullres.mp4",
|
240 |
"vcodec" => "libx264"
|
241 |
),
|
242 |
"1080" => array(
|
243 |
"name" => "1080p H.264",
|
244 |
+
"label" => '1080p',
|
245 |
"width" => 1920,
|
246 |
"height" => 1080,
|
247 |
"type" => "h264",
|
248 |
+
"extension" => "mp4",
|
249 |
"mime" => "video/mp4",
|
250 |
"suffix" => "-1080.mp4",
|
251 |
"old_suffix" => "-1080.m4v",
|
253 |
),
|
254 |
"720" => array(
|
255 |
"name" => "720p H.264",
|
256 |
+
"label" => '720p',
|
257 |
"width" => 1280,
|
258 |
"height" => 720,
|
259 |
"type" => "h264",
|
260 |
+
"extension" => "mp4",
|
261 |
"mime" => "video/mp4",
|
262 |
"suffix" => "-720.mp4",
|
263 |
"old_suffix" => "-720.m4v",
|
264 |
"vcodec" => "libx264"
|
265 |
),
|
266 |
"mobile" => array(
|
267 |
+
"name" => "360p H.264",
|
268 |
+
"label" => '360p',
|
269 |
"width" => 640,
|
270 |
"height" => 480,
|
271 |
"type" => "h264",
|
272 |
+
"extension" => "mp4",
|
273 |
+
"suffix" => "-360.mp4",
|
274 |
"mime" => "video/mp4",
|
275 |
"old_suffix" => "-ipod.m4v",
|
276 |
"vcodec" => "libx264"
|
277 |
),
|
278 |
"webm" => array(
|
279 |
"name" => "WEBM",
|
280 |
+
"label" => 'WEBM',
|
281 |
+
"width" => INF,
|
282 |
+
"height" => INF,
|
283 |
"type" => "webm",
|
284 |
+
"extension" => "webm",
|
285 |
"mime" => "video/webm",
|
286 |
"suffix" => ".webm",
|
287 |
"vcodec" => "libvpx",
|
288 |
),
|
289 |
"ogg" => array(
|
290 |
"name" => "OGV",
|
291 |
+
"label" => 'OGV',
|
292 |
+
"width" => INF,
|
293 |
+
"height" => INF,
|
294 |
"type" => "ogv",
|
295 |
+
"extension" => "ogv",
|
296 |
"mime" => "video/ogg",
|
297 |
"suffix" => ".ogv",
|
298 |
"vcodec" => "libtheora"
|
299 |
)
|
300 |
);
|
301 |
+
|
302 |
+
if ( $return_customs ) {
|
303 |
+
|
304 |
+
$video_formats = $video_formats + array(
|
305 |
+
"custom_h264" => array(
|
306 |
+
"name" => "Custom MP4",
|
307 |
+
"label" => 'Custom MP4',
|
308 |
+
"width" => 0,
|
309 |
+
"height" => 0,
|
310 |
+
"type" => "h264",
|
311 |
+
"extension" => "mp4",
|
312 |
+
"mime" => "video/mp4",
|
313 |
+
"suffix" => "-custom.mp4",
|
314 |
+
"vcodec" => "libx264"
|
315 |
+
),
|
316 |
+
"custom_webm" => array(
|
317 |
+
"name" => "Custom WEBM",
|
318 |
+
"label" => 'Custom WEBM',
|
319 |
+
"width" => 0,
|
320 |
+
"height" => 0,
|
321 |
+
"type" => "webm",
|
322 |
+
"extension" => "webm",
|
323 |
+
"mime" => "video/webm",
|
324 |
+
"suffix" => "-custom.webm",
|
325 |
+
"vcodec" => "libvpx"
|
326 |
+
),
|
327 |
+
"custom_ogg" => array(
|
328 |
+
"name" => "Custom OGV",
|
329 |
+
"label" => 'Custom OGV',
|
330 |
+
"width" => 0,
|
331 |
+
"height" => 0,
|
332 |
+
"type" => "ogv",
|
333 |
+
"extension" => "ogv",
|
334 |
+
"mime" => "video/ogv",
|
335 |
+
"suffix" => "-custom.ogv",
|
336 |
+
"vcodec" => "libtheora"
|
337 |
+
)
|
338 |
+
);
|
339 |
+
}
|
340 |
+
|
341 |
+
if ( is_array($options['custom_format']) && ( !empty($options['custom_format']['width']) || !empty($options['custom_format']['height']) ) ) {
|
342 |
+
$video_formats['custom'] = $options['custom_format'];
|
343 |
+
unset($video_formats['custom_'.$options['custom_format']['format']]);
|
344 |
+
}
|
345 |
+
|
346 |
+
$video_formats['fullres'] = array(
|
347 |
+
'name' => sprintf( __("Replace original with %s", 'video-embed-thumbnail-generator'), $video_formats[$options['replace_format']]['name'] ),
|
348 |
+
'width' => $video_formats[$options['replace_format']]['width'],
|
349 |
+
'height' => $video_formats[$options['replace_format']]['height'],
|
350 |
+
'type' => $video_formats[$options['replace_format']]['type'],
|
351 |
+
'extension' => $video_formats[$options['replace_format']]['extension'],
|
352 |
+
'mime' => $video_formats[$options['replace_format']]['mime'],
|
353 |
+
'suffix' => '-fullres.'.$video_formats[$options['replace_format']]['extension'],
|
354 |
+
'vcodec' => $video_formats[$options['replace_format']]['vcodec']
|
355 |
+
);
|
356 |
+
|
357 |
+
if ( !$return_replace && $options['replace_format'] != 'fullres' ) { unset($video_formats[$options['replace_format']]); }
|
358 |
+
|
359 |
return $video_formats;
|
360 |
|
361 |
}
|
526 |
|
527 |
function kgvid_aac_encoders() {
|
528 |
|
529 |
+
$aac_array = array("libfdk_aac", "libfaac", "aac", "libvo_aacenc");
|
530 |
return $aac_array;
|
531 |
|
532 |
}
|
597 |
}
|
598 |
}
|
599 |
|
600 |
+
function kvid_readfile_chunked($file, $retbytes=TRUE) { //sends large files in chunks so PHP doesn't timeout
|
601 |
+
|
602 |
+
$chunksize = 1 * (1024 * 1024);
|
603 |
+
$buffer = '';
|
604 |
+
$cnt =0;
|
605 |
+
|
606 |
+
$handle = fopen($file, 'r');
|
607 |
+
if ($handle === FALSE) { return FALSE; }
|
608 |
+
|
609 |
+
while (!feof($handle)) {
|
610 |
+
|
611 |
+
$buffer = fread($handle, $chunksize);
|
612 |
+
echo $buffer;
|
613 |
+
ob_flush();
|
614 |
+
flush();
|
615 |
+
|
616 |
+
if ($retbytes) { $cnt += strlen($buffer); }
|
617 |
+
}
|
618 |
+
|
619 |
+
$status = fclose($handle);
|
620 |
+
|
621 |
+
if ($retbytes AND $status) { return $cnt; }
|
622 |
+
|
623 |
+
return $status;
|
624 |
+
|
625 |
+
}
|
626 |
+
|
627 |
function kgvid_check_for_shortcode_in_content() {
|
628 |
global $post;
|
629 |
$pattern = get_shortcode_regex();
|
763 |
function kgvid_set_video_dimensions($id, $gallery = false) {
|
764 |
|
765 |
$options = kgvid_get_options();
|
766 |
+
$moviefile = get_attached_file( $id );
|
767 |
+
$video_meta = wp_get_attachment_metadata( $id );
|
|
|
|
|
768 |
|
769 |
if ( is_array($video_meta) && array_key_exists('width', $video_meta) ) { $widthactual = $video_meta['width']; }
|
770 |
else { $widthactual = get_post_meta($id, "_kgflashmediaplayer-actualwidth", true); }
|
794 |
|
795 |
}
|
796 |
|
797 |
+
function kgvid_set_encode_dimensions($movie_info, $format_stats) {
|
798 |
|
799 |
+
if ( empty($format_stats['width']) || is_infinite($format_stats['width']) ) { $format_stats['width'] = $movie_info['width']; }
|
800 |
+
if ( empty($format_stats['height']) || is_infinite($format_stats['height']) ) { $format_stats['height'] = $movie_info['height']; }
|
|
|
|
|
|
|
801 |
|
802 |
+
if ( intval($movie_info['width']) > $format_stats['width'] ) { $encode_movie_width = $format_stats['width']; }
|
803 |
+
else { $encode_movie_width = $movie_info['width']; }
|
804 |
+
$encode_movie_height = strval(round(floatval($movie_info['height']) / floatval($movie_info['width']) * $encode_movie_width));
|
805 |
+
if ($encode_movie_height % 2 != 0) { $encode_movie_height--; } //if it's odd, decrease by 1 to make sure it's an even number
|
806 |
|
807 |
+
if ( intval($encode_movie_height) > $format_stats['height'] ) {
|
808 |
+
$encode_movie_height = $format_stats['height'];
|
809 |
+
$encode_movie_width = strval(round(floatval($movie_info['width']) / floatval($movie_info['height']) * $encode_movie_height));
|
810 |
+
}
|
811 |
+
if ($encode_movie_width % 2 != 0) { $encode_movie_width--; } //if it's odd, decrease by 1 to make sure it's an even number
|
812 |
+
|
813 |
+
$arr = array( 'width' => $encode_movie_width, 'height' => $encode_movie_height );
|
814 |
return $arr;
|
815 |
|
816 |
}
|
823 |
$video_formats = kgvid_video_formats();
|
824 |
$sanitized_url = kgvid_sanitize_url($movieurl);
|
825 |
$movieurl = $sanitized_url['movieurl'];
|
826 |
+
$moviefile = '';
|
827 |
|
828 |
$encodevideo_info['moviefilebasename'] = $sanitized_url['basename'];
|
|
|
829 |
$encodevideo_info['encodepath'] = $uploads['path'];
|
830 |
+
|
831 |
+
|
832 |
if ( get_post_type($postID) == "attachment" ) { //if it's an attachment, not from URL
|
833 |
$moviefile = get_attached_file($postID);
|
834 |
$path_parts = pathinfo($moviefile);
|
841 |
'post_mime_type' => 'video'
|
842 |
);
|
843 |
}
|
844 |
+
elseif ($moviefile == '' || !is_file($moviefile) ) {
|
845 |
|
846 |
$url_parts = parse_url($uploads['url']);
|
847 |
if ( is_array($url_parts) && array_key_exists('host', $url_parts) && strpos($movieurl, $url_parts['host']) !== false ) { //if we're on the same server
|
872 |
|
873 |
foreach ( $video_formats as $format => $format_stats ) { //loop through each format
|
874 |
|
875 |
+
$encodevideo_info[$format]['exists'] = false;
|
876 |
+
$encodevideo_info[$format]['writable'] = false;
|
877 |
|
878 |
//start with the new database info before checking other locations
|
879 |
|
882 |
$mime_type = get_post_mime_type($child->ID);
|
883 |
$wp_attached_file = get_post_meta($child->ID, '_wp_attached_file', true);
|
884 |
$wp_file_info = pathinfo($wp_attached_file);
|
885 |
+
$video_meta = wp_get_attachment_metadata( $child->ID );
|
886 |
+
$meta_format = get_post_meta($child->ID, '_kgflashmediaplayer-format', true);
|
887 |
+
if ( $meta_format == $format || ( substr($wp_attached_file, -strlen($format_stats['suffix'])) == $format_stats['suffix'] && $meta_format == false ) ) {
|
888 |
+
$encodevideo_info[$format]['url'] = $uploads['baseurl'].'/'.$wp_attached_file;
|
889 |
+
$encodevideo_info[$format]['filepath'] = $uploads['basedir'].'/'.$wp_attached_file;
|
890 |
+
$encodevideo_info[$format]['id'] = $child->ID;
|
891 |
+
$encodevideo_info[$format]['exists'] = true;
|
892 |
+
$encodevideo_info[$format]['writable'] = true;
|
893 |
+
if ( is_array($video_meta) && array_key_exists('width', $video_meta) ) {
|
894 |
+
$encodevideo_info[$format]['width'] = $video_meta['width'];
|
895 |
+
}
|
896 |
+
if ( is_array($video_meta) && array_key_exists('height', $video_meta) ) {
|
897 |
+
$encodevideo_info[$format]['height'] = $video_meta['height'];
|
898 |
+
}
|
899 |
continue 2; //skip rest of children loop and format loop
|
900 |
}
|
901 |
}
|
917 |
'filepath' => $uploads['basedir']."/html5encodes/".$encodevideo_info['moviefilebasename'].$old_suffix ),
|
918 |
);
|
919 |
if ( !array_key_exists('old_suffix', $format_stats) ) { unset($potential_locations['same_directory_old_suffix']); }
|
920 |
+
if ( $format == 'mobile' ) {
|
921 |
+
$potential_locations['480p'] = array(
|
922 |
+
'url' => $sanitized_url['noextension'].'-480.mp4',
|
923 |
+
'filepath' => $encodevideo_info['encodepath'].$encodevideo_info['moviefilebasename'].'-480.mp4'
|
924 |
+
);
|
925 |
+
}
|
926 |
|
927 |
foreach ( $potential_locations as $name => $location ) {
|
928 |
|
929 |
if ( file_exists($location['filepath']) ) {
|
930 |
+
$encodevideo_info[$format]['exists'] = true;
|
931 |
+
$encodevideo_info[$format]['url'] = $location['url'];
|
932 |
+
$encodevideo_info[$format]['filepath'] = $location['filepath'];
|
933 |
+
if ( is_writable($location['filepath']) ) { $encodevideo_info[$format]['writable'] = true; }
|
934 |
break;
|
935 |
}
|
936 |
elseif ( !$encodevideo_info['sameserver'] && $name != "html5encodes" ) { //last resort if it's not on the same server, check url_exists
|
938 |
$already_checked_url = get_post_meta($postID, '_kgflashmediaplayer-'.$sanitized_url['singleurl_id'].'-'.$format, true);
|
939 |
if ( empty($already_checked_url) ) {
|
940 |
if ( kgvid_url_exists(esc_url_raw(str_replace(" ", "%20", $location['url']))) ) {
|
941 |
+
$encodevideo_info[$format]['exists'] = true;
|
942 |
+
$encodevideo_info[$format]['url'] = $location['url'];
|
943 |
+
update_post_meta($postID, '_kgflashmediaplayer-'.$sanitized_url['singleurl_id'].'-'.$format, $encodevideo_info[$format]['url']);
|
944 |
}
|
945 |
else {
|
946 |
update_post_meta($postID, '_kgflashmediaplayer-'.$sanitized_url['singleurl_id'].'-'.$format, 'not found');
|
948 |
}
|
949 |
else { //url already checked
|
950 |
if ( substr($already_checked_url, 0, 4) == 'http' ) { //if it smells like a URL...
|
951 |
+
$encodevideo_info[$format]['exists'] = true;
|
952 |
+
$encodevideo_info[$format]['url'] = $already_checked_url;
|
953 |
}
|
954 |
}
|
955 |
}//end if not on same server
|
956 |
}//end potential locations loop
|
957 |
|
958 |
+
if ( !$encodevideo_info[$format]['exists'] ) {
|
959 |
+
$encodevideo_info[$format]['url'] = $uploads['url'].'/'.$encodevideo_info['moviefilebasename'].$format_stats['suffix'];
|
960 |
+
$encodevideo_info[$format]['filepath'] = $uploads['path'].'/'.$encodevideo_info['moviefilebasename'].$format_stats['suffix'];
|
|
|
961 |
}
|
962 |
|
963 |
}//end format loop
|
983 |
$video_id = kgvid_url_to_id($video);
|
984 |
if ( $video_id ) {
|
985 |
$video_path = get_attached_file($video_id);
|
986 |
+
if ( file_exists($video_path) ) { $video = $video_path; }
|
987 |
}
|
988 |
else { //not in the database
|
989 |
if ( !empty($options['htaccess_login']) && strpos($video, 'http://') === 0 ) {
|
1060 |
$flash_source_found = false;
|
1061 |
$video_formats = kgvid_video_formats();
|
1062 |
foreach ($video_formats as $format => $format_stats) { //check if there's an H.264 format available and pick the highest quality one
|
1063 |
+
if ( $encodevideo_info[$format]["exists"] && $format_stats['type'] == "mp4" ) {
|
1064 |
+
$flashvars['src'] = urlencode(trim($encodevideo_info[$format]['url']));
|
1065 |
$flash_source_found = true;
|
1066 |
break;
|
1067 |
}
|
1158 |
if ( strpos($options['ffmpeg_watermark']['url'], 'http://') === 0 ) {
|
1159 |
$watermark_id = false;
|
1160 |
$watermark_id = kgvid_url_to_id($options['ffmpeg_watermark']['url']);
|
1161 |
+
if ( $watermark_id ) {
|
1162 |
+
$watermark_file = get_attached_file($watermark_id);
|
1163 |
+
if ( file_exists($watermark_file) ) { $options['ffmpeg_watermark']['url'] = $watermark_file; }
|
1164 |
+
}
|
1165 |
}
|
1166 |
|
1167 |
$watermark_input = '-i "'.$options['ffmpeg_watermark']['url'].'" ';
|
1205 |
|
1206 |
}
|
1207 |
else { //if it's not H.264 the settings are basically the same
|
1208 |
+
$ffmpeg_options = "-acodec libvorbis -".$audio_bitrate_flag." ".$options['audio_bitrate']."k -s ".$width."x".$height." -vcodec ".$video_formats[$format]['vcodec'];
|
1209 |
if ( $video_formats[$format]['type'] == 'webm' && $options['rate_control'] == "crf" ) {
|
1210 |
$ffmpeg_options .= " -".$video_bitrate_flag." ".round(floatval($options['bitrate_multiplier'])*1.25*$width*$height*30/1024)."k"; //set a max bitrate 25% larger than the ABR. Otherwise libvpx goes way too low.
|
1211 |
}
|
1218 |
if ( !empty($options['htaccess_login']) && strpos($input, 'http://') === 0 ) {
|
1219 |
$input = substr_replace($input, $options['htaccess_login'].':'.$options['htaccess_password'].'@', 7, 0);
|
1220 |
}
|
1221 |
+
|
1222 |
+
$nostdin = "";
|
1223 |
+
if ( $options['nostdin'] == "on" && $options['video_app'] == 'ffmpeg' ) { $nostdin = " -nostdin"; }
|
1224 |
+
|
1225 |
$encode_string = array();
|
1226 |
+
$encode_string[1] = $nice.$options['app_path']."/".$options['video_app'].$nostdin.' -y -i "'.$input.'" '.$watermark_input.$ffmpeg_options.$rate_control_flag.$rotate." -threads ".$options['threads'];
|
1227 |
$encode_string[2] = $watermark_filter;
|
1228 |
$encode_string[3] = ' "'.$output.'"';
|
1229 |
|
1296 |
|
1297 |
//Video.js styles
|
1298 |
if ( $options['embed_method'] == "Video.js" || $options['embed_method'] == "Strobe Media Playback" ) {
|
1299 |
+
wp_enqueue_style( 'video-js', plugins_url("", __FILE__).'/video-js/video-js.css', '', '4.9.1' );
|
1300 |
wp_enqueue_style( 'video-js-kg-skin', plugins_url("", __FILE__).'/video-js/kg-video-js-skin.css', '', $options['version'] );
|
1301 |
}
|
1302 |
|
1306 |
}
|
1307 |
add_action('wp_enqueue_scripts', 'kgvid_video_embed_enqueue_scripts', 12);
|
1308 |
|
1309 |
+
//add_action( 'all', create_function( '', 'error_log(print_r( current_filter(),true ));' ) );
|
1310 |
+
|
1311 |
function enqueue_kgvid_script() { //loads plugin-related scripts in the admin area
|
1312 |
+
|
1313 |
$options = kgvid_get_options();
|
1314 |
|
1315 |
wp_enqueue_script( 'kgvid_video_plugin_admin', plugins_url('/js/kgvid_video_plugin_admin.js', __FILE__), array('jquery'), $options['version'], true );
|
1334 |
'runningtest' => __('Running test...', 'video-embed-thumbnail-generator'),
|
1335 |
'ffmpegrequired' => __('FFMPEG or LIBAV required for these functions.', 'video-embed-thumbnail-generator'),
|
1336 |
'featuredwarning' => __("You are about to set all existing video thumbnails previously generated by this plugin as the featured images for their posts. There is no 'undo' button, so proceed at your own risk.", 'video-embed-thumbnail-generator'),
|
1337 |
+
'autothumbnailwarning' => __("You are about to create thumbnails for every video in your Media Library that doesn't already have one. This might take a long time. There is no 'undo' button, so proceed at your own risk.\n\nNumber of videos without thumbnails: ", 'video-embed-thumbnail-generator'),
|
1338 |
+
'autoencodewarning' => __("You are about to add every video in your Media Library to the video encode queue if it hasn't already been encoded. This might take a long time.", 'video-embed-thumbnail-generator'),
|
1339 |
+
'nothumbstomake' => __("No thumbnails generated. All videos have thumbnails already.", 'video-embed-thumbnail-generator'),
|
1340 |
'cancel_ok' => __("'Cancel' to stop, 'OK' to proceed.", 'video-embed-thumbnail-generator'),
|
1341 |
'processing' => __('Processing...', 'video-embed-thumbnail-generator'),
|
1342 |
'parentwarning_posts' => __("You are about to set all existing video thumbnails previously generated by this plugin as attachments of their posts rather than their associated videos. Proceed at your own risk.", 'video-embed-thumbnail-generator'),
|
1350 |
'settracksource' => __('Set as track source', 'video-embed-thumbnail-generator'),
|
1351 |
'choosefromlibrary' => __('Choose from Library', 'video-embed-thumbnail-generator'),
|
1352 |
'languagecode' => __('Language code:', 'video-embed-thumbnail-generator'),
|
1353 |
+
'label' => _x('Label:', 'noun', 'video-embed-thumbnail-generator'),
|
1354 |
+
'custom' => _x('Custom', 'Custom format', 'video-embed-thumbnail-generator')
|
1355 |
) );
|
1356 |
|
1357 |
}
|
1358 |
add_action('admin_enqueue_scripts', 'enqueue_kgvid_script');
|
1359 |
+
add_action('wp_enqueue_media', 'enqueue_kgvid_script');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1360 |
|
1361 |
function kgvid_video_embed_print_scripts() {
|
1362 |
|
1366 |
$pattern = get_shortcode_regex();
|
1367 |
$options = kgvid_get_options();
|
1368 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1369 |
echo '<script type="text/javascript">document.createElement(\'video\');document.createElement(\'audio\');</script>'."\n";
|
1370 |
|
1371 |
if ( !empty($posts) && is_array($posts) ) {
|
1396 |
}
|
1397 |
add_action('wp_head', 'kgvid_video_embed_print_scripts', 99);
|
1398 |
|
1399 |
+
function kgvid_enqueue_shortcode_scripts() {
|
1400 |
+
|
1401 |
+
$options = kgvid_get_options();
|
1402 |
+
|
1403 |
+
if ( $options['embed_method'] == "Video.js" || $options['embed_method'] == "Strobe Media Playback" ) {
|
1404 |
+
wp_enqueue_script( 'video-js', plugins_url("", __FILE__).'/video-js/video.js', '', '4.9.1', true );
|
1405 |
+
add_action('wp_footer', 'kgvid_print_videojs_footer', 99);
|
1406 |
+
}
|
1407 |
+
|
1408 |
+
if ( $options['embed_method'] == "Strobe Media Playback" ) {
|
1409 |
+
wp_enqueue_script( 'swfobject' );
|
1410 |
+
}
|
1411 |
+
|
1412 |
+
wp_enqueue_script( 'kgvid_video_embed', plugins_url("/js/kgvid_video_embed.js", __FILE__), array('jquery'), $options['version'], true );
|
1413 |
+
|
1414 |
+
}
|
1415 |
+
|
1416 |
function kgvid_print_videojs_footer() { //called by the shortcode if Video.js is used
|
1417 |
|
1418 |
+
echo '<script type="text/javascript">if(typeof videojs !== "undefined") { videojs.options.flash.swf = "'.plugins_url("", __FILE__).'/video-js/video-js.swf?4.5.1"; }</script>'."\n";
|
1419 |
|
1420 |
}
|
1421 |
|
1433 |
'videos' => -1,
|
1434 |
'width' => $options['width'],
|
1435 |
'height' => $options['height'],
|
1436 |
+
'fullwidth' => $options['fullwidth'],
|
1437 |
'align' => $options['align'],
|
1438 |
'controlbar' => $options['controlbar_style'],
|
1439 |
'autohide' => $options['autohide'],
|
1468 |
'downloadlink' => $options['downloadlink'],
|
1469 |
'right_click' => $options['right_click'],
|
1470 |
'resize' => $options['resize'],
|
1471 |
+
'auto_res' => $options['auto_res'],
|
1472 |
'track_kind' => 'subtitles',
|
1473 |
'track_srclang' => substr(get_bloginfo('language'), 0, 2),
|
1474 |
'track_src' => '',
|
1490 |
|
1491 |
$query_atts = shortcode_atts($default_atts, $atts, 'KGVID');
|
1492 |
|
1493 |
+
$checkbox_convert = array (
|
1494 |
+
"autohide",
|
1495 |
+
"endofvideooverlaysame",
|
1496 |
+
"playbutton",
|
1497 |
+
"loop",
|
1498 |
+
"autoplay",
|
1499 |
+
"title",
|
1500 |
+
"embedcode",
|
1501 |
+
"view_count",
|
1502 |
+
"inline",
|
1503 |
+
"resize",
|
1504 |
+
"auto_res",
|
1505 |
+
"downloadlink",
|
1506 |
+
"mute",
|
1507 |
+
"fullwidth"
|
1508 |
+
);
|
1509 |
foreach ( $checkbox_convert as $query ) {
|
1510 |
if ( $query_atts[$query] == "on" ) { $query_atts[$query] = "true"; }
|
1511 |
if ( $query_atts[$query] == false ) { $query_atts[$query] = "false"; }
|
1523 |
function KGVID_shortcode($atts, $content = ''){
|
1524 |
|
1525 |
global $content_width;
|
1526 |
+
static $kgvid_video_id;
|
1527 |
+
if ( !$kgvid_video_id ) { $kgvid_video_id = 0; }
|
1528 |
+
|
1529 |
$content_width_save = $content_width;
|
1530 |
|
1531 |
$code = "";
|
1533 |
|
1534 |
$options = kgvid_get_options();
|
1535 |
|
1536 |
+
kgvid_enqueue_shortcode_scripts();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1537 |
|
1538 |
if ( in_the_loop() ) { $post_ID = get_the_ID(); }
|
1539 |
else { $post_ID = 1; }
|
1542 |
|
1543 |
if ( $query_atts["gallery"] != "true" ) { //if this is not a pop-up gallery
|
1544 |
|
1545 |
+
$video_formats = kgvid_video_formats();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1546 |
|
1547 |
if ( empty($content) ) {
|
1548 |
if ( !empty($query_atts["id"]) ) {
|
1579 |
|
1580 |
foreach ( $id_array as $id ) { //loop through videos
|
1581 |
|
1582 |
+
$div_suffix = 'kgvid_'.strval($kgvid_video_id);
|
1583 |
+
|
1584 |
$query_atts = kgvid_shortcode_atts($atts); //reset values so they can be different with multiple videos
|
1585 |
$content = $original_content;
|
1586 |
$sources = array();
|
1587 |
$mp4already = false;
|
1588 |
+
$dimensions = array();
|
1589 |
|
1590 |
$compatible = array("flv", "f4v", "mp4", "mov", "m4v", "ogv", "ogg", "webm");
|
1591 |
$h264compatible = array("mp4", "mov", "m4v");
|
1597 |
if ( $content == false ) { echo "Invalid video ID"; continue; }
|
1598 |
}
|
1599 |
|
|
|
1600 |
$encodevideo_info = kgvid_encodevideo_info($content, $id);
|
1601 |
$attachment_info = get_post( $id );
|
1602 |
|
1603 |
$dimensions = kgvid_set_video_dimensions($id);
|
|
|
1604 |
|
1605 |
if ( empty($atts['width']) ) {
|
1606 |
$query_atts['width'] = $dimensions['width'];
|
1627 |
$countable = true;
|
1628 |
}
|
1629 |
else { //video is not in the database
|
1630 |
+
|
1631 |
$encodevideo_info = kgvid_encodevideo_info($content, $post_ID); //send the id of the post the video's embedded in
|
1632 |
if ( $query_atts['title'] == "true" ) {
|
1633 |
$query_atts['title'] = "false";
|
1650 |
$mime_type = $mime_type_check['type'];
|
1651 |
}
|
1652 |
|
|
|
1653 |
unset($video_formats['fullres']);
|
1654 |
+
$video_formats = array('original' => array( "type" => $format_type, "mime" => $mime_type, "name" => "Full", "label" => "Full" ) ) + $video_formats;
|
1655 |
|
1656 |
if ( in_array($mime_type_check['ext'], $compatible) ) {
|
1657 |
+
|
1658 |
+
$encodevideo_info["original"]["exists"] = true;
|
1659 |
+
$encodevideo_info["original"]["url"] = $content;
|
1660 |
+
|
1661 |
+
if ( is_array($dimensions) && array_key_exists('actualheight', $dimensions) ) {
|
1662 |
+
$video_formats['original']['label'] = $dimensions['actualheight'].'p';
|
1663 |
+
$video_formats['original']['height'] = $dimensions['actualheight'];
|
1664 |
+
$encodevideo_info["original"]["height"] = $dimensions['actualheight'];
|
1665 |
+
}
|
1666 |
+
|
1667 |
}
|
1668 |
+
else { $encodevideo_info["original"]["exists"] = false; }
|
1669 |
|
1670 |
if($query_atts["endofvideooverlaysame"] == "true") { $query_atts["endofvideooverlay"] = $query_atts["poster"]; }
|
1671 |
|
1726 |
$wp_shortcode = "[video ";
|
1727 |
$sources_hack = "";
|
1728 |
foreach ($video_formats as $format => $format_stats) {
|
1729 |
+
if ( $format != "original" && $encodevideo_info[$format]["url"] == $content ) { unset($sources['original']); }
|
1730 |
+
if ( $encodevideo_info[$format]["exists"] ) {
|
1731 |
if ( $format_stats['type'] != "h264" || !$mp4already ) {
|
1732 |
+
$shortcode_type = wp_check_filetype( $encodevideo_info[$format]["url"], wp_get_mime_types() );
|
1733 |
+
$sources[$format] = $shortcode_type['ext'].'="'.$encodevideo_info[$format]["url"].'" ';
|
1734 |
if ( $format_stats['type'] == "h264" ) { //WordPress built-in shortcode doesn't support multiple videos of the same type but we'll hack it in later
|
1735 |
$mp4already = true;
|
1736 |
}
|
1737 |
}
|
1738 |
+
else { $sources_hack .= '<source type="'.$format_stats['mime'].'" src="'.esc_attr($encodevideo_info[$format]["url"]).'" />'; }
|
1739 |
}
|
1740 |
}
|
1741 |
|
1764 |
|
1765 |
if ( class_exists('JWP6_Shortcode') ) {
|
1766 |
|
1767 |
+
$x = 0;
|
1768 |
+
foreach ($video_formats as $format => $format_stats) {
|
1769 |
+
if ( $format != "original" && $encodevideo_info[$format]["url"] == $content ) { unset($sources['original']); }
|
1770 |
+
if ( $encodevideo_info[$format]["exists"] ) {
|
1771 |
+
if ( array_key_exists('height', $encodevideo_info[$format]) ) {
|
1772 |
+
$source_key = $encodevideo_info[$format]['height'];
|
1773 |
+
$format_stats['label'] = $encodevideo_info[$format]['height'].'p';
|
1774 |
+
}
|
1775 |
+
else { $source_key = $x; }
|
1776 |
+
|
1777 |
+
$sources[$source_key] = '{ file:\''.esc_attr($encodevideo_info[$format]["url"]).'\', label:\''.$format_stats['label'].'\'';
|
1778 |
+
if ( $format == "original" ) { $sources[$source_key] .= ', default:\'true\''; }
|
1779 |
+
$sources[$source_key] .= '}';
|
1780 |
+
$x++;
|
1781 |
}
|
1782 |
}
|
1783 |
+
krsort($sources);
|
1784 |
|
1785 |
$jw_tracks = array();
|
1786 |
if ( !empty($track_option[0]['src']) ) {
|
1829 |
if ( $options['embed_method'] == "Video.js" || $options['embed_method'] == "Strobe Media Playback" ) {
|
1830 |
|
1831 |
$enable_resolutions_plugin = false;
|
1832 |
+
$x = 20;
|
1833 |
foreach ($video_formats as $format => $format_stats) {
|
1834 |
+
if ( $format != "original" && $encodevideo_info[$format]["url"] == $content ) { unset($sources['original']); }
|
1835 |
+
if ( $encodevideo_info[$format]["exists"] ) {
|
1836 |
|
1837 |
+
if ( array_key_exists('height', $encodevideo_info[$format]) && $format_stats['type'] == 'h264' ) {
|
1838 |
+
$source_key = $encodevideo_info[$format]['height'];
|
1839 |
+
$format_stats['label'] = $encodevideo_info[$format]['height'].'p';
|
1840 |
+
}
|
1841 |
+
else { $source_key = $x; }
|
1842 |
+
|
1843 |
+
$sources[$source_key] = "\t\t\t\t\t".'<source src="'.esc_attr($encodevideo_info[$format]["url"]).'?id='.$kgvid_video_id.'" type="'.$format_stats["mime"].'"';
|
1844 |
+
if ( $format_stats['type'] == 'h264' ) {
|
1845 |
+
$sources[$source_key] .= ' data-res="'.$format_stats['label'].'"';
|
1846 |
if ( $mp4already ) { //there is more than one resolution available
|
1847 |
+
wp_enqueue_script( 'video-quality-selector', plugins_url("", __FILE__).'/video-js/video-quality-selector.js', array('video-js'), $options['version'], true );
|
1848 |
$enable_resolutions_plugin = true;
|
1849 |
}
|
1850 |
$mp4already = true;
|
1851 |
+
}
|
1852 |
+
else { $sources[$source_key] .= ' data-res="'.$format_stats['name'].'"'; }
|
1853 |
+
$sources[$source_key] .= '>'."\n";
|
1854 |
}
|
1855 |
+
$x--;
|
1856 |
}
|
1857 |
+
krsort($sources);
|
1858 |
|
1859 |
$code .= '<video id="video_'.$div_suffix.'" ';
|
1860 |
if ( $query_atts["loop"] == 'true') { $code .= 'loop '; }
|
1863 |
$code .= 'preload="'.$options['preload'].'" ';
|
1864 |
if ( $query_atts["poster"] != '' ) { $code .= 'poster="'.esc_attr($query_atts["poster"]).'" '; }
|
1865 |
$code .= 'width="'.$query_atts["width"].'" height="'.esc_attr($query_atts["height"]).'"';
|
1866 |
+
$code .= ' class="fitvidsignore '.esc_attr('video-js '.$options['js_skin']).'" data-setup=\'{';
|
1867 |
+
if ( $enable_resolutions_plugin ) { $code .= ' "plugins" : { "resolutionSelector" : { "force_types" : ["video/mp4"] } } '; }
|
1868 |
+
$code .= '}\'';
|
1869 |
$code .= ">\n";
|
1870 |
|
1871 |
$code .= implode("", $sources); //add the <source> tags created earlier
|
1887 |
$code .= '<div class="kgvid-caption" id="video_'.$div_suffix.'_caption">'.$query_atts['caption'];
|
1888 |
if ( $query_atts['downloadlink'] == "true" ) {
|
1889 |
if ( !empty($query_atts['caption']) ) { $code .= '<br>'; }
|
1890 |
+
$forceable = false;
|
1891 |
+
if ( !empty($id) ) {
|
1892 |
+
$filepath = get_attached_file($id);
|
1893 |
+
if ( file_exists($filepath) ) {
|
1894 |
+
$forceable = true;
|
1895 |
+
$code .= '<a href="'.site_url('/').'?attachment_id='.$id.'&kgvid_video_embed[download]=true">'.__('Click on this link to download', 'video-embed-thumbnail-generator').'</a>';
|
1896 |
+
}
|
1897 |
+
}
|
1898 |
+
if ( !$forceable ) { $code .= '<a href="'.$content.'">'.__('Right-click or ctrl-click on this link to download', 'video-embed-thumbnail-generator').'</a>'; }
|
1899 |
}
|
1900 |
$code .= '</div>';
|
1901 |
}
|
1924 |
|
1925 |
$video_variables = array(
|
1926 |
'id' => $div_suffix,
|
1927 |
+
'attachment_id' => $id,
|
1928 |
'player_type' => $options['embed_method'],
|
1929 |
'width' => $query_atts['width'],
|
1930 |
'height' => $query_atts['height'],
|
1931 |
+
'fullwidth' => $query_atts['fullwidth'],
|
1932 |
'countable' => $countable,
|
1933 |
'autoplay' => $query_atts['autoplay'],
|
1934 |
'set_volume' => $query_atts['volume'],
|
1936 |
'meta' => $kgvid_meta,
|
1937 |
'endofvideooverlay' => $query_atts['endofvideooverlay'],
|
1938 |
'resize' => $query_atts['resize'],
|
1939 |
+
'auto_res' => $query_atts['auto_res'],
|
1940 |
'right_click' => $query_atts['right_click']
|
1941 |
);
|
1942 |
|
1953 |
|
1954 |
} //if Strobe Media
|
1955 |
|
1956 |
+
wp_localize_script( 'kgvid_video_embed', 'kgvidL10n_frontend', array(
|
1957 |
+
'ajaxurl' => admin_url( 'admin-ajax.php', is_ssl() ? 'admin' : 'http' ),
|
1958 |
+
'ajax_nonce' => wp_create_nonce('kgvid_frontend_nonce'),
|
1959 |
+
'playstart' => _x("Play Start", 'noun for Google Analytics event', 'video-embed-thumbnail-generator'),
|
1960 |
+
'completeview' => _x("Complete View", 'noun for Google Analytics event', 'video-embed-thumbnail-generator'),
|
1961 |
+
'next' => _x("Next", 'button text to play next video', 'video-embed-thumbnail-generator'),
|
1962 |
+
'previous' => _x("Previous", 'button text to play previous video', 'video-embed-thumbnail-generator')
|
1963 |
+
) );
|
1964 |
+
|
1965 |
wp_localize_script( 'kgvid_video_embed', 'kgvid_video_vars_'.$div_suffix, $video_variables ); //add video variables in footer
|
1966 |
|
1967 |
+
$kgvid_video_id++;
|
1968 |
+
|
1969 |
} //end id_array loop
|
1970 |
|
1971 |
} //if not gallery
|
1972 |
|
1973 |
else { //if gallery
|
1974 |
|
1975 |
+
wp_enqueue_script( 'simplemodal', plugins_url("/js/jquery.simplemodal.1.4.5.min.js", __FILE__), '', '1.4.5', true );
|
1976 |
|
1977 |
static $kgvid_gallery_id = 0;
|
1978 |
|
1995 |
if ( $query_atts['align'] == "left" ) { $aligncode = ' kgvid_textalign_left'; }
|
1996 |
if ( $query_atts['align'] == "center" ) { $aligncode = ' kgvid_textalign_center'; }
|
1997 |
if ( $query_atts['align'] == "right" ) { $aligncode = ' kgvid_textalign_right'; }
|
1998 |
+
if ( $query_atts['inline'] == "true" ) { $aligncode .= ' kgvid_wrapper_inline'; }
|
1999 |
$div_suffix = substr(uniqid(rand(), true),0,4);
|
2000 |
$code .= '<div class="kgvid_gallerywrapper'.$aligncode.'" id="kgvid_gallery_'.$kgvid_gallery_id.'">';
|
2001 |
foreach ( $attachments as $attachment ) {
|
2036 |
|
2037 |
$dimensions = kgvid_set_video_dimensions($attachment->ID, true);
|
2038 |
|
2039 |
+
$code .= '<div class="kgvid_video_gallery_thumb" id="kgvid_video_gallery_thumb_kgvid_'.strval($kgvid_video_id).'" data-id="kgvid_'.strval($kgvid_video_id).'" data-width="'.esc_attr($dimensions['width']).'" data-height="'.esc_attr($dimensions['height']).'" data-meta="'.esc_attr($below_video).'" data-gallery_end="'.esc_attr($query_atts['gallery_end']).'" style="width:'.$query_atts["gallery_thumb"].'px"><img src="'.esc_attr($thumbnail_url).'" alt="'.esc_attr($attachment->post_title).'"><div class="'.esc_attr($options['js_skin']).'" ><div class="'.$play_button_class.'" style="-webkit-transform: scale('.$play_scale.') translateY(-'.$play_translate.'px); -o-transform: scale('.$play_scale.') translateY(-'.$play_translate.'px); -ms-transform: scale('.$play_scale.') translateY(-'.$play_translate.'px); transform: scale('.$play_scale.') translateY(-'.$play_translate.'px);"><span></span></div></div><div class="titlebackground"><div class="videotitle">'.$attachment->post_title.'</div></div></div>'."\n\t\t\t";
|
2040 |
+
|
2041 |
+
$shortcode = '[KGVID autoplay="true" id="'.$attachment->ID.'" width="'.$dimensions['width'].'" height="'.$dimensions['height'].'"';
|
2042 |
+
if ($downloadlink == "checked") { $shortcode .= ' downloadlink="true"'; }
|
2043 |
+
$shortcode .= '][/KGVID]';
|
2044 |
+
|
2045 |
+
$popup_code = do_shortcode($shortcode);
|
2046 |
+
|
2047 |
+
wp_localize_script( 'kgvid_video_embed', 'kgvid_video_popup_code_kgvid_'.strval($kgvid_video_id-1), $popup_code ); //add popup video code in footer
|
2048 |
+
|
2049 |
+
} //end attachment loop
|
2050 |
|
2051 |
$code .= '</div>'; //end wrapper div
|
2052 |
|
2068 |
}
|
2069 |
add_filter( 'no_texturize_shortcodes', 'kgvid_no_texturize_shortcode' );
|
2070 |
|
2071 |
+
function kgvid_update_child_format() {
|
2072 |
+
|
2073 |
+
check_ajax_referer( 'video-embed-thumbnail-generator-nonce', 'security' );
|
2074 |
+
$video_id = $_POST['video_id'];
|
2075 |
+
$parent_id = $_POST['parent_id'];
|
2076 |
+
$format = $_POST['format'];
|
2077 |
+
$movieurl = $_POST['movieurl'];
|
2078 |
+
|
2079 |
+
|
2080 |
+
$post = get_post($video_id);
|
2081 |
+
update_post_meta( $video_id, '_kgflashmediaplayer-format', $format );
|
2082 |
+
update_post_meta( $video_id, '_kgflashmediaplayer-pickedformat', $post->post_parent ); //save the original parent
|
2083 |
+
$post->post_parent = $parent_id;
|
2084 |
+
wp_update_post($post);
|
2085 |
+
|
2086 |
+
|
2087 |
+
die();
|
2088 |
+
}
|
2089 |
+
add_action('wp_ajax_kgvid_update_child_format', 'kgvid_update_child_format');
|
2090 |
+
|
2091 |
+
function kgvid_clear_child_format() {
|
2092 |
+
|
2093 |
+
check_ajax_referer( 'video-embed-thumbnail-generator-nonce', 'security' );
|
2094 |
+
$video_id = $_POST['video_id'];
|
2095 |
+
if ( isset($_POST['blog_id']) ) { $blog_id = $_POST['blog_id']; }
|
2096 |
+
else { $blog_id = false; }
|
2097 |
+
|
2098 |
+
if ( $blog_id ) { switch_to_blog($blog_id); }
|
2099 |
+
|
2100 |
+
delete_post_meta( $video_id, '_kgflashmediaplayer-format' );
|
2101 |
+
$old_parent = get_post_meta( $video_id, '_kgflashmediaplayer-pickedformat', true );
|
2102 |
+
delete_post_meta( $video_id, '_kgflashmediaplayer-pickedformat' );
|
2103 |
+
$post = get_post($video_id);
|
2104 |
+
if ( is_string( get_post_status( $old_parent ) ) ) { $post->post_parent = $old_parent; }
|
2105 |
+
wp_update_post($post);
|
2106 |
+
|
2107 |
+
if ( $blog_id ) { restore_current_blog(); }
|
2108 |
+
|
2109 |
+
die();
|
2110 |
+
|
2111 |
+
}
|
2112 |
+
add_action('wp_ajax_kgvid_clear_child_format', 'kgvid_clear_child_format');
|
2113 |
+
|
2114 |
function kgvid_ajax_generate_encode_checkboxes() {
|
2115 |
|
2116 |
check_ajax_referer( 'video-embed-thumbnail-generator-nonce', 'security' );
|
2151 |
$actualheight = "1081";
|
2152 |
$rotated = false;
|
2153 |
$encodevideo_info = array();
|
2154 |
+
$is_attachment = false;
|
2155 |
|
2156 |
if ( !empty($movieurl) ) {
|
2157 |
|
2161 |
$sanitized_url = kgvid_sanitize_url($movieurl);
|
2162 |
$movieurl = $sanitized_url['movieurl'];
|
2163 |
if ( get_post_type($post_id) == "attachment" ) { //if the video is in the database
|
2164 |
+
$is_attachment = true;
|
2165 |
$post_mime_type = get_post_mime_type($post_id);
|
2166 |
$dimensions = kgvid_set_video_dimensions($post_id);
|
2167 |
$actualwidth = $dimensions['actualwidth'];
|
2168 |
$actualheight = $dimensions['actualheight'];
|
2169 |
$rotated = get_post_meta($post_id, "_kgflashmediaplayer-rotate", true);
|
2170 |
+
|
2171 |
}
|
2172 |
else { //video's not in the database
|
2173 |
+
$is_attachment = false;
|
2174 |
unset($video_formats['fullres']);
|
2175 |
|
2176 |
$post_mime_type = "video/".pathinfo($movieurl, PATHINFO_EXTENSION);
|
2200 |
else {
|
2201 |
$encode_disabled = ' disabled title="'.__('Please enter a valid video URL', 'video-embed-thumbnail-generator').'"';
|
2202 |
unset($video_formats['fullres']);
|
2203 |
+
unset($video_formats['custom_h264']);
|
2204 |
+
unset($video_formats['custom_webm']);
|
2205 |
+
unset($video_formats['custom_ogg']);
|
2206 |
}
|
2207 |
|
2208 |
if ( $options['ffmpeg_exists'] == "notinstalled" ) {
|
2215 |
foreach ($video_encode_queue as $video_key => $video_entry) {
|
2216 |
if ( $video_entry['movieurl'] == $movieurl ) {
|
2217 |
foreach ( $video_entry['encode_formats'] as $format => $value ) {
|
2218 |
+
if ( !array_key_exists($format, $video_formats) && $value['status'] != 'notchecked' ) {
|
2219 |
+
$video_formats[$format]['name'] = $value['name'];
|
2220 |
+
if ( array_key_exists('filepath', $value) && file_exists($value['filepath']) ) {
|
2221 |
+
$encodevideo_info[$format]['exists'] = true;
|
2222 |
+
if ( is_writable($value['filepath']) ) { $encodevideo_info[$format]['writable'] = true; }
|
2223 |
+
else { $encodevideo_info[$format]['writable'] = false; }
|
2224 |
+
}
|
2225 |
+
else {
|
2226 |
+
$encodevideo_info[$format]['exists'] = false;
|
2227 |
+
$encodevideo_info[$format]['writable'] = false;
|
2228 |
+
}
|
2229 |
+
$video_formats[$format]['status'] = $value['status'];
|
2230 |
+
}
|
2231 |
+
elseif ( array_key_exists($format, $video_formats) ) { //don't recreate any formats that were previously unset
|
2232 |
$video_formats[$format]['status'] = $value['status'];
|
2233 |
}
|
2234 |
}
|
2238 |
}
|
2239 |
}
|
2240 |
|
2241 |
+
$checkboxes = '<div id="attachments-'.$post_id.'-kgflashmediaplayer-encodeboxes" class="kgvid_checkboxes_section"><ul>';
|
2242 |
|
2243 |
foreach ( $video_formats as $format => $format_stats ) {
|
2244 |
+
|
2245 |
if ( strpos($post_mime_type, $format) !== false ) { continue; } //skip webm or ogv checkbox if the video is webm or ogv
|
2246 |
+
|
2247 |
$encodeset[$format] = "";
|
2248 |
$checked[$format] = "";
|
2249 |
$meta[$format] = "";
|
2250 |
$disabled[$format] = "";
|
2251 |
$child_id[$format] = "";
|
2252 |
|
2253 |
+
if ( empty($movieurl) ) { $disabled[$format] = ' disabled title="Please enter a valid video URL"'; }
|
2254 |
+
|
2255 |
if ( !array_key_exists('status', $format_stats) ) { $format_stats['status'] = "notchecked"; } //if this video isn't in the queue
|
2256 |
|
2257 |
+
if ( $is_attachment ) { $encodeset[$format] = get_post_meta($post_id, "_kgflashmediaplayer-encode".$format, true); }
|
2258 |
+
if ( $encodeset[$format] == "" && strpos($format, 'custom_') === false ) { $encodeset[$format] = $options['encode_'.$format]; }
|
2259 |
|
2260 |
if ( $format_stats['status'] == "lowres" ||
|
2261 |
(
|
2278 |
}
|
2279 |
|
2280 |
if ( !empty($encodevideo_info) ) {
|
2281 |
+
if ( $encodevideo_info[$format]['exists'] ) { //if the video file exists
|
2282 |
+
|
2283 |
+
if ( array_key_exists('id', $encodevideo_info[$format]) ) {
|
2284 |
+
$child_id[$format] = $encodevideo_info[$format]['id'];
|
2285 |
+
$was_picked = get_post_meta( $child_id[$format], '_kgflashmediaplayer-pickedformat', true );
|
2286 |
+
}
|
2287 |
+
|
2288 |
if ( $format_stats['status'] != "encoding" ) { // not currently encoding
|
2289 |
+
if ( $format_stats['status'] == "notchecked" ) {
|
2290 |
+
if ( $was_picked != false ) { $meta[$format] = ' <strong>Set: '.basename($encodevideo_info[$format]['filepath']).'</strong>'; }
|
2291 |
+
else { $meta[$format] = ' <strong>Encoded</strong>'; }
|
2292 |
+
}
|
2293 |
if ( $format_stats['status'] != "canceling" ) {
|
2294 |
+
|
2295 |
+
if ( $encodevideo_info[$format]['writable']
|
2296 |
&& current_user_can('encode_videos')
|
2297 |
&& $format != "fullres" ) {
|
2298 |
+
if ( $was_picked != false ) {
|
2299 |
+
$meta[$format] .= '<a id="unpick-'.$post_id.'-'.$format.'" class="kgvid_delete-format" onclick="kgvid_clear_video(\''.$movieurl.'\', \''.$post_id.'\', \''.$child_id[$format].'\', \''.$blog_id.'\');" href="javascript:void(0)">'.__('Clear Format', 'video-embed-thumbnail-generator').'</a>';
|
2300 |
+
}
|
2301 |
+
else {
|
2302 |
+
$meta[$format] .= '<a id="delete-'.$post_id.'-'.$format.'" class="kgvid_delete-format" onclick="kgvid_delete_video(\''.$movieurl.'\', \''.$post_id.'\', \''.$format.'\', \''.$child_id[$format].'\', \''.$blog_id.'\');" href="javascript:void(0)">'.__('Delete Permanently', 'video-embed-thumbnail-generator').'</a>';
|
2303 |
+
}
|
2304 |
}
|
2305 |
}
|
2306 |
$disabled[$format] = ' disabled title="Format already exists"';
|
2307 |
$checked[$format] = '';
|
2308 |
}
|
2309 |
}
|
2310 |
+
else {
|
2311 |
+
|
2312 |
+
$something_to_encode = true;
|
2313 |
+
if ( strpos($format, 'custom_') === 0 ) { continue; } //skip custom formats that don't exist
|
2314 |
+
|
2315 |
+
} //if the video file doesn't exist, there's something to encode
|
2316 |
}
|
2317 |
|
2318 |
if ( $format_stats['status'] == "encoding" ) {
|
2335 |
$something_to_encode = false;
|
2336 |
}
|
2337 |
|
2338 |
+
$checkboxes .= "\n\t\t\t".'<li><input class="kgvid_encode_checkbox" type="checkbox" id="attachments-'.$post_id.'-kgflashmediaplayer-encode'.$format.'" name="attachments['.$post_id.'][kgflashmediaplayer-encode'.$format.']" '.$checked[$format].' '.$ffmpeg_disabled_text.$disabled[$format].'> <label for="attachments-'.$post_id.'-kgflashmediaplayer-encode'.$format.'">'.$format_stats['name'].'</label> <span id="attachments-'.$post_id.'-kgflashmediaplayer-meta'.$format.'" class="kgvid_format_meta">'.$meta[$format].'</span>';
|
2339 |
+
|
2340 |
+
if ( $is_attachment && empty($disabled[$format]) && $format != 'fullres' && $blog_id == false ) { $checkboxes .= "<span id='pick-'".$format."' class='button-secondary kgvid_encode_checkbox_button' data-choose='".sprintf( __('Choose %s', 'video-embed-thumbnail-generator'), $format_stats['name'] )."' data-update='".sprintf( __('Set as %s', 'video-embed-thumbnail-generator'), $format_stats['name'] )."' onclick='kgvid_pick_format(this, \"".$post_id."\", \"".esc_attr($format_stats['mime'])."\", \"".$format."\", \"".esc_attr($movieurl)."\");'>".__('Choose from Library', 'video-embed-thumbnail-generator')."</span>";
|
2341 |
+
}
|
2342 |
+
$checkboxes .= '</li>';
|
2343 |
+
|
2344 |
+
}//end format loop
|
2345 |
+
|
2346 |
+
$checkboxes .= '</ul>';
|
2347 |
|
|
|
2348 |
if ( $something_to_encode == false ) {
|
2349 |
$encode_disabled = ' disabled title="'.__('Nothing to encode', 'video-embed-thumbnail-generator').'" style="display:none;"';
|
2350 |
}
|
2353 |
$button_text = _x('Update', 'Button text', 'video-embed-thumbnail-generator');
|
2354 |
$checkboxes .= "\n\t\t\t".'<input type="hidden" name="attachments['.$post_id.'][kgflashmediaplayer-url]" value="'.$movieurl.'">';
|
2355 |
}
|
2356 |
+
else { $button_text = _x('Encode selected', 'Button text', 'video-embed-thumbnail-generator'); }
|
2357 |
|
2358 |
|
2359 |
$checkboxes .= '<input type="button" id="attachments-'.$post_id.'-kgflashmediaplayer-encode" name="attachments['.$post_id.'][kgflashmediaplayer-encode]" class="button-secondary" value="'.$button_text.'" onclick="kgvid_enqueue_video_encode(\''.$post_id.'\');" '.$ffmpeg_disabled_text.$encode_disabled.'/><div style="display:block;" id="attachments-'.$post_id.'-encodeplaceholder"></div>';
|
2362 |
$checkboxes .= '<small><em>'.__('Generates additional video formats compatible with most mobile & HTML5-compatible browsers', 'video-embed-thumbnail-generator').'</em></small>';
|
2363 |
}
|
2364 |
|
|
|
2365 |
if ( $video_queued == true ) {
|
2366 |
while ( count($video_formats) > 0 ) {
|
2367 |
$last_format = array_pop( $video_formats );
|
2368 |
+
if ( array_key_exists('status', $last_format) && $last_format['status'] != "notchecked" ) { break; } //get the final queued format
|
2369 |
}
|
2370 |
|
2371 |
if ( !$encoding_now && ($last_format['status'] == "queued" || $last_format['status'] == "canceling") ) {
|
2425 |
foreach ( $video_encode_queue as $order => $video_entry ) {
|
2426 |
$html .= "\t<tr id='tr_".$video_entry['attachmentID']."'";
|
2427 |
foreach ( $video_formats as $format => $format_stats ) {
|
2428 |
+
|
2429 |
+
if ( array_key_exists($format, $video_entry['encode_formats']) && array_key_exists('status', $video_entry['encode_formats'][$format]) ) {
|
2430 |
+
|
2431 |
+
if ( $video_entry['encode_formats'][$format]['status'] == "encoding" ) {
|
2432 |
+
$currently_encoding[$order] = true;
|
2433 |
+
break;
|
2434 |
+
}
|
2435 |
+
else if ( $video_entry['encode_formats'][$format]['status'] == "queued" ) {
|
2436 |
+
$queued[$order] = true;
|
2437 |
+
}
|
2438 |
+
else {
|
2439 |
+
if ( !array_key_exists($order, $currently_encoding) ) { $currently_encoding[$order] = false; }
|
2440 |
+
if ( !array_key_exists($order, $queued) ) { $queued[$order] = false; }
|
2441 |
+
}
|
2442 |
+
|
2443 |
}
|
2444 |
}
|
2445 |
|
2703 |
|| ( function_exists( 'is_plugin_active_for_network' ) && is_plugin_active_for_network( plugin_basename(__FILE__) ) && $options['ffmpeg_exists'] == "on" && is_array($network_options) && (is_super_admin() || $network_options['superadmin_only_ffmpeg_settings'] == false) )
|
2704 |
) { ?>
|
2705 |
<h2 class="nav-tab-wrapper">
|
2706 |
+
<a href="#general" id="general_tab" class="nav-tab" onclick="kgvid_switch_settings_tab('general');"><?php _ex('General', 'Adjective, tab title', 'video-embed-thumbnail-generator') ?></a>
|
2707 |
+
<a href="#encoding" id="encoding_tab" class="nav-tab" onclick="kgvid_switch_settings_tab('encoding');"><?php printf( _x('%s Settings', 'FFMPEG Settings, tab title', 'video-embed-thumbnail-generator'), "<span class='video_app_name'>".strtoupper($video_app)."</span>" ); ?></a>
|
2708 |
</h2>
|
2709 |
<?php } ?>
|
2710 |
<form method="post" action="options.php">
|
2723 |
</div>
|
2724 |
<script type='text/javascript'>
|
2725 |
jQuery(document).ready(function() {
|
2726 |
+
kgvid_switch_settings_tab(document.URL.substr(document.URL.indexOf('#')+1));
|
2727 |
jQuery('form :input').change(function() {
|
2728 |
kgvid_save_plugin_settings(this);
|
2729 |
});
|
2852 |
add_settings_field('browser_thumbnails', __('Enable in-browser thumbnails:', 'video-embed-thumbnail-generator'), 'kgvid_browser_thumbnails_callback', __FILE__, 'kgvid_video_embed_encode_settings', array( 'label_for' => 'browser_thumbnails' ) );
|
2853 |
add_settings_field('encode_formats', __('Default video encode formats:', 'video-embed-thumbnail-generator'), 'kgvid_encode_formats_callback', __FILE__, 'kgvid_video_embed_encode_settings');
|
2854 |
add_settings_field('automatic', __('Do automatically on upload:', 'video-embed-thumbnail-generator'), 'kgvid_automatic_callback', __FILE__, 'kgvid_video_embed_encode_settings', array( 'label_for' => 'auto_encode' ) );
|
2855 |
+
add_settings_field('old_videos', __('For previously uploaded videos:', 'video-embed-thumbnail-generator'), 'kgvid_old_video_buttons_callback', __FILE__, 'kgvid_video_embed_encode_settings' );
|
2856 |
add_settings_field('htaccess', __('htaccess login:', 'video-embed-thumbnail-generator'), 'kgvid_htaccess_callback', __FILE__, 'kgvid_video_embed_encode_settings', array( 'label_for' => 'htaccess_username' ) );
|
2857 |
add_settings_field('ffmpeg_watermark', __('Add watermark to encoded files:', 'video-embed-thumbnail-generator'), 'kgvid_ffmpeg_watermark_callback', __FILE__, 'kgvid_video_embed_encode_settings', array( 'label_for' => 'ffmpeg_watermark' ) );
|
2858 |
if ( !is_plugin_active_for_network( plugin_basename(__FILE__) ) ) {
|
2965 |
|
2966 |
function kgvid_resize_callback() {
|
2967 |
$options = kgvid_get_options();
|
2968 |
+
echo "<input ".checked( $options['resize'], "on", false )." id='resize' name='kgvid_video_embed_options[resize]' type='checkbox' /> <label for='resize'>".__('Make video player responsive.', 'video-embed-thumbnail-generator')."</label><br />";
|
2969 |
+
echo "<input ".checked( $options['auto_res'], "on", false )." id='auto_res' name='kgvid_video_embed_options[auto_res]' type='checkbox' /> <label for='auto_res'>".__('Choose video resolution automatically based on player size.', 'video-embed-thumbnail-generator')."</label>\n\t";
|
2970 |
}
|
2971 |
|
2972 |
function kgvid_inline_callback() {
|
2976 |
|
2977 |
function kgvid_dimensions_callback() {
|
2978 |
$options = kgvid_get_options();
|
2979 |
+
echo __('Width:', 'video-embed-thumbnail-generator')." <input class='small-text affects_player' id='width' name='kgvid_video_embed_options[width]' type='text' value='".$options['width']."' /> ".__('Height:', 'video-embed-thumbnail-generator')." <input class='small-text affects_player' id='height' name='kgvid_video_embed_options[height]' type='text' value='".$options['height']."' /><br />";
|
2980 |
+
echo "<input ".checked( $options['minimum_width'], "on", false )." id='minimum_width' name='kgvid_video_embed_options[minimum_width]' type='checkbox' /> <label for='minimum_width'>".__('Enlarge lower resolution videos to max width.', 'video-embed-thumbnail-generator')."</label> <a class='kgvid_tooltip wp-ui-text-highlight' href='javascript:void(0);'><span class='kgvid_tooltip_classic'>".__('Usually if a video\'s resolution is less than the max width, the video player is set to the actual width of the video. Enabling this will always set the same width regardless of the quality of the video. When necessary you can override by setting the dimensions manually.', 'video-embed-thumbnail-generator')."</span></a><br />";
|
2981 |
+
echo "<input ".checked( $options['fullwidth'], "on", false )." id='fullwidth' name='kgvid_video_embed_options[fullwidth]' type='checkbox' /> <label for='fullwidth'>".__('Set all videos to expand to fill their containers.', 'video-embed-thumbnail-generator')."</label> <a class='kgvid_tooltip wp-ui-text-highlight' href='javascript:void(0);'><span class='kgvid_tooltip_classic'>".__('Enabling this will ignore any other width settings and set the width of the video to the width of the container it\'s in.', 'video-embed-thumbnail-generator')."</span></a>\n\t";
|
2982 |
}
|
2983 |
|
2984 |
function kgvid_gallery_dimensions_callback() {
|
3032 |
|
3033 |
function kgvid_audio_callback() {
|
3034 |
$options = kgvid_get_options();
|
3035 |
+
$items = array();
|
3036 |
+
$percent = 0;
|
3037 |
+
for ( $percent = 0; $percent <= 1.05; $percent = $percent + 0.05 ) {
|
3038 |
+
$items[sprintf( _x('%d%%', 'a list of percentages. eg: 15%', 'video-embed-thumbnail-generator'), round($percent*100) )] = strval($percent);
|
3039 |
+
}
|
3040 |
+
echo "<select class='affects_player' id='volume' name='kgvid_video_embed_options[volume]'>";
|
3041 |
+
foreach($items as $name=>$value) {
|
3042 |
+
$selected = ($options['volume']==$value) ? 'selected="selected"' : '';
|
3043 |
+
echo "<option value='$value' $selected>$name</option>";
|
3044 |
+
}
|
3045 |
+
echo "</select> <input class='affects_player' ".checked( $options['mute'], "on", false )." id='mute' name='kgvid_video_embed_options[mute]' type='checkbox' /> <label for='mute'>".__('Mute', 'video-embed-thumbnail-generator')."</label>\n\t";
|
3046 |
|
3047 |
}
|
3048 |
|
3255 |
|
3256 |
function kgvid_encode_formats_callback() {
|
3257 |
$options = kgvid_get_options();
|
3258 |
+
$video_formats = kgvid_video_formats(true, false);
|
3259 |
+
foreach ($video_formats as $format => $format_stats) {
|
3260 |
+
$items[$format] = $format_stats['name'];
|
3261 |
+
}
|
3262 |
+
$items['fullres'] = __('same resolution H.264', 'video-embed-thumbnail-generator');
|
3263 |
+
$items['custom'] = __('Custom', 'video-embed-thumbnail-generator');
|
3264 |
+
|
3265 |
echo "<div class='kgvid_video_app_required'>";
|
3266 |
+
echo "<input ".checked( $options['encode_fullres'], "on", false )." id='encode_fullres' name='kgvid_video_embed_options[encode_fullres]' type='checkbox' /> <label for='encode_fullres'>".__('Replace original with', 'video-embed-thumbnail-generator');
|
3267 |
+
|
3268 |
+
echo " <select id='replace_format' name='kgvid_video_embed_options[replace_format]' class='affects_ffmpeg'>";
|
3269 |
+
foreach($items as $value=>$name) {
|
3270 |
+
$selected = ($options['replace_format']==$value) ? 'selected="selected"' : '';
|
3271 |
+
echo "<option value='$value' $selected>$name</option>";
|
3272 |
+
}
|
3273 |
+
echo "</select> ";
|
3274 |
+
|
3275 |
+
|
3276 |
+
echo "</label> <a class='kgvid_tooltip wp-ui-text-highlight' href='javascript:void(0);'><span class='kgvid_tooltip_classic'>".__('If you have FFMPEG/LIBAV and the proper libraries installed, you can choose to replace your uploaded video with your preferred format, and also transcode into as many as six additional formats depending on the resolution of your original source. Different browsers have different playback capabilities. Most desktop browsers can play H.264, and all modern mobile devices can play at least 360p H.264. If you create multiple H.264 resolutions, the highest resolution supported by the device will be served up automatically. The plugin will not upconvert your video, so if you upload a 720p video, it will not waste your time creating a 1080p version. There was a time when it seemed like a good idea to provide OGV or WEBM for some desktop browsers, but even Firefox allows H.264 playback on Windows now. I no longer recommend encoding OGV or WEBM unless you expect a large number of no-Flash sticklers visiting your site.', 'video-embed-thumbnail-generator')."</span></a><br />";
|
3277 |
echo "<input ".checked( $options['encode_1080'], "on", false )." id='encode_1080' name='kgvid_video_embed_options[encode_1080]' type='checkbox' /> <label for='encode_1080'>1080p H.264 <small><em>".__('(iPhone 4s+, iPad 2+, modern Android, Windows Phone 8, Chrome, Safari, IE 9+, Firefox Windows)', 'video-embed-thumbnail-generator')."</em></small></label><br />";
|
3278 |
echo "<input ".checked( $options['encode_720'], "on", false )." id='encode_720' name='kgvid_video_embed_options[encode_720]' type='checkbox' /> <label for='encode_720'>720p H.264 <small><em>".__('(iPhone 4+, iPad, most Android, Chrome, Safari, IE 9+, Firefox Windows)', 'video-embed-thumbnail-generator')."</em></small></label><br />";
|
3279 |
+
echo "<input ".checked( $options['encode_mobile'], "on", false )." id='encode_mobile' name='kgvid_video_embed_options[encode_mobile]' type='checkbox' /> <label for='encode_mobile'>360p H.264 <small><em>(iOS, Android, Windows Phone 7, Chrome, Safari, IE 9+, Firefox Windows)</em></small></label><br />";
|
3280 |
echo "<input ".checked( $options['encode_webm'], "on", false )." id='encode_webm' name='kgvid_video_embed_options[encode_webm]' type='checkbox' /> <label for='encode_webm'>WEBM <small><em>(Firefox, Chrome, Android 2.3+, Opera)</em></small></label><br />";
|
3281 |
+
echo "<input ".checked( $options['encode_ogg'], "on", false )." id='encode_ogg' name='kgvid_video_embed_options[encode_ogg]' type='checkbox' /> <label for='encode_ogg'>OGV <small><em>(Firefox, Chrome, Android 2.3+, Opera)</em></small></label><br />";
|
3282 |
+
echo "<input ".checked( $options['encode_custom'], "on", false )." id='encode_custom' name='kgvid_video_embed_options[encode_custom]' type='checkbox' /> <label for='encode_custom'>Custom";
|
3283 |
+
$items = array( "H.264" => "h264" , "WEBM" => "webm", "OGV" => "ogg" );
|
3284 |
+
echo " <select id='custom_format_type' name='kgvid_video_embed_options[custom_format][format]' class='affects_ffmpeg'>";
|
3285 |
+
foreach($items as $name=>$value) {
|
3286 |
+
$selected = ($options['custom_format']['format']==$value) ? 'selected="selected"' : '';
|
3287 |
+
echo "<option value='$value' $selected>$name</option>";
|
3288 |
+
}
|
3289 |
+
echo "</select> ";
|
3290 |
+
echo "<small>Width: <input id='custom_format_width' name='kgvid_video_embed_options[custom_format][width]' class='small-text affects_ffmpeg kgvid_custom_format' value='".$options['custom_format']['width']."' /> Height: <input id='custom_format_height' name='kgvid_video_embed_options[custom_format][height]' class='small-text affects_ffmpeg kgvid_custom_format' value='".$options['custom_format']['height']."' /></small></label>";
|
3291 |
echo "</div>\n\t";
|
3292 |
}
|
3293 |
|
3326 |
else { $percentage_select = "<input id='auto_thumb_position' name='kgvid_video_embed_options[auto_thumb_position]' class='small-text' type='text' value='".$options['auto_thumb_position']."' maxlength='3'>"; }
|
3327 |
$auto_thumb_number_input = "<input id='auto_thumb_number' name='kgvid_video_embed_options[auto_thumb_number]' class='small-text' type='text' value='".$options['auto_thumb_number']."' maxlength='3'>";
|
3328 |
$auto_thumb_label = kgvid_generate_auto_thumb_label();
|
3329 |
+
echo "<input ".checked( $options['auto_thumb'], "on", false )." id='auto_thumb' name='kgvid_video_embed_options[auto_thumb]' type='checkbox' /> <label id='auto_thumb_label' for='auto_thumb'>".$auto_thumb_label." </label><br>";
|
3330 |
+
echo "</div>\n\t";
|
3331 |
+
}
|
3332 |
+
|
3333 |
+
function kgvid_old_video_buttons_callback() {
|
3334 |
+
$options = kgvid_get_options();
|
3335 |
+
echo "<div class='kgvid_video_app_required'>";
|
3336 |
+
echo "<p><a id='generate_old_thumbs_button' class='button-secondary' href='javascript:void(0);' onclick='kgvid_auto_generate_old(\"thumbs\");'>".__('Generate thumbnails', 'video-embed-thumbnail-generator')."</a> <a class='kgvid_tooltip wp-ui-text-highlight' href='javascript:void(0);'><span class='kgvid_tooltip_classic'>".sprintf( __('Use %s to automatically generate thumbnails for every video in the Media Library that doesn\'t already have them. Uses the automatic thumbnail settings above. This could take a very long time if you have a lot of videos. Proceed with caution!', 'video-embed-thumbnail-generator'), "<strong class='video_app_name'>".strtoupper($options['video_app'])."</strong>" )."</span></a></p>";
|
3337 |
+
echo "<p><a id='generate_old_encode_button' class='button-secondary' href='javascript:void(0);' onclick='kgvid_auto_generate_old(\"encode\");'>".__('Encode videos', 'video-embed-thumbnail-generator')."</a> <a class='kgvid_tooltip wp-ui-text-highlight' href='javascript:void(0);'><span class='kgvid_tooltip_classic'>".sprintf( __('Add every video in the Media Library to the encode queue if it hasn\'t already been encoded. Uses the default encode formats chosen above.', 'video-embed-thumbnail-generator'), "<strong class='video_app_name'>".strtoupper($options['video_app'])."</strong>" )."</span></a></p>";
|
3338 |
echo "</div>\n\t";
|
3339 |
}
|
3340 |
|
3380 |
$options = kgvid_get_options();
|
3381 |
echo "<div class='kgvid_video_app_required'>";
|
3382 |
$items = array(__("none", 'video-embed-thumbnail-generator')=>"none", "movflags faststart"=>"movflag", "qt-faststart"=>"qt-faststart", "MP4Box"=>"MP4Box");
|
3383 |
+
echo "<select onchange='kgvid_hide_plugin_settings()' id='moov' name='kgvid_video_embed_options[moov]' class='affects_ffmpeg'>";
|
3384 |
foreach($items as $name => $value) {
|
3385 |
$selected = ($options['moov']==$value) ? 'selected="selected"' : '';
|
3386 |
echo "<option value='$value' $selected>$name</option>";
|
3387 |
}
|
3388 |
echo "</select> <a class='kgvid_tooltip wp-ui-text-highlight' href='javascript:void(0);'><span class='kgvid_tooltip_classic'>".sprintf( __('By default %1$s places moov atoms at the end of H.264 encoded files, which forces the entire file to download before playback can start and can prevent Flash players from playing them at all. Since approximately October 2012 %1$s can fix the problem at the end of the encoding process by using the option `movflags faststart`. This is the easiest and fastest way to correct the problem, but older versions of %1$s will not work if you select the movflags option. If you can\'t update to a new version of %1$s, select qt-faststart or MP4Box which will run after encoding is finished if they are installed on your server.', 'video-embed-thumbnail-generator'), "<strong class='video_app_name'>".strtoupper($options['video_app'])."</strong>")."</span></a>";
|
3389 |
+
echo "<p id='moov_path_p'>Path to <span class='kgvid_moov_option'>".$options['moov']."</span>: <input class='regular-text code affects_ffmpeg' id='moov_path' name='kgvid_video_embed_options[moov_path]' type='text' value='".$options['moov_path']."' /></p>";
|
3390 |
echo "</div>\n\t";
|
3391 |
}
|
3392 |
|
3440 |
echo "</select> ".__('bits per pixel.', 'video-embed-thumbnail-generator')." <a class='kgvid_tooltip wp-ui-text-highlight' href='javascript:void(0);'><span class='kgvid_tooltip_classic'>".__('Default is 0.1', 'video-embed-thumbnail-generator')."</span></a><br />";
|
3441 |
echo "<span class='kgvid_gray_text'>1080p = <span id='1080_bitrate'>".round(floatval($options['bitrate_multiplier'])*1920*1080*30/1024)."</span> kbps<br />";
|
3442 |
echo "720p = <span id='720_bitrate'>".round(floatval($options['bitrate_multiplier'])*1280*720*30/1024)."</span> kbps<br />";
|
3443 |
+
echo "360p = <span id='360_bitrate'>".round(floatval($options['bitrate_multiplier'])*640*360*30/1024)."</span> kbps</span>";
|
3444 |
echo "</div>\n\t";
|
3445 |
}
|
3446 |
|
3467 |
function kgvid_audio_bitrate_options_callback() {
|
3468 |
$options = kgvid_get_options();
|
3469 |
echo "<div class='kgvid_video_app_required'>";
|
3470 |
+
$items = array(32, 64, 96, 112, 128, 160, 192, 224, 256, 320);
|
3471 |
echo "<select id='audio_bitrate' name='kgvid_video_embed_options[audio_bitrate]' class='affects_ffmpeg'>";
|
3472 |
foreach($items as $item) {
|
3473 |
$selected = ($options['audio_bitrate']==$item) ? 'selected="selected"' : '';
|
3480 |
function kgvid_ffmpeg_options_callback() {
|
3481 |
$options = kgvid_get_options();
|
3482 |
echo "<div class='kgvid_video_app_required'>";
|
3483 |
+
echo "<input class='affects_ffmpeg' onchange='if(jQuery(\"#ffmpeg_vpre\").attr(\"checked\")==\"checked\"){jQuery(\"#video_bitrate_flag\").attr(\"checked\", \"checked\"); jQuery(\"#nostdin\").removeAttr(\"checked\");}' ".checked( $options['video_bitrate_flag'], "on", false )." id='video_bitrate_flag' name='kgvid_video_embed_options[video_bitrate_flag]' type='checkbox' /> <label for='video_bitrate_flag'>".__('Enable legacy FFMPEG "-b" and "-ba" bitrate flags.', 'video-embed-thumbnail-generator')."</label> <a class='kgvid_tooltip wp-ui-text-highlight' href='javascript:void(0);'><span class='kgvid_tooltip_classic'>".__('Enable if your installed version of FFMPEG is old enough that you can\'t use the newer -b:v flags (Dreamhost users must turn this on). It may cause newer versions of FFMPEG to fail.', 'video-embed-thumbnail-generator')."</span></a><br />";
|
3484 |
+
echo "<input class='affects_ffmpeg' onchange='if(jQuery(\"#ffmpeg_vpre\").attr(\"checked\")==\"checked\"){jQuery(\"#video_bitrate_flag\").attr(\"checked\", \"checked\"); jQuery(\"#nostdin\").removeAttr(\"checked\");}' ".checked( $options['ffmpeg_vpre'], "on", false )." id='ffmpeg_vpre' name='kgvid_video_embed_options[ffmpeg_vpre]' type='checkbox' /> <label for='ffmpeg_vpre'>".__('Enable legacy FFMPEG parameters.', 'video-embed-thumbnail-generator')."</label> <a class='kgvid_tooltip wp-ui-text-highlight' href='javascript:void(0);'><span class='kgvid_tooltip_classic'>".__('Enable if your installed version of FFMPEG is old enough that libx264 requires additional configuration to operate (Dreamhost users must turn this on). This should help if you can encode WEBM or OGV files but H264/Mobile files fail. It could cause newer versions of FFMPEG to fail.', 'video-embed-thumbnail-generator')."</span></a><br />";
|
3485 |
+
echo "<input class='affects_ffmpeg' ".checked( $options['nostdin'], "on", false )." id='nostdin' name='kgvid_video_embed_options[nostdin]' type='checkbox' /> <label for='nostdin'>".__('Disable stdin.', 'video-embed-thumbnail-generator')."</label> <a class='kgvid_tooltip wp-ui-text-highlight' href='javascript:void(0);'><span class='kgvid_tooltip_classic'>".__('Turn off this checkbox if your installed version of FFMPEG is old enough that it does not recognize the nostdin flag (Dreamhost users must turn this off).', 'video-embed-thumbnail-generator')."</span></a>";
|
3486 |
echo "</div>\n\t";
|
3487 |
}
|
3488 |
|
3512 |
function kgvid_test_ffmpeg_options_callback( $scope = 'site' ) {
|
3513 |
|
3514 |
$options = kgvid_get_options();
|
3515 |
+
$video_formats = kgvid_video_formats(true, false);
|
3516 |
$encode_string = "";
|
3517 |
if ( $options['ffmpeg_exists'] == "on" ) {
|
3518 |
|
3519 |
$movie_info = kgvid_get_video_dimensions(plugin_dir_path(__FILE__)."images/sample-video-h264.mp4");
|
3520 |
$uploads = wp_upload_dir();
|
3521 |
+
$encode_dimensions = kgvid_set_encode_dimensions($movie_info, $video_formats[$options['sample_format']]);
|
|
|
|
|
|
|
3522 |
$encode_string = kgvid_generate_encode_string(plugin_dir_path(__FILE__)."images/sample-video-h264.mp4", $uploads['path']."/sample-video-h264".$video_formats[$options['sample_format']]['suffix'], $movie_info, $options['sample_format'], $encode_dimensions['width'], $encode_dimensions['height'], '');
|
3523 |
}
|
3524 |
|
3528 |
$display_div = "";
|
3529 |
if ( $options['ffmpeg_exists'] != "on" ) { $display_div = " style='display:none;'"; }
|
3530 |
|
3531 |
+
$video_formats['fullres']['name'] = __('Replace', 'video-embed-thumbnail-generator');
|
3532 |
+
if ( array_key_exists('custom', $video_formats) && array_key_exists('name', $video_formats['custom']) ) { $video_formats['custom']['name'] = __('Custom', 'video-embed-thumbnail-generator'); }
|
3533 |
+
|
3534 |
$sample_format_select = "<select id='sample_format' name='kgvid_video_embed_options[sample_format]' class='affects_ffmpeg'>";
|
3535 |
foreach ( $video_formats as $format => $format_stats ) {
|
3536 |
$selected = ($options['sample_format']==$format) ? 'selected="selected"' : '';
|
3717 |
$options['version'] = 4.304;
|
3718 |
$options['gallery_end'] = "";
|
3719 |
}
|
3720 |
+
if ( $options['version'] < 4.4 ) {
|
3721 |
+
$options['version'] = 4.4;
|
3722 |
+
$options['moov_path'] = $options['app_path'];
|
3723 |
+
$options['replace_format'] = 'fullres';
|
3724 |
+
$options['custom_format'] = array(
|
3725 |
+
'format' => 'h264',
|
3726 |
+
'width' => '',
|
3727 |
+
'height' => ''
|
3728 |
+
);
|
3729 |
+
$options['nostdin'] = false;
|
3730 |
+
$options['fullwidth'] = false;
|
3731 |
+
$options['auto_res'] = 'on';
|
3732 |
+
}
|
3733 |
|
3734 |
if ( $options['version'] != $default_options['version'] ) { $options['version'] = $default_options['version']; }
|
3735 |
if ( $options !== $options_old ) { update_option('kgvid_video_embed_options', $options); }
|
3799 |
|
3800 |
$input['titlecode'] = wp_kses_post( $input['titlecode'] );
|
3801 |
|
3802 |
+
if ( is_array($input['custom_format']) && ( !empty($input['custom_format']['width']) || !empty($input['custom_format']['height']) ) ) {
|
3803 |
+
|
3804 |
+
$video_formats = kgvid_video_formats();
|
3805 |
+
|
3806 |
+
$input['custom_format']['name'] = 'Custom';
|
3807 |
+
if ( !empty($input['custom_format']['height']) ) {
|
3808 |
+
$input['custom_format']['name'] .= ' '.$input['custom_format']['height'].'p';
|
3809 |
+
$input['custom_format']['label'] = $input['custom_format']['height'].'p';
|
3810 |
+
}
|
3811 |
+
else {
|
3812 |
+
$input['custom_format']['name'] .= ' '.$input['custom_format']['width'].' width';
|
3813 |
+
$approx_height = round(intval($input['custom_format']['width'])*0.5625);
|
3814 |
+
if ($approx_height % 2 != 0) { $approx_height--; } //make sure it's an even number
|
3815 |
+
$input['custom_format']['label'] = $approx_height.'p';
|
3816 |
+
}
|
3817 |
+
if ( $input['custom_format']['format'] == 'h264' ) {
|
3818 |
+
$input['custom_format']['name'] .= ' H.264';
|
3819 |
+
$input['custom_format']['extension'] = 'mp4';
|
3820 |
+
$input['custom_format']['mime'] = 'video/mp4';
|
3821 |
+
$input['custom_format']['vcodec'] = 'libx264';
|
3822 |
+
}
|
3823 |
+
else {
|
3824 |
+
$input['custom_format']['name'] .= ' '.strtoupper($input['custom_format']['format']);
|
3825 |
+
$input['custom_format']['extension'] = $video_formats[$input['custom_format']['format']]['extension'];
|
3826 |
+
$input['custom_format']['mime'] = $video_formats[$input['custom_format']['format']]['mime'];
|
3827 |
+
$input['custom_format']['vcodec'] = $video_formats[$input['custom_format']['format']]['vcodec'];
|
3828 |
+
if ( $input['custom_format']['format'] == 'ogg' ) { $input['custom_format']['type'] = 'ogv'; }
|
3829 |
+
}
|
3830 |
+
if ( $input['custom_format']['format'] == 'ogg' ) { $input['custom_format']['type'] = 'ogv'; }
|
3831 |
+
else { $input['custom_format']['type'] = $input['custom_format']['format']; }
|
3832 |
+
$input['custom_format']['suffix'] = '-custom.'.$input['custom_format']['extension'];
|
3833 |
+
|
3834 |
+
} // if the custom format has been set
|
3835 |
+
else {
|
3836 |
+
|
3837 |
+
/* $video_encode_queue = kgvid_get_encode_queue();
|
3838 |
+
|
3839 |
+
if ( !empty($video_encode_queue) && is_array($video_encode_queue) ) {
|
3840 |
+
foreach ( $video_encode_queue as $video_key => $video_entry ) {
|
3841 |
+
if ( is_array($video_entry)
|
3842 |
+
&& array_key_exists('encode_formats', $video_entry)
|
3843 |
+
&& is_array($video_entry['encode_formats'])
|
3844 |
+
&& array_key_exists('custom', $video_entry['encode_formats'])
|
3845 |
+
&& is_array($video_entry['encode_formats']['custom'])
|
3846 |
+
&& array_key_exists('status', $video_entry['encode_formats']['custom'])
|
3847 |
+
&& $video_entry['encode_formats']['custom']['status'] != 'encoding'
|
3848 |
+
) {
|
3849 |
+
unset($video_encode_queue[$video_key]['encode_formats']['custom']);
|
3850 |
+
}
|
3851 |
+
}
|
3852 |
+
kgvid_save_encode_queue($video_encode_queue);
|
3853 |
+
} */
|
3854 |
+
|
3855 |
+
if ( $input['sample_format'] == 'custom' ) { $input['sample_format'] = 'mobile'; }
|
3856 |
+
|
3857 |
+
}
|
3858 |
+
|
3859 |
if ( intval($options['auto_thumb_number']) == 1 && intval($input['auto_thumb_number']) > 1 ) {
|
3860 |
$input['auto_thumb_position'] = strval ( round( intval($input['auto_thumb_number']) * (intval($options['auto_thumb_position'])/100) ) );
|
3861 |
if ( $input['auto_thumb_position'] == "0" ) {
|
3862 |
$input['auto_thumb_position'] = "1";
|
3863 |
}
|
|
|
3864 |
}
|
3865 |
if ( intval($options['auto_thumb_number']) > 1 && intval($input['auto_thumb_number']) == 1 ) {
|
3866 |
//round to the nearest 25 but not 100
|
3916 |
$movie_info = kgvid_get_video_dimensions(plugin_dir_path(__FILE__)."images/sample-video-h264.mp4");
|
3917 |
$uploads = wp_upload_dir();
|
3918 |
$video_formats = kgvid_video_formats();
|
3919 |
+
$encode_dimensions = kgvid_set_encode_dimensions($movie_info, $video_formats[$validated_options['sample_format']]);
|
|
|
|
|
|
|
3920 |
$encode_string = kgvid_generate_encode_string(plugin_dir_path(__FILE__)."images/sample-video-h264.mp4", $uploads['path']."/sample-video-h264".$video_formats[$validated_options['sample_format']]['suffix'], $movie_info, $validated_options['sample_format'], $encode_dimensions['width'], $encode_dimensions['height'], '');
|
3921 |
$auto_thumb_label = kgvid_generate_auto_thumb_label();
|
3922 |
}
|
3924 |
|
3925 |
if ( !empty($wp_settings_errors) ) { $error_message = $wp_settings_errors[0]['message']; }
|
3926 |
|
3927 |
+
if ( strpos($setting, 'capability') !== false || strpos($setting, 'default_capabilities') !== false || strpos($setting, 'ffmpeg_watermark') !== false || strpos($setting, 'custom_format') !== false ) { $validated_options[$setting] = $value; }
|
3928 |
|
3929 |
$arr = array ( "error_message" => $error_message, "validated_value" => $validated_options[$setting], "ffmpeg_exists" => $validated_options['ffmpeg_exists'], "encode_string" => implode('', $encode_string), "app_path" => $validated_options['app_path'], "auto_thumb_label" => $auto_thumb_label );
|
3930 |
echo json_encode($arr);
|
3950 |
}
|
3951 |
add_action('add_attachment', 'kgvid_add_attachment_handler');
|
3952 |
|
3953 |
+
function kgvid_cron_new_attachment_handler($post_id, $force = false) {
|
3954 |
|
3955 |
$options = kgvid_get_options();
|
3956 |
|
3957 |
$post = get_post($post_id);
|
3958 |
$movieurl = wp_get_attachment_url($post_id);
|
3959 |
|
3960 |
+
if ( $force == 'thumbs' || $options['auto_thumb'] == "on" ) {
|
3961 |
|
3962 |
$thumb_output = array();
|
3963 |
$thumb_id = array();
|
4043 |
|
4044 |
}//end if auto_thumb is on
|
4045 |
|
4046 |
+
if ( $force == 'encode' || $options['auto_encode'] == "on" ) {
|
4047 |
$video_formats = kgvid_video_formats();
|
4048 |
$something_to_encode = false;
|
4049 |
$encode_checked = array();
|
4078 |
) { //if the attachment is a video with no parent or if it has a parent the parent is not a video and the video doesn't have the externalurl post meta
|
4079 |
|
4080 |
wp_enqueue_media(); //allows using the media modal in the Media Library
|
4081 |
+
wp_enqueue_script( 'kgvid_video_plugin_admin' );
|
4082 |
+
wp_enqueue_style( 'video_embed_thumbnail_generator_style' );
|
4083 |
|
4084 |
$field_id = kgvid_backwards_compatible($post->ID);
|
4085 |
$movieurl = wp_get_attachment_url($post->ID);
|
4088 |
$heightsaved = get_post_meta($post->ID, "_kgflashmediaplayer-height", true);
|
4089 |
$video_meta = array();
|
4090 |
$video_aspect = NULL;
|
4091 |
+
$video_meta = wp_get_attachment_metadata( $post->ID );
|
4092 |
if ( is_array($video_meta) && array_key_exists('width', $video_meta) && array_key_exists('height', $video_meta) ) { $video_aspect = $video_meta['height']/$video_meta['width']; }
|
4093 |
elseif ( $widthsaved && $heightsaved ) { $video_aspect = intval($heightsaved)/intval($widthsaved); }
|
4094 |
|
4201 |
$h264compatible = array("mp4", "mov", "m4v");
|
4202 |
if ( $moviefiletype == "mov" || $moviefiletype == "m4v" ) { $moviefiletype = "mp4"; }
|
4203 |
|
4204 |
+
$video_formats = kgvid_video_formats();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4205 |
$encodevideo_info = kgvid_encodevideo_info($movieurl, $post->ID);
|
4206 |
if ( in_array($moviefiletype, $h264compatible) ) {
|
4207 |
+
$encodevideo_info["original"]["exists"] = true;
|
4208 |
+
$encodevideo_info["original"]["url"] = $movieurl;
|
4209 |
+
$video_formats = array( "original" => array("mime" => "video/".$moviefiletype) ) + $video_formats;
|
4210 |
}
|
4211 |
+
else { $encodevideo_info["original"]["exists"] = false; }
|
4212 |
|
4213 |
$sources = array();
|
4214 |
+
|
4215 |
+
foreach ($video_formats as $format => $format_stats) {
|
4216 |
+
if ( $format != "original" && $encodevideo_info[$format]["url"] == $movieurl ) { unset($sources['original']); }
|
4217 |
+
if ( $encodevideo_info[$format]["exists"] ) { $sources[$format] = '<source src="'.$encodevideo_info[$format]["url"].'" type="'.$format_stats["mime"].'">'; }
|
4218 |
}
|
4219 |
|
4220 |
if ( $img_editor_works ) {
|
4278 |
$form_fields["kgflashmediaplayer-encode"]["html"] = $checkboxes['checkboxes'];
|
4279 |
|
4280 |
$track_option = get_post_meta($post->ID, "_kgflashmediaplayer-track", true);
|
|
|
|
|
|
|
|
|
4281 |
|
4282 |
$tracks_html = '';
|
4283 |
if ( is_array($track_option) ) {
|
4667 |
if( isset($attachment['kgflashmediaplayer-poster']) ) {
|
4668 |
|
4669 |
$thumb_url = $attachment['kgflashmediaplayer-poster'];
|
4670 |
+
|
4671 |
if ( !empty($thumb_url) ) {
|
4672 |
$thumb_id = kgvid_save_thumb($post['ID'], $post['post_title'], $thumb_url);
|
4673 |
if ( $thumb_id ) { update_post_meta($post['ID'], '_kgflashmediaplayer-poster-id', $thumb_id); }
|
4704 |
if ( !empty($thumb_id) ) { //always set the video's featured image regardless of the plugin setting
|
4705 |
set_post_thumbnail($post['ID'], $thumb_id);
|
4706 |
}
|
4707 |
+
else { delete_post_thumbnail($post['ID']); }
|
4708 |
|
4709 |
if( isset($attachment['thumbtime']) ) {update_post_meta($post['ID'], '_kgflashmediaplayer-thumbtime', $attachment['thumbtime']); }
|
4710 |
if( isset($attachment['kgflashmediaplayer-width']) ) { update_post_meta($post['ID'], '_kgflashmediaplayer-width', $attachment['kgflashmediaplayer-width']); }
|
5014 |
$content_width = $content_width_save; //reset $content_width
|
5015 |
exit;
|
5016 |
}
|
5017 |
+
|
5018 |
+
if ( array_key_exists('download', $kgvid_video_embed) && $kgvid_video_embed['download'] == 'true' && strpos($post->post_mime_type,"video") !== false ) {
|
5019 |
+
|
5020 |
+
$filepath = get_attached_file($post->ID);
|
5021 |
+
$filetype = wp_check_filetype( $filepath );
|
5022 |
+
if ( ! isset($filetype['type'])) { $filetype['type'] = 'application/octet-stream'; }
|
5023 |
+
|
5024 |
+
// Generate the server headers
|
5025 |
+
if (strpos($_SERVER['HTTP_USER_AGENT'], "MSIE") !== FALSE) {
|
5026 |
+
header('Content-Type: "'.$filetype['type'].'"');
|
5027 |
+
header('Content-Disposition: attachment; filename="'.basename($filepath).'"');
|
5028 |
+
header('Expires: 0');
|
5029 |
+
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
|
5030 |
+
header("Content-Transfer-Encoding: binary");
|
5031 |
+
header('Pragma: public');
|
5032 |
+
header("Content-Length: ".filesize($filepath));
|
5033 |
+
}
|
5034 |
+
else {
|
5035 |
+
header('Content-Type: "'.$filetype['type'].'"');
|
5036 |
+
header('Content-Disposition: attachment; filename="'.basename($filepath).'"');
|
5037 |
+
header("Content-Transfer-Encoding: binary");
|
5038 |
+
header('Expires: 0');
|
5039 |
+
header('Pragma: no-cache');
|
5040 |
+
header("Content-Length: ".filesize($filepath));
|
5041 |
+
}
|
5042 |
+
|
5043 |
+
kvid_readfile_chunked($filepath);
|
5044 |
+
exit;
|
5045 |
+
}
|
5046 |
+
|
5047 |
}
|
5048 |
add_action('template_redirect', 'kgvid_video_attachment_template');
|
5049 |
|
5108 |
|
5109 |
if ( get_post_type($postID) == "attachment" ) {
|
5110 |
$moviefilepath = get_attached_file($postID);
|
5111 |
+
if ( !file_exists($moviefilepath) ) {
|
5112 |
+
$moviefilepath = esc_url_raw(str_replace(" ", "%20", $movieurl));
|
5113 |
+
$moviefilepath = str_replace("https://", "http://", $moviefilepath);
|
5114 |
+
}
|
5115 |
$duration = get_post_meta($postID, '_kgflashmediaplayer-duration', true);
|
5116 |
if ( !$duration ) {
|
5117 |
$movie_info = kgvid_get_video_dimensions($moviefilepath);
|
5229 |
$encode_list = array();
|
5230 |
$embeddable = array("flv", "f4v", "mp4", "mov", "m4v", "ogv", "ogg", "webm");
|
5231 |
$h264extensions = array("mp4", "m4v", "mov");
|
5232 |
+
$video_formats = kgvid_video_formats(false, false);
|
5233 |
$sanitized_url = kgvid_sanitize_url($movieurl);
|
5234 |
$movieurl = $sanitized_url['movieurl'];
|
5235 |
|
5253 |
|
5254 |
foreach ( $video_formats as $format => $format_stats ) {
|
5255 |
if ( $encode_checked[$format] == "true" ) {
|
5256 |
+
if ( !$encodevideo_info[$format]['exists'] ) {
|
5257 |
if ( ($format == "1080" && $movie_height <= 1080) || ($format == "720" && $movie_height <= 720) ) {
|
5258 |
$movie_extension = pathinfo($movieurl, PATHINFO_EXTENSION);
|
5259 |
if ( $encode_checked['fullres'] == "true" || in_array($movie_extension, $h264extensions) || $movie_height < intval($format) ) {
|
5463 |
$video = $video_encode_queue[$video_key];
|
5464 |
|
5465 |
$ffmpegPath = $options['app_path']."/".$options['video_app'];
|
5466 |
+
$moviefilepath = '';
|
5467 |
if ( get_post_type($video['attachmentID']) == "attachment" ) { $moviefilepath = get_attached_file($video['attachmentID']); }
|
5468 |
+
elseif ( empty($moviefilepath) || !file_exists($moviefilepath) ) {
|
5469 |
$moviefilepath = str_replace(" ", "%20", esc_url_raw($video['movieurl']));
|
5470 |
$moviefilepath = str_replace("https://", "http://", $moviefilepath);
|
5471 |
}
|
5478 |
$serverOS = "";
|
5479 |
$ffmpeg_options = "";
|
5480 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5481 |
$aac_array = kgvid_aac_encoders();
|
5482 |
$aac_available = false;
|
5483 |
foreach ( $aac_array as $aaclib ) { //cycle through available AAC encoders in order of quality
|
5485 |
}
|
5486 |
|
5487 |
foreach( $video_formats as $format => $format_stats ) {
|
|
|
|
|
5488 |
|
5489 |
+
if ( $queued_format == $format ) {
|
5490 |
|
5491 |
+
$encode_dimensions = kgvid_set_encode_dimensions($movie_info, $format_stats);
|
5492 |
|
5493 |
+
if ( $format_stats['type'] == "h264" ) {
|
5494 |
+
if ( $movie_info['configuration']['libx264'] == "true" && $aac_available ) {
|
5495 |
|
5496 |
+
if ( ! $encodevideo_info[$format]['exists'] || ($encodevideo_info['sameserver'] && filesize($encodevideo_info[$format]['filepath']) < 24576) ) {
|
5497 |
+
|
5498 |
+
$encode_string = kgvid_generate_encode_string($moviefilepath, $encodevideo_info[$format]['filepath'], $movie_info, $queued_format, $encode_dimensions['width'], $encode_dimensions['height'], $movie_info['rotate']);
|
5499 |
+
|
5500 |
+
}//if file doesn't already exist
|
5501 |
+
else { $embed_display = sprintf( __('%s already encoded', 'video-embed-thumbnail-generator'), $format_stats['name'] ); }
|
5502 |
+
break; //don't bother looping through the rest if we already found the format
|
5503 |
+
}//if the x264 library and an aac library is enabled
|
5504 |
+
else {
|
5505 |
+
$lastline = sprintf( __('%s missing library libx264 required for H.264 encoding', 'video-embed-thumbnail-generator'), strtoupper($options['video_app']) );
|
5506 |
+
if ( !$aac_available ) {
|
5507 |
+
array_pop($aac_array); //get rid of the built-in "aac" encoder since it can't really be "installed"
|
5508 |
+
$lastaac = array_pop($aac_array);
|
5509 |
+
$aac_list = implode(", ", $aac_array);
|
5510 |
+
$aac_list .= ", ".__('or', 'video-embed-thumbnail-generator')." ".$lastaac;
|
5511 |
+
$lastline .= " ".sprintf( __('and missing an AAC encoding library. Please install and enable libx264 and %s', 'video-embed-thumbnail-generator'), $aac_list );
|
5512 |
+
}
|
5513 |
+
$video_encode_queue[$video_key]['encode_formats'][$format]['status'] = "error";
|
5514 |
+
$video_encode_queue[$video_key]['encode_formats'][$format]['lastline'] = $lastline;
|
5515 |
+
$embed_display = __("Missing libraries", 'video-embed-thumbnail-generator');
|
5516 |
}
|
|
|
|
|
|
|
5517 |
}
|
5518 |
+
|
5519 |
+
|
5520 |
+
if ( $format_stats['type'] == "webm" || $format_stats['type'] == "ogv" ) { //if it's not H.264 they both work essentially the same
|
5521 |
+
if ( ! $encodevideo_info[$queued_format]['exists'] || ($encodevideo_info['sameserver'] && filesize($encodevideo_info[$queued_format]['filepath']) < 24576) ) {
|
5522 |
+
if ( $movie_info['configuration']['libvorbis'] == "true" && $movie_info['configuration'][$video_formats[$queued_format]['vcodec']] == "true" ) {
|
5523 |
+
|
5524 |
+
$encode_string = kgvid_generate_encode_string($moviefilepath, $encodevideo_info[$queued_format]['filepath'], $movie_info, $queued_format, $encode_dimensions['width'], $encode_dimensions['height'], $movie_info['rotate']);
|
5525 |
+
$embed_display = sprintf( __('Encoding %s', 'video-embed-thumbnail-generator'), $video_formats[$queued_format]['name'] );
|
5526 |
+
}//if the necessary libraries are enabled
|
5527 |
+
else {
|
5528 |
+
$missing_libraries = array();
|
5529 |
+
if($movie_info['configuration']['libvorbis'] == 'false') { $missing_libraries[] = 'libvorbis'; }
|
5530 |
+
if($movie_info['configuration'][$video_formats[$queued_format]['vcodec']] == 'false') { $missing_libraries[] = $video_formats[$queued_format]['vcodec']; }
|
5531 |
+
$lastline = sprintf( __('%1$s missing library %2$s required for %3$s encoding.', 'video-embed-thumbnail-generator'), strtoupper($options['video_app']), implode(', ', $missing_libraries), $video_formats[$queued_format]['name']);
|
5532 |
+
$video_encode_queue[$video_key]['encode_formats'][$queued_format]['status'] = "error";
|
5533 |
+
$video_encode_queue[$video_key]['encode_formats'][$queued_format]['lastline'] = $lastline;
|
5534 |
+
$embed_display = __("Missing libraries", 'video-embed-thumbnail-generator');
|
5535 |
+
}
|
5536 |
+
}//if file doesn't already exist
|
5537 |
+
else { $embed_display = sprintf( __('%s already encoded.', 'video-embed-thumbnail-generator'), $video_formats[$queued_format]['vcodec'] ); }
|
5538 |
+
|
5539 |
+
}//if webm or ogg format is queued
|
5540 |
+
|
5541 |
}//if format is chosen for encoding
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5542 |
|
5543 |
+
}//format loop
|
5544 |
|
5545 |
if ( !empty($encode_string) ) {
|
5546 |
|
5570 |
$video_encode_queue[$video_key]['encode_formats'][$queued_format] = array (
|
5571 |
'name' => $video_formats[$queued_format]['name'],
|
5572 |
'status' => 'encoding',
|
5573 |
+
'filepath' => $encodevideo_info[$queued_format]['filepath'],
|
5574 |
+
'url' => $encodevideo_info[$queued_format]['url'],
|
5575 |
'logfile' => $logfile,
|
5576 |
'PID' => $processPID,
|
5577 |
'OS' => $serverOS,
|
5583 |
}//end loop
|
5584 |
|
5585 |
kgvid_save_encode_queue($video_encode_queue);
|
|
|
5586 |
|
5587 |
} //if there's a format to encode
|
5588 |
|
5618 |
if ( file_exists($uploads['path']."/sample-video-h264".$suffix) ) {
|
5619 |
|
5620 |
if ( $options['moov'] == "qt-faststart" || $options['moov'] == "MP4Box" ) {
|
5621 |
+
$arr['output'] .= kgvid_fix_moov_atom($uploads['path']."/sample-video-h264".$suffix);
|
5622 |
}
|
5623 |
|
5624 |
if ( $options['ffmpeg_watermark']['url'] != "" ) {
|
5702 |
if ( is_array($time_matches) && array_key_exists(1, $time_matches) != true ) { //if something other than the regular FFMPEG encoding output check for these
|
5703 |
preg_match('/video:(.*?) /', $lastline, $video_matches);
|
5704 |
preg_match('/libx264 (.*?) /', $lastline, $libx264_matches);
|
5705 |
+
$queue_match = preg_match('/queue on closing/', $lastline);
|
5706 |
}
|
5707 |
+
|
5708 |
if ( is_array($time_matches) && array_key_exists(1, $time_matches) == true ) { //still encoding
|
5709 |
|
5710 |
if ( strpos($time_matches[1], ':') !== false ) {
|
5723 |
if ( $percent_done < 20 ) { $percent_done_text = ""; }
|
5724 |
else { $percent_done_text = strval($percent_done)."%"; }
|
5725 |
|
5726 |
+
preg_match('/fps=\s?(.*?) /', $lastline, $fps_matches);
|
5727 |
if ( is_array($fps_matches) && array_key_exists(1, $fps_matches) == true ) {
|
5728 |
if ( $fps_matches[1] != 0 ) { $fps_match = $fps_matches[1]; }
|
5729 |
else { $fps_match = "10"; }
|
5737 |
$args = array($video_key, $format, $page);
|
5738 |
wp_schedule_single_event(time()+60, 'kgvid_cron_queue_check', $args);
|
5739 |
|
5740 |
+
$embed_display = '<strong>'.__('Encoding', 'video-embed-thumbnail-generator').'</strong><br /><div class="kgvid_meter"><div class="kgvid_meter_bar" style="width:'.$percent_done.'%;"><div class="kgvid_meter_text">'.$percent_done_text.'</div></div></div>';
|
5741 |
|
5742 |
if ( current_user_can('encode_videos') && $pid ) {
|
5743 |
$embed_display .= '<a href="javascript:void(0);" class="kgvid_cancel_button" id="attachments-'.$video_entry["attachmentID"].'-kgflashmediaplayer-cancelencode" onclick="kgvid_cancel_encode('.$pid.', \''.$video_entry["attachmentID"].'\', \''.$video_key.'\', \''.$format.'\');">'.__('Cancel', 'video-embed-thumbnail-generator').'</a>';
|
5744 |
}
|
5745 |
|
5746 |
+
$embed_display .= '<div class="kgvid_encoding_small_text"><small>'.__('Elapsed:', 'video-embed-thumbnail-generator').' '.date('H:i:s',$time_elapsed).'. '.__('Remaining:', 'video-embed-thumbnail-generator').' '.$time_remaining.'. '._x('FPS:', 'Frames per second', 'video-embed-thumbnail-generator').' '.$fps_match.'</small></div><script type="text/javascript">percent_timeout = setTimeout(function(){'.$script_function.'}, '.$time_to_wait.');</script>';
|
5747 |
}
|
5748 |
elseif ( time() - $started < 10 || ( file_exists($filepath) && time() - filemtime($filepath) < 10 ) ) { //not enough time has passed, so check again later
|
5749 |
$args = array($video_key, $format, $page);
|
5750 |
$embed_display = '<strong>'.__('Encoding', 'video-embed-thumbnail-generator').'</strong> <script type="text/javascript">percent_timeout = setTimeout(function(){'.$script_function.'}, 1000);</script>';
|
5751 |
wp_schedule_single_event(time()+60, 'kgvid_cron_queue_check', $args);
|
5752 |
}
|
5753 |
+
elseif (
|
5754 |
+
( is_array($video_matches) && array_key_exists(1, $video_matches) == true )
|
5755 |
+
|| ( is_array($libx264_matches) && array_key_exists(1, $libx264_matches) == true )
|
5756 |
+
|| ( $queue_match )
|
5757 |
+
) { //encoding complete
|
5758 |
|
5759 |
if ( $blog_id ) { switch_to_blog($blog_id); }
|
5760 |
|
5789 |
$video_id = kgvid_url_to_id($video_encode_queue[$video_key]['encode_formats'][$format]['url']);
|
5790 |
if ( !$video_id ) {
|
5791 |
$wp_filetype = wp_check_filetype(basename($filepath), null );
|
5792 |
+
|
5793 |
+
$title .= " ".$video_entry['encode_formats'][$format]['name'];
|
5794 |
|
5795 |
if ( $user_ID == 0 ) {
|
5796 |
$parent_post = get_post($parent_id);
|
5829 |
$args = array($next_video['video_key'], $next_video['format'], $page);
|
5830 |
wp_schedule_single_event(time()+60, 'kgvid_cron_queue_check', $args);
|
5831 |
}
|
5832 |
+
|
5833 |
+
if ( (empty($next_video['format']) || $next_video['video_key'] != $video_key) && $video_encode_queue[$video_key]['encode_formats']['fullres']['status'] == "Encoding Complete" ) { //if there's nothing left to encode in this video and we've encoded the fullres
|
5834 |
|
5835 |
$new_movie_url = kgvid_replace_video( $video_key, 'fullres' );
|
5836 |
$script_function = 'kgvid_redraw_encode_checkboxes("'.$new_movie_url.'", "'.$video_entry['attachmentID'].'", "'.$page.'")';
|
5916 |
function kgvid_replace_video ( $video_key, $format ) {
|
5917 |
|
5918 |
$video_encode_queue = kgvid_get_encode_queue();
|
5919 |
+
$video_formats = kgvid_video_formats();
|
5920 |
$encoded_filename = $video_encode_queue[$video_key]['encode_formats'][$format]['filepath'];
|
5921 |
$video_id = $video_encode_queue[$video_key]['attachmentID'];
|
5922 |
|
5923 |
$original_filename = get_attached_file($video_id);
|
5924 |
$path_parts = pathinfo($original_filename);
|
5925 |
+
if ( $path_parts['extension'] != $video_formats[$format]['extension'] ) {
|
5926 |
$new_filename = str_replace("-fullres", "", $encoded_filename);
|
5927 |
$sanitized_url = kgvid_sanitize_url($video_encode_queue[$video_key]['movieurl']);
|
5928 |
+
$new_url = $sanitized_url['noextension'].".".$video_formats[$format]['extension'];
|
5929 |
$video_encode_queue[$video_key]['movieurl'] = $new_url;
|
5930 |
global $wpdb;
|
5931 |
$query = $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE `post_content` LIKE '%%%s%%'", $sanitized_url['basename'].".".$path_parts['extension'] ); //find posts that use the old filename
|
5933 |
if ( $results ) {
|
5934 |
foreach ( $results as $result ) {
|
5935 |
$post = get_post($result->ID);
|
5936 |
+
$post->post_content = str_replace($sanitized_url['noextension'].".".$path_parts['extension'], $new_url, $post->post_content);
|
5937 |
wp_update_post($post);
|
5938 |
}
|
5939 |
}
|
5961 |
|
5962 |
$new_mime = wp_check_filetype( $new_filename );
|
5963 |
$post = get_post($video_id);
|
5964 |
+
$new_guid = str_replace( $path_parts['extension'], $new_mime['ext'], $post->guid );
|
5965 |
+
|
5966 |
+
if ( $new_guid != $post->guid ) {
|
5967 |
+
global $wpdb;
|
5968 |
+
$guid_change = $wpdb->update( $wpdb->posts, //can't use wp_update_post because it won't change GUID
|
5969 |
+
array(
|
5970 |
+
'guid' => $new_guid,
|
5971 |
+
'post_mime_type' => $new_mime['type']
|
5972 |
+
),
|
5973 |
+
array( 'ID' => $video_id ),
|
5974 |
+
array( '%s', '%s' ),
|
5975 |
+
array( '%d' )
|
5976 |
+
);
|
5977 |
+
|
5978 |
+
}
|
5979 |
|
5980 |
return $new_url;
|
5981 |
}
|
6070 |
|
6071 |
$output = "\n".__('Fixing moov atom for streaming', 'video-embed-thumbnail-generator');
|
6072 |
|
6073 |
+
if ( !empty($options['moov_path']) ) { $options['app_path'] = $options['moov_path']; }
|
6074 |
+
|
6075 |
if ( $options['moov'] == 'qt-faststart' && file_exists($filepath) ) {
|
6076 |
$faststart_tmp_file = str_replace('.mp4', '-faststart.mp4', $filepath);
|
6077 |
+
$cmd = escapeshellcmd($options['app_path']."/".$options['moov']." ".$filepath." ".$faststart_tmp_file)." 2>&1";
|
6078 |
$output .= "\n".$cmd."\n";
|
6079 |
exec($cmd, $qtfaststart_output, $returnvalue);
|
6080 |
$output .= implode("\n", $qtfaststart_output);
|
6085 |
}//if qt-faststart is selected
|
6086 |
|
6087 |
if ( $options['moov'] == 'MP4Box' ) {
|
6088 |
+
$cmd = escapeshellcmd($options['app_path']."/".$options['moov']." -inter 500 ".$filepath)." 2>&1";
|
6089 |
$output .= "\n".$cmd."\n";
|
6090 |
exec($cmd, $mp4box_output, $returnvalue);
|
6091 |
$output .= implode("\n", $mp4box_output);
|
6134 |
|
6135 |
if ( empty($attachment_id) ) { //if there's no post_meta giving us the attachment to delete
|
6136 |
$encodevideo_info = kgvid_encodevideo_info($movieurl, $post_id);
|
6137 |
+
if ( is_file($encodevideo_info[$format]['filepath']) ) {
|
6138 |
+
$deleted = unlink($encodevideo_info[$format]['filepath']);
|
6139 |
}
|
6140 |
}
|
6141 |
else {
|
6365 |
|
6366 |
check_ajax_referer( 'video-embed-thumbnail-generator-nonce', 'security' );
|
6367 |
$queue = get_option('kgvid_video_embed_cms_switch');
|
6368 |
+
if ( is_array($queue) && array_key_exists('switching_parents', $queue) && $queue['switching_parents'] ) {
|
6369 |
$new_parent = 'post';
|
6370 |
if (isset($_POST['parent'])) { $new_parent = $_POST['parent']; }
|
6371 |
|
6389 |
}
|
6390 |
add_action('wp_ajax_kgvid_switch_parents', 'kgvid_switch_parents');
|
6391 |
|
6392 |
+
|
6393 |
+
function kgvid_get_generating_old() {
|
6394 |
+
|
6395 |
+
check_ajax_referer( 'video-embed-thumbnail-generator-nonce', 'security' );
|
6396 |
+
|
6397 |
+
if (isset($_POST['type'])) { $type = $_POST['type']; }
|
6398 |
+
$attachments = array();
|
6399 |
+
|
6400 |
+
if ( $type == 'thumbs' ) {
|
6401 |
+
|
6402 |
+
$args = array(
|
6403 |
+
'orderby' => 'post_date',
|
6404 |
+
'order' => 'ASC',
|
6405 |
+
'post_type' => 'attachment',
|
6406 |
+
'post_mime_type' => 'video',
|
6407 |
+
'meta_query' => array(
|
6408 |
+
'relation' => 'OR',
|
6409 |
+
array(
|
6410 |
+
'key' => '_kgflashmediaplayer-poster',
|
6411 |
+
'value' => ''
|
6412 |
+
),
|
6413 |
+
array(
|
6414 |
+
'key' => '_kgflashmediaplayer-poster',
|
6415 |
+
'compare' => 'NOT EXISTS',
|
6416 |
+
'value' => 'completely'
|
6417 |
+
)
|
6418 |
+
),
|
6419 |
+
'numberposts' => -1
|
6420 |
+
);
|
6421 |
+
|
6422 |
+
}
|
6423 |
+
|
6424 |
+
if ( $type == 'encode' ) {
|
6425 |
+
|
6426 |
+
$args = array(
|
6427 |
+
'orderby' => 'post_date',
|
6428 |
+
'order' => 'ASC',
|
6429 |
+
'post_type' => 'attachment',
|
6430 |
+
'post_mime_type' => 'video',
|
6431 |
+
'numberposts' => -1
|
6432 |
+
);
|
6433 |
+
|
6434 |
+
}
|
6435 |
+
|
6436 |
+
$videos = get_posts( $args );
|
6437 |
+
|
6438 |
+
if ( $videos ) {
|
6439 |
+
foreach ($videos as $video) {
|
6440 |
+
$is_child_format = get_post_meta($video->ID, '_kgflashmediaplayer-format', true); //check if video is a child format
|
6441 |
+
if ( !$is_child_format ) {
|
6442 |
+
$attachments[] = $video->ID;
|
6443 |
+
}
|
6444 |
+
}
|
6445 |
+
}
|
6446 |
+
|
6447 |
+
if ( $attachments ) {
|
6448 |
+
$cms_switch_queue = get_option('kgvid_video_embed_cms_switch');
|
6449 |
+
$cms_switch_queue['generating_old_'.$type] = $attachments;
|
6450 |
+
update_option('kgvid_video_embed_cms_switch', $cms_switch_queue);
|
6451 |
+
}
|
6452 |
+
echo count($attachments);
|
6453 |
+
die;
|
6454 |
+
}
|
6455 |
+
add_action('wp_ajax_kgvid_get_generating_old', 'kgvid_get_generating_old');
|
6456 |
+
|
6457 |
+
function kgvid_generating_old() {
|
6458 |
+
|
6459 |
+
check_ajax_referer( 'video-embed-thumbnail-generator-nonce', 'security' );
|
6460 |
+
if (isset($_POST['type'])) { $type = $_POST['type']; }
|
6461 |
+
$queue = get_option('kgvid_video_embed_cms_switch');
|
6462 |
+
if ( is_array($queue) && array_key_exists('generating_old_'.$type, $queue) && $queue['generating_old_'.$type] ) {
|
6463 |
+
|
6464 |
+
foreach ( $queue['generating_old_'.$type] as $video_id ) {
|
6465 |
+
|
6466 |
+
kgvid_cron_new_attachment_handler($video_id, $type);
|
6467 |
+
|
6468 |
+
unset($queue['generating_old_'.$type][$video_id]);
|
6469 |
+
update_option('kgvid_video_embed_cms_switch', $queue);
|
6470 |
+
}
|
6471 |
+
unset($queue['generating_old_'.$type]);
|
6472 |
+
if ( empty($queue) ) { delete_option('kgvid_video_embed_cms_switch'); }
|
6473 |
+
else { update_option('kgvid_video_embed_cms_switch', $queue); }
|
6474 |
+
}
|
6475 |
+
die;
|
6476 |
+
}
|
6477 |
+
add_action('wp_ajax_kgvid_generating_old', 'kgvid_generating_old');
|
6478 |
+
|
6479 |
function kgvid_update_cms_progress() {
|
6480 |
|
6481 |
check_ajax_referer( 'video-embed-thumbnail-generator-nonce', 'security' );
|
6586 |
add_action( 'wp_ajax_kgvid_count_play', 'kgvid_count_play' ); // ajax for logged in users
|
6587 |
add_action( 'wp_ajax_nopriv_kgvid_count_play', 'kgvid_count_play' ); // ajax for not logged in users
|
6588 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6589 |
function kgvid_add_contextual_help_tab() {
|
6590 |
|
6591 |
$false_code = '<code>"false"</code>';
|
6602 |
<li><code>endofvideooverlay="http://www.example.com/end_image.jpg</code> '.__('sets the image shown when the video ends.', 'video-embed-thumbnail-generator').'</li>
|
6603 |
<li><code>width="xxx"</code></li>
|
6604 |
<li><code>height="xxx"</code></li>
|
6605 |
+
<li><code>fullwidth="true/false"</code> '.__('set video to always expand to fill its container.', 'video-embed-thumbnail-generator').'</li>
|
6606 |
<li><code>align="left/right/center"</code></li>
|
6607 |
<li><code>inline="true/false"</code> '.__('allow other content on the same line as the video', 'video-embed-thumbnail-generator').'</li>
|
6608 |
<li><code>volume="0.x"</code> '.__('pre-sets the volume for unusually loud videos. Value between 0 and 1.', 'video-embed-thumbnail-generator').'</li>
|
6618 |
<li><code>description="Description"</code> '.__('Used for metadata only.', 'video-embed-thumbnail-generator').'</li>
|
6619 |
<li><code>downloadlink="true/false"</code> '.__('generates a link below the video to make it easier for users to save the video file to their computers.', 'video-embed-thumbnail-generator').'</li>
|
6620 |
<li><code>right_click="true/false"</code> '.__('allow or disable right-clicking on the video player.', 'video-embed-thumbnail-generator').'</li>
|
6621 |
+
<li><code>resize="true/false"</code> '.__('allow or disable responsive resizing.', 'video-embed-thumbnail-generator').'</li>
|
6622 |
+
<li><code>auto_res="true/false"</code> '.__('let the plugin select the best resolution for the size of the player.', 'video-embed-thumbnail-generator').'</li></ul>
|
6623 |
|
6624 |
<p><strong>'.__('These options will add a subtitle/caption track.', 'video-embed-thumbnail-generator').'</strong></p>
|
6625 |
<ul><li><code>track_src="http://www.example.com/subtitles.vtt_.txt"</code> '.__('URL of the WebVTT file.', 'video-embed-thumbnail-generator').'</li>
|
video-js/lang/de.js
CHANGED
@@ -1,26 +1,26 @@
|
|
1 |
videojs.addLanguage("de",{
|
2 |
-
"Play": "
|
3 |
-
"Pause": "
|
4 |
-
"Current Time": "
|
5 |
-
"Duration Time": "
|
6 |
-
"Remaining Time": "
|
7 |
-
"Stream Type": "
|
8 |
"LIVE": "LIVE",
|
9 |
-
"Loaded": "
|
10 |
-
"Progress": "
|
11 |
-
"Fullscreen": "
|
12 |
-
"Non-Fullscreen": "
|
13 |
-
"Mute": "Ton
|
14 |
-
"Unmuted": "Ton
|
15 |
-
"Playback Rate": "
|
16 |
-
"Subtitles": "Untertitel
|
17 |
-
"subtitles off": "Untertitel
|
18 |
-
"Captions": "
|
19 |
-
"captions off": "
|
20 |
"Chapters": "Kapitel",
|
21 |
-
"You aborted the video playback": "Sie haben die
|
22 |
-
"A network error caused the video download to fail part-way.": "
|
23 |
-
"The video could not be loaded, either because the server or network failed or because the format is not supported.": "Das Video konnte nicht geladen werden, entweder
|
24 |
-
"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.": "Die
|
25 |
"No compatible source was found for this video.": "Für dieses Video wurde keine kompatible Quelle gefunden."
|
26 |
});
|
1 |
videojs.addLanguage("de",{
|
2 |
+
"Play": "Wiedergabe",
|
3 |
+
"Pause": "Pause",
|
4 |
+
"Current Time": "Aktuelle Uhrzeit",
|
5 |
+
"Duration Time": "Laufzeit",
|
6 |
+
"Remaining Time": "Verbleibende Zeit",
|
7 |
+
"Stream Type": "Streamtyp",
|
8 |
"LIVE": "LIVE",
|
9 |
+
"Loaded": "Geladen",
|
10 |
+
"Progress": "Status",
|
11 |
+
"Fullscreen": "Vollbild",
|
12 |
+
"Non-Fullscreen": "Kein Vollbild",
|
13 |
+
"Mute": "Ton aus",
|
14 |
+
"Unmuted": "Ton ein",
|
15 |
+
"Playback Rate": "Wiedergaberate",
|
16 |
+
"Subtitles": "Untertitel",
|
17 |
+
"subtitles off": "Untertitel aus",
|
18 |
+
"Captions": "Geschlossene Untertitel",
|
19 |
+
"captions off": "Geschlossene Untertitel aus",
|
20 |
"Chapters": "Kapitel",
|
21 |
+
"You aborted the video playback": "Sie haben die Videowiedergabe abgebrochen.",
|
22 |
+
"A network error caused the video download to fail part-way.": "Der Videodownload ist aufgrund eines Netzwerkfehlers fehlgeschlagen.",
|
23 |
+
"The video could not be loaded, either because the server or network failed or because the format is not supported.": "Das Video konnte nicht geladen werden, da entweder ein Server- oder Netzwerkfehler auftrat oder das Format nicht unterstützt wird.",
|
24 |
+
"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.": "Die Videowiedergabe wurde entweder wegen eines Problems mit einem beschädigten Video oder wegen verwendeten Funktionen, die vom Browser nicht unterstützt werden, abgebrochen.",
|
25 |
"No compatible source was found for this video.": "Für dieses Video wurde keine kompatible Quelle gefunden."
|
26 |
});
|
video-js/lang/es.js
CHANGED
@@ -1,26 +1,26 @@
|
|
1 |
videojs.addLanguage("es",{
|
2 |
-
"Play": "
|
3 |
"Pause": "Pausa",
|
4 |
-
"Current Time": "Tiempo
|
5 |
-
"Duration Time": "
|
6 |
-
"Remaining Time": "Tiempo
|
7 |
-
"Stream Type": "Tipo de
|
8 |
-
"LIVE": "
|
9 |
"Loaded": "Cargado",
|
10 |
"Progress": "Progreso",
|
11 |
-
"Fullscreen": "Pantalla
|
12 |
-
"Non-Fullscreen": "
|
13 |
-
"Mute": "
|
14 |
-
"Unmuted": "
|
15 |
-
"Playback Rate": "
|
16 |
-
"Subtitles": "
|
17 |
-
"subtitles off": "
|
18 |
-
"Captions": "
|
19 |
-
"captions off": "
|
20 |
-
"Chapters": "
|
21 |
-
"You aborted the video playback": "Ha
|
22 |
-
"A network error caused the video download to fail part-way.": "Un error
|
23 |
-
"The video could not be loaded, either because the server or network failed or because the format is not supported.": "
|
24 |
-
"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.": "La
|
25 |
-
"No compatible source was found for this video.": "
|
26 |
});
|
1 |
videojs.addLanguage("es",{
|
2 |
+
"Play": "Reproducción",
|
3 |
"Pause": "Pausa",
|
4 |
+
"Current Time": "Tiempo reproducido",
|
5 |
+
"Duration Time": "Duración total",
|
6 |
+
"Remaining Time": "Tiempo restante",
|
7 |
+
"Stream Type": "Tipo de secuencia",
|
8 |
+
"LIVE": "DIRECTO",
|
9 |
"Loaded": "Cargado",
|
10 |
"Progress": "Progreso",
|
11 |
+
"Fullscreen": "Pantalla completa",
|
12 |
+
"Non-Fullscreen": "Pantalla no completa",
|
13 |
+
"Mute": "Silenciar",
|
14 |
+
"Unmuted": "No silenciado",
|
15 |
+
"Playback Rate": "Velocidad de reproducción",
|
16 |
+
"Subtitles": "Subtítulos",
|
17 |
+
"subtitles off": "Subtítulos desactivados",
|
18 |
+
"Captions": "Subtítulos especiales",
|
19 |
+
"captions off": "Subtítulos especiales desactivados",
|
20 |
+
"Chapters": "Capítulos",
|
21 |
+
"You aborted the video playback": "Ha interrumpido la reproducción del vídeo.",
|
22 |
+
"A network error caused the video download to fail part-way.": "Un error de red ha interrumpido la descarga del vídeo.",
|
23 |
+
"The video could not be loaded, either because the server or network failed or because the format is not supported.": "No se ha podido cargar el vídeo debido a un fallo de red o del servidor o porque el formato es incompatible.",
|
24 |
+
"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.": "La reproducción de vídeo se ha interrumpido por un problema de corrupción de datos o porque el vídeo precisa funciones que su navegador no ofrece.",
|
25 |
+
"No compatible source was found for this video.": "No se ha encontrado ninguna fuente compatible con este vídeo."
|
26 |
});
|
video-js/lang/fr.js
CHANGED
@@ -1,26 +1,26 @@
|
|
1 |
videojs.addLanguage("fr",{
|
2 |
-
"Play": "
|
3 |
"Pause": "Pause",
|
4 |
-
"Current Time": "
|
5 |
"Duration Time": "Durée",
|
6 |
-
"Remaining Time": "
|
7 |
"Stream Type": "Type de flux",
|
8 |
-
"LIVE": "
|
9 |
"Loaded": "Chargé",
|
10 |
"Progress": "Progression",
|
11 |
"Fullscreen": "Plein écran",
|
12 |
"Non-Fullscreen": "Fenêtré",
|
13 |
-
"Mute": "
|
14 |
-
"Unmuted": "
|
15 |
"Playback Rate": "Vitesse de lecture",
|
16 |
"Subtitles": "Sous-titres",
|
17 |
-
"subtitles off": "
|
18 |
-
"Captions": "
|
19 |
-
"captions off": "
|
20 |
"Chapters": "Chapitres",
|
21 |
"You aborted the video playback": "Vous avez interrompu la lecture de la vidéo.",
|
22 |
-
"A network error caused the video download to fail part-way.": "Une erreur réseau a
|
23 |
-
"The video could not be loaded, either because the server or network failed or because the format is not supported.": "
|
24 |
-
"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.": "La lecture a été interrompue à cause d'un problème de corruption ou parce que la vidéo
|
25 |
-
"No compatible source was found for this video.": "Aucune source compatible n'a
|
26 |
});
|
1 |
videojs.addLanguage("fr",{
|
2 |
+
"Play": "Lecture",
|
3 |
"Pause": "Pause",
|
4 |
+
"Current Time": "Temps actuel",
|
5 |
"Duration Time": "Durée",
|
6 |
+
"Remaining Time": "Temps restant",
|
7 |
"Stream Type": "Type de flux",
|
8 |
+
"LIVE": "EN DIRECT",
|
9 |
"Loaded": "Chargé",
|
10 |
"Progress": "Progression",
|
11 |
"Fullscreen": "Plein écran",
|
12 |
"Non-Fullscreen": "Fenêtré",
|
13 |
+
"Mute": "Sourdine",
|
14 |
+
"Unmuted": "Son activé",
|
15 |
"Playback Rate": "Vitesse de lecture",
|
16 |
"Subtitles": "Sous-titres",
|
17 |
+
"subtitles off": "Sous-titres désactivés",
|
18 |
+
"Captions": "Sous-titres",
|
19 |
+
"captions off": "Sous-titres désactivés",
|
20 |
"Chapters": "Chapitres",
|
21 |
"You aborted the video playback": "Vous avez interrompu la lecture de la vidéo.",
|
22 |
+
"A network error caused the video download to fail part-way.": "Une erreur de réseau a interrompu le téléchargement de la vidéo.",
|
23 |
+
"The video could not be loaded, either because the server or network failed or because the format is not supported.": "Cette vidéo n'a pas pu être chargée, soit parce que le serveur ou le réseau a échoué ou parce que le format n'est pas reconnu.",
|
24 |
+
"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.": "La lecture de la vidéo a été interrompue à cause d'un problème de corruption ou parce que la vidéo utilise des fonctionnalités non prises en charge par votre navigateur.",
|
25 |
+
"No compatible source was found for this video.": "Aucune source compatible n'a été trouvée pour cette vidéo."
|
26 |
});
|
video-js/lang/it.js
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
videojs.addLanguage("it",{
|
2 |
+
"Play": "Play",
|
3 |
+
"Pause": "Pausa",
|
4 |
+
"Current Time": "Orario attuale",
|
5 |
+
"Duration Time": "Durata",
|
6 |
+
"Remaining Time": "Tempo rimanente",
|
7 |
+
"Stream Type": "Tipo del Streaming",
|
8 |
+
"LIVE": "LIVE",
|
9 |
+
"Loaded": "Caricato",
|
10 |
+
"Progress": "Stato",
|
11 |
+
"Fullscreen": "Schermo intero",
|
12 |
+
"Non-Fullscreen": "Chiudi schermo intero",
|
13 |
+
"Mute": "Muto",
|
14 |
+
"Unmuted": "Audio",
|
15 |
+
"Playback Rate": "Tasso di riproduzione",
|
16 |
+
"Subtitles": "Sottotitoli",
|
17 |
+
"subtitles off": "Senza sottotitoli",
|
18 |
+
"Captions": "Sottotitoli non udenti",
|
19 |
+
"captions off": "Senza sottotitoli non udenti",
|
20 |
+
"Chapters": "Capitolo",
|
21 |
+
"You aborted the video playback": "La riproduzione del filmato è stata interrotta.",
|
22 |
+
"A network error caused the video download to fail part-way.": "Il download del filmato è stato interrotto a causa di un problema rete.",
|
23 |
+
"The video could not be loaded, either because the server or network failed or because the format is not supported.": "Il filmato non può essere caricato a causa di un errore nel server o nella rete o perché il formato non viene supportato.",
|
24 |
+
"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.": "La riproduzione del filmato è stata interrotta a causa di un file danneggiato o per l’utilizzo di impostazioni non supportate dal browser.",
|
25 |
+
"No compatible source was found for this video.": "Non ci sono fonti compatibili per questo filmato."
|
26 |
+
});
|
video-js/lang/ja.js
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
videojs.addLanguage("ja",{
|
2 |
+
"Play": "再生",
|
3 |
+
"Pause": "一時停止",
|
4 |
+
"Current Time": "現在の時間",
|
5 |
+
"Duration Time": "長さ",
|
6 |
+
"Remaining Time": "残りの時間",
|
7 |
+
"Stream Type": "ストリームの種類",
|
8 |
+
"LIVE": "ライブ",
|
9 |
+
"Loaded": "ロード済み",
|
10 |
+
"Progress": "進行状況",
|
11 |
+
"Fullscreen": "フルスクリーン",
|
12 |
+
"Non-Fullscreen": "フルスクリーン以外",
|
13 |
+
"Mute": "ミュート",
|
14 |
+
"Unmuted": "ミュート解除",
|
15 |
+
"Playback Rate": "再生レート",
|
16 |
+
"Subtitles": "サブタイトル",
|
17 |
+
"subtitles off": "サブタイトル オフ",
|
18 |
+
"Captions": "キャプション",
|
19 |
+
"captions off": "キャプション オフ",
|
20 |
+
"Chapters": "チャプター",
|
21 |
+
"You aborted the video playback": "動画再生を中止しました",
|
22 |
+
"A network error caused the video download to fail part-way.": "ネットワーク エラーにより動画のダウンロードが途中で失敗しました",
|
23 |
+
"The video could not be loaded, either because the server or network failed or because the format is not supported.": "サーバーまたはネットワークのエラー、またはフォーマットがサポートされていないため、動画をロードできませんでした",
|
24 |
+
"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.": "破損の問題、またはお使いのブラウザがサポートしていない機能が動画に使用されていたため、動画の再生が中止されました",
|
25 |
+
"No compatible source was found for this video.": "この動画に対して互換性のあるソースが見つかりませんでした"
|
26 |
+
});
|
video-js/lang/ko.js
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
videojs.addLanguage("ko",{
|
2 |
+
"Play": "재생",
|
3 |
+
"Pause": "일시중지",
|
4 |
+
"Current Time": "현재 시간",
|
5 |
+
"Duration Time": "지정 기간",
|
6 |
+
"Remaining Time": "남은 시간",
|
7 |
+
"Stream Type": "스트리밍 유형",
|
8 |
+
"LIVE": "라이브",
|
9 |
+
"Loaded": "로드됨",
|
10 |
+
"Progress": "진행",
|
11 |
+
"Fullscreen": "전체 화면",
|
12 |
+
"Non-Fullscreen": "전체 화면 해제",
|
13 |
+
"Mute": "음소거",
|
14 |
+
"Unmuted": "음소거 해제",
|
15 |
+
"Playback Rate": "재생 비율",
|
16 |
+
"Subtitles": "서브타이틀",
|
17 |
+
"subtitles off": "서브타이틀 끄기",
|
18 |
+
"Captions": "자막",
|
19 |
+
"captions off": "자막 끄기",
|
20 |
+
"Chapters": "챕터",
|
21 |
+
"You aborted the video playback": "비디오 재생을 취소했습니다.",
|
22 |
+
"A network error caused the video download to fail part-way.": "네트워크 오류로 인하여 비디오 일부를 다운로드하지 못 했습니다.",
|
23 |
+
"The video could not be loaded, either because the server or network failed or because the format is not supported.": "비디오를 로드할 수 없습니다. 서버 혹은 네트워크 오류 때문이거나 지원되지 않는 형식 때문일 수 있습니다.",
|
24 |
+
"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.": "비디오 재생이 취소됐습니다. 비디오가 손상되었거나 비디오가 사용하는 기능을 브라우저에서 지원하지 않는 것 같습니다.",
|
25 |
+
"No compatible source was found for this video.": "비디오에 호환되지 않는 소스가 있습니다."
|
26 |
+
});
|
video-js/lang/pt-BR.js
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
videojs.addLanguage("pt-BR",{
|
2 |
+
"Play": "Tocar",
|
3 |
+
"Pause": "Pause",
|
4 |
+
"Current Time": "Tempo",
|
5 |
+
"Duration Time": "Duração",
|
6 |
+
"Remaining Time": "Tempo Restante",
|
7 |
+
"Stream Type": "Tipo de Stream",
|
8 |
+
"LIVE": "AO VIVO",
|
9 |
+
"Loaded": "Carregado",
|
10 |
+
"Progress": "Progressão",
|
11 |
+
"Fullscreen": "Tela Cheia",
|
12 |
+
"Non-Fullscreen": "Tela Normal",
|
13 |
+
"Mute": "Mudo",
|
14 |
+
"Unmuted": "Habilitar Som",
|
15 |
+
"Playback Rate": "Velocidade",
|
16 |
+
"Subtitles": "Legendas",
|
17 |
+
"subtitles off": "Sem Legendas",
|
18 |
+
"Captions": "Anotações",
|
19 |
+
"captions off": "Sem Anotações",
|
20 |
+
"Chapters": "Capítulos",
|
21 |
+
"You aborted the video playback": "Você parou a execução de vídeo.",
|
22 |
+
"A network error caused the video download to fail part-way.": "Um erro na rede fez o vídeo parar parcialmente.",
|
23 |
+
"The video could not be loaded, either because the server or network failed or because the format is not supported.": "O vídeo não pode ser carregado, ou porque houve um problema com sua rede ou pelo formato do vídeo não ser suportado.",
|
24 |
+
"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.": "A Execução foi interrompida por um problema com o vídeo ou por seu navegador não dar suporte ao seu formato.",
|
25 |
+
"No compatible source was found for this video.": "Não foi encontrada fonte de vídeo compatível."
|
26 |
+
});
|
video-js/video-js.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
/*!
|
2 |
Video.js Default Styles (http://videojs.com)
|
3 |
-
Version 4.
|
4 |
Create your own skin at http://designer.videojs.com
|
5 |
-
*/.vjs-default-skin{color:#ccc}@font-face{font-family:VideoJS;src:url(font/vjs.eot);src:url(font/vjs.eot?#iefix) format('embedded-opentype'),url(font/vjs.woff) format('woff'),url(font/vjs.ttf) format('truetype'),url(font/vjs.svg#icomoon) format('svg');font-weight:400;font-style:normal}.vjs-default-skin .vjs-slider{outline:0;position:relative;cursor:pointer;padding:0;background-color:#333;background-color:rgba(51,51,51,.9)}.vjs-default-skin .vjs-slider:focus{-webkit-box-shadow:0 0 2em #fff;-moz-box-shadow:0 0 2em #fff;box-shadow:0 0 2em #fff}.vjs-default-skin .vjs-slider-handle{position:absolute;left:0;top:0}.vjs-default-skin .vjs-slider-handle:before{content:"\e009";font-family:VideoJS;font-size:1em;line-height:1;text-align:center;text-shadow:0 0 1em #fff;position:absolute;top:0;left:0;-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-ms-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg)}.vjs-default-skin .vjs-control-bar{display:none;position:absolute;bottom:0;left:0;right:0;height:3em;background-color:#07141e;background-color:rgba(7,20,30,.7)}.vjs-default-skin.vjs-has-started .vjs-control-bar{display:block;visibility:visible;opacity:1;-webkit-transition:visibility .1s,opacity .1s;-moz-transition:visibility .1s,opacity .1s;-o-transition:visibility .1s,opacity .1s;transition:visibility .1s,opacity .1s}.vjs-default-skin.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{display:block;visibility:hidden;opacity:0;-webkit-transition:visibility 1s,opacity 1s;-moz-transition:visibility 1s,opacity 1s;-o-transition:visibility 1s,opacity 1s;transition:visibility 1s,opacity 1s}.vjs-default-skin.vjs-controls-disabled .vjs-control-bar{display:none}.vjs-default-skin.vjs-using-native-controls .vjs-control-bar{display:none}.vjs-default-skin.vjs-error .vjs-control-bar{display:none}@media \0screen{.vjs-default-skin.vjs-user-inactive.vjs-playing .vjs-control-bar :before{content:""}}.vjs-default-skin .vjs-control{outline:0;position:relative;float:left;text-align:center;margin:0;padding:0;height:3em;width:4em}.vjs-default-skin .vjs-control:before{font-family:VideoJS;font-size:1.5em;line-height:2;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;text-shadow:1px 1px 1px rgba(0,0,0,.5)}.vjs-default-skin .vjs-control:focus:before,.vjs-default-skin .vjs-control:hover:before{text-shadow:0 0 1em #fff}.vjs-default-skin .vjs-control:focus{}.vjs-default-skin .vjs-control-text{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.vjs-default-skin .vjs-play-control{width:5em;cursor:pointer}.vjs-default-skin .vjs-play-control:before{content:"\e001"}.vjs-default-skin.vjs-playing .vjs-play-control:before{content:"\e002"}.vjs-default-skin .vjs-playback-rate .vjs-playback-rate-value{font-size:1.5em;line-height:2;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;text-shadow:1px 1px 1px rgba(0,0,0,.5)}.vjs-default-skin .vjs-playback-rate.vjs-menu-button .vjs-menu .vjs-menu-content{width:4em;left:-2em;list-style:none}.vjs-default-skin .vjs-mute-control,.vjs-default-skin .vjs-volume-menu-button{cursor:pointer;float:right}.vjs-default-skin .vjs-mute-control:before,.vjs-default-skin .vjs-volume-menu-button:before{content:"\e006"}.vjs-default-skin .vjs-mute-control.vjs-vol-0:before,.vjs-default-skin .vjs-volume-menu-button.vjs-vol-0:before{content:"\e003"}.vjs-default-skin .vjs-mute-control.vjs-vol-1:before,.vjs-default-skin .vjs-volume-menu-button.vjs-vol-1:before{content:"\e004"}.vjs-default-skin .vjs-mute-control.vjs-vol-2:before,.vjs-default-skin .vjs-volume-menu-button.vjs-vol-2:before{content:"\e005"}.vjs-default-skin .vjs-volume-control{width:5em;float:right}.vjs-default-skin .vjs-volume-bar{width:5em;height:.6em;margin:1.1em auto 0}.vjs-default-skin .vjs-volume-menu-button .vjs-menu-content{height:2.9em}.vjs-default-skin .vjs-volume-level{position:absolute;top:0;left:0;height:.5em;width:100%;background:#66a8cc url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAP0lEQVQIHWWMAQoAIAgDR/QJ/Ub//04+w7ZICBwcOg5FZi5iBB82AGzixEglJrd4TVK5XUJpskSTEvpdFzX9AB2pGziSQcvAAAAAAElFTkSuQmCC) -50% 0 repeat}.vjs-default-skin .vjs-volume-bar .vjs-volume-handle{width:.5em;height:.5em;left:4.5em}.vjs-default-skin .vjs-volume-handle:before{font-size:.9em;top:-.2em;left:-.2em;width:1em;height:1em}.vjs-default-skin .vjs-volume-menu-button .vjs-menu .vjs-menu-content{width:6em;left:-4em}.vjs-default-skin .vjs-progress-control{position:absolute;left:0;right:0;width:auto;font-size:.3em;height:1em;top:-1em;-webkit-transition:all .4s;-moz-transition:all .4s;-o-transition:all .4s;transition:all .4s}.vjs-default-skin:hover .vjs-progress-control{font-size:.9em;-webkit-transition:all .2s;-moz-transition:all .2s;-o-transition:all .2s;transition:all .2s}.vjs-default-skin .vjs-progress-holder{height:100%}.vjs-default-skin .vjs-progress-holder .vjs-play-progress,.vjs-default-skin .vjs-progress-holder .vjs-load-progress,.vjs-default-skin .vjs-progress-holder .vjs-load-progress div{position:absolute;display:block;height:100%;margin:0;padding:0;width:0;left:0;top:0}.vjs-default-skin .vjs-play-progress{background:#66a8cc url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAP0lEQVQIHWWMAQoAIAgDR/QJ/Ub//04+w7ZICBwcOg5FZi5iBB82AGzixEglJrd4TVK5XUJpskSTEvpdFzX9AB2pGziSQcvAAAAAAElFTkSuQmCC) -50% 0 repeat}.vjs-default-skin .vjs-load-progress{background:#646464;background:rgba(255,255,255,.2)}.vjs-default-skin .vjs-load-progress div{background:#787878;background:rgba(255,255,255,.1)}.vjs-default-skin .vjs-seek-handle{width:1.5em;height:100%}.vjs-default-skin .vjs-seek-handle:before{padding-top:.1em}.vjs-default-skin.vjs-live .vjs-time-controls,.vjs-default-skin.vjs-live .vjs-time-divider,.vjs-default-skin.vjs-live .vjs-progress-control{display:none}.vjs-default-skin.vjs-live .vjs-live-display{display:block}.vjs-default-skin .vjs-live-display{display:none;font-size:1em;line-height:3em}.vjs-default-skin .vjs-time-controls{font-size:1em;line-height:3em}.vjs-default-skin .vjs-current-time{float:left}.vjs-default-skin .vjs-duration{float:left}.vjs-default-skin .vjs-remaining-time{display:none;float:left}.vjs-time-divider{float:left;line-height:3em}.vjs-default-skin .vjs-fullscreen-control{width:3.8em;cursor:pointer;float:right}.vjs-default-skin .vjs-fullscreen-control:before{content:"\e000"}.vjs-default-skin.vjs-fullscreen .vjs-fullscreen-control:before{content:"\e00b"}.vjs-default-skin .vjs-big-play-button{left:.5em;top:.5em;font-size:3em;display:block;z-index:2;position:absolute;width:4em;height:2.6em;text-align:center;vertical-align:middle;cursor:pointer;opacity:1;background-color:#07141e;background-color:rgba(7,20,30,.7);border:.1em solid #3b4249;-webkit-border-radius:.8em;-moz-border-radius:.8em;border-radius:.8em;-webkit-box-shadow:0 0 1em rgba(255,255,255,.25);-moz-box-shadow:0 0 1em rgba(255,255,255,.25);box-shadow:0 0 1em rgba(255,255,255,.25);-webkit-transition:all .4s;-moz-transition:all .4s;-o-transition:all .4s;transition:all .4s}.vjs-default-skin.vjs-big-play-centered .vjs-big-play-button{left:50%;margin-left:-2.1em;top:50%;margin-top:-1.4000000000000001em}.vjs-default-skin.vjs-controls-disabled .vjs-big-play-button{display:none}.vjs-default-skin.vjs-has-started .vjs-big-play-button{display:none}.vjs-default-skin.vjs-using-native-controls .vjs-big-play-button{display:none}.vjs-default-skin:hover .vjs-big-play-button,.vjs-default-skin .vjs-big-play-button:focus{outline:0;border-color:#fff;background-color:#505050;background-color:rgba(50,50,50,.75);-webkit-box-shadow:0 0 3em #fff;-moz-box-shadow:0 0 3em #fff;box-shadow:0 0 3em #fff;-webkit-transition:all 0s;-moz-transition:all 0s;-o-transition:all 0s;transition:all 0s}.vjs-default-skin .vjs-big-play-button:before{content:"\e001";font-family:VideoJS;line-height:2.6em;text-shadow:.05em .05em .1em #000;text-align:center;position:absolute;left:0;width:100%;height:100%}.vjs-error .vjs-big-play-button{display:none}.vjs-error-display{display:none}.vjs-error .vjs-error-display{display:block;position:absolute;left:0;top:0;width:100%;height:100%}.vjs-error .vjs-error-display:before{content:'X';font-family:Arial;font-size:4em;color:#666;line-height:1;text-shadow:.05em .05em .1em #000;text-align:center;vertical-align:middle;position:absolute;left:0;top:50%;margin-top:-.5em;width:100%}.vjs-error-display div{position:absolute;bottom:1em;right:0;left:0;font-size:1.4em;text-align:center;padding:3px;background:#000;background:rgba(0,0,0,.5)}.vjs-error-display a,.vjs-error-display a:visited{color:#F4A460}.vjs-loading-spinner{display:none;position:absolute;top:50%;left:50%;font-size:4em;line-height:1;width:1em;height:1em;margin-left:-.5em;margin-top:-.5em;opacity:.75}.vjs-waiting .vjs-loading-spinner,.vjs-seeking .vjs-loading-spinner{display:block;-webkit-animation:spin 1.5s infinite linear;-moz-animation:spin 1.5s infinite linear;-o-animation:spin 1.5s infinite linear;animation:spin 1.5s infinite linear}.vjs-error .vjs-loading-spinner{display:none;-webkit-animation:none;-moz-animation:none;-o-animation:none;animation:none}.vjs-default-skin .vjs-loading-spinner:before{content:"\e01e";font-family:VideoJS;position:absolute;top:0;left:0;width:1em;height:1em;text-align:center;text-shadow:0 0 .1em #000}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)}100%{-o-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}}.vjs-default-skin .vjs-menu-button{float:right;cursor:pointer}.vjs-default-skin .vjs-menu{display:none;position:absolute;bottom:0;left:0;width:0;height:0;margin-bottom:3em;border-left:2em solid transparent;border-right:2em solid transparent;border-top:1.55em solid #000;border-top-color:rgba(7,40,50,.5)}.vjs-default-skin .vjs-menu-button .vjs-menu .vjs-menu-content{display:block;padding:0;margin:0;position:absolute;width:10em;bottom:1.5em;max-height:15em;overflow:auto;left:-5em;background-color:#07141e;background-color:rgba(7,20,30,.7);-webkit-box-shadow:-.2em -.2em .3em rgba(255,255,255,.2);-moz-box-shadow:-.2em -.2em .3em rgba(255,255,255,.2);box-shadow:-.2em -.2em .3em rgba(255,255,255,.2)}.vjs-default-skin .vjs-menu-button:hover .vjs-menu{display:block}.vjs-default-skin .vjs-menu-button ul li{list-style:none;margin:0;padding:.3em 0;line-height:1.4em;font-size:1.2em;text-align:center;text-transform:lowercase}.vjs-default-skin .vjs-menu-button ul li.vjs-selected{background-color:#000}.vjs-default-skin .vjs-menu-button ul li:focus,.vjs-default-skin .vjs-menu-button ul li:hover,.vjs-default-skin .vjs-menu-button ul li.vjs-selected:focus,.vjs-default-skin .vjs-menu-button ul li.vjs-selected:hover{outline:0;color:#111;background-color:#fff;background-color:rgba(255,255,255,.75);-webkit-box-shadow:0 0 1em #fff;-moz-box-shadow:0 0 1em #fff;box-shadow:0 0 1em #fff}.vjs-default-skin .vjs-menu-button ul li.vjs-menu-title{text-align:center;text-transform:uppercase;font-size:1em;line-height:2em;padding:0;margin:0 0 .3em;font-weight:700;cursor:default}.vjs-default-skin .vjs-subtitles-button:before{content:"\e00c"}.vjs-default-skin .vjs-captions-button:before{content:"\e008"}.vjs-default-skin .vjs-chapters-button:before{content:"\e00c"}.vjs-default-skin .vjs-chapters-button.vjs-menu-button .vjs-menu .vjs-menu-content{width:24em;left:-12em}.vjs-default-skin .vjs-captions-button:focus .vjs-control-content:before,.vjs-default-skin .vjs-captions-button:hover .vjs-control-content:before{-webkit-box-shadow:0 0 1em #fff;-moz-box-shadow:0 0 1em #fff;box-shadow:0 0 1em #fff}.video-js{background-color:#000;position:relative;padding:0;font-size:10px;vertical-align:middle;font-weight:400;font-style:normal;font-family:Arial,sans-serif;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.video-js .vjs-tech{position:absolute;top:0;left:0;width:100%;height:100%}.video-js:-moz-full-screen{position:absolute}body.vjs-full-window{padding:0;margin:0;height:100%;overflow-y:auto}.video-js.vjs-fullscreen{position:fixed;overflow:hidden;z-index:1000;left:0;top:0;bottom:0;right:0;width:100%!important;height:100%!important;_position:absolute}.video-js:-webkit-full-screen{width:100%!important;height:100%!important}.video-js.vjs-fullscreen.vjs-user-inactive{cursor:none}.vjs-poster{background-repeat:no-repeat;background-position:50% 50%;background-size:contain;cursor:pointer;margin:0;padding:0;position:absolute;top:0;right:0;bottom:0;left:0}.vjs-poster img{display:block;margin:0 auto;max-height:100%;padding:0;width:100%}.video-js.vjs-using-native-controls .vjs-poster{display:none}.video-js .vjs-text-track-display{text-align:center;position:absolute;bottom:4em;left:1em;right:1em}.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display{bottom:1em}.video-js .vjs-text-track{display:none;font-size:1.4em;text-align:center;margin-bottom:.1em;background-color:#000;background-color:rgba(0,0,0,.5)}.video-js .vjs-subtitles{color:#fff}.video-js .vjs-captions{color:#fc6}.vjs-tt-cue{display:block}.vjs-default-skin .vjs-hidden{display:none}.vjs-lock-showing{display:block!important;opacity:1;visibility:visible}.vjs-no-js{padding:20px;color:#ccc;background-color:#333;font-size:18px;font-family:Arial,sans-serif;text-align:center;width:300px;height:150px;margin:0 auto}.vjs-no-js a,.vjs-no-js a:visited{color:#F4A460}
|
1 |
/*!
|
2 |
Video.js Default Styles (http://videojs.com)
|
3 |
+
Version 4.9.1
|
4 |
Create your own skin at http://designer.videojs.com
|
5 |
+
*/.vjs-default-skin{color:#ccc}@font-face{font-family:VideoJS;src:url(font/vjs.eot);src:url(font/vjs.eot?#iefix) format('embedded-opentype'),url(font/vjs.woff) format('woff'),url(font/vjs.ttf) format('truetype'),url(font/vjs.svg#icomoon) format('svg');font-weight:400;font-style:normal}.vjs-default-skin .vjs-slider{outline:0;position:relative;cursor:pointer;padding:0;background-color:#333;background-color:rgba(51,51,51,.9)}.vjs-default-skin .vjs-slider:focus{-webkit-box-shadow:0 0 2em #fff;-moz-box-shadow:0 0 2em #fff;box-shadow:0 0 2em #fff}.vjs-default-skin .vjs-slider-handle{position:absolute;left:0;top:0}.vjs-default-skin .vjs-slider-handle:before{content:"\e009";font-family:VideoJS;font-size:1em;line-height:1;text-align:center;text-shadow:0 0 1em #fff;position:absolute;top:0;left:0;-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-ms-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg)}.vjs-default-skin .vjs-control-bar{display:none;position:absolute;bottom:0;left:0;right:0;height:3em;background-color:#07141e;background-color:rgba(7,20,30,.7)}.vjs-default-skin.vjs-has-started .vjs-control-bar{display:block;visibility:visible;opacity:1;-webkit-transition:visibility .1s,opacity .1s;-moz-transition:visibility .1s,opacity .1s;-o-transition:visibility .1s,opacity .1s;transition:visibility .1s,opacity .1s}.vjs-default-skin.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{display:block;visibility:hidden;opacity:0;-webkit-transition:visibility 1s,opacity 1s;-moz-transition:visibility 1s,opacity 1s;-o-transition:visibility 1s,opacity 1s;transition:visibility 1s,opacity 1s}.vjs-default-skin.vjs-controls-disabled .vjs-control-bar{display:none}.vjs-default-skin.vjs-using-native-controls .vjs-control-bar{display:none}.vjs-default-skin.vjs-error .vjs-control-bar{display:none}.vjs-audio.vjs-default-skin.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:1;visibility:visible}@media \0screen{.vjs-default-skin.vjs-user-inactive.vjs-playing .vjs-control-bar :before{content:""}}.vjs-default-skin .vjs-control{outline:0;position:relative;float:left;text-align:center;margin:0;padding:0;height:3em;width:4em}.vjs-default-skin .vjs-control:before{font-family:VideoJS;font-size:1.5em;line-height:2;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;text-shadow:1px 1px 1px rgba(0,0,0,.5)}.vjs-default-skin .vjs-control:focus:before,.vjs-default-skin .vjs-control:hover:before{text-shadow:0 0 1em #fff}.vjs-default-skin .vjs-control:focus{}.vjs-default-skin .vjs-control-text{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.vjs-default-skin .vjs-play-control{width:5em;cursor:pointer}.vjs-default-skin .vjs-play-control:before{content:"\e001"}.vjs-default-skin.vjs-playing .vjs-play-control:before{content:"\e002"}.vjs-default-skin .vjs-playback-rate .vjs-playback-rate-value{font-size:1.5em;line-height:2;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;text-shadow:1px 1px 1px rgba(0,0,0,.5)}.vjs-default-skin .vjs-playback-rate.vjs-menu-button .vjs-menu .vjs-menu-content{width:4em;left:-2em;list-style:none}.vjs-default-skin .vjs-mute-control,.vjs-default-skin .vjs-volume-menu-button{cursor:pointer;float:right}.vjs-default-skin .vjs-mute-control:before,.vjs-default-skin .vjs-volume-menu-button:before{content:"\e006"}.vjs-default-skin .vjs-mute-control.vjs-vol-0:before,.vjs-default-skin .vjs-volume-menu-button.vjs-vol-0:before{content:"\e003"}.vjs-default-skin .vjs-mute-control.vjs-vol-1:before,.vjs-default-skin .vjs-volume-menu-button.vjs-vol-1:before{content:"\e004"}.vjs-default-skin .vjs-mute-control.vjs-vol-2:before,.vjs-default-skin .vjs-volume-menu-button.vjs-vol-2:before{content:"\e005"}.vjs-default-skin .vjs-volume-control{width:5em;float:right}.vjs-default-skin .vjs-volume-bar{width:5em;height:.6em;margin:1.1em auto 0}.vjs-default-skin .vjs-volume-level{position:absolute;top:0;left:0;height:.5em;width:100%;background:#66a8cc url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAP0lEQVQIHWWMAQoAIAgDR/QJ/Ub//04+w7ZICBwcOg5FZi5iBB82AGzixEglJrd4TVK5XUJpskSTEvpdFzX9AB2pGziSQcvAAAAAAElFTkSuQmCC) -50% 0 repeat}.vjs-default-skin .vjs-volume-bar .vjs-volume-handle{width:.5em;height:.5em;left:4.5em}.vjs-default-skin .vjs-volume-handle:before{font-size:.9em;top:-.2em;left:-.2em;width:1em;height:1em}.vjs-default-skin .vjs-volume-menu-button .vjs-menu{display:block;width:0;height:0;border-top-color:transparent}.vjs-default-skin .vjs-volume-menu-button .vjs-menu .vjs-menu-content{height:0;width:0}.vjs-default-skin .vjs-volume-menu-button:hover .vjs-menu,.vjs-default-skin .vjs-volume-menu-button .vjs-menu.vjs-lock-showing{border-top-color:rgba(7,40,50,.5)}.vjs-default-skin .vjs-volume-menu-button:hover .vjs-menu .vjs-menu-content,.vjs-default-skin .vjs-volume-menu-button .vjs-menu.vjs-lock-showing .vjs-menu-content{height:2.9em;width:10em}.vjs-default-skin .vjs-progress-control{position:absolute;left:0;right:0;width:auto;font-size:.3em;height:1em;top:-1em;-webkit-transition:all .4s;-moz-transition:all .4s;-o-transition:all .4s;transition:all .4s}.vjs-default-skin:hover .vjs-progress-control{font-size:.9em;-webkit-transition:all .2s;-moz-transition:all .2s;-o-transition:all .2s;transition:all .2s}.vjs-default-skin .vjs-progress-holder{height:100%}.vjs-default-skin .vjs-progress-holder .vjs-play-progress,.vjs-default-skin .vjs-progress-holder .vjs-load-progress,.vjs-default-skin .vjs-progress-holder .vjs-load-progress div{position:absolute;display:block;height:100%;margin:0;padding:0;width:0;left:0;top:0}.vjs-default-skin .vjs-play-progress{background:#66a8cc url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAP0lEQVQIHWWMAQoAIAgDR/QJ/Ub//04+w7ZICBwcOg5FZi5iBB82AGzixEglJrd4TVK5XUJpskSTEvpdFzX9AB2pGziSQcvAAAAAAElFTkSuQmCC) -50% 0 repeat}.vjs-default-skin .vjs-load-progress{background:#646464;background:rgba(255,255,255,.2)}.vjs-default-skin .vjs-load-progress div{background:#787878;background:rgba(255,255,255,.1)}.vjs-default-skin .vjs-seek-handle{width:1.5em;height:100%}.vjs-default-skin .vjs-seek-handle:before{padding-top:.1em}.vjs-default-skin.vjs-live .vjs-time-controls,.vjs-default-skin.vjs-live .vjs-time-divider,.vjs-default-skin.vjs-live .vjs-progress-control{display:none}.vjs-default-skin.vjs-live .vjs-live-display{display:block}.vjs-default-skin .vjs-live-display{display:none;font-size:1em;line-height:3em}.vjs-default-skin .vjs-time-controls{font-size:1em;line-height:3em}.vjs-default-skin .vjs-current-time{float:left}.vjs-default-skin .vjs-duration{float:left}.vjs-default-skin .vjs-remaining-time{display:none;float:left}.vjs-time-divider{float:left;line-height:3em}.vjs-default-skin .vjs-fullscreen-control{width:3.8em;cursor:pointer;float:right}.vjs-default-skin .vjs-fullscreen-control:before{content:"\e000"}.vjs-default-skin.vjs-fullscreen .vjs-fullscreen-control:before{content:"\e00b"}.vjs-default-skin .vjs-big-play-button{left:.5em;top:.5em;font-size:3em;display:block;z-index:2;position:absolute;width:4em;height:2.6em;text-align:center;vertical-align:middle;cursor:pointer;opacity:1;background-color:#07141e;background-color:rgba(7,20,30,.7);border:.1em solid #3b4249;-webkit-border-radius:.8em;-moz-border-radius:.8em;border-radius:.8em;-webkit-box-shadow:0 0 1em rgba(255,255,255,.25);-moz-box-shadow:0 0 1em rgba(255,255,255,.25);box-shadow:0 0 1em rgba(255,255,255,.25);-webkit-transition:all .4s;-moz-transition:all .4s;-o-transition:all .4s;transition:all .4s}.vjs-default-skin.vjs-big-play-centered .vjs-big-play-button{left:50%;margin-left:-2.1em;top:50%;margin-top:-1.4000000000000001em}.vjs-default-skin.vjs-controls-disabled .vjs-big-play-button{display:none}.vjs-default-skin.vjs-has-started .vjs-big-play-button{display:none}.vjs-default-skin.vjs-using-native-controls .vjs-big-play-button{display:none}.vjs-default-skin:hover .vjs-big-play-button,.vjs-default-skin .vjs-big-play-button:focus{outline:0;border-color:#fff;background-color:#505050;background-color:rgba(50,50,50,.75);-webkit-box-shadow:0 0 3em #fff;-moz-box-shadow:0 0 3em #fff;box-shadow:0 0 3em #fff;-webkit-transition:all 0s;-moz-transition:all 0s;-o-transition:all 0s;transition:all 0s}.vjs-default-skin .vjs-big-play-button:before{content:"\e001";font-family:VideoJS;line-height:2.6em;text-shadow:.05em .05em .1em #000;text-align:center;position:absolute;left:0;width:100%;height:100%}.vjs-error .vjs-big-play-button{display:none}.vjs-error-display{display:none}.vjs-error .vjs-error-display{display:block;position:absolute;left:0;top:0;width:100%;height:100%}.vjs-error .vjs-error-display:before{content:'X';font-family:Arial;font-size:4em;color:#666;line-height:1;text-shadow:.05em .05em .1em #000;text-align:center;vertical-align:middle;position:absolute;left:0;top:50%;margin-top:-.5em;width:100%}.vjs-error-display div{position:absolute;bottom:1em;right:0;left:0;font-size:1.4em;text-align:center;padding:3px;background:#000;background:rgba(0,0,0,.5)}.vjs-error-display a,.vjs-error-display a:visited{color:#F4A460}.vjs-loading-spinner{display:none;position:absolute;top:50%;left:50%;font-size:4em;line-height:1;width:1em;height:1em;margin-left:-.5em;margin-top:-.5em;opacity:.75}.vjs-waiting .vjs-loading-spinner,.vjs-seeking .vjs-loading-spinner{display:block;-webkit-animation:spin 1.5s infinite linear;-moz-animation:spin 1.5s infinite linear;-o-animation:spin 1.5s infinite linear;animation:spin 1.5s infinite linear}.vjs-error .vjs-loading-spinner{display:none;-webkit-animation:none;-moz-animation:none;-o-animation:none;animation:none}.vjs-default-skin .vjs-loading-spinner:before{content:"\e01e";font-family:VideoJS;position:absolute;top:0;left:0;width:1em;height:1em;text-align:center;text-shadow:0 0 .1em #000}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)}100%{-o-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}}.vjs-default-skin .vjs-menu-button{float:right;cursor:pointer}.vjs-default-skin .vjs-menu{display:none;position:absolute;bottom:0;left:0;width:0;height:0;margin-bottom:3em;border-left:2em solid transparent;border-right:2em solid transparent;border-top:1.55em solid #000;border-top-color:rgba(7,40,50,.5)}.vjs-default-skin .vjs-menu-button .vjs-menu .vjs-menu-content{display:block;padding:0;margin:0;position:absolute;width:10em;bottom:1.5em;max-height:15em;overflow:auto;left:-5em;background-color:#07141e;background-color:rgba(7,20,30,.7);-webkit-box-shadow:-.2em -.2em .3em rgba(255,255,255,.2);-moz-box-shadow:-.2em -.2em .3em rgba(255,255,255,.2);box-shadow:-.2em -.2em .3em rgba(255,255,255,.2)}.vjs-default-skin .vjs-menu-button:hover .vjs-control-content .vjs-menu,.vjs-default-skin .vjs-control-content .vjs-menu.vjs-lock-showing{display:block}.vjs-default-skin .vjs-menu-button ul li{list-style:none;margin:0;padding:.3em 0;line-height:1.4em;font-size:1.2em;text-align:center;text-transform:lowercase}.vjs-default-skin .vjs-menu-button ul li.vjs-selected{background-color:#000}.vjs-default-skin .vjs-menu-button ul li:focus,.vjs-default-skin .vjs-menu-button ul li:hover,.vjs-default-skin .vjs-menu-button ul li.vjs-selected:focus,.vjs-default-skin .vjs-menu-button ul li.vjs-selected:hover{outline:0;color:#111;background-color:#fff;background-color:rgba(255,255,255,.75);-webkit-box-shadow:0 0 1em #fff;-moz-box-shadow:0 0 1em #fff;box-shadow:0 0 1em #fff}.vjs-default-skin .vjs-menu-button ul li.vjs-menu-title{text-align:center;text-transform:uppercase;font-size:1em;line-height:2em;padding:0;margin:0 0 .3em;font-weight:700;cursor:default}.vjs-default-skin .vjs-subtitles-button:before{content:"\e00c"}.vjs-default-skin .vjs-captions-button:before{content:"\e008"}.vjs-default-skin .vjs-chapters-button:before{content:"\e00c"}.vjs-default-skin .vjs-chapters-button.vjs-menu-button .vjs-menu .vjs-menu-content{width:24em;left:-12em}.vjs-default-skin .vjs-captions-button:focus .vjs-control-content:before,.vjs-default-skin .vjs-captions-button:hover .vjs-control-content:before{-webkit-box-shadow:0 0 1em #fff;-moz-box-shadow:0 0 1em #fff;box-shadow:0 0 1em #fff}.video-js{background-color:#000;position:relative;padding:0;font-size:10px;vertical-align:middle;font-weight:400;font-style:normal;font-family:Arial,sans-serif;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.video-js .vjs-tech{position:absolute;top:0;left:0;width:100%;height:100%}.video-js:-moz-full-screen{position:absolute}body.vjs-full-window{padding:0;margin:0;height:100%;overflow-y:auto}.video-js.vjs-fullscreen{position:fixed;overflow:hidden;z-index:1000;left:0;top:0;bottom:0;right:0;width:100%!important;height:100%!important;_position:absolute}.video-js:-webkit-full-screen{width:100%!important;height:100%!important}.video-js.vjs-fullscreen.vjs-user-inactive{cursor:none}.vjs-poster{background-repeat:no-repeat;background-position:50% 50%;background-size:contain;cursor:pointer;margin:0;padding:0;position:absolute;top:0;right:0;bottom:0;left:0}.vjs-poster img{display:block;margin:0 auto;max-height:100%;padding:0;width:100%}.video-js.vjs-using-native-controls .vjs-poster{display:none}.video-js .vjs-text-track-display{text-align:center;position:absolute;bottom:4em;left:1em;right:1em}.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display{bottom:1em}.video-js .vjs-text-track{display:none;font-size:1.4em;text-align:center;margin-bottom:.1em;background-color:#000;background-color:rgba(0,0,0,.5)}.video-js .vjs-subtitles{color:#fff}.video-js .vjs-captions{color:#fc6}.vjs-tt-cue{display:block}.video-js.vjs-fullscreen .vjs-text-track{font-size:3em}.vjs-default-skin .vjs-hidden{display:none}.vjs-lock-showing{display:block!important;opacity:1;visibility:visible}.vjs-no-js{padding:20px;color:#ccc;background-color:#333;font-size:18px;font-family:Arial,sans-serif;text-align:center;width:300px;height:150px;margin:0 auto}.vjs-no-js a,.vjs-no-js a:visited{color:#F4A460}
|
video-js/video-js.swf
CHANGED
Binary file
|
video-js/video-quality-selector-license.txt
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
The MIT License (MIT)
|
2 |
+
|
3 |
+
Copyright (c) 2013 Dominic
|
4 |
+
|
5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6 |
+
this software and associated documentation files (the "Software"), to deal in
|
7 |
+
the Software without restriction, including without limitation the rights to
|
8 |
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9 |
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
10 |
+
subject to the following conditions:
|
11 |
+
|
12 |
+
The above copyright notice and this permission notice shall be included in all
|
13 |
+
copies or substantial portions of the Software.
|
14 |
+
|
15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17 |
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18 |
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19 |
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20 |
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
video-js/video-quality-selector.js
ADDED
@@ -0,0 +1,383 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Video.js Resolution Selector
|
3 |
+
*
|
4 |
+
* This plugin for Video.js adds a resolution selector option
|
5 |
+
* to the toolbar. Usage:
|
6 |
+
*
|
7 |
+
* <video>
|
8 |
+
* <source data-res="480" src="..." />
|
9 |
+
* <source data-res="240" src="..." />
|
10 |
+
* </video>
|
11 |
+
*/
|
12 |
+
|
13 |
+
(function( _V_ ) {
|
14 |
+
|
15 |
+
/***********************************************************************************
|
16 |
+
* Define some helper functions
|
17 |
+
***********************************************************************************/
|
18 |
+
var methods = {
|
19 |
+
|
20 |
+
/**
|
21 |
+
* In a future version, this can be made more intelligent,
|
22 |
+
* but for now, we'll just add a "p" at the end if we are passed
|
23 |
+
* numbers.
|
24 |
+
*
|
25 |
+
* @param (string) res The resolution to make a label for
|
26 |
+
*
|
27 |
+
* @returns (string) The label text string
|
28 |
+
*/
|
29 |
+
res_label : function( res ) {
|
30 |
+
|
31 |
+
return ( /^\d+$/.test( res ) ) ? res + 'p' : res;
|
32 |
+
}
|
33 |
+
};
|
34 |
+
|
35 |
+
/***********************************************************************************
|
36 |
+
* Setup our resolution menu items
|
37 |
+
***********************************************************************************/
|
38 |
+
_V_.ResolutionMenuItem = _V_.MenuItem.extend({
|
39 |
+
|
40 |
+
// Call variable to prevent the resolution change from being called twice
|
41 |
+
call_count : 0,
|
42 |
+
|
43 |
+
/** @constructor */
|
44 |
+
init : function( player, options ){
|
45 |
+
|
46 |
+
var touchstart = false;
|
47 |
+
|
48 |
+
// Modify options for parent MenuItem class's init.
|
49 |
+
options.label = methods.res_label( options.res );
|
50 |
+
options.selected = ( options.res.toString() === player.getCurrentRes().toString() );
|
51 |
+
|
52 |
+
// Call the parent constructor
|
53 |
+
_V_.MenuItem.call( this, player, options );
|
54 |
+
|
55 |
+
// Store the resolution as a property
|
56 |
+
this.resolution = options.res;
|
57 |
+
|
58 |
+
// Register our click and tap handlers
|
59 |
+
this.on( ['click', 'tap'], this.onClick );
|
60 |
+
|
61 |
+
// Toggle the selected class whenever the resolution changes
|
62 |
+
player.on( 'changeRes', _V_.bind( this, function() {
|
63 |
+
|
64 |
+
if ( this.resolution == player.getCurrentRes() ) {
|
65 |
+
|
66 |
+
this.selected( true );
|
67 |
+
|
68 |
+
} else {
|
69 |
+
|
70 |
+
this.selected( false );
|
71 |
+
}
|
72 |
+
|
73 |
+
// Reset the call count
|
74 |
+
this.call_count = 0;
|
75 |
+
}));
|
76 |
+
}
|
77 |
+
});
|
78 |
+
|
79 |
+
// Handle clicks on the menu items
|
80 |
+
_V_.ResolutionMenuItem.prototype.onClick = function() {
|
81 |
+
|
82 |
+
// Check if this has already been called
|
83 |
+
if ( this.call_count > 0 ) { return; }
|
84 |
+
|
85 |
+
// Call the player.changeRes method
|
86 |
+
this.player().changeRes( this.resolution );
|
87 |
+
|
88 |
+
// Increment the call counter
|
89 |
+
this.call_count++;
|
90 |
+
};
|
91 |
+
|
92 |
+
/***********************************************************************************
|
93 |
+
* Setup our resolution menu title item
|
94 |
+
***********************************************************************************/
|
95 |
+
_V_.ResolutionTitleMenuItem = _V_.MenuItem.extend({
|
96 |
+
|
97 |
+
init : function( player, options ) {
|
98 |
+
|
99 |
+
// Call the parent constructor
|
100 |
+
_V_.MenuItem.call( this, player, options );
|
101 |
+
|
102 |
+
// No click handler for the menu title
|
103 |
+
this.off( 'click' );
|
104 |
+
}
|
105 |
+
});
|
106 |
+
|
107 |
+
/***********************************************************************************
|
108 |
+
* Define our resolution selector button
|
109 |
+
***********************************************************************************/
|
110 |
+
_V_.ResolutionSelector = _V_.MenuButton.extend({
|
111 |
+
|
112 |
+
/** @constructor */
|
113 |
+
init : function( player, options ) {
|
114 |
+
|
115 |
+
// Add our list of available resolutions to the player object
|
116 |
+
player.availableRes = options.available_res;
|
117 |
+
|
118 |
+
// Call the parent constructor
|
119 |
+
_V_.MenuButton.call( this, player, options );
|
120 |
+
|
121 |
+
// Set the button text based on the option provided
|
122 |
+
this.el().firstChild.firstChild.innerHTML = options.buttonText;
|
123 |
+
}
|
124 |
+
});
|
125 |
+
|
126 |
+
// Set class for resolution selector button
|
127 |
+
_V_.ResolutionSelector.prototype.className = 'vjs-res-button';
|
128 |
+
|
129 |
+
// Create a menu item for each available resolution
|
130 |
+
_V_.ResolutionSelector.prototype.createItems = function() {
|
131 |
+
|
132 |
+
var player = this.player(),
|
133 |
+
items = [],
|
134 |
+
current_res;
|
135 |
+
|
136 |
+
// Add the menu title item
|
137 |
+
items.push( new _V_.ResolutionTitleMenuItem( player, {
|
138 |
+
|
139 |
+
el : _V_.Component.prototype.createEl( 'li', {
|
140 |
+
|
141 |
+
className : 'vjs-menu-title vjs-res-menu-title',
|
142 |
+
innerHTML : 'Quality'
|
143 |
+
})
|
144 |
+
}));
|
145 |
+
|
146 |
+
// Add an item for each available resolution
|
147 |
+
for ( current_res in player.availableRes ) {
|
148 |
+
|
149 |
+
// Don't add an item for the length attribute
|
150 |
+
if ( 'length' == current_res ) { continue; }
|
151 |
+
|
152 |
+
items.push( new _V_.ResolutionMenuItem( player, {
|
153 |
+
res : current_res
|
154 |
+
}));
|
155 |
+
}
|
156 |
+
|
157 |
+
// Sort the available resolutions in descending order
|
158 |
+
items.sort(function( a, b ) {
|
159 |
+
|
160 |
+
if ( typeof a.resolution == 'undefined' ) {
|
161 |
+
|
162 |
+
return -1;
|
163 |
+
|
164 |
+
} else {
|
165 |
+
|
166 |
+
return parseInt( b.resolution ) - parseInt( a.resolution );
|
167 |
+
}
|
168 |
+
});
|
169 |
+
|
170 |
+
return items;
|
171 |
+
};
|
172 |
+
|
173 |
+
/***********************************************************************************
|
174 |
+
* Register the plugin with videojs, main plugin function
|
175 |
+
***********************************************************************************/
|
176 |
+
_V_.plugin( 'resolutionSelector', function( options ) {
|
177 |
+
|
178 |
+
// Only enable the plugin on HTML5 videos
|
179 |
+
if ( ! this.el().firstChild.canPlayType ) { return; }
|
180 |
+
if ( this.L != null && this.L.canPlayType('video/mp4') == "" ) { return; } //disables if the player can't play mp4
|
181 |
+
|
182 |
+
/*******************************************************************
|
183 |
+
* Setup variables, parse settings
|
184 |
+
*******************************************************************/
|
185 |
+
var player = this,
|
186 |
+
sources = player.options().sources,
|
187 |
+
i = sources.length,
|
188 |
+
j,
|
189 |
+
found_type,
|
190 |
+
|
191 |
+
// Override default options with those provided
|
192 |
+
settings = _V_.util.mergeOptions({
|
193 |
+
|
194 |
+
default_res : '', // (string) The resolution that should be selected by default ( '480' or '480,1080,240' )
|
195 |
+
force_types : false // (array) List of media types. If passed, we need to have source for each type in each resolution or that resolution will not be an option
|
196 |
+
|
197 |
+
}, options || {} ),
|
198 |
+
|
199 |
+
available_res = { length : 0 },
|
200 |
+
current_res,
|
201 |
+
resolutionSelector,
|
202 |
+
|
203 |
+
// Split default resolutions if set and valid, otherwise default to an empty array
|
204 |
+
default_resolutions = ( settings.default_res && typeof settings.default_res == 'string' ) ? settings.default_res.split( ',' ) : [];
|
205 |
+
|
206 |
+
// Get all of the available resoloutions
|
207 |
+
while ( i > 0 ) {
|
208 |
+
|
209 |
+
i--;
|
210 |
+
|
211 |
+
// Skip sources that don't have data-res attributes
|
212 |
+
if ( ! sources[i]['data-res'] ) { continue; }
|
213 |
+
|
214 |
+
current_res = sources[i]['data-res'];
|
215 |
+
|
216 |
+
if ( typeof available_res[current_res] !== 'object' ) {
|
217 |
+
|
218 |
+
available_res[current_res] = [];
|
219 |
+
available_res.length++;
|
220 |
+
}
|
221 |
+
|
222 |
+
available_res[current_res].push( sources[i] );
|
223 |
+
}
|
224 |
+
|
225 |
+
// Check for forced types
|
226 |
+
if ( settings.force_types ) {
|
227 |
+
|
228 |
+
// Loop through all available resoultions
|
229 |
+
for ( current_res in available_res ) {
|
230 |
+
|
231 |
+
// Don't count the length property as a resolution
|
232 |
+
if ( 'length' == current_res ) { continue; }
|
233 |
+
|
234 |
+
i = settings.force_types.length;
|
235 |
+
found_types = 0;
|
236 |
+
|
237 |
+
// Loop through all required types
|
238 |
+
while ( i > 0 ) {
|
239 |
+
|
240 |
+
i--;
|
241 |
+
|
242 |
+
j = available_res[current_res].length;
|
243 |
+
|
244 |
+
// Loop through all available sources in current resolution
|
245 |
+
while ( j > 0 ) {
|
246 |
+
|
247 |
+
j--;
|
248 |
+
|
249 |
+
// Check if the current source matches the current type we're checking
|
250 |
+
if ( settings.force_types[i] === available_res[current_res][j].type ) {
|
251 |
+
|
252 |
+
found_types++;
|
253 |
+
break;
|
254 |
+
}
|
255 |
+
}
|
256 |
+
}
|
257 |
+
|
258 |
+
// If we didn't find sources for all of the required types in the current res, remove it
|
259 |
+
if ( found_types < settings.force_types.length ) {
|
260 |
+
|
261 |
+
delete available_res[current_res];
|
262 |
+
available_res.length--;
|
263 |
+
}
|
264 |
+
}
|
265 |
+
}
|
266 |
+
|
267 |
+
// Make sure we have at least 2 available resolutions before we add the button
|
268 |
+
if ( available_res.length < 2 ) { return; }
|
269 |
+
|
270 |
+
// Loop through the choosen default resolutions if there were any
|
271 |
+
for ( i = 0; i < default_resolutions.length; i++ ) {
|
272 |
+
|
273 |
+
// Set the video to start out with the first available default res
|
274 |
+
if ( available_res[default_resolutions[i]] ) {
|
275 |
+
|
276 |
+
player.src( available_res[default_resolutions[i]] );
|
277 |
+
player.currentRes = default_resolutions[i];
|
278 |
+
break;
|
279 |
+
}
|
280 |
+
}
|
281 |
+
|
282 |
+
/*******************************************************************
|
283 |
+
* Add methods to player object
|
284 |
+
*******************************************************************/
|
285 |
+
|
286 |
+
// Helper function to get the current resolution
|
287 |
+
player.getCurrentRes = function() {
|
288 |
+
|
289 |
+
if ( typeof player.currentRes !== 'undefined' ) {
|
290 |
+
|
291 |
+
return player.currentRes;
|
292 |
+
|
293 |
+
} else {
|
294 |
+
|
295 |
+
try {
|
296 |
+
|
297 |
+
return res = player.options().sources[0]['data-res'];
|
298 |
+
|
299 |
+
} catch(e) {
|
300 |
+
|
301 |
+
return '';
|
302 |
+
}
|
303 |
+
}
|
304 |
+
};
|
305 |
+
|
306 |
+
// Define the change res method
|
307 |
+
player.changeRes = function( target_resolution ) {
|
308 |
+
|
309 |
+
var video_el = player.el().firstChild,
|
310 |
+
is_paused = player.paused(),
|
311 |
+
current_time = player.currentTime(),
|
312 |
+
button_nodes,
|
313 |
+
button_node_count;
|
314 |
+
|
315 |
+
// Do nothing if we aren't changing resolutions or if the resolution isn't defined
|
316 |
+
if ( player.getCurrentRes() == target_resolution
|
317 |
+
|| ! player.availableRes
|
318 |
+
|| ! player.availableRes[target_resolution] ) { return; }
|
319 |
+
|
320 |
+
// Make sure the loadedmetadata event will fire
|
321 |
+
if ( 'none' == video_el.preload ) { video_el.preload = 'metadata'; }
|
322 |
+
|
323 |
+
// Change the source and make sure we don't start the video over
|
324 |
+
player.src( player.availableRes[target_resolution] ).one( 'loadedmetadata', function() {
|
325 |
+
|
326 |
+
player.currentTime( current_time );
|
327 |
+
|
328 |
+
if ( player.currentTime() == 0 && current_time != 0 ) {
|
329 |
+
player.addClass( 'vjs-has-started' );
|
330 |
+
player.one( 'loadeddata', function() { player.currentTime( current_time ); } );
|
331 |
+
}
|
332 |
+
if ( current_time != 0 ) { player.addClass( 'vjs-has-started' ); } // If the video was paused, don't show the big play button
|
333 |
+
|
334 |
+
if ( ! is_paused ) { player.play(); }
|
335 |
+
|
336 |
+
});
|
337 |
+
|
338 |
+
// Save the newly selected resolution in our player options property
|
339 |
+
player.currentRes = target_resolution;
|
340 |
+
|
341 |
+
// Make sure the button has been added to the control bar
|
342 |
+
if ( player.controlBar.resolutionSelector ) {
|
343 |
+
|
344 |
+
button_nodes = player.controlBar.resolutionSelector.el().firstChild.children;
|
345 |
+
button_node_count = button_nodes.length;
|
346 |
+
|
347 |
+
// Update the button text
|
348 |
+
while ( button_node_count > 0 ) {
|
349 |
+
|
350 |
+
button_node_count--;
|
351 |
+
|
352 |
+
if ( 'vjs-control-text' == button_nodes[button_node_count].className ) {
|
353 |
+
|
354 |
+
button_nodes[button_node_count].innerHTML = methods.res_label( target_resolution );
|
355 |
+
break;
|
356 |
+
}
|
357 |
+
}
|
358 |
+
}
|
359 |
+
|
360 |
+
// Update the classes to reflect the currently selected resolution
|
361 |
+
player.trigger( 'changeRes' );
|
362 |
+
};
|
363 |
+
|
364 |
+
/*******************************************************************
|
365 |
+
* Add the resolution selector button
|
366 |
+
*******************************************************************/
|
367 |
+
|
368 |
+
// Get the starting resolution
|
369 |
+
current_res = player.getCurrentRes();
|
370 |
+
|
371 |
+
if ( current_res ) { current_res = methods.res_label( current_res ); }
|
372 |
+
|
373 |
+
// Add the resolution selector button
|
374 |
+
resolutionSelector = new _V_.ResolutionSelector( player, {
|
375 |
+
buttonText : ( current_res || 'Quality' ),
|
376 |
+
available_res : available_res
|
377 |
+
});
|
378 |
+
|
379 |
+
// Add the button to the control bar object and the DOM
|
380 |
+
player.controlBar.resolutionSelector = player.controlBar.addChild( resolutionSelector );
|
381 |
+
});
|
382 |
+
|
383 |
+
})( videojs );
|
video-js/video.js
CHANGED
@@ -1,157 +1,163 @@
|
|
1 |
-
/*! Video.js v4.
|
2 |
-
(function() {var b=void 0,f=!0,
|
3 |
-
var videojs=window.videojs=t;t.Ub="4.
|
4 |
-
t.options={techOrder:["html5","flash"],html5:{},flash:{},width:300,height:150,defaultVolume:0,playbackRates:[],inactivityTimeout:2E3,children:{mediaLoader:{},posterImage:{},textTrackDisplay:{},loadingSpinner:{},bigPlayButton:{},controlBar:{},errorDisplay:{}},language:document.getElementsByTagName("html")[0].getAttribute("lang")||navigator.languages&&navigator.languages[0]||navigator.
|
5 |
-
"GENERATED_CDN_VSN"!==t.Ub&&(videojs.options.flash.swf=t.
|
6 |
-
t.qa.extend=function(a){var c,d;a=a||{};c=a.init||a.i||this.prototype.init||this.prototype.i||m();d=function(){c.apply(this,arguments)};d.prototype=t.
|
7 |
-
t.d=function(a,c,d){if(t.
|
8 |
-
t.o=function(a,c,d){if(t.
|
9 |
-
t.
|
10 |
-
e.stopPropagation();a.cancelBubble=f;a.Ib=c};a.Ib=d;a.stopImmediatePropagation=function(){e.stopImmediatePropagation&&e.stopImmediatePropagation();a.
|
11 |
-
4?1:a.button&2?2:0)}return a};t.
|
12 |
-
t.
|
13 |
-
t.
|
14 |
-
t.
|
15 |
-
t.
|
16 |
-
t.p=function(a,c){var d,e;if(
|
17 |
-
A?(B=A[1]&&parseFloat(A[1]),C=A[2]&&parseFloat(A[2]),z=B&&C?parseFloat(A[1]+"."+A[2]):B?B:
|
18 |
-
t.za=function(a){var c,d,e,g;c={};if(a&&a.attributes&&0<a.attributes.length){d=a.attributes;for(var h=d.length-1;0<=h;h--){e=d[h].name;g=d[h].value;if("boolean"===typeof a[e]||-1!==",autoplay,controls,loop,muted,default,".indexOf(","+e+","))g=g!==
|
19 |
-
t.
|
20 |
-
t.ya=function(a,c){c=c||a;var d=Math.floor(a%60),e=Math.floor(a/60%60),g=Math.floor(a/3600),h=Math.floor(c/60%60),
|
21 |
t.zb=function(a,c){return{length:1,start:function(){return a},end:function(){return c}}};
|
22 |
-
t.get=function(a,c,d,e){var g,h,
|
23 |
-
h)?(h=new window.XDomainRequest,h.onload=function(){c(h.responseText)},h.onerror=d,h.onprogress=m(),h.ontimeout=d):(g="file:"==
|
24 |
-
t.
|
25 |
-
t.
|
26 |
-
function D(a,c){var d,e;d=Array.prototype.slice.call(c);e=m();e=window.console||{log:e,warn:e,error:e};a?d.unshift(a.toUpperCase()+":"):a="log";t.log.history.push(d);d.unshift("VIDEOJS:");if(e[a].apply)e[a].apply(e,d);else e[a](d.join(" "))}t.log=function(){D(
|
27 |
-
t.
|
28 |
-
t.ga.Va=function(a,c){var d,e,g;a=t.
|
29 |
-
t.a=t.qa.extend({i:function(a,c,d){this.c=a;this.
|
30 |
-
s.dispose=function(){this.
|
31 |
-
s.ja=function(){return this.u||this.b};s.id=p("
|
32 |
-
s.removeChild=function(a){"string"===typeof a&&(a=this.ka(a));if(a&&this.
|
33 |
-
s.d=function(a,c){t.d(this.b,a,t.bind(this,c));return this};s.o=function(a,c){t.o(this.b,a,c);return this};s.
|
34 |
-
s.p=function(a){t.p(this.b,a);return this};s.show=function(){this.b.style.display="block";return this};s.
|
35 |
-
function F(a,c,d,e){if(d!==b){if(d===
|
36 |
-
function G(a){var c,d,e,g,h,
|
37 |
t.t=t.a.extend({i:function(a,c){t.a.call(this,a,c);G(this);this.d("tap",this.r);this.d("click",this.r);this.d("focus",this.Ya);this.d("blur",this.Xa)}});s=t.t.prototype;
|
38 |
-
s.e=function(a,c){var d;c=t.
|
39 |
-
s.
|
40 |
-
t.
|
41 |
-
s.e=function(a,c){c=c||{};c.className+=" vjs-slider";c=t.
|
42 |
-
s.
|
43 |
-
function
|
44 |
-
|
45 |
-
|
46 |
-
t
|
47 |
-
t.
|
48 |
-
|
49 |
-
s.
|
50 |
-
|
51 |
-
t.D.
|
|
|
52 |
var L,M,N,O;
|
53 |
L=["requestFullscreen exitFullscreen fullscreenElement fullscreenEnabled fullscreenchange fullscreenerror".split(" "),"webkitRequestFullscreen webkitExitFullscreen webkitFullscreenElement webkitFullscreenEnabled webkitfullscreenchange webkitfullscreenerror".split(" "),"webkitRequestFullScreen webkitCancelFullScreen webkitCurrentFullScreenElement webkitCancelFullScreen webkitfullscreenchange webkitfullscreenerror".split(" "),"mozRequestFullScreen mozCancelFullScreen mozFullScreenElement mozFullScreenEnabled mozfullscreenchange mozfullscreenerror".split(" "),"msRequestFullscreen msExitFullscreen msFullscreenElement msFullscreenEnabled MSFullscreenChange MSFullscreenError".split(" ")];
|
54 |
M=L[0];for(O=0;O<L.length;O++)if(L[O][1]in document){N=L[O];break}if(N){t.Oa.Eb={};for(O=0;O<N.length;O++)t.Oa.Eb[M[O]]=N[O]}
|
55 |
-
t.Player=t.a.extend({i:function(a,c,d){this.
|
56 |
-
function(){e();clearInterval(g);g=setInterval(e,250)});this.d("mousemove",function(a){if(a.screenX!=n||a.screenY!=
|
57 |
-
s=t.Player.prototype;s.language=function(a){if(a===b)return this.Ua;this.Ua=a;return this};s.languages=p("
|
58 |
-
function da(a){var c={sources:[],tracks:[]};t.
|
59 |
-
s.e=function(){var a=this.b=t.a.prototype.e.call(this,"div"),c=this.
|
60 |
-
c.parentNode.insertBefore(a,c);t.Gb(c,a);this.b=a;this.d("loadstart",this.
|
61 |
-
function
|
62 |
-
function
|
63 |
-
s.
|
64 |
-
function
|
65 |
-
s.currentTime=function(a){return a!==b?(
|
66 |
-
s.bufferedPercent=function(){var a=this.duration(),c=this.buffered(),d=0,e,g;if(!a)return 0;for(var h=0;h<c.length;h++)e=c.start(h),g=c.end(h),g>a&&(g=a),d+=g-e;return d/a};s.volume=function(a){if(a!==b)return a=Math.max(0,Math.min(1,parseFloat(a))),this.
|
67 |
-
s.isFullscreen=function(a){return a!==b?(this.
|
68 |
-
s.
|
69 |
-
s.
|
70 |
-
s.
|
71 |
-
s.
|
72 |
-
function
|
73 |
-
|
74 |
-
s.
|
75 |
-
s.
|
76 |
-
s.
|
77 |
-
s.
|
|
|
78 |
t.Xb=t.a.extend({i:function(a,c){t.a.call(this,a,c)}});t.Xb.prototype.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-live-controls vjs-control"});this.u=t.e("div",{className:"vjs-live-display",innerHTML:'<span class="vjs-control-text">'+this.s("Stream Type")+"</span>"+this.s("LIVE"),"aria-live":"off"});a.appendChild(this.u);return a};t.$b=t.t.extend({i:function(a,c){t.t.call(this,a,c);a.d("play",t.bind(this,this.Nb));a.d("pause",t.bind(this,this.Mb))}});s=t.$b.prototype;s.ta="Play";
|
79 |
-
s.
|
80 |
-
t.hb.prototype.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-current-time vjs-time-controls vjs-control"});this.u=t.e("div",{className:"vjs-current-time-display",innerHTML:'<span class="vjs-control-text">Current Time </span>0:00',"aria-live":"off"});a.appendChild(this.u);return a};t.hb.prototype.fa=function(){var a=this.c.bb?this.c.
|
81 |
t.ib=t.a.extend({i:function(a,c){t.a.call(this,a,c);a.d("timeupdate",t.bind(this,this.fa))}});t.ib.prototype.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-duration vjs-time-controls vjs-control"});this.u=t.e("div",{className:"vjs-duration-display",innerHTML:'<span class="vjs-control-text">'+this.s("Duration Time")+"</span> 0:00","aria-live":"off"});a.appendChild(this.u);return a};
|
82 |
t.ib.prototype.fa=function(){var a=this.c.duration();a&&(this.u.innerHTML='<span class="vjs-control-text">'+this.s("Duration Time")+"</span> "+t.ya(a))};t.fc=t.a.extend({i:function(a,c){t.a.call(this,a,c)}});t.fc.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-time-divider",innerHTML:"<div><span>/</span></div>"})};t.pb=t.a.extend({i:function(a,c){t.a.call(this,a,c);a.d("timeupdate",t.bind(this,this.fa))}});
|
83 |
t.pb.prototype.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-remaining-time vjs-time-controls vjs-control"});this.u=t.e("div",{className:"vjs-remaining-time-display",innerHTML:'<span class="vjs-control-text">'+this.s("Remaining Time")+"</span> -0:00","aria-live":"off"});a.appendChild(this.u);return a};t.pb.prototype.fa=function(){this.c.duration()&&(this.u.innerHTML='<span class="vjs-control-text">'+this.s("Remaining Time")+"</span> -"+t.ya(this.c.remainingTime()))};
|
84 |
-
t.Ja=t.t.extend({i:function(a,c){t.t.call(this,a,c)}});t.Ja.prototype.ta="Fullscreen";t.Ja.prototype.
|
85 |
-
t.ob.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-progress-control vjs-control"})};t.bc=t.
|
86 |
-
s.oa=function(){var a=this.c.bb?this.c.
|
87 |
-
s.Lb=function(a){t.
|
88 |
-
t.lb.prototype.update=function(){var a,c,d,e,g=this.c.buffered();a=this.c.duration();var h,
|
89 |
-
t.Zb.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-play-progress",innerHTML:'<span class="vjs-control-text"><span>'+this.s("Progress")+"</span>: 0%</span>"})};t.La=t
|
90 |
-
t.La.prototype.fa=function(){var a=this.c.bb?this.c.
|
91 |
-
t.rb.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-volume-control vjs-control"})};t.qb=t.
|
92 |
-
s.
|
93 |
-
t.gc.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-volume-level",innerHTML:'<span class="vjs-control-text"></span>'})};t.sb=t
|
94 |
-
t.ia=t.t.extend({i:function(a,c){t.t.call(this,a,c);a.d("volumechange",t.bind(this,this.update));a.
|
95 |
-
t.ia.prototype.r=function(){this.c.muted(this.c.muted()?l:f)};t.ia.prototype.update=function(){var a=this.c.volume(),c=3;0===a||this.c.muted()?c=0:0.33>a?c=1:0.67>a&&(c=2);this.c.muted()?this.b.children[0].children[0].innerHTML!=this.s("Unmute")&&(this.b.children[0].children[0].innerHTML=this.s("Unmute")):this.b.children[0].children[0].innerHTML!=this.s("Mute")&&(this.b.children[0].children[0].innerHTML=this.s("Mute"));for(a=0;4>a;a++)t.p(this.b,"vjs-vol-"+a);t.
|
96 |
-
t.ra=t.
|
97 |
-
t.ra.prototype.e=function(){return t.t.prototype.e.call(this,"div",{className:"vjs-volume-menu-button vjs-menu-button vjs-control",innerHTML:'<div><span class="vjs-control-text">'+this.s("Mute")+"</span></div>"})};t.ra.prototype.update=t.ia.prototype.update;t.ac=t.
|
98 |
-
s.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-playback-rate vjs-menu-button vjs-control",innerHTML:'<div class="vjs-control-content"><span class="vjs-control-text">'+this.s("Playback Rate")+"</span></div>"});this.
|
99 |
-
s.oa=function(){this.v().setAttribute("aria-valuenow",this.j().playbackRate())};s.r=function(){for(var a=this.j().playbackRate(),c=this.j().options().playbackRates,d=c[0],e=0;e<c.length;e++)if(c[e]>a){d=c[e];break}this.j().playbackRate(d)};function
|
100 |
-
s.
|
101 |
-
t.Ka=t.t.extend({i:function(a,c){t.t.call(this,a,c);a.poster()&&this.src(a.poster());(!a.poster()||!a.controls())&&this.
|
102 |
-
t.Ka.prototype.r=function(){this.j().controls()&&this.c.play()};t.Yb=t.a.extend({i:function(a,c){t.a.call(this,a,c)}});t.Yb.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-loading-spinner"})};t.fb=t.t.extend();
|
103 |
-
t.jb=t.a.extend({i:function(a,c){t.a.call(this,a,c);this.update();a.d("error",t.bind(this,this.update))}});t.jb.prototype.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-error-display"});this.u=t.e("div");a.appendChild(this.u);return a};
|
104 |
-
t.
|
105 |
-
|
106 |
-
|
107 |
-
s.
|
|
|
108 |
t.q.prototype.featuresProgressEvents=l;t.q.prototype.featuresTimeupdateEvents=l;t.media={};
|
109 |
-
t.
|
110 |
-
l};g.d("controlsenabled",h);g.d("controlsdisabled",
|
111 |
-
s.e=function(){var a=this.c,c=a.
|
112 |
-
s.pause=function(){this.b.pause()};s.paused=function(){return this.b.paused};s.currentTime=function(){return this.b.currentTime};s.Pb=function(a){try{this.b.currentTime=a}catch(c){t.log(c,"Video is not ready. (Video.js)")}};s.duration=function(){return this.b.duration||0};s.buffered=function(){return this.b.buffered};s.volume=function(){return this.b.volume};s.
|
113 |
-
s.height=function(){return this.b.offsetHeight};s.Da=function(){return"function"==typeof this.b.webkitEnterFullScreen&&(/Android/.test(t.
|
114 |
-
s.
|
115 |
-
s
|
116 |
-
|
117 |
-
t.
|
118 |
-
t.
|
119 |
-
|
120 |
-
t.f.
|
121 |
-
t.f.
|
122 |
-
t.f.prototype.
|
123 |
-
|
124 |
-
t.f.
|
|
|
|
|
125 |
t.f.onError=function(a,c){var d=t.v(a).player,e="FLASH: "+c;"srcnotfound"==c?d.error({code:4,message:e}):d.error(e)};t.f.version=function(){var a="0,0,0";try{a=(new window.ActiveXObject("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version").replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}catch(c){try{navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin&&(a=(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1])}catch(d){}}return a.split(",")};
|
126 |
-
t.f.
|
127 |
-
t.f.
|
128 |
-
t.f.
|
129 |
-
t.
|
130 |
-
function
|
131 |
-
t.B=t.a.extend({i:function(a,c){t.a.call(this,a,c);this.
|
132 |
-
s.
|
133 |
-
|
134 |
-
s.
|
135 |
-
function
|
136 |
-
s.update=function(){if(0<this.
|
137 |
-
|
138 |
-
t.ec=t.a.extend({i:function(a,c,d){t.a.call(this,a,c,d);if(a.
|
139 |
-
t
|
140 |
-
t.mb.prototype.update=function(){for(var a=this.c.textTracks(),c=0,d=a.length,e,g=f;c<d;c++)e=a[c],e.
|
141 |
-
t.Ga=t.
|
142 |
-
t.Ha=t.
|
143 |
-
s.wa=function(){for(var a=this.c.textTracks(),c=0,d=a.length,e,g,h=this.
|
144 |
-
t.gb=t.
|
145 |
-
t.
|
146 |
-
if("undefined"!==typeof window.JSON&&"function"===window.JSON.parse)t.JSON=window.JSON;else{t.JSON={};var Z=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;t.JSON.parse=function(a,c){function d(a,e){var
|
147 |
if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof c?d({"":e},""):e;throw new SyntaxError("JSON.parse(): invalid or malformed JSON data");}}
|
148 |
-
t.ic=function(){var a,c,d=document.getElementsByTagName("video");if(
|
149 |
-
t.
|
150 |
-
t.a.prototype.
|
151 |
-
t.
|
152 |
-
|
153 |
-
|
154 |
-
$("videojs.
|
155 |
-
|
156 |
-
t.
|
157 |
-
|
|
1 |
+
/*! Video.js v4.9.1 Copyright 2014 Brightcove, Inc. https://github.com/videojs/video.js/blob/master/LICENSE */
|
2 |
+
(function() {var b=void 0,f=!0,j=null,l=!1;function m(){return function(){}}function p(a){return function(){return this[a]}}function q(a){return function(){return a}}var s;document.createElement("video");document.createElement("audio");document.createElement("track");function t(a,c,d){if("string"===typeof a){0===a.indexOf("#")&&(a=a.slice(1));if(t.Ba[a])return t.Ba[a];a=t.v(a)}if(!a||!a.nodeName)throw new TypeError("The element or ID supplied is not valid. (videojs)");return a.player||new t.Player(a,c,d)}
|
3 |
+
var videojs=window.videojs=t;t.Ub="4.9";t.Uc="https:"==document.location.protocol?"https://":"http://";
|
4 |
+
t.options={techOrder:["html5","flash"],html5:{},flash:{},width:300,height:150,defaultVolume:0,playbackRates:[],inactivityTimeout:2E3,children:{mediaLoader:{},posterImage:{},textTrackDisplay:{},loadingSpinner:{},bigPlayButton:{},controlBar:{},errorDisplay:{}},language:document.getElementsByTagName("html")[0].getAttribute("lang")||navigator.languages&&navigator.languages[0]||navigator.we||navigator.language||"en",languages:{},notSupportedMessage:"No compatible source was found for this video."};
|
5 |
+
"GENERATED_CDN_VSN"!==t.Ub&&(videojs.options.flash.swf=t.Uc+"vjs.zencdn.net/"+t.Ub+"/video-js.swf");t.fd=function(a,c){t.options.languages[a]=t.options.languages[a]!==b?t.ga.Va(t.options.languages[a],c):c;return t.options.languages};t.Ba={};"function"===typeof define&&define.amd?define([],function(){return videojs}):"object"===typeof exports&&"object"===typeof module&&(module.exports=videojs);t.qa=t.CoreObject=m();
|
6 |
+
t.qa.extend=function(a){var c,d;a=a||{};c=a.init||a.i||this.prototype.init||this.prototype.i||m();d=function(){c.apply(this,arguments)};d.prototype=t.g.create(this.prototype);d.prototype.constructor=d;d.extend=t.qa.extend;d.create=t.qa.create;for(var e in a)a.hasOwnProperty(e)&&(d.prototype[e]=a[e]);return d};t.qa.create=function(){var a=t.g.create(this.prototype);this.apply(a,arguments);return a};
|
7 |
+
t.d=function(a,c,d){if(t.g.isArray(c))return u(t.d,a,c,d);var e=t.getData(a);e.C||(e.C={});e.C[c]||(e.C[c]=[]);d.w||(d.w=t.w++);e.C[c].push(d);e.X||(e.disabled=l,e.X=function(c){if(!e.disabled){c=t.qc(c);var d=e.C[c.type];if(d)for(var d=d.slice(0),k=0,n=d.length;k<n&&!c.yc();k++)d[k].call(a,c)}});1==e.C[c].length&&(a.addEventListener?a.addEventListener(c,e.X,l):a.attachEvent&&a.attachEvent("on"+c,e.X))};
|
8 |
+
t.o=function(a,c,d){if(t.tc(a)){var e=t.getData(a);if(e.C){if(t.g.isArray(c))return u(t.o,a,c,d);if(c){var g=e.C[c];if(g){if(d){if(d.w)for(e=0;e<g.length;e++)g[e].w===d.w&&g.splice(e--,1)}else e.C[c]=[];t.jc(a,c)}}else for(g in e.C)c=g,e.C[c]=[],t.jc(a,c)}}};t.jc=function(a,c){var d=t.getData(a);0===d.C[c].length&&(delete d.C[c],a.removeEventListener?a.removeEventListener(c,d.X,l):a.detachEvent&&a.detachEvent("on"+c,d.X));t.Hb(d.C)&&(delete d.C,delete d.X,delete d.disabled);t.Hb(d)&&t.Hc(a)};
|
9 |
+
t.qc=function(a){function c(){return f}function d(){return l}if(!a||!a.Ib){var e=a||window.event;a={};for(var g in e)"layerX"!==g&&("layerY"!==g&&"keyboardEvent.keyLocation"!==g)&&("returnValue"==g&&e.preventDefault||(a[g]=e[g]));a.target||(a.target=a.srcElement||document);a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;a.preventDefault=function(){e.preventDefault&&e.preventDefault();a.returnValue=l;a.zd=c;a.defaultPrevented=f};a.zd=d;a.defaultPrevented=l;a.stopPropagation=function(){e.stopPropagation&&
|
10 |
+
e.stopPropagation();a.cancelBubble=f;a.Ib=c};a.Ib=d;a.stopImmediatePropagation=function(){e.stopImmediatePropagation&&e.stopImmediatePropagation();a.yc=c;a.stopPropagation()};a.yc=d;if(a.clientX!=j){g=document.documentElement;var h=document.body;a.pageX=a.clientX+(g&&g.scrollLeft||h&&h.scrollLeft||0)-(g&&g.clientLeft||h&&h.clientLeft||0);a.pageY=a.clientY+(g&&g.scrollTop||h&&h.scrollTop||0)-(g&&g.clientTop||h&&h.clientTop||0)}a.which=a.charCode||a.keyCode;a.button!=j&&(a.button=a.button&1?0:a.button&
|
11 |
+
4?1:a.button&2?2:0)}return a};t.k=function(a,c){var d=t.tc(a)?t.getData(a):{},e=a.parentNode||a.ownerDocument;"string"===typeof c&&(c={type:c,target:a});c=t.qc(c);d.X&&d.X.call(a,c);if(e&&!c.Ib()&&c.bubbles!==l)t.k(e,c);else if(!e&&!c.defaultPrevented&&(d=t.getData(c.target),c.target[c.type])){d.disabled=f;if("function"===typeof c.target[c.type])c.target[c.type]();d.disabled=l}return!c.defaultPrevented};
|
12 |
+
t.Q=function(a,c,d){function e(){t.o(a,c,e);d.apply(this,arguments)}if(t.g.isArray(c))return u(t.Q,a,c,d);e.w=d.w=d.w||t.w++;t.d(a,c,e)};function u(a,c,d,e){t.hc.forEach(d,function(d){a(c,d,e)})}var v=Object.prototype.hasOwnProperty;t.e=function(a,c){var d;c=c||{};d=document.createElement(a||"div");t.g.Y(c,function(a,c){-1!==a.indexOf("aria-")||"role"==a?d.setAttribute(a,c):d[a]=c});return d};t.ba=function(a){return a.charAt(0).toUpperCase()+a.slice(1)};t.g={};
|
13 |
+
t.g.create=Object.create||function(a){function c(){}c.prototype=a;return new c};t.g.Y=function(a,c,d){for(var e in a)v.call(a,e)&&c.call(d||this,e,a[e])};t.g.z=function(a,c){if(!c)return a;for(var d in c)v.call(c,d)&&(a[d]=c[d]);return a};t.g.od=function(a,c){var d,e,g;a=t.g.copy(a);for(d in c)v.call(c,d)&&(e=a[d],g=c[d],a[d]=t.g.Ta(e)&&t.g.Ta(g)?t.g.od(e,g):c[d]);return a};t.g.copy=function(a){return t.g.z({},a)};
|
14 |
+
t.g.Ta=function(a){return!!a&&"object"===typeof a&&"[object Object]"===a.toString()&&a.constructor===Object};t.g.isArray=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)};t.Bd=function(a){return a!==a};t.bind=function(a,c,d){function e(){return c.apply(a,arguments)}c.w||(c.w=t.w++);e.w=d?d+"_"+c.w:c.w;return e};t.ua={};t.w=1;t.expando="vdata"+(new Date).getTime();t.getData=function(a){var c=a[t.expando];c||(c=a[t.expando]=t.w++,t.ua[c]={});return t.ua[c]};
|
15 |
+
t.tc=function(a){a=a[t.expando];return!(!a||t.Hb(t.ua[a]))};t.Hc=function(a){var c=a[t.expando];if(c){delete t.ua[c];try{delete a[t.expando]}catch(d){a.removeAttribute?a.removeAttribute(t.expando):a[t.expando]=j}}};t.Hb=function(a){for(var c in a)if(a[c]!==j)return l;return f};t.Sa=function(a,c){return-1!==(" "+a.className+" ").indexOf(" "+c+" ")};t.m=function(a,c){t.Sa(a,c)||(a.className=""===a.className?c:a.className+" "+c)};
|
16 |
+
t.p=function(a,c){var d,e;if(t.Sa(a,c)){d=a.className.split(" ");for(e=d.length-1;0<=e;e--)d[e]===c&&d.splice(e,1);a.className=d.join(" ")}};t.A=t.e("video");t.N=navigator.userAgent;t.$c=/iPhone/i.test(t.N);t.Zc=/iPad/i.test(t.N);t.ad=/iPod/i.test(t.N);t.Yc=t.$c||t.Zc||t.ad;var aa=t,x;var y=t.N.match(/OS (\d+)_/i);x=y&&y[1]?y[1]:b;aa.le=x;t.Wc=/Android/i.test(t.N);var ba=t,z;var A=t.N.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i),B,C;
|
17 |
+
A?(B=A[1]&&parseFloat(A[1]),C=A[2]&&parseFloat(A[2]),z=B&&C?parseFloat(A[1]+"."+A[2]):B?B:j):z=j;ba.Tb=z;t.bd=t.Wc&&/webkit/i.test(t.N)&&2.3>t.Tb;t.Xc=/Firefox/i.test(t.N);t.me=/Chrome/i.test(t.N);t.dc=!!("ontouchstart"in window||window.Vc&&document instanceof window.Vc);t.Jc=function(a,c){t.g.Y(c,function(c,e){e===j||"undefined"===typeof e||e===l?a.removeAttribute(c):a.setAttribute(c,e===f?"":e)})};
|
18 |
+
t.za=function(a){var c,d,e,g;c={};if(a&&a.attributes&&0<a.attributes.length){d=a.attributes;for(var h=d.length-1;0<=h;h--){e=d[h].name;g=d[h].value;if("boolean"===typeof a[e]||-1!==",autoplay,controls,loop,muted,default,".indexOf(","+e+","))g=g!==j?f:l;c[e]=g}}return c};
|
19 |
+
t.se=function(a,c){var d="";document.defaultView&&document.defaultView.getComputedStyle?d=document.defaultView.getComputedStyle(a,"").getPropertyValue(c):a.currentStyle&&(d=a["client"+c.substr(0,1).toUpperCase()+c.substr(1)]+"px");return d};t.Gb=function(a,c){c.firstChild?c.insertBefore(a,c.firstChild):c.appendChild(a)};t.Oa={};t.v=function(a){0===a.indexOf("#")&&(a=a.slice(1));return document.getElementById(a)};
|
20 |
+
t.ya=function(a,c){c=c||a;var d=Math.floor(a%60),e=Math.floor(a/60%60),g=Math.floor(a/3600),h=Math.floor(c/60%60),k=Math.floor(c/3600);if(isNaN(a)||Infinity===a)g=e=d="-";g=0<g||0<k?g+":":"";return g+(((g||10<=h)&&10>e?"0"+e:e)+":")+(10>d?"0"+d:d)};t.hd=function(){document.body.focus();document.onselectstart=q(l)};t.he=function(){document.onselectstart=q(f)};t.trim=function(a){return(a+"").replace(/^\s+|\s+$/g,"")};t.round=function(a,c){c||(c=0);return Math.round(a*Math.pow(10,c))/Math.pow(10,c)};
|
21 |
t.zb=function(a,c){return{length:1,start:function(){return a},end:function(){return c}}};
|
22 |
+
t.get=function(a,c,d,e){var g,h,k,n;d=d||m();"undefined"===typeof XMLHttpRequest&&(window.XMLHttpRequest=function(){try{return new window.ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new window.ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(c){}try{return new window.ActiveXObject("Msxml2.XMLHTTP")}catch(d){}throw Error("This browser does not support XMLHttpRequest.");});h=new XMLHttpRequest;k=t.Ud(a);n=window.location;k.protocol+k.host!==n.protocol+n.host&&window.XDomainRequest&&!("withCredentials"in
|
23 |
+
h)?(h=new window.XDomainRequest,h.onload=function(){c(h.responseText)},h.onerror=d,h.onprogress=m(),h.ontimeout=d):(g="file:"==k.protocol||"file:"==n.protocol,h.onreadystatechange=function(){4===h.readyState&&(200===h.status||g&&0===h.status?c(h.responseText):d(h.responseText))});try{h.open("GET",a,f),e&&(h.withCredentials=f)}catch(r){d(r);return}try{h.send()}catch(w){d(w)}};
|
24 |
+
t.Yd=function(a){try{var c=window.localStorage||l;c&&(c.volume=a)}catch(d){22==d.code||1014==d.code?t.log("LocalStorage Full (VideoJS)",d):18==d.code?t.log("LocalStorage not allowed (VideoJS)",d):t.log("LocalStorage Error (VideoJS)",d)}};t.sc=function(a){a.match(/^https?:\/\//)||(a=t.e("div",{innerHTML:'<a href="'+a+'">x</a>'}).firstChild.href);return a};
|
25 |
+
t.Ud=function(a){var c,d,e,g;g="protocol hostname port pathname search hash host".split(" ");d=t.e("a",{href:a});if(e=""===d.host&&"file:"!==d.protocol)c=t.e("div"),c.innerHTML='<a href="'+a+'"></a>',d=c.firstChild,c.setAttribute("style","display:none; position:absolute;"),document.body.appendChild(c);a={};for(var h=0;h<g.length;h++)a[g[h]]=d[g[h]];e&&document.body.removeChild(c);return a};
|
26 |
+
function D(a,c){var d,e;d=Array.prototype.slice.call(c);e=m();e=window.console||{log:e,warn:e,error:e};a?d.unshift(a.toUpperCase()+":"):a="log";t.log.history.push(d);d.unshift("VIDEOJS:");if(e[a].apply)e[a].apply(e,d);else e[a](d.join(" "))}t.log=function(){D(j,arguments)};t.log.history=[];t.log.error=function(){D("error",arguments)};t.log.warn=function(){D("warn",arguments)};
|
27 |
+
t.vd=function(a){var c,d;a.getBoundingClientRect&&a.parentNode&&(c=a.getBoundingClientRect());if(!c)return{left:0,top:0};a=document.documentElement;d=document.body;return{left:t.round(c.left+(window.pageXOffset||d.scrollLeft)-(a.clientLeft||d.clientLeft||0)),top:t.round(c.top+(window.pageYOffset||d.scrollTop)-(a.clientTop||d.clientTop||0))}};t.hc={};t.hc.forEach=function(a,c,d){if(t.g.isArray(a)&&c instanceof Function)for(var e=0,g=a.length;e<g;++e)c.call(d||t,a[e],e,a);return a};t.ga={};
|
28 |
+
t.ga.Va=function(a,c){var d,e,g;a=t.g.copy(a);for(d in c)c.hasOwnProperty(d)&&(e=a[d],g=c[d],a[d]=t.g.Ta(e)&&t.g.Ta(g)?t.ga.Va(e,g):c[d]);return a};
|
29 |
+
t.a=t.qa.extend({i:function(a,c,d){this.c=a;this.l=t.g.copy(this.l);c=this.options(c);this.U=c.id||(c.el&&c.el.id?c.el.id:a.id()+"_component_"+t.w++);this.Hd=c.name||j;this.b=c.el||this.e();this.O=[];this.Pa={};this.Qa={};this.vc();this.J(d);if(c.Ic!==l){var e,g;e=t.bind(this.j(),this.j().reportUserActivity);this.d("touchstart",function(){e();clearInterval(g);g=setInterval(e,250)});a=function(){e();clearInterval(g)};this.d("touchmove",e);this.d("touchend",a);this.d("touchcancel",a)}}});s=t.a.prototype;
|
30 |
+
s.dispose=function(){this.k({type:"dispose",bubbles:l});if(this.O)for(var a=this.O.length-1;0<=a;a--)this.O[a].dispose&&this.O[a].dispose();this.Qa=this.Pa=this.O=j;this.o();this.b.parentNode&&this.b.parentNode.removeChild(this.b);t.Hc(this.b);this.b=j};s.c=f;s.j=p("c");s.options=function(a){return a===b?this.l:this.l=t.ga.Va(this.l,a)};s.e=function(a,c){return t.e(a,c)};s.s=function(a){var c=this.c.language(),d=this.c.languages();return d&&d[c]&&d[c][a]?d[c][a]:a};s.v=p("b");
|
31 |
+
s.ja=function(){return this.u||this.b};s.id=p("U");s.name=p("Hd");s.children=p("O");s.xd=function(a){return this.Pa[a]};s.ka=function(a){return this.Qa[a]};s.S=function(a,c){var d,e;"string"===typeof a?(e=a,c=c||{},d=c.componentClass||t.ba(e),c.name=e,d=new window.videojs[d](this.c||this,c)):d=a;this.O.push(d);"function"===typeof d.id&&(this.Pa[d.id()]=d);(e=e||d.name&&d.name())&&(this.Qa[e]=d);"function"===typeof d.el&&d.el()&&this.ja().appendChild(d.el());return d};
|
32 |
+
s.removeChild=function(a){"string"===typeof a&&(a=this.ka(a));if(a&&this.O){for(var c=l,d=this.O.length-1;0<=d;d--)if(this.O[d]===a){c=f;this.O.splice(d,1);break}c&&(this.Pa[a.id]=j,this.Qa[a.name]=j,(c=a.v())&&c.parentNode===this.ja()&&this.ja().removeChild(a.v()))}};s.vc=function(){var a,c,d,e;a=this;if(c=this.options().children)if(t.g.isArray(c))for(var g=0;g<c.length;g++)d=c[g],"string"==typeof d?(e=d,d={}):e=d.name,a[e]=a.S(e,d);else t.g.Y(c,function(c,d){d!==l&&(a[c]=a.S(c,d))})};s.T=q("");
|
33 |
+
s.d=function(a,c){t.d(this.b,a,t.bind(this,c));return this};s.o=function(a,c){t.o(this.b,a,c);return this};s.Q=function(a,c){t.Q(this.b,a,t.bind(this,c));return this};s.k=function(a){t.k(this.b,a);return this};s.J=function(a){a&&(this.la?a.call(this):(this.ab===b&&(this.ab=[]),this.ab.push(a)));return this};s.Fa=function(){this.la=f;var a=this.ab;if(a&&0<a.length){for(var c=0,d=a.length;c<d;c++)a[c].call(this);this.ab=[];this.k("ready")}};s.Sa=function(a){return t.Sa(this.b,a)};
|
34 |
+
s.m=function(a){t.m(this.b,a);return this};s.p=function(a){t.p(this.b,a);return this};s.show=function(){this.b.style.display="block";return this};s.W=function(){this.b.style.display="none";return this};function E(a){a.p("vjs-lock-showing")}s.disable=function(){this.W();this.show=m()};s.width=function(a,c){return F(this,"width",a,c)};s.height=function(a,c){return F(this,"height",a,c)};s.rd=function(a,c){return this.width(a,f).height(c)};
|
35 |
+
function F(a,c,d,e){if(d!==b){if(d===j||t.Bd(d))d=0;a.b.style[c]=-1!==(""+d).indexOf("%")||-1!==(""+d).indexOf("px")?d:"auto"===d?"":d+"px";e||a.k("resize");return a}if(!a.b)return 0;d=a.b.style[c];e=d.indexOf("px");return-1!==e?parseInt(d.slice(0,e),10):parseInt(a.b["offset"+t.ba(c)],10)}
|
36 |
+
function G(a){var c,d,e,g,h,k,n,r;c=0;d=j;a.d("touchstart",function(a){1===a.touches.length&&(d=a.touches[0],c=(new Date).getTime(),g=f)});a.d("touchmove",function(a){1<a.touches.length?g=l:d&&(k=a.touches[0].pageX-d.pageX,n=a.touches[0].pageY-d.pageY,r=Math.sqrt(k*k+n*n),22<r&&(g=l))});h=function(){g=l};a.d("touchleave",h);a.d("touchcancel",h);a.d("touchend",function(a){d=j;g===f&&(e=(new Date).getTime()-c,250>e&&(a.preventDefault(),this.k("tap")))})}
|
37 |
t.t=t.a.extend({i:function(a,c){t.a.call(this,a,c);G(this);this.d("tap",this.r);this.d("click",this.r);this.d("focus",this.Ya);this.d("blur",this.Xa)}});s=t.t.prototype;
|
38 |
+
s.e=function(a,c){var d;c=t.g.z({className:this.T(),role:"button","aria-live":"polite",tabIndex:0},c);d=t.a.prototype.e.call(this,a,c);c.innerHTML||(this.u=t.e("div",{className:"vjs-control-content"}),this.xb=t.e("span",{className:"vjs-control-text",innerHTML:this.s(this.ta)||"Need Text"}),this.u.appendChild(this.xb),d.appendChild(this.u));return d};s.T=function(){return"vjs-control "+t.a.prototype.T.call(this)};s.r=m();s.Ya=function(){t.d(document,"keydown",t.bind(this,this.Z))};
|
39 |
+
s.Z=function(a){if(32==a.which||13==a.which)a.preventDefault(),this.r()};s.Xa=function(){t.o(document,"keydown",t.bind(this,this.Z))};
|
40 |
+
t.R=t.a.extend({i:function(a,c){t.a.call(this,a,c);this.gd=this.ka(this.l.barName);this.handle=this.ka(this.l.handleName);this.d("mousedown",this.Za);this.d("touchstart",this.Za);this.d("focus",this.Ya);this.d("blur",this.Xa);this.d("click",this.r);this.c.d("controlsvisible",t.bind(this,this.update));a.d(this.Dc,t.bind(this,this.update));this.F={};this.F.move=t.bind(this,this.$a);this.F.end=t.bind(this,this.Lb)}});s=t.R.prototype;
|
41 |
+
s.dispose=function(){t.o(document,"mousemove",this.F.move,l);t.o(document,"mouseup",this.F.end,l);t.o(document,"touchmove",this.F.move,l);t.o(document,"touchend",this.F.end,l);t.o(document,"keyup",t.bind(this,this.Z));t.a.prototype.dispose.call(this)};s.e=function(a,c){c=c||{};c.className+=" vjs-slider";c=t.g.z({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},c);return t.a.prototype.e.call(this,a,c)};
|
42 |
+
s.Za=function(a){a.preventDefault();t.hd();this.m("vjs-sliding");t.d(document,"mousemove",this.F.move);t.d(document,"mouseup",this.F.end);t.d(document,"touchmove",this.F.move);t.d(document,"touchend",this.F.end);this.$a(a)};s.$a=m();s.Lb=function(){t.he();this.p("vjs-sliding");t.o(document,"mousemove",this.F.move,l);t.o(document,"mouseup",this.F.end,l);t.o(document,"touchmove",this.F.move,l);t.o(document,"touchend",this.F.end,l);this.update()};
|
43 |
+
s.update=function(){if(this.b){var a,c=this.Fb(),d=this.handle,e=this.gd;isNaN(c)&&(c=0);a=c;if(d){a=this.b.offsetWidth;var g=d.v().offsetWidth;a=g?g/a:0;c*=1-a;a=c+a/2;d.v().style.left=t.round(100*c,2)+"%"}e&&(e.v().style.width=t.round(100*a,2)+"%")}};
|
44 |
+
function H(a,c){var d,e,g,h;d=a.b;e=t.vd(d);h=g=d.offsetWidth;d=a.handle;if(a.options().vertical)return h=e.top,e=c.changedTouches?c.changedTouches[0].pageY:c.pageY,d&&(d=d.v().offsetHeight,h+=d/2,g-=d),Math.max(0,Math.min(1,(h-e+g)/g));g=e.left;e=c.changedTouches?c.changedTouches[0].pageX:c.pageX;d&&(d=d.v().offsetWidth,g+=d/2,h-=d);return Math.max(0,Math.min(1,(e-g)/h))}s.Ya=function(){t.d(document,"keyup",t.bind(this,this.Z))};
|
45 |
+
s.Z=function(a){if(37==a.which||40==a.which)a.preventDefault(),this.Mc();else if(38==a.which||39==a.which)a.preventDefault(),this.Nc()};s.Xa=function(){t.o(document,"keyup",t.bind(this,this.Z))};s.r=function(a){a.stopImmediatePropagation();a.preventDefault()};t.$=t.a.extend();t.$.prototype.defaultValue=0;
|
46 |
+
t.$.prototype.e=function(a,c){c=c||{};c.className+=" vjs-slider-handle";c=t.g.z({innerHTML:'<span class="vjs-control-text">'+this.defaultValue+"</span>"},c);return t.a.prototype.e.call(this,"div",c)};t.ha=t.a.extend();function ca(a,c){a.S(c);c.d("click",t.bind(a,function(){E(this)}))}
|
47 |
+
t.ha.prototype.e=function(){var a=this.options().kc||"ul";this.u=t.e(a,{className:"vjs-menu-content"});a=t.a.prototype.e.call(this,"div",{append:this.u,className:"vjs-menu"});a.appendChild(this.u);t.d(a,"click",function(a){a.preventDefault();a.stopImmediatePropagation()});return a};t.I=t.t.extend({i:function(a,c){t.t.call(this,a,c);this.selected(c.selected)}});t.I.prototype.e=function(a,c){return t.t.prototype.e.call(this,"li",t.g.z({className:"vjs-menu-item",innerHTML:this.l.label},c))};
|
48 |
+
t.I.prototype.r=function(){this.selected(f)};t.I.prototype.selected=function(a){a?(this.m("vjs-selected"),this.b.setAttribute("aria-selected",f)):(this.p("vjs-selected"),this.b.setAttribute("aria-selected",l))};t.M=t.t.extend({i:function(a,c){t.t.call(this,a,c);this.Aa=this.wa();this.S(this.Aa);this.P&&0===this.P.length&&this.W();this.d("keyup",this.Z);this.b.setAttribute("aria-haspopup",f);this.b.setAttribute("role","button")}});s=t.M.prototype;s.sa=l;
|
49 |
+
s.wa=function(){var a=new t.ha(this.c);this.options().title&&a.ja().appendChild(t.e("li",{className:"vjs-menu-title",innerHTML:t.ba(this.options().title),ee:-1}));if(this.P=this.createItems())for(var c=0;c<this.P.length;c++)ca(a,this.P[c]);return a};s.va=m();s.T=function(){return this.className+" vjs-menu-button "+t.t.prototype.T.call(this)};s.Ya=m();s.Xa=m();s.r=function(){this.Q("mouseout",t.bind(this,function(){E(this.Aa);this.b.blur()}));this.sa?I(this):J(this)};
|
50 |
+
s.Z=function(a){a.preventDefault();32==a.which||13==a.which?this.sa?I(this):J(this):27==a.which&&this.sa&&I(this)};function J(a){a.sa=f;a.Aa.m("vjs-lock-showing");a.b.setAttribute("aria-pressed",f);a.P&&0<a.P.length&&a.P[0].v().focus()}function I(a){a.sa=l;E(a.Aa);a.b.setAttribute("aria-pressed",l)}t.D=function(a){"number"===typeof a?this.code=a:"string"===typeof a?this.message=a:"object"===typeof a&&t.g.z(this,a);this.message||(this.message=t.D.pd[this.code]||"")};t.D.prototype.code=0;
|
51 |
+
t.D.prototype.message="";t.D.prototype.status=j;t.D.Ra="MEDIA_ERR_CUSTOM MEDIA_ERR_ABORTED MEDIA_ERR_NETWORK MEDIA_ERR_DECODE MEDIA_ERR_SRC_NOT_SUPPORTED MEDIA_ERR_ENCRYPTED".split(" ");
|
52 |
+
t.D.pd={1:"You aborted the video playback",2:"A network error caused the video download to fail part-way.",3:"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.",4:"The video could not be loaded, either because the server or network failed or because the format is not supported.",5:"The video is encrypted and we do not have the keys to decrypt it."};for(var K=0;K<t.D.Ra.length;K++)t.D[t.D.Ra[K]]=K,t.D.prototype[t.D.Ra[K]]=K;
|
53 |
var L,M,N,O;
|
54 |
L=["requestFullscreen exitFullscreen fullscreenElement fullscreenEnabled fullscreenchange fullscreenerror".split(" "),"webkitRequestFullscreen webkitExitFullscreen webkitFullscreenElement webkitFullscreenEnabled webkitfullscreenchange webkitfullscreenerror".split(" "),"webkitRequestFullScreen webkitCancelFullScreen webkitCurrentFullScreenElement webkitCancelFullScreen webkitfullscreenchange webkitfullscreenerror".split(" "),"mozRequestFullScreen mozCancelFullScreen mozFullScreenElement mozFullScreenEnabled mozfullscreenchange mozfullscreenerror".split(" "),"msRequestFullscreen msExitFullscreen msFullscreenElement msFullscreenEnabled MSFullscreenChange MSFullscreenError".split(" ")];
|
55 |
M=L[0];for(O=0;O<L.length;O++)if(L[O][1]in document){N=L[O];break}if(N){t.Oa.Eb={};for(O=0;O<N.length;O++)t.Oa.Eb[M[O]]=N[O]}
|
56 |
+
t.Player=t.a.extend({i:function(a,c,d){this.L=a;a.id=a.id||"vjs_video_"+t.w++;this.fe=a&&t.za(a);c=t.g.z(da(a),c);this.Ua=c.language||t.options.language;this.Fd=c.languages||t.options.languages;this.G={};this.Ec=c.poster;this.yb=c.controls;a.controls=l;c.Ic=l;P(this,"audio"===this.L.nodeName.toLowerCase());t.a.call(this,this,c,d);this.controls()?this.m("vjs-controls-enabled"):this.m("vjs-controls-disabled");P(this)&&this.m("vjs-audio");t.Ba[this.U]=this;c.plugins&&t.g.Y(c.plugins,function(a,c){this[a](c)},
|
57 |
+
this);var e,g,h,k,n,r;e=t.bind(this,this.reportUserActivity);this.d("mousedown",function(){e();clearInterval(g);g=setInterval(e,250)});this.d("mousemove",function(a){if(a.screenX!=n||a.screenY!=r)n=a.screenX,r=a.screenY,e()});this.d("mouseup",function(){e();clearInterval(g)});this.d("keydown",e);this.d("keyup",e);h=setInterval(t.bind(this,function(){if(this.pa){this.pa=l;this.userActive(f);clearTimeout(k);var a=this.options().inactivityTimeout;0<a&&(k=setTimeout(t.bind(this,function(){this.pa||this.userActive(l)}),
|
58 |
+
a))}}),250);this.d("dispose",function(){clearInterval(h);clearTimeout(k)})}});s=t.Player.prototype;s.language=function(a){if(a===b)return this.Ua;this.Ua=a;return this};s.languages=p("Fd");s.l=t.options;s.dispose=function(){this.k("dispose");this.o("dispose");t.Ba[this.U]=j;this.L&&this.L.player&&(this.L.player=j);this.b&&this.b.player&&(this.b.player=j);this.n&&this.n.dispose();t.a.prototype.dispose.call(this)};
|
59 |
+
function da(a){var c,d,e={sources:[],tracks:[]};c=t.za(a);d=c["data-setup"];d!==j&&t.g.z(c,t.JSON.parse(d||"{}"));t.g.z(e,c);if(a.hasChildNodes()){var g,h;a=a.childNodes;g=0;for(h=a.length;g<h;g++)c=a[g],d=c.nodeName.toLowerCase(),"source"===d?e.sources.push(t.za(c)):"track"===d&&e.tracks.push(t.za(c))}return e}
|
60 |
+
s.e=function(){var a=this.b=t.a.prototype.e.call(this,"div"),c=this.L,d;c.removeAttribute("width");c.removeAttribute("height");if(c.hasChildNodes()){var e,g,h,k,n;e=c.childNodes;g=e.length;for(n=[];g--;)h=e[g],k=h.nodeName.toLowerCase(),"track"===k&&n.push(h);for(e=0;e<n.length;e++)c.removeChild(n[e])}d=t.za(c);t.g.Y(d,function(c){"class"==c?a.className=d[c]:a.setAttribute(c,d[c])});c.id+="_html5_api";c.className="vjs-tech";c.player=a.player=this;this.m("vjs-paused");this.width(this.l.width,f);this.height(this.l.height,
|
61 |
+
f);c.parentNode&&c.parentNode.insertBefore(a,c);t.Gb(c,a);this.b=a;this.d("loadstart",this.Md);this.d("waiting",this.Sd);this.d(["canplay","canplaythrough","playing","ended"],this.Rd);this.d("seeking",this.Pd);this.d("seeked",this.Od);this.d("ended",this.Id);this.d("play",this.Nb);this.d("firstplay",this.Kd);this.d("pause",this.Mb);this.d("progress",this.Nd);this.d("durationchange",this.Bc);this.d("fullscreenchange",this.Ld);return a};
|
62 |
+
function Q(a,c,d){a.n&&(a.la=l,a.n.dispose(),a.n=l);"Html5"!==c&&a.L&&(t.h.Bb(a.L),a.L=j);a.eb=c;a.la=l;var e=t.g.z({source:d,parentEl:a.b},a.l[c.toLowerCase()]);d&&(a.mc=d.type,d.src==a.G.src&&0<a.G.currentTime&&(e.startTime=a.G.currentTime),a.G.src=d.src);a.n=new window.videojs[c](a,e);a.n.J(function(){this.c.Fa()})}s.Md=function(){this.error(j);this.paused()?(R(this,l),this.Q("play",function(){R(this,f)})):this.k("firstplay")};s.uc=l;
|
63 |
+
function R(a,c){c!==b&&a.uc!==c&&((a.uc=c)?(a.m("vjs-has-started"),a.k("firstplay")):a.p("vjs-has-started"))}s.Nb=function(){this.p("vjs-paused");this.m("vjs-playing")};s.Sd=function(){this.m("vjs-waiting")};s.Rd=function(){this.p("vjs-waiting")};s.Pd=function(){this.m("vjs-seeking")};s.Od=function(){this.p("vjs-seeking")};s.Kd=function(){this.l.starttime&&this.currentTime(this.l.starttime);this.m("vjs-has-started")};s.Mb=function(){this.p("vjs-playing");this.m("vjs-paused")};
|
64 |
+
s.Nd=function(){1==this.bufferedPercent()&&this.k("loadedalldata")};s.Id=function(){this.l.loop?(this.currentTime(0),this.play()):this.paused()||this.pause()};s.Bc=function(){var a=S(this,"duration");a&&(0>a&&(a=Infinity),this.duration(a),Infinity===a?this.m("vjs-live"):this.p("vjs-live"))};s.Ld=function(){this.isFullscreen()?this.m("vjs-fullscreen"):this.p("vjs-fullscreen")};function T(a,c,d){if(a.n&&!a.n.la)a.n.J(function(){this[c](d)});else try{a.n[c](d)}catch(e){throw t.log(e),e;}}
|
65 |
+
function S(a,c){if(a.n&&a.n.la)try{return a.n[c]()}catch(d){throw a.n[c]===b?t.log("Video.js: "+c+" method not defined for "+a.eb+" playback technology.",d):"TypeError"==d.name?(t.log("Video.js: "+c+" unavailable on "+a.eb+" playback technology element.",d),a.n.la=l):t.log(d),d;}}s.play=function(){T(this,"play");return this};s.pause=function(){T(this,"pause");return this};s.paused=function(){return S(this,"paused")===l?l:f};
|
66 |
+
s.currentTime=function(a){return a!==b?(T(this,"setCurrentTime",a),this):this.G.currentTime=S(this,"currentTime")||0};s.duration=function(a){if(a!==b)return this.G.duration=parseFloat(a),this;this.G.duration===b&&this.Bc();return this.G.duration||0};s.remainingTime=function(){return this.duration()-this.currentTime()};s.buffered=function(){var a=S(this,"buffered");if(!a||!a.length)a=t.zb(0,0);return a};
|
67 |
+
s.bufferedPercent=function(){var a=this.duration(),c=this.buffered(),d=0,e,g;if(!a)return 0;for(var h=0;h<c.length;h++)e=c.start(h),g=c.end(h),g>a&&(g=a),d+=g-e;return d/a};s.volume=function(a){if(a!==b)return a=Math.max(0,Math.min(1,parseFloat(a))),this.G.volume=a,T(this,"setVolume",a),t.Yd(a),this;a=parseFloat(S(this,"volume"));return isNaN(a)?1:a};s.muted=function(a){return a!==b?(T(this,"setMuted",a),this):S(this,"muted")||l};s.Da=function(){return S(this,"supportsFullScreen")||l};s.xc=l;
|
68 |
+
s.isFullscreen=function(a){return a!==b?(this.xc=!!a,this):this.xc};s.isFullScreen=function(a){t.log.warn('player.isFullScreen() has been deprecated, use player.isFullscreen() with a lowercase "s")');return this.isFullscreen(a)};
|
69 |
+
s.requestFullscreen=function(){var a=t.Oa.Eb;this.isFullscreen(f);a?(t.d(document,a.fullscreenchange,t.bind(this,function(c){this.isFullscreen(document[a.fullscreenElement]);this.isFullscreen()===l&&t.o(document,a.fullscreenchange,arguments.callee);this.k("fullscreenchange")})),this.b[a.requestFullscreen]()):this.n.Da()?T(this,"enterFullScreen"):(this.pc(),this.k("fullscreenchange"));return this};
|
70 |
+
s.requestFullScreen=function(){t.log.warn('player.requestFullScreen() has been deprecated, use player.requestFullscreen() with a lowercase "s")');return this.requestFullscreen()};s.exitFullscreen=function(){var a=t.Oa.Eb;this.isFullscreen(l);if(a)document[a.exitFullscreen]();else this.n.Da()?T(this,"exitFullScreen"):(this.Cb(),this.k("fullscreenchange"));return this};s.cancelFullScreen=function(){t.log.warn("player.cancelFullScreen() has been deprecated, use player.exitFullscreen()");return this.exitFullscreen()};
|
71 |
+
s.pc=function(){this.Ad=f;this.sd=document.documentElement.style.overflow;t.d(document,"keydown",t.bind(this,this.rc));document.documentElement.style.overflow="hidden";t.m(document.body,"vjs-full-window");this.k("enterFullWindow")};s.rc=function(a){27===a.keyCode&&(this.isFullscreen()===f?this.exitFullscreen():this.Cb())};s.Cb=function(){this.Ad=l;t.o(document,"keydown",this.rc);document.documentElement.style.overflow=this.sd;t.p(document.body,"vjs-full-window");this.k("exitFullWindow")};
|
72 |
+
s.selectSource=function(a){for(var c=0,d=this.l.techOrder;c<d.length;c++){var e=t.ba(d[c]),g=window.videojs[e];if(g){if(g.isSupported())for(var h=0,k=a;h<k.length;h++){var n=k[h];if(g.canPlaySource(n))return{source:n,n:e}}}else t.log.error('The "'+e+'" tech is undefined. Skipped browser support check for that tech.')}return l};
|
73 |
+
s.src=function(a){if(a===b)return S(this,"src");t.g.isArray(a)?U(this,a):"string"===typeof a?this.src({src:a}):a instanceof Object&&(a.type&&!window.videojs[this.eb].canPlaySource(a)?U(this,[a]):(this.G.src=a.src,this.mc=a.type||"",this.J(function(){T(this,"src",a.src);"auto"==this.l.preload&&this.load();this.l.autoplay&&this.play()})));return this};
|
74 |
+
function U(a,c){var d=a.selectSource(c),e;d?d.n===a.eb?a.src(d.source):Q(a,d.n,d.source):(e=setTimeout(t.bind(a,function(){this.error({code:4,message:this.s(this.options().notSupportedMessage)})}),0),a.Fa(),a.d("dispose",function(){clearTimeout(e)}))}s.load=function(){T(this,"load");return this};s.currentSrc=function(){return S(this,"currentSrc")||this.G.src||""};s.nd=function(){return this.mc||""};s.Ca=function(a){return a!==b?(T(this,"setPreload",a),this.l.preload=a,this):S(this,"preload")};
|
75 |
+
s.autoplay=function(a){return a!==b?(T(this,"setAutoplay",a),this.l.autoplay=a,this):S(this,"autoplay")};s.loop=function(a){return a!==b?(T(this,"setLoop",a),this.l.loop=a,this):S(this,"loop")};s.poster=function(a){if(a===b)return this.Ec;this.Ec=a;T(this,"setPoster",a);this.k("posterchange");return this};
|
76 |
+
s.controls=function(a){return a!==b?(a=!!a,this.yb!==a&&((this.yb=a)?(this.p("vjs-controls-disabled"),this.m("vjs-controls-enabled"),this.k("controlsenabled")):(this.p("vjs-controls-enabled"),this.m("vjs-controls-disabled"),this.k("controlsdisabled"))),this):this.yb};t.Player.prototype.Sb;s=t.Player.prototype;
|
77 |
+
s.usingNativeControls=function(a){return a!==b?(a=!!a,this.Sb!==a&&((this.Sb=a)?(this.m("vjs-using-native-controls"),this.k("usingnativecontrols")):(this.p("vjs-using-native-controls"),this.k("usingcustomcontrols"))),this):this.Sb};s.da=j;s.error=function(a){if(a===b)return this.da;if(a===j)return this.da=a,this.p("vjs-error"),this;this.da=a instanceof t.D?a:new t.D(a);this.k("error");this.m("vjs-error");t.log.error("(CODE:"+this.da.code+" "+t.D.Ra[this.da.code]+")",this.da.message,this.da);return this};
|
78 |
+
s.ended=function(){return S(this,"ended")};s.seeking=function(){return S(this,"seeking")};s.pa=f;s.reportUserActivity=function(){this.pa=f};s.Rb=f;s.userActive=function(a){return a!==b?(a=!!a,a!==this.Rb&&((this.Rb=a)?(this.pa=f,this.p("vjs-user-inactive"),this.m("vjs-user-active"),this.k("useractive")):(this.pa=l,this.n&&this.n.Q("mousemove",function(a){a.stopPropagation();a.preventDefault()}),this.p("vjs-user-active"),this.m("vjs-user-inactive"),this.k("userinactive"))),this):this.Rb};
|
79 |
+
s.playbackRate=function(a){return a!==b?(T(this,"setPlaybackRate",a),this):this.n&&this.n.featuresPlaybackRate?S(this,"playbackRate"):1};s.wc=l;function P(a,c){return c!==b?(a.wc=!!c,a):a.wc}t.Ia=t.a.extend();t.Ia.prototype.l={te:"play",children:{playToggle:{},currentTimeDisplay:{},timeDivider:{},durationDisplay:{},remainingTimeDisplay:{},liveDisplay:{},progressControl:{},fullscreenToggle:{},volumeControl:{},muteToggle:{},playbackRateMenuButton:{}}};t.Ia.prototype.e=function(){return t.e("div",{className:"vjs-control-bar"})};
|
80 |
t.Xb=t.a.extend({i:function(a,c){t.a.call(this,a,c)}});t.Xb.prototype.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-live-controls vjs-control"});this.u=t.e("div",{className:"vjs-live-display",innerHTML:'<span class="vjs-control-text">'+this.s("Stream Type")+"</span>"+this.s("LIVE"),"aria-live":"off"});a.appendChild(this.u);return a};t.$b=t.t.extend({i:function(a,c){t.t.call(this,a,c);a.d("play",t.bind(this,this.Nb));a.d("pause",t.bind(this,this.Mb))}});s=t.$b.prototype;s.ta="Play";
|
81 |
+
s.T=function(){return"vjs-play-control "+t.t.prototype.T.call(this)};s.r=function(){this.c.paused()?this.c.play():this.c.pause()};s.Nb=function(){t.p(this.b,"vjs-paused");t.m(this.b,"vjs-playing");this.b.children[0].children[0].innerHTML=this.s("Pause")};s.Mb=function(){t.p(this.b,"vjs-playing");t.m(this.b,"vjs-paused");this.b.children[0].children[0].innerHTML=this.s("Play")};t.hb=t.a.extend({i:function(a,c){t.a.call(this,a,c);a.d("timeupdate",t.bind(this,this.fa))}});
|
82 |
+
t.hb.prototype.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-current-time vjs-time-controls vjs-control"});this.u=t.e("div",{className:"vjs-current-time-display",innerHTML:'<span class="vjs-control-text">Current Time </span>0:00',"aria-live":"off"});a.appendChild(this.u);return a};t.hb.prototype.fa=function(){var a=this.c.bb?this.c.G.currentTime:this.c.currentTime();this.u.innerHTML='<span class="vjs-control-text">'+this.s("Current Time")+"</span> "+t.ya(a,this.c.duration())};
|
83 |
t.ib=t.a.extend({i:function(a,c){t.a.call(this,a,c);a.d("timeupdate",t.bind(this,this.fa))}});t.ib.prototype.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-duration vjs-time-controls vjs-control"});this.u=t.e("div",{className:"vjs-duration-display",innerHTML:'<span class="vjs-control-text">'+this.s("Duration Time")+"</span> 0:00","aria-live":"off"});a.appendChild(this.u);return a};
|
84 |
t.ib.prototype.fa=function(){var a=this.c.duration();a&&(this.u.innerHTML='<span class="vjs-control-text">'+this.s("Duration Time")+"</span> "+t.ya(a))};t.fc=t.a.extend({i:function(a,c){t.a.call(this,a,c)}});t.fc.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-time-divider",innerHTML:"<div><span>/</span></div>"})};t.pb=t.a.extend({i:function(a,c){t.a.call(this,a,c);a.d("timeupdate",t.bind(this,this.fa))}});
|
85 |
t.pb.prototype.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-remaining-time vjs-time-controls vjs-control"});this.u=t.e("div",{className:"vjs-remaining-time-display",innerHTML:'<span class="vjs-control-text">'+this.s("Remaining Time")+"</span> -0:00","aria-live":"off"});a.appendChild(this.u);return a};t.pb.prototype.fa=function(){this.c.duration()&&(this.u.innerHTML='<span class="vjs-control-text">'+this.s("Remaining Time")+"</span> -"+t.ya(this.c.remainingTime()))};
|
86 |
+
t.Ja=t.t.extend({i:function(a,c){t.t.call(this,a,c)}});t.Ja.prototype.ta="Fullscreen";t.Ja.prototype.T=function(){return"vjs-fullscreen-control "+t.t.prototype.T.call(this)};t.Ja.prototype.r=function(){this.c.isFullscreen()?(this.c.exitFullscreen(),this.xb.innerHTML=this.s("Fullscreen")):(this.c.requestFullscreen(),this.xb.innerHTML=this.s("Non-Fullscreen"))};t.ob=t.a.extend({i:function(a,c){t.a.call(this,a,c)}});t.ob.prototype.l={children:{seekBar:{}}};
|
87 |
+
t.ob.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-progress-control vjs-control"})};t.bc=t.R.extend({i:function(a,c){t.R.call(this,a,c);a.d("timeupdate",t.bind(this,this.oa));a.J(t.bind(this,this.oa))}});s=t.bc.prototype;s.l={children:{loadProgressBar:{},playProgressBar:{},seekHandle:{}},barName:"playProgressBar",handleName:"seekHandle"};s.Dc="timeupdate";s.e=function(){return t.R.prototype.e.call(this,"div",{className:"vjs-progress-holder","aria-label":"video progress bar"})};
|
88 |
+
s.oa=function(){var a=this.c.bb?this.c.G.currentTime:this.c.currentTime();this.b.setAttribute("aria-valuenow",t.round(100*this.Fb(),2));this.b.setAttribute("aria-valuetext",t.ya(a,this.c.duration()))};s.Fb=function(){return this.c.currentTime()/this.c.duration()};s.Za=function(a){t.R.prototype.Za.call(this,a);this.c.bb=f;this.je=!this.c.paused();this.c.pause()};s.$a=function(a){a=H(this,a)*this.c.duration();a==this.c.duration()&&(a-=0.1);this.c.currentTime(a)};
|
89 |
+
s.Lb=function(a){t.R.prototype.Lb.call(this,a);this.c.bb=l;this.je&&this.c.play()};s.Nc=function(){this.c.currentTime(this.c.currentTime()+5)};s.Mc=function(){this.c.currentTime(this.c.currentTime()-5)};t.lb=t.a.extend({i:function(a,c){t.a.call(this,a,c);a.d("progress",t.bind(this,this.update))}});t.lb.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-load-progress",innerHTML:'<span class="vjs-control-text"><span>'+this.s("Loaded")+"</span>: 0%</span>"})};
|
90 |
+
t.lb.prototype.update=function(){var a,c,d,e,g=this.c.buffered();a=this.c.duration();var h,k=this.c;h=k.buffered();k=k.duration();h=h.end(h.length-1);h>k&&(h=k);k=this.b.children;this.b.style.width=100*(h/a||0)+"%";for(a=0;a<g.length;a++)c=g.start(a),d=g.end(a),(e=k[a])||(e=this.b.appendChild(t.e())),e.style.left=100*(c/h||0)+"%",e.style.width=100*((d-c)/h||0)+"%";for(a=k.length;a>g.length;a--)this.b.removeChild(k[a-1])};t.Zb=t.a.extend({i:function(a,c){t.a.call(this,a,c)}});
|
91 |
+
t.Zb.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-play-progress",innerHTML:'<span class="vjs-control-text"><span>'+this.s("Progress")+"</span>: 0%</span>"})};t.La=t.$.extend({i:function(a,c){t.$.call(this,a,c);a.d("timeupdate",t.bind(this,this.fa))}});t.La.prototype.defaultValue="00:00";t.La.prototype.e=function(){return t.$.prototype.e.call(this,"div",{className:"vjs-seek-handle","aria-live":"off"})};
|
92 |
+
t.La.prototype.fa=function(){var a=this.c.bb?this.c.G.currentTime:this.c.currentTime();this.b.innerHTML='<span class="vjs-control-text">'+t.ya(a,this.c.duration())+"</span>"};t.rb=t.a.extend({i:function(a,c){t.a.call(this,a,c);a.n&&a.n.featuresVolumeControl===l&&this.m("vjs-hidden");a.d("loadstart",t.bind(this,function(){a.n.featuresVolumeControl===l?this.m("vjs-hidden"):this.p("vjs-hidden")}))}});t.rb.prototype.l={children:{volumeBar:{}}};
|
93 |
+
t.rb.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-volume-control vjs-control"})};t.qb=t.R.extend({i:function(a,c){t.R.call(this,a,c);a.d("volumechange",t.bind(this,this.oa));a.J(t.bind(this,this.oa))}});s=t.qb.prototype;s.oa=function(){this.b.setAttribute("aria-valuenow",t.round(100*this.c.volume(),2));this.b.setAttribute("aria-valuetext",t.round(100*this.c.volume(),2)+"%")};s.l={children:{volumeLevel:{},volumeHandle:{}},barName:"volumeLevel",handleName:"volumeHandle"};
|
94 |
+
s.Dc="volumechange";s.e=function(){return t.R.prototype.e.call(this,"div",{className:"vjs-volume-bar","aria-label":"volume level"})};s.$a=function(a){this.c.muted()&&this.c.muted(l);this.c.volume(H(this,a))};s.Fb=function(){return this.c.muted()?0:this.c.volume()};s.Nc=function(){this.c.volume(this.c.volume()+0.1)};s.Mc=function(){this.c.volume(this.c.volume()-0.1)};t.gc=t.a.extend({i:function(a,c){t.a.call(this,a,c)}});
|
95 |
+
t.gc.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-volume-level",innerHTML:'<span class="vjs-control-text"></span>'})};t.sb=t.$.extend();t.sb.prototype.defaultValue="00:00";t.sb.prototype.e=function(){return t.$.prototype.e.call(this,"div",{className:"vjs-volume-handle"})};
|
96 |
+
t.ia=t.t.extend({i:function(a,c){t.t.call(this,a,c);a.d("volumechange",t.bind(this,this.update));a.n&&a.n.featuresVolumeControl===l&&this.m("vjs-hidden");a.d("loadstart",t.bind(this,function(){a.n.featuresVolumeControl===l?this.m("vjs-hidden"):this.p("vjs-hidden")}))}});t.ia.prototype.e=function(){return t.t.prototype.e.call(this,"div",{className:"vjs-mute-control vjs-control",innerHTML:'<div><span class="vjs-control-text">'+this.s("Mute")+"</span></div>"})};
|
97 |
+
t.ia.prototype.r=function(){this.c.muted(this.c.muted()?l:f)};t.ia.prototype.update=function(){var a=this.c.volume(),c=3;0===a||this.c.muted()?c=0:0.33>a?c=1:0.67>a&&(c=2);this.c.muted()?this.b.children[0].children[0].innerHTML!=this.s("Unmute")&&(this.b.children[0].children[0].innerHTML=this.s("Unmute")):this.b.children[0].children[0].innerHTML!=this.s("Mute")&&(this.b.children[0].children[0].innerHTML=this.s("Mute"));for(a=0;4>a;a++)t.p(this.b,"vjs-vol-"+a);t.m(this.b,"vjs-vol-"+c)};
|
98 |
+
t.ra=t.M.extend({i:function(a,c){t.M.call(this,a,c);a.d("volumechange",t.bind(this,this.update));a.n&&a.n.featuresVolumeControl===l&&this.m("vjs-hidden");a.d("loadstart",t.bind(this,function(){a.n.featuresVolumeControl===l?this.m("vjs-hidden"):this.p("vjs-hidden")}));this.m("vjs-menu-button")}});t.ra.prototype.wa=function(){var a=new t.ha(this.c,{kc:"div"}),c=new t.qb(this.c,t.g.z({vertical:f},this.l.xe));c.d("focus",function(){a.m("vjs-lock-showing")});c.d("blur",function(){E(a)});a.S(c);return a};
|
99 |
+
t.ra.prototype.r=function(){t.ia.prototype.r.call(this);t.M.prototype.r.call(this)};t.ra.prototype.e=function(){return t.t.prototype.e.call(this,"div",{className:"vjs-volume-menu-button vjs-menu-button vjs-control",innerHTML:'<div><span class="vjs-control-text">'+this.s("Mute")+"</span></div>"})};t.ra.prototype.update=t.ia.prototype.update;t.ac=t.M.extend({i:function(a,c){t.M.call(this,a,c);this.Sc();this.Rc();a.d("loadstart",t.bind(this,this.Sc));a.d("ratechange",t.bind(this,this.Rc))}});s=t.ac.prototype;
|
100 |
+
s.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-playback-rate vjs-menu-button vjs-control",innerHTML:'<div class="vjs-control-content"><span class="vjs-control-text">'+this.s("Playback Rate")+"</span></div>"});this.zc=t.e("div",{className:"vjs-playback-rate-value",innerHTML:1});a.appendChild(this.zc);return a};s.wa=function(){var a=new t.ha(this.j()),c=this.j().options().playbackRates;if(c)for(var d=c.length-1;0<=d;d--)a.S(new t.nb(this.j(),{rate:c[d]+"x"}));return a};
|
101 |
+
s.oa=function(){this.v().setAttribute("aria-valuenow",this.j().playbackRate())};s.r=function(){for(var a=this.j().playbackRate(),c=this.j().options().playbackRates,d=c[0],e=0;e<c.length;e++)if(c[e]>a){d=c[e];break}this.j().playbackRate(d)};function ea(a){return a.j().n&&a.j().n.featuresPlaybackRate&&a.j().options().playbackRates&&0<a.j().options().playbackRates.length}s.Sc=function(){ea(this)?this.p("vjs-hidden"):this.m("vjs-hidden")};
|
102 |
+
s.Rc=function(){ea(this)&&(this.zc.innerHTML=this.j().playbackRate()+"x")};t.nb=t.I.extend({kc:"button",i:function(a,c){var d=this.label=c.rate,e=this.Gc=parseFloat(d,10);c.label=d;c.selected=1===e;t.I.call(this,a,c);this.j().d("ratechange",t.bind(this,this.update))}});t.nb.prototype.r=function(){t.I.prototype.r.call(this);this.j().playbackRate(this.Gc)};t.nb.prototype.update=function(){this.selected(this.j().playbackRate()==this.Gc)};
|
103 |
+
t.Ka=t.t.extend({i:function(a,c){t.t.call(this,a,c);a.poster()&&this.src(a.poster());(!a.poster()||!a.controls())&&this.W();a.d("posterchange",t.bind(this,function(){this.src(a.poster())}));P(a)||a.d("play",t.bind(this,this.W))}});var fa="backgroundSize"in t.A.style;t.Ka.prototype.e=function(){var a=t.e("div",{className:"vjs-poster",tabIndex:-1});fa||a.appendChild(t.e("img"));return a};
|
104 |
+
t.Ka.prototype.src=function(a){var c=this.v();a!==b&&(fa?c.style.backgroundImage='url("'+a+'")':c.firstChild.src=a)};t.Ka.prototype.r=function(){this.j().controls()&&this.c.play()};t.Yb=t.a.extend({i:function(a,c){t.a.call(this,a,c)}});t.Yb.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-loading-spinner"})};t.fb=t.t.extend();
|
105 |
+
t.fb.prototype.e=function(){return t.t.prototype.e.call(this,"div",{className:"vjs-big-play-button",innerHTML:'<span aria-hidden="true"></span>',"aria-label":"play video"})};t.fb.prototype.r=function(){this.c.play()};t.jb=t.a.extend({i:function(a,c){t.a.call(this,a,c);this.update();a.d("error",t.bind(this,this.update))}});t.jb.prototype.e=function(){var a=t.a.prototype.e.call(this,"div",{className:"vjs-error-display"});this.u=t.e("div");a.appendChild(this.u);return a};
|
106 |
+
t.jb.prototype.update=function(){this.j().error()&&(this.u.innerHTML=this.s(this.j().error().message))};
|
107 |
+
t.q=t.a.extend({i:function(a,c,d){c=c||{};c.Ic=l;t.a.call(this,a,c,d);this.featuresProgressEvents||(this.Ac=f,this.Fc=setInterval(t.bind(this,function(){var a=this.j().bufferedPercent();this.jd!=a&&this.j().k("progress");this.jd=a;1===a&&clearInterval(this.Fc)}),500));this.featuresTimeupdateEvents||(this.Kb=f,this.j().d("play",t.bind(this,this.Qc)),this.j().d("pause",t.bind(this,this.cb)),this.Q("timeupdate",function(){this.featuresTimeupdateEvents=f;ga(this)}));var e,g;g=this;e=this.j();a=function(){if(e.controls()&&
|
108 |
+
!e.usingNativeControls()){var a;g.d("mousedown",g.r);g.d("touchstart",function(){a=this.c.userActive()});g.d("touchmove",function(){a&&this.j().reportUserActivity()});g.d("touchend",function(a){a.preventDefault()});G(g);g.d("tap",g.Qd)}};c=t.bind(g,g.Wd);this.J(a);e.d("controlsenabled",a);e.d("controlsdisabled",c);this.J(function(){this.networkState&&0<this.networkState()&&this.j().k("loadstart")})}});s=t.q.prototype;
|
109 |
+
s.Wd=function(){this.o("tap");this.o("touchstart");this.o("touchmove");this.o("touchleave");this.o("touchcancel");this.o("touchend");this.o("click");this.o("mousedown")};s.r=function(a){0===a.button&&this.j().controls()&&(this.j().paused()?this.j().play():this.j().pause())};s.Qd=function(){this.j().userActive(!this.j().userActive())};function ga(a){a.Kb=l;a.cb();a.o("play",a.Qc);a.o("pause",a.cb)}
|
110 |
+
s.Qc=function(){this.lc&&this.cb();this.lc=setInterval(t.bind(this,function(){this.j().k("timeupdate")}),250)};s.cb=function(){clearInterval(this.lc);this.j().k("timeupdate")};s.dispose=function(){this.Ac&&(this.Ac=l,clearInterval(this.Fc));this.Kb&&ga(this);t.a.prototype.dispose.call(this)};s.Pb=function(){this.Kb&&this.j().k("timeupdate")};s.Kc=m();t.q.prototype.featuresVolumeControl=f;t.q.prototype.featuresFullscreenResize=l;t.q.prototype.featuresPlaybackRate=l;
|
111 |
t.q.prototype.featuresProgressEvents=l;t.q.prototype.featuresTimeupdateEvents=l;t.media={};
|
112 |
+
t.h=t.q.extend({i:function(a,c,d){this.featuresVolumeControl=t.h.ld();this.featuresPlaybackRate=t.h.kd();this.movingMediaElementInDOM=!t.Yc;this.featuresProgressEvents=this.featuresFullscreenResize=f;t.q.call(this,a,c,d);for(d=t.h.kb.length-1;0<=d;d--)t.d(this.b,t.h.kb[d],t.bind(this,this.td));if((c=c.source)&&this.b.currentSrc!==c.src)this.b.src=c.src;if(t.dc&&a.options().nativeControlsForTouch!==l){var e,g,h,k;e=this;g=this.j();c=g.controls();e.b.controls=!!c;h=function(){e.b.controls=f};k=function(){e.b.controls=
|
113 |
+
l};g.d("controlsenabled",h);g.d("controlsdisabled",k);c=function(){g.o("controlsenabled",h);g.o("controlsdisabled",k)};e.d("dispose",c);g.d("usingcustomcontrols",c);g.usingNativeControls(f)}a.J(function(){this.L&&(this.l.autoplay&&this.paused())&&(delete this.L.poster,this.play())});this.Fa()}});s=t.h.prototype;s.dispose=function(){t.h.Bb(this.b);t.q.prototype.dispose.call(this)};
|
114 |
+
s.e=function(){var a=this.c,c=a.L,d;if(!c||this.movingMediaElementInDOM===l)c?(d=c.cloneNode(l),t.h.Bb(c),c=d,a.L=j):(c=t.e("video"),t.Jc(c,t.g.z(a.fe||{},{id:a.id()+"_html5_api","class":"vjs-tech"}))),c.player=a,t.Gb(c,a.v());d=["autoplay","preload","loop","muted"];for(var e=d.length-1;0<=e;e--){var g=d[e],h={};"undefined"!==typeof a.l[g]&&(h[g]=a.l[g]);t.Jc(c,h)}return c};s.td=function(a){"error"==a.type&&this.error()?this.j().error(this.error().code):(a.bubbles=l,this.j().k(a))};s.play=function(){this.b.play()};
|
115 |
+
s.pause=function(){this.b.pause()};s.paused=function(){return this.b.paused};s.currentTime=function(){return this.b.currentTime};s.Pb=function(a){try{this.b.currentTime=a}catch(c){t.log(c,"Video is not ready. (Video.js)")}};s.duration=function(){return this.b.duration||0};s.buffered=function(){return this.b.buffered};s.volume=function(){return this.b.volume};s.ce=function(a){this.b.volume=a};s.muted=function(){return this.b.muted};s.$d=function(a){this.b.muted=a};s.width=function(){return this.b.offsetWidth};
|
116 |
+
s.height=function(){return this.b.offsetHeight};s.Da=function(){return"function"==typeof this.b.webkitEnterFullScreen&&(/Android/.test(t.N)||!/Chrome|Mac OS X 10.5/.test(t.N))?f:l};
|
117 |
+
s.oc=function(){var a=this.b;"webkitDisplayingFullscreen"in a&&this.Q("webkitbeginfullscreen",t.bind(this,function(){this.c.isFullscreen(f);this.Q("webkitendfullscreen",t.bind(this,function(){this.c.isFullscreen(l);this.c.k("fullscreenchange")}));this.c.k("fullscreenchange")}));a.paused&&a.networkState<=a.ke?(this.b.play(),setTimeout(function(){a.pause();a.webkitEnterFullScreen()},0)):a.webkitEnterFullScreen()};s.ud=function(){this.b.webkitExitFullScreen()};
|
118 |
+
s.src=function(a){if(a===b)return this.b.src;this.b.src=a};s.load=function(){this.b.load()};s.currentSrc=function(){return this.b.currentSrc};s.poster=function(){return this.b.poster};s.Kc=function(a){this.b.poster=a};s.Ca=function(){return this.b.Ca};s.be=function(a){this.b.Ca=a};s.autoplay=function(){return this.b.autoplay};s.Xd=function(a){this.b.autoplay=a};s.controls=function(){return this.b.controls};s.loop=function(){return this.b.loop};s.Zd=function(a){this.b.loop=a};s.error=function(){return this.b.error};
|
119 |
+
s.seeking=function(){return this.b.seeking};s.ended=function(){return this.b.ended};s.playbackRate=function(){return this.b.playbackRate};s.ae=function(a){this.b.playbackRate=a};s.networkState=function(){return this.b.networkState};t.h.isSupported=function(){try{t.A.volume=0.5}catch(a){return l}return!!t.A.canPlayType};t.h.vb=function(a){try{return!!t.A.canPlayType(a.type)}catch(c){return""}};t.h.ld=function(){var a=t.A.volume;t.A.volume=a/2+0.1;return a!==t.A.volume};
|
120 |
+
t.h.kd=function(){var a=t.A.playbackRate;t.A.playbackRate=a/2+0.1;return a!==t.A.playbackRate};var V,ha=/^application\/(?:x-|vnd\.apple\.)mpegurl/i,ia=/^video\/mp4/i;t.h.Cc=function(){4<=t.Tb&&(V||(V=t.A.constructor.prototype.canPlayType),t.A.constructor.prototype.canPlayType=function(a){return a&&ha.test(a)?"maybe":V.call(this,a)});t.bd&&(V||(V=t.A.constructor.prototype.canPlayType),t.A.constructor.prototype.canPlayType=function(a){return a&&ia.test(a)?"maybe":V.call(this,a)})};
|
121 |
+
t.h.ie=function(){var a=t.A.constructor.prototype.canPlayType;t.A.constructor.prototype.canPlayType=V;V=j;return a};t.h.Cc();t.h.kb="loadstart suspend abort error emptied stalled loadedmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate progress play pause ratechange volumechange".split(" ");
|
122 |
+
t.h.Bb=function(a){if(a){a.player=j;for(a.parentNode&&a.parentNode.removeChild(a);a.hasChildNodes();)a.removeChild(a.firstChild);a.removeAttribute("src");if("function"===typeof a.load)try{a.load()}catch(c){}}};
|
123 |
+
t.f=t.q.extend({i:function(a,c,d){t.q.call(this,a,c,d);var e=c.source;d=c.parentEl;var g=this.b=t.e("div",{id:a.id()+"_temp_flash"}),h=a.id()+"_flash_api",k=a.l,k=t.g.z({readyFunction:"videojs.Flash.onReady",eventProxyFunction:"videojs.Flash.onEvent",errorEventProxyFunction:"videojs.Flash.onError",autoplay:k.autoplay,preload:k.Ca,loop:k.loop,muted:k.muted},c.flashVars),n=t.g.z({wmode:"opaque",bgcolor:"#000000"},c.params),h=t.g.z({id:h,name:h,"class":"vjs-tech"},c.attributes);e&&(e.type&&t.f.Dd(e.type)?
|
124 |
+
(e=t.f.Oc(e.src),k.rtmpConnection=encodeURIComponent(e.wb),k.rtmpStream=encodeURIComponent(e.Qb)):k.src=encodeURIComponent(t.sc(e.src)));t.Gb(g,d);c.startTime&&this.J(function(){this.load();this.play();this.currentTime(c.startTime)});t.Xc&&this.J(function(){t.d(this.v(),"mousemove",t.bind(this,function(){this.j().k({type:"mousemove",bubbles:l})}))});a.d("stageclick",a.reportUserActivity);this.b=t.f.nc(c.swf,g,k,n,h)}});t.f.prototype.dispose=function(){t.q.prototype.dispose.call(this)};
|
125 |
+
t.f.prototype.play=function(){this.b.vjs_play()};t.f.prototype.pause=function(){this.b.vjs_pause()};t.f.prototype.src=function(a){if(a===b)return this.currentSrc();t.f.Cd(a)?(a=t.f.Oc(a),this.ue(a.wb),this.ve(a.Qb)):(a=t.sc(a),this.b.vjs_src(a));if(this.c.autoplay()){var c=this;setTimeout(function(){c.play()},0)}};t.f.prototype.setCurrentTime=function(a){this.Gd=a;this.b.vjs_setProperty("currentTime",a);t.q.prototype.Pb.call(this)};
|
126 |
+
t.f.prototype.currentTime=function(){return this.seeking()?this.Gd||0:this.b.vjs_getProperty("currentTime")};t.f.prototype.currentSrc=function(){var a=this.b.vjs_getProperty("currentSrc");if(a==j){var c=this.rtmpConnection(),d=this.rtmpStream();c&&d&&(a=t.f.de(c,d))}return a};t.f.prototype.load=function(){this.b.vjs_load()};t.f.prototype.poster=function(){this.b.vjs_getProperty("poster")};t.f.prototype.setPoster=m();t.f.prototype.buffered=function(){return t.zb(0,this.b.vjs_getProperty("buffered"))};
|
127 |
+
t.f.prototype.Da=q(l);t.f.prototype.oc=q(l);function ja(){var a=W[X],c=a.charAt(0).toUpperCase()+a.slice(1);ka["set"+c]=function(c){return this.b.vjs_setProperty(a,c)}}function la(a){ka[a]=function(){return this.b.vjs_getProperty(a)}}
|
128 |
+
var ka=t.f.prototype,W="rtmpConnection rtmpStream preload defaultPlaybackRate playbackRate autoplay loop mediaGroup controller controls volume muted defaultMuted".split(" "),ma="error networkState readyState seeking initialTime duration startOffsetTime paused played seekable ended videoTracks audioTracks videoWidth videoHeight textTracks".split(" "),X;for(X=0;X<W.length;X++)la(W[X]),ja();for(X=0;X<ma.length;X++)la(ma[X]);t.f.isSupported=function(){return 10<=t.f.version()[0]};
|
129 |
+
t.f.vb=function(a){if(!a.type)return"";a=a.type.replace(/;.*/,"").toLowerCase();if(a in t.f.wd||a in t.f.Pc)return"maybe"};t.f.wd={"video/flv":"FLV","video/x-flv":"FLV","video/mp4":"MP4","video/m4v":"MP4"};t.f.Pc={"rtmp/mp4":"MP4","rtmp/flv":"FLV"};t.f.onReady=function(a){var c;if(c=(a=t.v(a))&&a.parentNode&&a.parentNode.player)a.player=c,t.f.checkReady(c.n)};t.f.checkReady=function(a){a.v()&&(a.v().vjs_getProperty?a.Fa():setTimeout(function(){t.f.checkReady(a)},50))};t.f.onEvent=function(a,c){t.v(a).player.k(c)};
|
130 |
t.f.onError=function(a,c){var d=t.v(a).player,e="FLASH: "+c;"srcnotfound"==c?d.error({code:4,message:e}):d.error(e)};t.f.version=function(){var a="0,0,0";try{a=(new window.ActiveXObject("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version").replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}catch(c){try{navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin&&(a=(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1])}catch(d){}}return a.split(",")};
|
131 |
+
t.f.nc=function(a,c,d,e,g){a=t.f.yd(a,d,e,g);a=t.e("div",{innerHTML:a}).childNodes[0];d=c.parentNode;c.parentNode.replaceChild(a,c);var h=d.childNodes[0];setTimeout(function(){h.style.display="block"},1E3);return a};
|
132 |
+
t.f.yd=function(a,c,d,e){var g="",h="",k="";c&&t.g.Y(c,function(a,c){g+=a+"="+c+"&"});d=t.g.z({movie:a,flashvars:g,allowScriptAccess:"always",allowNetworking:"all"},d);t.g.Y(d,function(a,c){h+='<param name="'+a+'" value="'+c+'" />'});e=t.g.z({data:a,width:"100%",height:"100%"},e);t.g.Y(e,function(a,c){k+=a+'="'+c+'" '});return'<object type="application/x-shockwave-flash"'+k+">"+h+"</object>"};t.f.de=function(a,c){return a+"&"+c};
|
133 |
+
t.f.Oc=function(a){var c={wb:"",Qb:""};if(!a)return c;var d=a.indexOf("&"),e;-1!==d?e=d+1:(d=e=a.lastIndexOf("/")+1,0===d&&(d=e=a.length));c.wb=a.substring(0,d);c.Qb=a.substring(e,a.length);return c};t.f.Dd=function(a){return a in t.f.Pc};t.f.dd=/^rtmp[set]?:\/\//i;t.f.Cd=function(a){return t.f.dd.test(a)};
|
134 |
+
t.cd=t.a.extend({i:function(a,c,d){t.a.call(this,a,c,d);if(!a.l.sources||0===a.l.sources.length){c=0;for(d=a.l.techOrder;c<d.length;c++){var e=t.ba(d[c]),g=window.videojs[e];if(g&&g.isSupported()){Q(a,e);break}}}else a.src(a.l.sources)}});t.Player.prototype.textTracks=function(){return this.Ea=this.Ea||[]};
|
135 |
+
function na(a,c,d,e,g){var h=a.Ea=a.Ea||[];g=g||{};g.kind=c;g.label=d;g.language=e;c=t.ba(c||"subtitles");var k=new window.videojs[c+"Track"](a,g);h.push(k);k.Ab()&&a.J(function(){setTimeout(function(){Y(k.j(),k.id())},0)})}function Y(a,c,d){for(var e=a.Ea,g=0,h=e.length,k,n;g<h;g++)k=e[g],k.id()===c?(k.show(),n=k):d&&(k.K()==d&&0<k.mode())&&k.disable();(c=n?n.K():d?d:l)&&a.k(c+"trackchange")}
|
136 |
+
t.B=t.a.extend({i:function(a,c){t.a.call(this,a,c);this.U=c.id||"vjs_"+c.kind+"_"+c.language+"_"+t.w++;this.Lc=c.src;this.qd=c["default"]||c.dflt;this.ge=c.title;this.Ua=c.srclang;this.Ed=c.label;this.ca=[];this.tb=[];this.ma=this.na=0}});s=t.B.prototype;s.K=p("H");s.src=p("Lc");s.Ab=p("qd");s.title=p("ge");s.language=p("Ua");s.label=p("Ed");s.md=p("ca");s.ed=p("tb");s.readyState=p("na");s.mode=p("ma");s.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-"+this.H+" vjs-text-track"})};
|
137 |
+
s.show=function(){oa(this);this.ma=2;t.a.prototype.show.call(this)};s.W=function(){oa(this);this.ma=1;t.a.prototype.W.call(this)};s.disable=function(){2==this.ma&&this.W();this.c.o("timeupdate",t.bind(this,this.update,this.U));this.c.o("ended",t.bind(this,this.reset,this.U));this.reset();this.c.ka("textTrackDisplay").removeChild(this);this.ma=0};
|
138 |
+
function oa(a){0===a.na&&a.load();0===a.ma&&(a.c.d("timeupdate",t.bind(a,a.update,a.U)),a.c.d("ended",t.bind(a,a.reset,a.U)),("captions"===a.H||"subtitles"===a.H)&&a.c.ka("textTrackDisplay").S(a))}s.load=function(){0===this.na&&(this.na=1,t.get(this.Lc,t.bind(this,this.Td),t.bind(this,this.Jd)))};s.Jd=function(a){this.error=a;this.na=3;this.k("error")};
|
139 |
+
s.Td=function(a){var c,d;a=a.split("\n");for(var e="",g=1,h=a.length;g<h;g++)if(e=t.trim(a[g])){-1==e.indexOf("--\x3e")?(c=e,e=t.trim(a[++g])):c=this.ca.length;c={id:c,index:this.ca.length};d=e.split(/[\t ]+/);c.startTime=pa(d[0]);c.xa=pa(d[2]);for(d=[];a[++g]&&(e=t.trim(a[g]));)d.push(e);c.text=d.join("<br/>");this.ca.push(c)}this.na=2;this.k("loaded")};
|
140 |
+
function pa(a){var c=a.split(":");a=0;var d,e,g;3==c.length?(d=c[0],e=c[1],c=c[2]):(d=0,e=c[0],c=c[1]);c=c.split(/\s+/);c=c.splice(0,1)[0];c=c.split(/\.|,/);g=parseFloat(c[1]);c=c[0];a+=3600*parseFloat(d);a+=60*parseFloat(e);a+=parseFloat(c);g&&(a+=g/1E3);return a}
|
141 |
+
s.update=function(){if(0<this.ca.length){var a=this.c.options().trackTimeOffset||0,a=this.c.currentTime()+a;if(this.Ob===b||a<this.Ob||this.Wa<=a){var c=this.ca,d=this.c.duration(),e=0,g=l,h=[],k,n,r,w;a>=this.Wa||this.Wa===b?w=this.Db!==b?this.Db:0:(g=f,w=this.Jb!==b?this.Jb:c.length-1);for(;;){r=c[w];if(r.xa<=a)e=Math.max(e,r.xa),r.Na&&(r.Na=l);else if(a<r.startTime){if(d=Math.min(d,r.startTime),r.Na&&(r.Na=l),!g)break}else g?(h.splice(0,0,r),n===b&&(n=w),k=w):(h.push(r),k===b&&(k=w),n=w),d=Math.min(d,
|
142 |
+
r.xa),e=Math.max(e,r.startTime),r.Na=f;if(g)if(0===w)break;else w--;else if(w===c.length-1)break;else w++}this.tb=h;this.Wa=d;this.Ob=e;this.Db=k;this.Jb=n;k=this.tb;n="";a=0;for(c=k.length;a<c;a++)n+='<span class="vjs-tt-cue">'+k[a].text+"</span>";this.b.innerHTML=n;this.k("cuechange")}}};s.reset=function(){this.Wa=0;this.Ob=this.c.duration();this.Jb=this.Db=0};t.Vb=t.B.extend();t.Vb.prototype.H="captions";t.cc=t.B.extend();t.cc.prototype.H="subtitles";t.Wb=t.B.extend();t.Wb.prototype.H="chapters";
|
143 |
+
t.ec=t.a.extend({i:function(a,c,d){t.a.call(this,a,c,d);if(a.l.tracks&&0<a.l.tracks.length){c=this.c;a=a.l.tracks;for(var e=0;e<a.length;e++)d=a[e],na(c,d.kind,d.label,d.language,d)}}});t.ec.prototype.e=function(){return t.a.prototype.e.call(this,"div",{className:"vjs-text-track-display"})};t.aa=t.I.extend({i:function(a,c){var d=this.ea=c.track;c.label=d.label();c.selected=d.Ab();t.I.call(this,a,c);this.c.d(d.K()+"trackchange",t.bind(this,this.update))}});
|
144 |
+
t.aa.prototype.r=function(){t.I.prototype.r.call(this);Y(this.c,this.ea.U,this.ea.K())};t.aa.prototype.update=function(){this.selected(2==this.ea.mode())};t.mb=t.aa.extend({i:function(a,c){c.track={K:function(){return c.kind},j:a,label:function(){return c.kind+" off"},Ab:q(l),mode:q(l)};t.aa.call(this,a,c);this.selected(f)}});t.mb.prototype.r=function(){t.aa.prototype.r.call(this);Y(this.c,this.ea.U,this.ea.K())};
|
145 |
+
t.mb.prototype.update=function(){for(var a=this.c.textTracks(),c=0,d=a.length,e,g=f;c<d;c++)e=a[c],e.K()==this.ea.K()&&2==e.mode()&&(g=l);this.selected(g)};t.V=t.M.extend({i:function(a,c){t.M.call(this,a,c);1>=this.P.length&&this.W()}});t.V.prototype.va=function(){var a=[],c;a.push(new t.mb(this.c,{kind:this.H}));for(var d=0;d<this.c.textTracks().length;d++)c=this.c.textTracks()[d],c.K()===this.H&&a.push(new t.aa(this.c,{track:c}));return a};
|
146 |
+
t.Ga=t.V.extend({i:function(a,c,d){t.V.call(this,a,c,d);this.b.setAttribute("aria-label","Captions Menu")}});t.Ga.prototype.H="captions";t.Ga.prototype.ta="Captions";t.Ga.prototype.className="vjs-captions-button";t.Ma=t.V.extend({i:function(a,c,d){t.V.call(this,a,c,d);this.b.setAttribute("aria-label","Subtitles Menu")}});t.Ma.prototype.H="subtitles";t.Ma.prototype.ta="Subtitles";t.Ma.prototype.className="vjs-subtitles-button";
|
147 |
+
t.Ha=t.V.extend({i:function(a,c,d){t.V.call(this,a,c,d);this.b.setAttribute("aria-label","Chapters Menu")}});s=t.Ha.prototype;s.H="chapters";s.ta="Chapters";s.className="vjs-chapters-button";s.va=function(){for(var a=[],c,d=0;d<this.c.textTracks().length;d++)c=this.c.textTracks()[d],c.K()===this.H&&a.push(new t.aa(this.c,{track:c}));return a};
|
148 |
+
s.wa=function(){for(var a=this.c.textTracks(),c=0,d=a.length,e,g,h=this.P=[];c<d;c++)if(e=a[c],e.K()==this.H)if(0===e.readyState())e.load(),e.d("loaded",t.bind(this,this.wa));else{g=e;break}a=this.Aa;a===b&&(a=new t.ha(this.c),a.ja().appendChild(t.e("li",{className:"vjs-menu-title",innerHTML:t.ba(this.H),ee:-1})));if(g){e=g.ca;for(var k,c=0,d=e.length;c<d;c++)k=e[c],k=new t.gb(this.c,{track:g,cue:k}),h.push(k),a.S(k);this.S(a)}0<this.P.length&&this.show();return a};
|
149 |
+
t.gb=t.I.extend({i:function(a,c){var d=this.ea=c.track,e=this.cue=c.cue,g=a.currentTime();c.label=e.text;c.selected=e.startTime<=g&&g<e.xa;t.I.call(this,a,c);d.d("cuechange",t.bind(this,this.update))}});t.gb.prototype.r=function(){t.I.prototype.r.call(this);this.c.currentTime(this.cue.startTime);this.update(this.cue.startTime)};t.gb.prototype.update=function(){var a=this.cue,c=this.c.currentTime();this.selected(a.startTime<=c&&c<a.xa)};
|
150 |
+
t.g.z(t.Ia.prototype.l.children,{subtitlesButton:{},captionsButton:{},chaptersButton:{}});
|
151 |
+
if("undefined"!==typeof window.JSON&&"function"===window.JSON.parse)t.JSON=window.JSON;else{t.JSON={};var Z=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;t.JSON.parse=function(a,c){function d(a,e){var k,n,r=a[e];if(r&&"object"===typeof r)for(k in r)Object.prototype.hasOwnProperty.call(r,k)&&(n=d(r,k),n!==b?r[k]=n:delete r[k]);return c.call(a,e,r)}var e;a=String(a);Z.lastIndex=0;Z.test(a)&&(a=a.replace(Z,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));
|
152 |
if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof c?d({"":e},""):e;throw new SyntaxError("JSON.parse(): invalid or malformed JSON data");}}
|
153 |
+
t.ic=function(){var a,c,d,e;a=document.getElementsByTagName("video");c=document.getElementsByTagName("audio");var g=[];if(a&&0<a.length){d=0;for(e=a.length;d<e;d++)g.push(a[d])}if(c&&0<c.length){d=0;for(e=c.length;d<e;d++)g.push(c[d])}if(g&&0<g.length){d=0;for(e=g.length;d<e;d++)if((c=g[d])&&c.getAttribute)c.player===b&&(a=c.getAttribute("data-setup"),a!==j&&videojs(c));else{t.ub();break}}else t.Tc||t.ub()};t.ub=function(){setTimeout(t.ic,1)};
|
154 |
+
"complete"===document.readyState?t.Tc=f:t.Q(window,"load",function(){t.Tc=f});t.ub();t.Vd=function(a,c){t.Player.prototype[a]=c};var qa=this;function $(a,c){var d=a.split("."),e=qa;!(d[0]in e)&&e.execScript&&e.execScript("var "+d[0]);for(var g;d.length&&(g=d.shift());)!d.length&&c!==b?e[g]=c:e=e[g]?e[g]:e[g]={}};$("videojs",t);$("_V_",t);$("videojs.options",t.options);$("videojs.players",t.Ba);$("videojs.TOUCH_ENABLED",t.dc);$("videojs.cache",t.ua);$("videojs.Component",t.a);t.a.prototype.player=t.a.prototype.j;t.a.prototype.options=t.a.prototype.options;t.a.prototype.init=t.a.prototype.i;t.a.prototype.dispose=t.a.prototype.dispose;t.a.prototype.createEl=t.a.prototype.e;t.a.prototype.contentEl=t.a.prototype.ja;t.a.prototype.el=t.a.prototype.v;t.a.prototype.addChild=t.a.prototype.S;
|
155 |
+
t.a.prototype.getChild=t.a.prototype.ka;t.a.prototype.getChildById=t.a.prototype.xd;t.a.prototype.children=t.a.prototype.children;t.a.prototype.initChildren=t.a.prototype.vc;t.a.prototype.removeChild=t.a.prototype.removeChild;t.a.prototype.on=t.a.prototype.d;t.a.prototype.off=t.a.prototype.o;t.a.prototype.one=t.a.prototype.Q;t.a.prototype.trigger=t.a.prototype.k;t.a.prototype.triggerReady=t.a.prototype.Fa;t.a.prototype.show=t.a.prototype.show;t.a.prototype.hide=t.a.prototype.W;
|
156 |
+
t.a.prototype.width=t.a.prototype.width;t.a.prototype.height=t.a.prototype.height;t.a.prototype.dimensions=t.a.prototype.rd;t.a.prototype.ready=t.a.prototype.J;t.a.prototype.addClass=t.a.prototype.m;t.a.prototype.removeClass=t.a.prototype.p;t.a.prototype.buildCSSClass=t.a.prototype.T;t.a.prototype.localize=t.a.prototype.s;t.Player.prototype.ended=t.Player.prototype.ended;t.Player.prototype.enterFullWindow=t.Player.prototype.pc;t.Player.prototype.exitFullWindow=t.Player.prototype.Cb;
|
157 |
+
t.Player.prototype.preload=t.Player.prototype.Ca;t.Player.prototype.remainingTime=t.Player.prototype.remainingTime;t.Player.prototype.supportsFullScreen=t.Player.prototype.Da;t.Player.prototype.currentType=t.Player.prototype.nd;t.Player.prototype.requestFullScreen=t.Player.prototype.requestFullScreen;t.Player.prototype.requestFullscreen=t.Player.prototype.requestFullscreen;t.Player.prototype.cancelFullScreen=t.Player.prototype.cancelFullScreen;t.Player.prototype.exitFullscreen=t.Player.prototype.exitFullscreen;
|
158 |
+
t.Player.prototype.isFullScreen=t.Player.prototype.isFullScreen;t.Player.prototype.isFullscreen=t.Player.prototype.isFullscreen;$("videojs.MediaLoader",t.cd);$("videojs.TextTrackDisplay",t.ec);$("videojs.ControlBar",t.Ia);$("videojs.Button",t.t);$("videojs.PlayToggle",t.$b);$("videojs.FullscreenToggle",t.Ja);$("videojs.BigPlayButton",t.fb);$("videojs.LoadingSpinner",t.Yb);$("videojs.CurrentTimeDisplay",t.hb);$("videojs.DurationDisplay",t.ib);$("videojs.TimeDivider",t.fc);
|
159 |
+
$("videojs.RemainingTimeDisplay",t.pb);$("videojs.LiveDisplay",t.Xb);$("videojs.ErrorDisplay",t.jb);$("videojs.Slider",t.R);$("videojs.ProgressControl",t.ob);$("videojs.SeekBar",t.bc);$("videojs.LoadProgressBar",t.lb);$("videojs.PlayProgressBar",t.Zb);$("videojs.SeekHandle",t.La);$("videojs.VolumeControl",t.rb);$("videojs.VolumeBar",t.qb);$("videojs.VolumeLevel",t.gc);$("videojs.VolumeMenuButton",t.ra);$("videojs.VolumeHandle",t.sb);$("videojs.MuteToggle",t.ia);$("videojs.PosterImage",t.Ka);
|
160 |
+
$("videojs.Menu",t.ha);$("videojs.MenuItem",t.I);$("videojs.MenuButton",t.M);$("videojs.PlaybackRateMenuButton",t.ac);t.M.prototype.createItems=t.M.prototype.va;t.V.prototype.createItems=t.V.prototype.va;t.Ha.prototype.createItems=t.Ha.prototype.va;$("videojs.SubtitlesButton",t.Ma);$("videojs.CaptionsButton",t.Ga);$("videojs.ChaptersButton",t.Ha);$("videojs.MediaTechController",t.q);t.q.prototype.featuresVolumeControl=t.q.prototype.re;t.q.prototype.featuresFullscreenResize=t.q.prototype.ne;
|
161 |
+
t.q.prototype.featuresPlaybackRate=t.q.prototype.oe;t.q.prototype.featuresProgressEvents=t.q.prototype.pe;t.q.prototype.featuresTimeupdateEvents=t.q.prototype.qe;t.q.prototype.setPoster=t.q.prototype.Kc;$("videojs.Html5",t.h);t.h.Events=t.h.kb;t.h.isSupported=t.h.isSupported;t.h.canPlaySource=t.h.vb;t.h.patchCanPlayType=t.h.Cc;t.h.unpatchCanPlayType=t.h.ie;t.h.prototype.setCurrentTime=t.h.prototype.Pb;t.h.prototype.setVolume=t.h.prototype.ce;t.h.prototype.setMuted=t.h.prototype.$d;
|
162 |
+
t.h.prototype.setPreload=t.h.prototype.be;t.h.prototype.setAutoplay=t.h.prototype.Xd;t.h.prototype.setLoop=t.h.prototype.Zd;t.h.prototype.enterFullScreen=t.h.prototype.oc;t.h.prototype.exitFullScreen=t.h.prototype.ud;t.h.prototype.playbackRate=t.h.prototype.playbackRate;t.h.prototype.setPlaybackRate=t.h.prototype.ae;$("videojs.Flash",t.f);t.f.isSupported=t.f.isSupported;t.f.canPlaySource=t.f.vb;t.f.onReady=t.f.onReady;t.f.embed=t.f.nc;t.f.version=t.f.version;$("videojs.TextTrack",t.B);
|
163 |
+
t.B.prototype.label=t.B.prototype.label;t.B.prototype.kind=t.B.prototype.K;t.B.prototype.mode=t.B.prototype.mode;t.B.prototype.cues=t.B.prototype.md;t.B.prototype.activeCues=t.B.prototype.ed;$("videojs.CaptionsTrack",t.Vb);$("videojs.SubtitlesTrack",t.cc);$("videojs.ChaptersTrack",t.Wb);$("videojs.autoSetup",t.ic);$("videojs.plugin",t.Vd);$("videojs.createTimeRange",t.zb);$("videojs.util",t.ga);t.ga.mergeOptions=t.ga.Va;t.addLanguage=t.fd;})();
|