FV Flowplayer Video Player - Version 6.5

Version Description

  • 2018/03/14 =

  • New feature - Video position saving for both guest and logged in users - see Settings -> FV Player -> Sidewide Flowplayer Defaults -> Remember video position

  • Custom video fields are now easy to add with the FV_Player_MetaBox PHP class

  • DASH - updating to latest tested Dash.js version

  • Bugfix - iframe embed code placing body closing tag in bad place

  • Bugfix - fix for PHP warnings on AMP pages

  • Bugfix - Shortcode editor bug when you select the subtitle language and it adds the subtitles twice

  • Bugfix - Subtitles in playlist - making sure multilingual subtitles work for the first item at least

Download this release

Release Info

Developer FolioVision
Plugin Icon 128x128 FV Flowplayer Video Player
Version 6.5
Comparing to
See all releases

Code changes from version 6.4.2 to 6.5

composer.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "require-dev": {
3
+ "mockery/mockery": "dev-master"
4
+ }
5
+ }
controller/editor.php CHANGED
@@ -7,13 +7,18 @@ function fv_player_shortcode_editor_scripts( $page ) {
7
return;
8
}
9
10
global $fv_wp_flowplayer_ver;
11
-
12
-
13
wp_register_script('fvwpflowplayer-domwindow', flowplayer::get_plugin_url().'/js/jquery.colorbox-min.js',array('jquery'), $fv_wp_flowplayer_ver );
14
wp_enqueue_script('fvwpflowplayer-domwindow');
15
16
- wp_register_script('fvwpflowplayer-shortcode-editor', flowplayer::get_plugin_url().'/js/shortcode-editor.js',array('jquery'), $fv_wp_flowplayer_ver );
17
wp_register_script('fvwpflowplayer-shortcode-editor-old', flowplayer::get_plugin_url().'/js/shortcode-editor.old.js',array('jquery'), $fv_wp_flowplayer_ver );
18
19
global $fv_fp;
7
return;
8
}
9
10
+ fv_player_shortcode_editor_scripts_enqueue();
11
+ }
12
+
13
+
14
+
15
+
16
+ function fv_player_shortcode_editor_scripts_enqueue() {
17
global $fv_wp_flowplayer_ver;
18
wp_register_script('fvwpflowplayer-domwindow', flowplayer::get_plugin_url().'/js/jquery.colorbox-min.js',array('jquery'), $fv_wp_flowplayer_ver );
19
wp_enqueue_script('fvwpflowplayer-domwindow');
20
21
+ wp_register_script('fvwpflowplayer-shortcode-editor', flowplayer::get_plugin_url().'/js/shortcode-editor.js',array('jquery','jquery-ui-sortable'), $fv_wp_flowplayer_ver );
22
wp_register_script('fvwpflowplayer-shortcode-editor-old', flowplayer::get_plugin_url().'/js/shortcode-editor.old.js',array('jquery'), $fv_wp_flowplayer_ver );
23
24
global $fv_fp;
controller/frontend.php CHANGED
@@ -357,6 +357,12 @@ function flowplayer_prepare_scripts() {
357
$aConf['mobile_native_fullscreen'] = $fv_fp->_get_option('mobile_native_fullscreen');
358
$aConf['mobile_force_fullscreen'] = $fv_fp->_get_option('mobile_force_fullscreen');
359
360
$aConf['sticky_video'] = $fv_fp->_get_option('sticky_video');
361
$aConf['sticky_place'] = $fv_fp->_get_option('sticky_place');
362
$aConf['sticky_width'] = $fv_fp->_get_option('sticky_width');
@@ -411,7 +417,7 @@ function flowplayer_prepare_scripts() {
411
}
412
413
global $FV_Player_lightbox;
414
- if( $FV_Player_lightbox->bLoad || $fv_fp->_get_option('lightbox_images') || $fv_fp->_get_option('js-everywhere') ) {
415
$aConf = array();
416
$aConf['lightbox_images'] = $fv_fp->_get_option('lightbox_images');
417
@@ -565,4 +571,3 @@ function fv_player_comment_text( $comment_text ) {
565
566
return $comment_text;
567
}
568
-
357
$aConf['mobile_native_fullscreen'] = $fv_fp->_get_option('mobile_native_fullscreen');
358
$aConf['mobile_force_fullscreen'] = $fv_fp->_get_option('mobile_force_fullscreen');
359
360
+ if ( $fv_fp->_get_option('video_position_save_enable') ) {
361
+ $aConf['video_position_save_enable'] = $fv_fp->_get_option('video_position_save_enable');
362
+ }
363
+
364
+ if( is_user_logged_in() ) $aConf['is_logged_in'] = true;
365
+
366
$aConf['sticky_video'] = $fv_fp->_get_option('sticky_video');
367
$aConf['sticky_place'] = $fv_fp->_get_option('sticky_place');
368
$aConf['sticky_width'] = $fv_fp->_get_option('sticky_width');
417
}
418
419
global $FV_Player_lightbox;
420
+ if( isset($FV_Player_lightbox) && ( $FV_Player_lightbox->bLoad || $fv_fp->_get_option('lightbox_images') || $fv_fp->_get_option('js-everywhere') ) ) {
421
$aConf = array();
422
$aConf['lightbox_images'] = $fv_fp->_get_option('lightbox_images');
423
571
572
return $comment_text;
573
}
css/admin.css CHANGED
@@ -129,4 +129,6 @@ table.fv-player-popup-formats td:first-child { width: 72px }
129
#fp-preview-wrapper>.flowplayer{position:relative; height:160px}
130
#fp-preview-wrapper .fp-subtitle{height:50px}
131
132
- #dashboard-widgets .flowplayer-wrapper h3, #dashboard-widgets .flowplayer-wrapper h4 {color:inherit;margin:0 auto;padding:0;font-weight:700;font-size:inherit}
129
#fp-preview-wrapper>.flowplayer{position:relative; height:160px}
130
#fp-preview-wrapper .fp-subtitle{height:50px}
131
132
+ #dashboard-widgets .flowplayer-wrapper h3, #dashboard-widgets .flowplayer-wrapper h4 {color:inherit;margin:0 auto;padding:0;font-weight:700;font-size:inherit}
133
+
134
+ .fv-player-editor-wrapper { float: left }
css/flowplayer-beta.css CHANGED
@@ -1501,9 +1501,8 @@
1501
1502
1503
1504
- /* Alignment, todo: check! */
1505
- .flowplayer.alignleft { margin-left: 10px; margin-bottom: 10px; }
1506
- .flowplayer.alignright { margin-right: 10px; margin-bottom: 10px; }
1507
1508
1509
@@ -1872,7 +1871,6 @@ article .entry-content .fvfp_admin_error p { line-height: 18px }
1872
.edd_form .fv-player-custom-video-list {
1873
clear: both;
1874
position: relative;
1875
- top: -26px;
1876
}
1877
a.fv-player-custom-video-add, a.fv-player-custom-video-remove {
1878
margin: 0 6px 0 0;
@@ -1921,7 +1919,8 @@ body.fv_flowplayer_tabs_hide .fv_flowplayer_tabs_content > div.fv_flowplayer_tab
1921
text-align: center;
1922
}
1923
.fv-fp-playlist .fvp-icon,
1924
- .fv-fp-playlist #fvp-playlist-play {
1925
display: none;
1926
}
1927
.fv-fp-playlist.mode-repeat-playlist .fvp-icon.fvp-replay-list,
1501
1502
1503
1504
+ .flowplayer.alignleft { margin-right: 10px; margin-bottom: 10px; }
1505
+ .flowplayer.alignright { margin-left: 10px; margin-bottom: 10px; }
1506
1507
1508
1871
.edd_form .fv-player-custom-video-list {
1872
clear: both;
1873
position: relative;
1874
}
1875
a.fv-player-custom-video-add, a.fv-player-custom-video-remove {
1876
margin: 0 6px 0 0;
1919
text-align: center;
1920
}
1921
.fv-fp-playlist .fvp-icon,
1922
+ .fv-fp-playlist #fvp-playlist-play,
1923
+ .flowplayer .fp-menu.fv-fp-playlist-menu .fp-selected::before {
1924
display: none;
1925
}
1926
.fv-fp-playlist.mode-repeat-playlist .fvp-icon.fvp-replay-list,
css/flowplayer.css CHANGED
@@ -1068,7 +1068,6 @@ body.fv_flowplayer_tabs_hide .fv_flowplayer_tabs_content > div.fv_flowplayer_tab
1068
.edd_form .fv-player-custom-video-list {
1069
clear: both;
1070
position: relative;
1071
- top: -26px;
1072
}
1073
a.fv-player-custom-video-add, a.fv-player-custom-video-remove {
1074
margin: 0 6px 0 0;
1068
.edd_form .fv-player-custom-video-list {
1069
clear: both;
1070
position: relative;
1071
}
1072
a.fv-player-custom-video-add, a.fv-player-custom-video-remove {
1073
margin: 0 6px 0 0;
flowplayer-beta/fv-flowplayer.min.js CHANGED
@@ -10,6 +10,8 @@ for(n=0;n<t.length;n++)t[n]&&(e[t[n]]=1);return e}({},g(y+(f?w:""))),I=function(
10
if(this instanceof r){var e=w.call(n,this,m.call(o,d.call(arguments)));return i(e)===e?e:this}return w.call(n,t,m.call(o,d.call(arguments)))},l=b(0,n.length-o.length),u=[],c=0;l>c;c++)h.call(u,"quot;+c);return r=a("binder","return function ("+v.call(u,",")+"){ return binder.apply(this, arguments); }")(s),n.prototype&&(U.prototype=n.prototype,r.prototype=new U,U.prototype=null),r}});var J=y.bind(o.hasOwnProperty),B=y.bind(o.toString),F=y.bind(d),H=w.bind(d);if("object"==typeof document&&document&&document.documentElement)try{F(document.documentElement.childNodes)}catch(V){var X=F,_=H;F=function(e){for(var t=[],n=e.length;n-->0;)t[n]=e[n];return _(t,X(arguments,1))},H=function(e,t){return _(F(e),t)}}var K=y.bind(u.slice),Q=y.bind(u.split),q=y.bind(u.indexOf),$=y.bind(h),ee=y.bind(o.propertyIsEnumerable),te=y.bind(r.sort),ne=n.isArray||function(e){return"[object Array]"===B(e)},re=1!==[].unshift(0);O(r,{unshift:function(){return g.apply(this,arguments),this.length}},re),O(n,{isArray:ne});var ie=i("a"),oe="a"!==ie[0]||!(0 in ie),ae=function(e){var t=!0,n=!0,r=!1;if(e)try{e.call("foo",function(e,n,r){"object"!=typeof r&&(t=!1)}),e.call([1],function(){"use strict";n="string"==typeof this},"x")}catch(i){r=!0}return!!e&&!r&&t&&n};O(r,{forEach:function(t){var n,r=W.ToObject(this),i=oe&&Z(this)?Q(this,""):r,o=-1,a=W.ToUint32(i.length);if(arguments.length>1&&(n=arguments[1]),!e(t))throw new TypeError("Array.prototype.forEach callback must be a function");for(;++o<a;)o in i&&("undefined"==typeof n?t(i[o],o,r):t.call(n,i[o],o,r))}},!ae(r.forEach)),O(r,{map:function(t){var r,i=W.ToObject(this),o=oe&&Z(this)?Q(this,""):i,a=W.ToUint32(o.length),s=n(a);if(arguments.length>1&&(r=arguments[1]),!e(t))throw new TypeError("Array.prototype.map callback must be a function");for(var l=0;a>l;l++)l in o&&("undefined"==typeof r?s[l]=t(o[l],l,i):s[l]=t.call(r,o[l],l,i));return s}},!ae(r.map)),O(r,{filter:function(t){var n,r,i=W.ToObject(this),o=oe&&Z(this)?Q(this,""):i,a=W.ToUint32(o.length),s=[];if(arguments.length>1&&(r=arguments[1]),!e(t))throw new TypeError("Array.prototype.filter callback must be a function");for(var l=0;a>l;l++)l in o&&(n=o[l],("undefined"==typeof r?t(n,l,i):t.call(r,n,l,i))&&$(s,n));return s}},!ae(r.filter)),O(r,{every:function(t){var n,r=W.ToObject(this),i=oe&&Z(this)?Q(this,""):r,o=W.ToUint32(i.length);if(arguments.length>1&&(n=arguments[1]),!e(t))throw new TypeError("Array.prototype.every callback must be a function");for(var a=0;o>a;a++)if(a in i&&!("undefined"==typeof n?t(i[a],a,r):t.call(n,i[a],a,r)))return!1;return!0}},!ae(r.every)),O(r,{some:function(t){var n,r=W.ToObject(this),i=oe&&Z(this)?Q(this,""):r,o=W.ToUint32(i.length);if(arguments.length>1&&(n=arguments[1]),!e(t))throw new TypeError("Array.prototype.some callback must be a function");for(var a=0;o>a;a++)if(a in i&&("undefined"==typeof n?t(i[a],a,r):t.call(n,i[a],a,r)))return!0;return!1}},!ae(r.some));var se=!1;r.reduce&&(se="object"==typeof r.reduce.call("es5",function(e,t,n,r){return r})),O(r,{reduce:function(t){var n=W.ToObject(this),r=oe&&Z(this)?Q(this,""):n,i=W.ToUint32(r.length);if(!e(t))throw new TypeError("Array.prototype.reduce callback must be a function");if(0===i&&1===arguments.length)throw new TypeError("reduce of empty array with no initial value");var o,a=0;if(arguments.length>=2)o=arguments[1];else for(;;){if(a in r){o=r[a++];break}if(++a>=i)throw new TypeError("reduce of empty array with no initial value")}for(;i>a;a++)a in r&&(o=t(o,r[a],a,n));return o}},!se);var le=!1;r.reduceRight&&(le="object"==typeof r.reduceRight.call("es5",function(e,t,n,r){return r})),O(r,{reduceRight:function(t){var n=W.ToObject(this),r=oe&&Z(this)?Q(this,""):n,i=W.ToUint32(r.length);if(!e(t))throw new TypeError("Array.prototype.reduceRight callback must be a function");if(0===i&&1===arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var o,a=i-1;if(arguments.length>=2)o=arguments[1];else for(;;){if(a in r){o=r[a--];break}if(--a<0)throw new TypeError("reduceRight of empty array with no initial value")}if(0>a)return o;do a in r&&(o=t(o,r[a],a,n));while(a--);return o}},!le);var ue=r.indexOf&&-1!==[0,1].indexOf(1,2);O(r,{indexOf:function(e){var t=oe&&Z(this)?Q(this,""):W.ToObject(this),n=W.ToUint32(t.length);if(0===n)return-1;var r=0;for(arguments.length>1&&(r=W.ToInteger(arguments[1])),r=r>=0?r:b(0,n+r);n>r;r++)if(r in t&&t[r]===e)return r;return-1}},ue);var ce=r.lastIndexOf&&-1!==[0,1].lastIndexOf(0,-3);O(r,{lastIndexOf:function(e){var t=oe&&Z(this)?Q(this,""):W.ToObject(this),n=W.ToUint32(t.length);if(0===n)return-1;var r=n-1;for(arguments.length>1&&(r=I(r,W.ToInteger(arguments[1]))),r=r>=0?r:n-Math.abs(r);r>=0;r--)if(r in t&&e===t[r])return r;return-1}},ce);var fe=function(){var e=[1,2],t=e.splice();return 2===e.length&&ne(t)&&0===t.length}();O(r,{splice:function(e,t){return 0===arguments.length?[]:p.apply(this,arguments)}},!fe);var de=function(){var e={};return r.splice.call(e,0,0,1),1===e.length}();O(r,{splice:function(e,t){if(0===arguments.length)return[];var n=arguments;return this.length=b(W.ToInteger(this.length),0),arguments.length>0&&"number"!=typeof t&&(n=F(arguments),n.length<2?$(n,this.length-e):n[1]=W.ToInteger(t)),p.apply(this,n)}},!de);var pe=function(){var e=new n(1e5);return e[8]="x",e.splice(1,1),7===e.indexOf("x")}(),he=function(){var e=256,t=[];return t[e]="a",t.splice(e+1,0,"b"),"a"===t[e]}();O(r,{splice:function(e,t){for(var n,r=W.ToObject(this),i=[],o=W.ToUint32(r.length),a=W.ToInteger(e),s=0>a?b(o+a,0):I(a,o),u=I(b(W.ToInteger(t),0),o-s),c=0;u>c;)n=l(s+c),J(r,n)&&(i[c]=r[n]),c+=1;var f,d=F(arguments,2),p=d.length;if(u>p){c=s;for(var h=o-u;h>c;)n=l(c+u),f=l(c+p),J(r,n)?r[f]=r[n]:delete r[f],c+=1;c=o;for(var g=o-u+p;c>g;)delete r[c-1],c-=1}else if(p>u)for(c=o-u;c>s;)n=l(c+u-1),f=l(c+p-1),J(r,n)?r[f]=r[n]:delete r[f],c-=1;c=s;for(var m=0;m<d.length;++m)r[c]=d[m],c+=1;return r.length=o-u+p,i}},!pe||!he);var ge,me=r.join;try{ge="1,2,3"!==Array.prototype.join.call("123",",")}catch(V){ge=!0}ge&&O(r,{join:function(e){var t="undefined"==typeof e?",":e;return me.call(Z(this)?Q(this,""):this,t)}},ge);var ve="1,2"!==[1,2].join(void 0);ve&&O(r,{join:function(e){var t="undefined"==typeof e?",":e;return me.call(this,t)}},ve);var ye=function(e){for(var t=W.ToObject(this),n=W.ToUint32(t.length),r=0;r<arguments.length;)t[n+r]=arguments[r],r+=1;return t.length=n+r,n+r},we=function(){var e={},t=Array.prototype.push.call(e,void 0);return 1!==t||1!==e.length||"undefined"!=typeof e[0]||!J(e,0)}();O(r,{push:function(e){return ne(this)?h.apply(this,arguments):ye.apply(this,arguments)}},we);var be=function(){var e=[],t=e.push(void 0);return 1!==t||1!==e.length||"undefined"!=typeof e[0]||!J(e,0)}();O(r,{push:ye},be),O(r,{slice:function(e,t){var n=Z(this)?Q(this,""):this;return H(n,arguments)}},oe);var Ie=function(){try{[1,2].sort(null)}catch(e){try{[1,2].sort({})}catch(t){return!1}}return!0}(),Me=function(){try{return[1,2].sort(/a/),!1}catch(e){}return!0}(),Ce=function(){try{return[1,2].sort(void 0),!0}catch(e){}return!1}();O(r,{sort:function(t){if("undefined"==typeof t)return te(this);if(!e(t))throw new TypeError("Array.prototype.sort callback must be a function");return te(this,t)}},Ie||!Ce||!Me);var Ae=!ee({toString:null},"toString"),Se=ee(function(){},"prototype"),Ee=!J("x","0"),je=function(e){var t=e.constructor;return t&&t.prototype===e},De={$window:!0,$console:!0,$parent:!0,$self:!0,$frame:!0,$frames:!0,$frameElement:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$external:!0,$width:!0,$height:!0,$top:!0,$localStorage:!0},Ne=function(){if("undefined"==typeof window)return!1;for(var e in window)try{!De["quot;+e]&&J(window,e)&&null!==window[e]&&"object"==typeof window[e]&&je(window[e])}catch(t){return!0}return!1}(),Le=function(e){if("undefined"==typeof window||!Ne)return je(e);try{return je(e)}catch(t){return!1}},xe=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Te=xe.length,Ze=function(e){return"[object Arguments]"===B(e)},Pe=function(t){return null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&!ne(t)&&e(t.callee)},ke=Ze(arguments)?Ze:Pe;O(i,{keys:function(t){var n=e(t),r=ke(t),i=null!==t&&"object"==typeof t,o=i&&Z(t);if(!i&&!n&&!r)throw new TypeError("Object.keys called on a non-object");var a=[],s=Se&&n;if(o&&Ee||r)for(var u=0;u<t.length;++u)$(a,l(u));if(!r)for(var c in t)s&&"prototype"===c||!J(t,c)||$(a,l(c));if(Ae)for(var f=Le(t),d=0;Te>d;d++){var p=xe[d];f&&"constructor"===p||!J(t,p)||$(a,p)}return a}});var Ye=i.keys&&function(){return 2===i.keys(arguments).length}(1,2),ze=i.keys&&function(){var e=i.keys(arguments);return 1!==arguments.length||1!==e.length||1!==e[0]}(1),Oe=i.keys;O(i,{keys:function(e){return Oe(ke(e)?F(e):e)}},!Ye||ze);var Ge,Re,We=0!==new Date(-0xc782b5b342b24).getUTCMonth(),Ue=new Date(-0x55d318d56a724),Je=new Date(14496624e5),Be="Mon, 01 Jan -45875 11:59:59 GMT"!==Ue.toUTCString(),Fe=Ue.getTimezoneOffset();-720>Fe?(Ge="Tue Jan 02 -45875"!==Ue.toDateString(),Re=!/^Thu Dec 10 2015 \d\d:\d\d:\d\d GMT[-+]\d\d\d\d(?: |$)/.test(String(Je))):(Ge="Mon Jan 01 -45875"!==Ue.toDateString(),Re=!/^Wed Dec 09 2015 \d\d:\d\d:\d\d GMT[-+]\d\d\d\d(?: |$)/.test(String(Je)));var He=y.bind(Date.prototype.getFullYear),Ve=y.bind(Date.prototype.getMonth),Xe=y.bind(Date.prototype.getDate),_e=y.bind(Date.prototype.getUTCFullYear),Ke=y.bind(Date.prototype.getUTCMonth),Qe=y.bind(Date.prototype.getUTCDate),qe=y.bind(Date.prototype.getUTCDay),$e=y.bind(Date.prototype.getUTCHours),et=y.bind(Date.prototype.getUTCMinutes),tt=y.bind(Date.prototype.getUTCSeconds),nt=y.bind(Date.prototype.getUTCMilliseconds),rt=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],it=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ot=function(e,t){return Xe(new Date(t,e,0))};O(Date.prototype,{getFullYear:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=He(this);return 0>e&&Ve(this)>11?e+1:e},getMonth:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=He(this),t=Ve(this);return 0>e&&t>11?0:t},getDate:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=He(this),t=Ve(this),n=Xe(this);if(0>e&&t>11){if(12===t)return n;var r=ot(0,e+1);return r-n+1}return n},getUTCFullYear:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=_e(this);return 0>e&&Ke(this)>11?e+1:e},getUTCMonth:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=_e(this),t=Ke(this);return 0>e&&t>11?0:t},getUTCDate:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=_e(this),t=Ke(this),n=Qe(this);if(0>e&&t>11){if(12===t)return n;var r=ot(0,e+1);return r-n+1}return n}},We),O(Date.prototype,{toUTCString:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=qe(this),t=Qe(this),n=Ke(this),r=_e(this),i=$e(this),o=et(this),a=tt(this);return rt[e]+", "+(10>t?"0"+t:t)+" "+it[n]+" "+r+" "+(10>i?"0"+i:i)+":"+(10>o?"0"+o:o)+":"+(10>a?"0"+a:a)+" GMT"}},We||Be),O(Date.prototype,{toDateString:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=this.getDay(),t=this.getDate(),n=this.getMonth(),r=this.getFullYear();return rt[e]+" "+it[n]+" "+(10>t?"0"+t:t)+" "+r}},We||Ge),(We||Re)&&(Date.prototype.toString=function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=this.getDay(),t=this.getDate(),n=this.getMonth(),r=this.getFullYear(),i=this.getHours(),o=this.getMinutes(),a=this.getSeconds(),s=this.getTimezoneOffset(),l=Math.floor(Math.abs(s)/60),u=Math.floor(Math.abs(s)%60);return rt[e]+" "+it[n]+" "+(10>t?"0"+t:t)+" "+r+" "+(10>i?"0"+i:i)+":"+(10>o?"0"+o:o)+":"+(10>a?"0"+a:a)+" GMT"+(s>0?"-":"+")+(10>l?"0"+l:l)+(10>u?"0"+u:u)},z&&i.defineProperty(Date.prototype,"toString",{configurable:!0,enumerable:!1,writable:!0}));var at=-621987552e5,st="-000001",lt=Date.prototype.toISOString&&-1===new Date(at).toISOString().indexOf(st),ut=Date.prototype.toISOString&&"1969-12-31T23:59:59.999Z"!==new Date(-1).toISOString(),ct=y.bind(Date.prototype.getTime);O(Date.prototype,{toISOString:function(){if(!isFinite(this)||!isFinite(ct(this)))throw new RangeError("Date.prototype.toISOString called on non-finite value.");var e=_e(this),t=Ke(this);e+=Math.floor(t/12),t=(t%12+12)%12;var n=[t+1,Qe(this),$e(this),et(this),tt(this)];e=(0>e?"-":e>9999?"+":"")+K("00000"+Math.abs(e),e>=0&&9999>=e?-4:-6);for(var r=0;r<n.length;++r)n[r]=K("00"+n[r],-2);return e+"-"+F(n,0,2).join("-")+"T"+F(n,2).join(":")+"."+K("000"+nt(this),-3)+"Z"}},lt||ut);var ft=function(){try{return Date.prototype.toJSON&&null===new Date(NaN).toJSON()&&-1!==new Date(at).toJSON().indexOf(st)&&Date.prototype.toJSON.call({toISOString:function(){return!0}})}catch(e){return!1}}();ft||(Date.prototype.toJSON=function(t){var n=i(this),r=W.ToPrimitive(n);if("number"==typeof r&&!isFinite(r))return null;var o=n.toISOString;if(!e(o))throw new TypeError("toISOString property is not callable");return o.call(n)});var dt=1e15===Date.parse("+033658-09-27T01:46:40.000Z"),pt=!isNaN(Date.parse("2012-04-04T24:00:00.500Z"))||!isNaN(Date.parse("2012-11-31T23:59:59.000Z"))||!isNaN(Date.parse("2012-12-31T23:59:60.000Z")),ht=isNaN(Date.parse("2000-01-01T00:00:00.000Z"));if(ht||pt||!dt){var gt=Math.pow(2,31)-1,mt=R(new Date(1970,0,1,0,0,0,gt+1).getTime());Date=function(e){var t=function(n,r,i,o,a,s,u){var c,f=arguments.length;if(this instanceof e){var d=s,p=u;if(mt&&f>=7&&u>gt){var h=Math.floor(u/gt)*gt,g=Math.floor(h/1e3);d+=g,p-=1e3*g}c=1===f&&l(n)===n?new e(t.parse(n)):f>=7?new e(n,r,i,o,a,d,p):f>=6?new e(n,r,i,o,a,d):f>=5?new e(n,r,i,o,a):f>=4?new e(n,r,i,o):f>=3?new e(n,r,i):f>=2?new e(n,r):f>=1?new e(n instanceof e?+n:n):new e}else c=e.apply(this,arguments);return G(c)||O(c,{constructor:t},!0),c},n=new RegExp("^(\\d{4}|[+-]\\d{6})(?:-(\\d{2})(?:-(\\d{2})(?:T(\\d{2}):(\\d{2})(?::(\\d{2})(?:(\\.\\d{1,}))?)?(Z|(?:([-+])(\\d{2}):(\\d{2})))?)?)?)?quot;),r=[0,31,59,90,120,151,181,212,243,273,304,334,365],i=function(e,t){var n=t>1?1:0;return r[t]+Math.floor((e-1969+n)/4)-Math.floor((e-1901+n)/100)+Math.floor((e-1601+n)/400)+365*(e-1970)},o=function(t){var n=0,r=t;if(mt&&r>gt){var i=Math.floor(r/gt)*gt,o=Math.floor(i/1e3);n+=o,r-=1e3*o}return c(new e(1970,0,1,0,0,n,r))};for(var a in e)J(e,a)&&(t[a]=e[a]);O(t,{now:e.now,UTC:e.UTC},!0),t.prototype=e.prototype,O(t.prototype,{constructor:t},!0);var s=function(t){var r=n.exec(t);if(r){var a,s=c(r[1]),l=c(r[2]||1)-1,u=c(r[3]||1)-1,f=c(r[4]||0),d=c(r[5]||0),p=c(r[6]||0),h=Math.floor(1e3*c(r[7]||0)),g=Boolean(r[4]&&!r[8]),m="-"===r[9]?1:-1,v=c(r[10]||0),y=c(r[11]||0),w=d>0||p>0||h>0;return(w?24:25)>f&&60>d&&60>p&&1e3>h&&l>-1&&12>l&&24>v&&60>y&&u>-1&&u<i(s,l+1)-i(s,l)&&(a=60*(24*(i(s,l)+u)+f+v*m),a=1e3*(60*(a+d+y*m)+p)+h,g&&(a=o(a)),a>=-864e13&&864e13>=a)?a:NaN}return e.parse.apply(this,arguments)};return O(t,{parse:s}),t}(Date)}Date.now||(Date.now=function(){return(new Date).getTime()});var vt=f.toFixed&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==0xde0b6b3a7640080.toFixed(0)),yt={base:1e7,size:6,data:[0,0,0,0,0,0],multiply:function(e,t){for(var n=-1,r=t;++n<yt.size;)r+=e*yt.data[n],yt.data[n]=r%yt.base,r=Math.floor(r/yt.base)},divide:function(e){for(var t=yt.size,n=0;--t>=0;)n+=yt.data[t],yt.data[t]=Math.floor(n/e),n=n%e*yt.base},numToString:function(){for(var e=yt.size,t="";--e>=0;)if(""!==t||0===e||0!==yt.data[e]){var n=l(yt.data[e]);""===t?t=n:t+=K("0000000",0,7-n.length)+n}return t},pow:function Ot(e,t,n){return 0===t?n:t%2===1?Ot(e,t-1,n*e):Ot(e*e,t/2,n)},log:function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}},wt=function(e){var t,n,r,i,o,a,s,u;if(t=c(e),t=R(t)?0:Math.floor(t),0>t||t>20)throw new RangeError("Number.toFixed called with invalid number of decimals");if(n=c(this),R(n))return"NaN";if(-1e21>=n||n>=1e21)return l(n);if(r="",0>n&&(r="-",n=-n),i="0",n>1e-21)if(o=yt.log(n*yt.pow(2,69,1))-69,a=0>o?n*yt.pow(2,-o,1):n/yt.pow(2,o,1),a*=4503599627370496,o=52-o,o>0){for(yt.multiply(0,a),s=t;s>=7;)yt.multiply(1e7,0),s-=7;for(yt.multiply(yt.pow(10,s,1),0),s=o-1;s>=23;)yt.divide(1<<23),s-=23;yt.divide(1<<s),yt.multiply(1,1),yt.divide(2),i=yt.numToString()}else yt.multiply(0,a),yt.multiply(1<<-o,0),i=yt.numToString()+K("0.00000000000000000000",2,2+t);return t>0?(u=i.length,i=t>=u?r+K("0.0000000000000000000",0,t-u+2)+i:r+K(i,0,u-t)+"."+K(i,u-t)):i=r+i,i};O(f,{toFixed:wt},vt);var bt=function(){try{return"1"===1..toPrecision(void 0)}catch(e){return!0}}(),It=f.toPrecision;O(f,{toPrecision:function(e){return"undefined"==typeof e?It.call(this):It.call(this,e)}},bt),2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||"t"==="tesst".split(/(s)*/)[1]||4!=="test".split(/(?:)/,-1).length||"".split(/.?/).length||".".split(/()()/).length>1?!function(){var e="undefined"==typeof/()??/.exec("")[1],n=Math.pow(2,32)-1;u.split=function(r,i){var o=String(this);if("undefined"==typeof r&&0===i)return[];if(!t(r))return Q(this,r,i);var a,s,l,u,c=[],f=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.unicode?"u":"")+(r.sticky?"y":""),d=0,p=new RegExp(r.source,f+"g");e||(a=new RegExp("^"+p.source+"$(?!\\s)",f));var g="undefined"==typeof i?n:W.ToUint32(i);for(s=p.exec(o);s&&(l=s.index+s[0].length,!(l>d&&($(c,K(o,d,s.index)),!e&&s.length>1&&s[0].replace(a,function(){for(var e=1;e<arguments.length-2;e++)"undefined"==typeof arguments[e]&&(s[e]=void 0)}),s.length>1&&s.index<o.length&&h.apply(c,F(s,1)),u=s[0].length,d=l,c.length>=g)));)p.lastIndex===s.index&&p.lastIndex++,s=p.exec(o);return d===o.length?(u||!p.test(""))&&$(c,""):$(c,K(o,d)),c.length>g?F(c,0,g):c}}():"0".split(void 0,0).length&&(u.split=function(e,t){return"undefined"==typeof e&&0===t?[]:Q(this,e,t)});var Mt=u.replace,Ct=function(){var e=[];return"x".replace(/x(.)?/g,function(t,n){$(e,n)}),1===e.length&&"undefined"==typeof e[0]}();Ct||(u.replace=function(n,r){var i=e(r),o=t(n)&&/\)[*?]/.test(n.source);if(i&&o){var a=function(e){var t=arguments.length,i=n.lastIndex;n.lastIndex=0;var o=n.exec(e)||[];return n.lastIndex=i,$(o,arguments[t-2],arguments[t-1]),r.apply(this,o)};return Mt.call(this,n,a)}return Mt.call(this,n,r)});var At=u.substr,St="".substr&&"b"!=="0b".substr(-1);O(u,{substr:function(e,t){var n=e;return 0>e&&(n=b(this.length+e,0)),At.call(this,n,t)}},St);var Et=" \n\f\r   ᠎              \u2028\u2029\ufeff",jt="​",Dt="["+Et+"]",Nt=new RegExp("^"+Dt+Dt+"*"),Lt=new RegExp(Dt+Dt+"*quot;),xt=u.trim&&(Et.trim()||!jt.trim());O(u,{trim:function(){if("undefined"==typeof this||null===this)throw new TypeError("can't convert "+this+" to object");return l(this).replace(Nt,"").replace(Lt,"")}},xt);var Tt=y.bind(String.prototype.trim),Zt=u.lastIndexOf&&-1!=="abcあい".lastIndexOf("あい",2);O(u,{lastIndexOf:function(e){if("undefined"==typeof this||null===this)throw new TypeError("can't convert "+this+" to object");for(var t=l(this),n=l(e),r=arguments.length>1?c(arguments[1]):NaN,i=R(r)?1/0:W.ToInteger(r),o=I(b(i,0),t.length),a=n.length,s=o+a;s>0;){s=b(0,s-a);var u=q(K(t,s,o+a),n);if(-1!==u)return s+u}return-1}},Zt);var Pt=u.lastIndexOf;if(O(u,{lastIndexOf:function(e){return Pt.apply(this,arguments)}},1!==u.lastIndexOf.length),(8!==parseInt(Et+"08")||22!==parseInt(Et+"0x16"))&&(parseInt=function(e){var t=/^[-+]?0[xX]/;return function(n,r){var i=Tt(String(n)),o=c(r)||(t.test(i)?16:10);return e(i,o)}}(parseInt)),1/parseFloat("-0")!==-(1/0)&&(parseFloat=function(e){return function(t){var n=Tt(String(t)),r=e(n);return 0===r&&"-"===K(n,0,1)?-0:r}}(parseFloat)),"RangeError: test"!==String(new RangeError("test"))){var kt=function(){if("undefined"==typeof this||null===this)throw new TypeError("can't convert "+this+" to object");var e=this.name;"undefined"==typeof e?e="Error":"string"!=typeof e&&(e=l(e));var t=this.message;return"undefined"==typeof t?t="":"string"!=typeof t&&(t=l(t)),e?t?e+": "+t:e:t};Error.prototype.toString=kt}if(z){var Yt=function(e,t){if(ee(e,t)){var n=Object.getOwnPropertyDescriptor(e,t);n.configurable&&(n.enumerable=!1,Object.defineProperty(e,t,n))}};Yt(Error.prototype,"message"),""!==Error.prototype.message&&(Error.prototype.message=""),Yt(Error.prototype,"name")}if("/a/gim"!==String(/a/gim)){var zt=function(){var e="/"+this.source+"/";return this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),e};RegExp.prototype.toString=zt}})},{}],39:[function(e,t,n){var r=[],i=r.forEach,o=r.slice;t.exports=function(e){return i.call(o.call(arguments,1),function(t){if(t)for(var n in t)e[n]=t[n]}),e}},{}],40:[function(e,t,n){n.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,l=(1<<s)-1,u=l>>1,c=-7,f=n?i-1:0,d=n?-1:1,p=e[t+f];for(f+=d,o=p&(1<<-c)-1,p>>=-c,c+=s;c>0;o=256*o+e[t+f],f+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+f],f+=d,c-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:(p?-1:1)*(1/0);a+=Math.pow(2,r),o-=u}return(p?-1:1)*a*Math.pow(2,o-r)},n.write=function(e,t,n,r,i,o){var a,s,l,u=8*o-i-1,c=(1<<u)-1,f=c>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,h=r?1:-1,g=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),t+=a+f>=1?d/l:d*Math.pow(2,1-f),t*l>=2&&(a++,l/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(t*l-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[n+p]=255&s,p+=h,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;e[n+p]=255&a,p+=h,a/=256,u-=8);e[n+p-h]|=128*g}},{}],41:[function(e,t,n){var r=[].indexOf;t.exports=function(e,t){if(r)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}},{}],42:[function(e,t,n){function r(e){var t=i.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}t.exports=r;var i=Object.prototype.toString},{}],43:[function(e,t,n){var r={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},{}],44:[function(t,n,r){(function(t){!function(i){function o(e){throw new RangeError(P[e])}function a(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function s(e,t){var n=e.split("@"),r="";n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace(Z,".");var i=e.split("."),o=a(i,t).join(".");return r+o}function l(e){for(var t,n,r=[],i=0,o=e.length;o>i;)t=e.charCodeAt(i++),t>=55296&&56319>=t&&o>i?(n=e.charCodeAt(i++),56320==(64512&n)?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--)):r.push(t);return r}function u(e){return a(e,function(e){var t="";return e>65535&&(e-=65536,t+=z(e>>>10&1023|55296),e=56320|1023&e),t+=z(e)}).join("")}function c(e){return 10>e-48?e-22:26>e-65?e-65:26>e-97?e-97:C}function f(e,t){return e+22+75*(26>e)-((0!=t)<<5)}function d(e,t,n){var r=0;for(e=n?Y(e/j):e>>1,e+=Y(e/t);e>k*S>>1;r+=C)e=Y(e/k);return Y(r+(k+1)*e/(e+E))}function p(e){var t,n,r,i,a,s,l,f,p,h,g=[],m=e.length,v=0,y=N,w=D;for(n=e.lastIndexOf(L),0>n&&(n=0),r=0;n>r;++r)e.charCodeAt(r)>=128&&o("not-basic"),g.push(e.charCodeAt(r));for(i=n>0?n+1:0;m>i;){for(a=v,s=1,l=C;i>=m&&o("invalid-input"),f=c(e.charCodeAt(i++)),(f>=C||f>Y((M-v)/s))&&o("overflow"),v+=f*s,p=w>=l?A:l>=w+S?S:l-w,!(p>f);l+=C)h=C-p,s>Y(M/h)&&o("overflow"),s*=h;t=g.length+1,w=d(v-a,t,0==a),Y(v/t)>M-y&&o("overflow"),y+=Y(v/t),v%=t,g.splice(v++,0,y)}return u(g)}function h(e){var t,n,r,i,a,s,u,c,p,h,g,m,v,y,w,b=[];for(e=l(e),m=e.length,t=N,n=0,a=D,s=0;m>s;++s)g=e[s],128>g&&b.push(z(g));for(r=i=b.length,i&&b.push(L);m>r;){for(u=M,s=0;m>s;++s)g=e[s],g>=t&&u>g&&(u=g);for(v=r+1,u-t>Y((M-n)/v)&&o("overflow"),n+=(u-t)*v,t=u,s=0;m>s;++s)if(g=e[s],t>g&&++n>M&&o("overflow"),g==t){for(c=n,p=C;h=a>=p?A:p>=a+S?S:p-a,!(h>c);p+=C)w=c-h,y=C-h,b.push(z(f(h+w%y,0))),c=Y(w/y);b.push(z(f(c,0))),a=d(n,v,r==i),n=0,++r}++n,++t}return b.join("")}function g(e){return s(e,function(e){return x.test(e)?p(e.slice(4).toLowerCase()):e})}function m(e){return s(e,function(e){return T.test(e)?"xn--"+h(e):e})}var v="object"==typeof r&&r&&!r.nodeType&&r,y="object"==typeof n&&n&&!n.nodeType&&n,w="object"==typeof t&&t;(w.global===w||w.window===w||w.self===w)&&(i=w);var b,I,M=2147483647,C=36,A=1,S=26,E=38,j=700,D=72,N=128,L="-",x=/^xn--/,T=/[^\x20-\x7E]/,Z=/[\x2E\u3002\uFF0E\uFF61]/g,P={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},k=C-A,Y=Math.floor,z=String.fromCharCode;if(b={version:"1.4.1",ucs2:{decode:l,encode:u},decode:p,encode:h,toASCII:m,toUnicode:g},"function"==typeof e&&"object"==typeof e.amd&&e.amd)e("punycode",function(){return b});else if(v&&y)if(n.exports==v)y.exports=b;else for(I in b)b.hasOwnProperty(I)&&(v[I]=b[I]);else i.punycode=b}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],45:[function(t,n,r){!function(t,r){"undefined"!=typeof n&&n.exports?n.exports=r():"function"==typeof e&&e.amd?e(r):this[t]=r()}("$script",function(){function e(e,t){for(var n=0,r=e.length;r>n;++n)if(!t(e[n]))return l;return 1}function t(t,n){e(t,function(e){return!n(e)})}function n(o,a,s){function l(e){return e.call?e():d[e]}function c(){if(!--y){d[v]=1,m&&m();for(var n in h)e(n.split("|"),l)&&!t(h[n],l)&&(h[n]=[])}}o=o[u]?o:[o];var f=a&&a.call,m=f?a:s,v=f?o.join(""):a,y=o.length;return setTimeout(function(){t(o,function e(t,n){return null===t?c():(n||/^https?:\/\//.test(t)||!i||(t=-1===t.indexOf(".js")?i+t+".js":i+t),g[t]?(v&&(p[v]=1),2==g[t]?c():setTimeout(function(){e(t,!0)},0)):(g[t]=1,v&&(p[v]=1),void r(t,c)))})},0),n}function r(e,t){var n,r=a.createElement("script");r.onload=r.onerror=r[f]=function(){r[c]&&!/^c|loade/.test(r[c])||n||(r.onload=r[f]=null,n=1,g[e]=2,t())},r.async=1,r.src=o?e+(-1===e.indexOf("?")?"?":"&")+o:e,s.insertBefore(r,s.lastChild)}var i,o,a=document,s=a.getElementsByTagName("head")[0],l=!1,u="push",c="readyState",f="onreadystatechange",d={},p={},h={},g={};return n.get=r,n.order=function(e,t,r){!function i(o){o=e.shift(),e.length?n(o,i):n(o,t,r)}()},n.path=function(e){i=e},n.urlArgs=function(e){o=e},n.ready=function(r,i,o){r=r[u]?r:[r];var a=[];return!t(r,function(e){d[e]||a[u](e)})&&e(r,function(e){return d[e]})?i():!function(e){h[e]=h[e]||[],h[e][u](i),o&&o(a)}(r.join("|")),n},n.done=function(e){n([null],e)},n})},{}]},{},[32])(32)});
11
12
13
14
15
/*
@@ -2270,4 +2272,293 @@ jQuery(function($) {
2270
$(document).on('click', "div.flowplayer.is-unSticky", function() {
2271
$("div.flowplayer").removeClass("is-unSticky");
2272
});
2273
- });
10
if(this instanceof r){var e=w.call(n,this,m.call(o,d.call(arguments)));return i(e)===e?e:this}return w.call(n,t,m.call(o,d.call(arguments)))},l=b(0,n.length-o.length),u=[],c=0;l>c;c++)h.call(u,"quot;+c);return r=a("binder","return function ("+v.call(u,",")+"){ return binder.apply(this, arguments); }")(s),n.prototype&&(U.prototype=n.prototype,r.prototype=new U,U.prototype=null),r}});var J=y.bind(o.hasOwnProperty),B=y.bind(o.toString),F=y.bind(d),H=w.bind(d);if("object"==typeof document&&document&&document.documentElement)try{F(document.documentElement.childNodes)}catch(V){var X=F,_=H;F=function(e){for(var t=[],n=e.length;n-->0;)t[n]=e[n];return _(t,X(arguments,1))},H=function(e,t){return _(F(e),t)}}var K=y.bind(u.slice),Q=y.bind(u.split),q=y.bind(u.indexOf),$=y.bind(h),ee=y.bind(o.propertyIsEnumerable),te=y.bind(r.sort),ne=n.isArray||function(e){return"[object Array]"===B(e)},re=1!==[].unshift(0);O(r,{unshift:function(){return g.apply(this,arguments),this.length}},re),O(n,{isArray:ne});var ie=i("a"),oe="a"!==ie[0]||!(0 in ie),ae=function(e){var t=!0,n=!0,r=!1;if(e)try{e.call("foo",function(e,n,r){"object"!=typeof r&&(t=!1)}),e.call([1],function(){"use strict";n="string"==typeof this},"x")}catch(i){r=!0}return!!e&&!r&&t&&n};O(r,{forEach:function(t){var n,r=W.ToObject(this),i=oe&&Z(this)?Q(this,""):r,o=-1,a=W.ToUint32(i.length);if(arguments.length>1&&(n=arguments[1]),!e(t))throw new TypeError("Array.prototype.forEach callback must be a function");for(;++o<a;)o in i&&("undefined"==typeof n?t(i[o],o,r):t.call(n,i[o],o,r))}},!ae(r.forEach)),O(r,{map:function(t){var r,i=W.ToObject(this),o=oe&&Z(this)?Q(this,""):i,a=W.ToUint32(o.length),s=n(a);if(arguments.length>1&&(r=arguments[1]),!e(t))throw new TypeError("Array.prototype.map callback must be a function");for(var l=0;a>l;l++)l in o&&("undefined"==typeof r?s[l]=t(o[l],l,i):s[l]=t.call(r,o[l],l,i));return s}},!ae(r.map)),O(r,{filter:function(t){var n,r,i=W.ToObject(this),o=oe&&Z(this)?Q(this,""):i,a=W.ToUint32(o.length),s=[];if(arguments.length>1&&(r=arguments[1]),!e(t))throw new TypeError("Array.prototype.filter callback must be a function");for(var l=0;a>l;l++)l in o&&(n=o[l],("undefined"==typeof r?t(n,l,i):t.call(r,n,l,i))&&$(s,n));return s}},!ae(r.filter)),O(r,{every:function(t){var n,r=W.ToObject(this),i=oe&&Z(this)?Q(this,""):r,o=W.ToUint32(i.length);if(arguments.length>1&&(n=arguments[1]),!e(t))throw new TypeError("Array.prototype.every callback must be a function");for(var a=0;o>a;a++)if(a in i&&!("undefined"==typeof n?t(i[a],a,r):t.call(n,i[a],a,r)))return!1;return!0}},!ae(r.every)),O(r,{some:function(t){var n,r=W.ToObject(this),i=oe&&Z(this)?Q(this,""):r,o=W.ToUint32(i.length);if(arguments.length>1&&(n=arguments[1]),!e(t))throw new TypeError("Array.prototype.some callback must be a function");for(var a=0;o>a;a++)if(a in i&&("undefined"==typeof n?t(i[a],a,r):t.call(n,i[a],a,r)))return!0;return!1}},!ae(r.some));var se=!1;r.reduce&&(se="object"==typeof r.reduce.call("es5",function(e,t,n,r){return r})),O(r,{reduce:function(t){var n=W.ToObject(this),r=oe&&Z(this)?Q(this,""):n,i=W.ToUint32(r.length);if(!e(t))throw new TypeError("Array.prototype.reduce callback must be a function");if(0===i&&1===arguments.length)throw new TypeError("reduce of empty array with no initial value");var o,a=0;if(arguments.length>=2)o=arguments[1];else for(;;){if(a in r){o=r[a++];break}if(++a>=i)throw new TypeError("reduce of empty array with no initial value")}for(;i>a;a++)a in r&&(o=t(o,r[a],a,n));return o}},!se);var le=!1;r.reduceRight&&(le="object"==typeof r.reduceRight.call("es5",function(e,t,n,r){return r})),O(r,{reduceRight:function(t){var n=W.ToObject(this),r=oe&&Z(this)?Q(this,""):n,i=W.ToUint32(r.length);if(!e(t))throw new TypeError("Array.prototype.reduceRight callback must be a function");if(0===i&&1===arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var o,a=i-1;if(arguments.length>=2)o=arguments[1];else for(;;){if(a in r){o=r[a--];break}if(--a<0)throw new TypeError("reduceRight of empty array with no initial value")}if(0>a)return o;do a in r&&(o=t(o,r[a],a,n));while(a--);return o}},!le);var ue=r.indexOf&&-1!==[0,1].indexOf(1,2);O(r,{indexOf:function(e){var t=oe&&Z(this)?Q(this,""):W.ToObject(this),n=W.ToUint32(t.length);if(0===n)return-1;var r=0;for(arguments.length>1&&(r=W.ToInteger(arguments[1])),r=r>=0?r:b(0,n+r);n>r;r++)if(r in t&&t[r]===e)return r;return-1}},ue);var ce=r.lastIndexOf&&-1!==[0,1].lastIndexOf(0,-3);O(r,{lastIndexOf:function(e){var t=oe&&Z(this)?Q(this,""):W.ToObject(this),n=W.ToUint32(t.length);if(0===n)return-1;var r=n-1;for(arguments.length>1&&(r=I(r,W.ToInteger(arguments[1]))),r=r>=0?r:n-Math.abs(r);r>=0;r--)if(r in t&&e===t[r])return r;return-1}},ce);var fe=function(){var e=[1,2],t=e.splice();return 2===e.length&&ne(t)&&0===t.length}();O(r,{splice:function(e,t){return 0===arguments.length?[]:p.apply(this,arguments)}},!fe);var de=function(){var e={};return r.splice.call(e,0,0,1),1===e.length}();O(r,{splice:function(e,t){if(0===arguments.length)return[];var n=arguments;return this.length=b(W.ToInteger(this.length),0),arguments.length>0&&"number"!=typeof t&&(n=F(arguments),n.length<2?$(n,this.length-e):n[1]=W.ToInteger(t)),p.apply(this,n)}},!de);var pe=function(){var e=new n(1e5);return e[8]="x",e.splice(1,1),7===e.indexOf("x")}(),he=function(){var e=256,t=[];return t[e]="a",t.splice(e+1,0,"b"),"a"===t[e]}();O(r,{splice:function(e,t){for(var n,r=W.ToObject(this),i=[],o=W.ToUint32(r.length),a=W.ToInteger(e),s=0>a?b(o+a,0):I(a,o),u=I(b(W.ToInteger(t),0),o-s),c=0;u>c;)n=l(s+c),J(r,n)&&(i[c]=r[n]),c+=1;var f,d=F(arguments,2),p=d.length;if(u>p){c=s;for(var h=o-u;h>c;)n=l(c+u),f=l(c+p),J(r,n)?r[f]=r[n]:delete r[f],c+=1;c=o;for(var g=o-u+p;c>g;)delete r[c-1],c-=1}else if(p>u)for(c=o-u;c>s;)n=l(c+u-1),f=l(c+p-1),J(r,n)?r[f]=r[n]:delete r[f],c-=1;c=s;for(var m=0;m<d.length;++m)r[c]=d[m],c+=1;return r.length=o-u+p,i}},!pe||!he);var ge,me=r.join;try{ge="1,2,3"!==Array.prototype.join.call("123",",")}catch(V){ge=!0}ge&&O(r,{join:function(e){var t="undefined"==typeof e?",":e;return me.call(Z(this)?Q(this,""):this,t)}},ge);var ve="1,2"!==[1,2].join(void 0);ve&&O(r,{join:function(e){var t="undefined"==typeof e?",":e;return me.call(this,t)}},ve);var ye=function(e){for(var t=W.ToObject(this),n=W.ToUint32(t.length),r=0;r<arguments.length;)t[n+r]=arguments[r],r+=1;return t.length=n+r,n+r},we=function(){var e={},t=Array.prototype.push.call(e,void 0);return 1!==t||1!==e.length||"undefined"!=typeof e[0]||!J(e,0)}();O(r,{push:function(e){return ne(this)?h.apply(this,arguments):ye.apply(this,arguments)}},we);var be=function(){var e=[],t=e.push(void 0);return 1!==t||1!==e.length||"undefined"!=typeof e[0]||!J(e,0)}();O(r,{push:ye},be),O(r,{slice:function(e,t){var n=Z(this)?Q(this,""):this;return H(n,arguments)}},oe);var Ie=function(){try{[1,2].sort(null)}catch(e){try{[1,2].sort({})}catch(t){return!1}}return!0}(),Me=function(){try{return[1,2].sort(/a/),!1}catch(e){}return!0}(),Ce=function(){try{return[1,2].sort(void 0),!0}catch(e){}return!1}();O(r,{sort:function(t){if("undefined"==typeof t)return te(this);if(!e(t))throw new TypeError("Array.prototype.sort callback must be a function");return te(this,t)}},Ie||!Ce||!Me);var Ae=!ee({toString:null},"toString"),Se=ee(function(){},"prototype"),Ee=!J("x","0"),je=function(e){var t=e.constructor;return t&&t.prototype===e},De={$window:!0,$console:!0,$parent:!0,$self:!0,$frame:!0,$frames:!0,$frameElement:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$external:!0,$width:!0,$height:!0,$top:!0,$localStorage:!0},Ne=function(){if("undefined"==typeof window)return!1;for(var e in window)try{!De["quot;+e]&&J(window,e)&&null!==window[e]&&"object"==typeof window[e]&&je(window[e])}catch(t){return!0}return!1}(),Le=function(e){if("undefined"==typeof window||!Ne)return je(e);try{return je(e)}catch(t){return!1}},xe=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Te=xe.length,Ze=function(e){return"[object Arguments]"===B(e)},Pe=function(t){return null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&!ne(t)&&e(t.callee)},ke=Ze(arguments)?Ze:Pe;O(i,{keys:function(t){var n=e(t),r=ke(t),i=null!==t&&"object"==typeof t,o=i&&Z(t);if(!i&&!n&&!r)throw new TypeError("Object.keys called on a non-object");var a=[],s=Se&&n;if(o&&Ee||r)for(var u=0;u<t.length;++u)$(a,l(u));if(!r)for(var c in t)s&&"prototype"===c||!J(t,c)||$(a,l(c));if(Ae)for(var f=Le(t),d=0;Te>d;d++){var p=xe[d];f&&"constructor"===p||!J(t,p)||$(a,p)}return a}});var Ye=i.keys&&function(){return 2===i.keys(arguments).length}(1,2),ze=i.keys&&function(){var e=i.keys(arguments);return 1!==arguments.length||1!==e.length||1!==e[0]}(1),Oe=i.keys;O(i,{keys:function(e){return Oe(ke(e)?F(e):e)}},!Ye||ze);var Ge,Re,We=0!==new Date(-0xc782b5b342b24).getUTCMonth(),Ue=new Date(-0x55d318d56a724),Je=new Date(14496624e5),Be="Mon, 01 Jan -45875 11:59:59 GMT"!==Ue.toUTCString(),Fe=Ue.getTimezoneOffset();-720>Fe?(Ge="Tue Jan 02 -45875"!==Ue.toDateString(),Re=!/^Thu Dec 10 2015 \d\d:\d\d:\d\d GMT[-+]\d\d\d\d(?: |$)/.test(String(Je))):(Ge="Mon Jan 01 -45875"!==Ue.toDateString(),Re=!/^Wed Dec 09 2015 \d\d:\d\d:\d\d GMT[-+]\d\d\d\d(?: |$)/.test(String(Je)));var He=y.bind(Date.prototype.getFullYear),Ve=y.bind(Date.prototype.getMonth),Xe=y.bind(Date.prototype.getDate),_e=y.bind(Date.prototype.getUTCFullYear),Ke=y.bind(Date.prototype.getUTCMonth),Qe=y.bind(Date.prototype.getUTCDate),qe=y.bind(Date.prototype.getUTCDay),$e=y.bind(Date.prototype.getUTCHours),et=y.bind(Date.prototype.getUTCMinutes),tt=y.bind(Date.prototype.getUTCSeconds),nt=y.bind(Date.prototype.getUTCMilliseconds),rt=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],it=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ot=function(e,t){return Xe(new Date(t,e,0))};O(Date.prototype,{getFullYear:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=He(this);return 0>e&&Ve(this)>11?e+1:e},getMonth:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=He(this),t=Ve(this);return 0>e&&t>11?0:t},getDate:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=He(this),t=Ve(this),n=Xe(this);if(0>e&&t>11){if(12===t)return n;var r=ot(0,e+1);return r-n+1}return n},getUTCFullYear:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=_e(this);return 0>e&&Ke(this)>11?e+1:e},getUTCMonth:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=_e(this),t=Ke(this);return 0>e&&t>11?0:t},getUTCDate:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=_e(this),t=Ke(this),n=Qe(this);if(0>e&&t>11){if(12===t)return n;var r=ot(0,e+1);return r-n+1}return n}},We),O(Date.prototype,{toUTCString:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=qe(this),t=Qe(this),n=Ke(this),r=_e(this),i=$e(this),o=et(this),a=tt(this);return rt[e]+", "+(10>t?"0"+t:t)+" "+it[n]+" "+r+" "+(10>i?"0"+i:i)+":"+(10>o?"0"+o:o)+":"+(10>a?"0"+a:a)+" GMT"}},We||Be),O(Date.prototype,{toDateString:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=this.getDay(),t=this.getDate(),n=this.getMonth(),r=this.getFullYear();return rt[e]+" "+it[n]+" "+(10>t?"0"+t:t)+" "+r}},We||Ge),(We||Re)&&(Date.prototype.toString=function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=this.getDay(),t=this.getDate(),n=this.getMonth(),r=this.getFullYear(),i=this.getHours(),o=this.getMinutes(),a=this.getSeconds(),s=this.getTimezoneOffset(),l=Math.floor(Math.abs(s)/60),u=Math.floor(Math.abs(s)%60);return rt[e]+" "+it[n]+" "+(10>t?"0"+t:t)+" "+r+" "+(10>i?"0"+i:i)+":"+(10>o?"0"+o:o)+":"+(10>a?"0"+a:a)+" GMT"+(s>0?"-":"+")+(10>l?"0"+l:l)+(10>u?"0"+u:u)},z&&i.defineProperty(Date.prototype,"toString",{configurable:!0,enumerable:!1,writable:!0}));var at=-621987552e5,st="-000001",lt=Date.prototype.toISOString&&-1===new Date(at).toISOString().indexOf(st),ut=Date.prototype.toISOString&&"1969-12-31T23:59:59.999Z"!==new Date(-1).toISOString(),ct=y.bind(Date.prototype.getTime);O(Date.prototype,{toISOString:function(){if(!isFinite(this)||!isFinite(ct(this)))throw new RangeError("Date.prototype.toISOString called on non-finite value.");var e=_e(this),t=Ke(this);e+=Math.floor(t/12),t=(t%12+12)%12;var n=[t+1,Qe(this),$e(this),et(this),tt(this)];e=(0>e?"-":e>9999?"+":"")+K("00000"+Math.abs(e),e>=0&&9999>=e?-4:-6);for(var r=0;r<n.length;++r)n[r]=K("00"+n[r],-2);return e+"-"+F(n,0,2).join("-")+"T"+F(n,2).join(":")+"."+K("000"+nt(this),-3)+"Z"}},lt||ut);var ft=function(){try{return Date.prototype.toJSON&&null===new Date(NaN).toJSON()&&-1!==new Date(at).toJSON().indexOf(st)&&Date.prototype.toJSON.call({toISOString:function(){return!0}})}catch(e){return!1}}();ft||(Date.prototype.toJSON=function(t){var n=i(this),r=W.ToPrimitive(n);if("number"==typeof r&&!isFinite(r))return null;var o=n.toISOString;if(!e(o))throw new TypeError("toISOString property is not callable");return o.call(n)});var dt=1e15===Date.parse("+033658-09-27T01:46:40.000Z"),pt=!isNaN(Date.parse("2012-04-04T24:00:00.500Z"))||!isNaN(Date.parse("2012-11-31T23:59:59.000Z"))||!isNaN(Date.parse("2012-12-31T23:59:60.000Z")),ht=isNaN(Date.parse("2000-01-01T00:00:00.000Z"));if(ht||pt||!dt){var gt=Math.pow(2,31)-1,mt=R(new Date(1970,0,1,0,0,0,gt+1).getTime());Date=function(e){var t=function(n,r,i,o,a,s,u){var c,f=arguments.length;if(this instanceof e){var d=s,p=u;if(mt&&f>=7&&u>gt){var h=Math.floor(u/gt)*gt,g=Math.floor(h/1e3);d+=g,p-=1e3*g}c=1===f&&l(n)===n?new e(t.parse(n)):f>=7?new e(n,r,i,o,a,d,p):f>=6?new e(n,r,i,o,a,d):f>=5?new e(n,r,i,o,a):f>=4?new e(n,r,i,o):f>=3?new e(n,r,i):f>=2?new e(n,r):f>=1?new e(n instanceof e?+n:n):new e}else c=e.apply(this,arguments);return G(c)||O(c,{constructor:t},!0),c},n=new RegExp("^(\\d{4}|[+-]\\d{6})(?:-(\\d{2})(?:-(\\d{2})(?:T(\\d{2}):(\\d{2})(?::(\\d{2})(?:(\\.\\d{1,}))?)?(Z|(?:([-+])(\\d{2}):(\\d{2})))?)?)?)?quot;),r=[0,31,59,90,120,151,181,212,243,273,304,334,365],i=function(e,t){var n=t>1?1:0;return r[t]+Math.floor((e-1969+n)/4)-Math.floor((e-1901+n)/100)+Math.floor((e-1601+n)/400)+365*(e-1970)},o=function(t){var n=0,r=t;if(mt&&r>gt){var i=Math.floor(r/gt)*gt,o=Math.floor(i/1e3);n+=o,r-=1e3*o}return c(new e(1970,0,1,0,0,n,r))};for(var a in e)J(e,a)&&(t[a]=e[a]);O(t,{now:e.now,UTC:e.UTC},!0),t.prototype=e.prototype,O(t.prototype,{constructor:t},!0);var s=function(t){var r=n.exec(t);if(r){var a,s=c(r[1]),l=c(r[2]||1)-1,u=c(r[3]||1)-1,f=c(r[4]||0),d=c(r[5]||0),p=c(r[6]||0),h=Math.floor(1e3*c(r[7]||0)),g=Boolean(r[4]&&!r[8]),m="-"===r[9]?1:-1,v=c(r[10]||0),y=c(r[11]||0),w=d>0||p>0||h>0;return(w?24:25)>f&&60>d&&60>p&&1e3>h&&l>-1&&12>l&&24>v&&60>y&&u>-1&&u<i(s,l+1)-i(s,l)&&(a=60*(24*(i(s,l)+u)+f+v*m),a=1e3*(60*(a+d+y*m)+p)+h,g&&(a=o(a)),a>=-864e13&&864e13>=a)?a:NaN}return e.parse.apply(this,arguments)};return O(t,{parse:s}),t}(Date)}Date.now||(Date.now=function(){return(new Date).getTime()});var vt=f.toFixed&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==0xde0b6b3a7640080.toFixed(0)),yt={base:1e7,size:6,data:[0,0,0,0,0,0],multiply:function(e,t){for(var n=-1,r=t;++n<yt.size;)r+=e*yt.data[n],yt.data[n]=r%yt.base,r=Math.floor(r/yt.base)},divide:function(e){for(var t=yt.size,n=0;--t>=0;)n+=yt.data[t],yt.data[t]=Math.floor(n/e),n=n%e*yt.base},numToString:function(){for(var e=yt.size,t="";--e>=0;)if(""!==t||0===e||0!==yt.data[e]){var n=l(yt.data[e]);""===t?t=n:t+=K("0000000",0,7-n.length)+n}return t},pow:function Ot(e,t,n){return 0===t?n:t%2===1?Ot(e,t-1,n*e):Ot(e*e,t/2,n)},log:function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}},wt=function(e){var t,n,r,i,o,a,s,u;if(t=c(e),t=R(t)?0:Math.floor(t),0>t||t>20)throw new RangeError("Number.toFixed called with invalid number of decimals");if(n=c(this),R(n))return"NaN";if(-1e21>=n||n>=1e21)return l(n);if(r="",0>n&&(r="-",n=-n),i="0",n>1e-21)if(o=yt.log(n*yt.pow(2,69,1))-69,a=0>o?n*yt.pow(2,-o,1):n/yt.pow(2,o,1),a*=4503599627370496,o=52-o,o>0){for(yt.multiply(0,a),s=t;s>=7;)yt.multiply(1e7,0),s-=7;for(yt.multiply(yt.pow(10,s,1),0),s=o-1;s>=23;)yt.divide(1<<23),s-=23;yt.divide(1<<s),yt.multiply(1,1),yt.divide(2),i=yt.numToString()}else yt.multiply(0,a),yt.multiply(1<<-o,0),i=yt.numToString()+K("0.00000000000000000000",2,2+t);return t>0?(u=i.length,i=t>=u?r+K("0.0000000000000000000",0,t-u+2)+i:r+K(i,0,u-t)+"."+K(i,u-t)):i=r+i,i};O(f,{toFixed:wt},vt);var bt=function(){try{return"1"===1..toPrecision(void 0)}catch(e){return!0}}(),It=f.toPrecision;O(f,{toPrecision:function(e){return"undefined"==typeof e?It.call(this):It.call(this,e)}},bt),2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||"t"==="tesst".split(/(s)*/)[1]||4!=="test".split(/(?:)/,-1).length||"".split(/.?/).length||".".split(/()()/).length>1?!function(){var e="undefined"==typeof/()??/.exec("")[1],n=Math.pow(2,32)-1;u.split=function(r,i){var o=String(this);if("undefined"==typeof r&&0===i)return[];if(!t(r))return Q(this,r,i);var a,s,l,u,c=[],f=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.unicode?"u":"")+(r.sticky?"y":""),d=0,p=new RegExp(r.source,f+"g");e||(a=new RegExp("^"+p.source+"$(?!\\s)",f));var g="undefined"==typeof i?n:W.ToUint32(i);for(s=p.exec(o);s&&(l=s.index+s[0].length,!(l>d&&($(c,K(o,d,s.index)),!e&&s.length>1&&s[0].replace(a,function(){for(var e=1;e<arguments.length-2;e++)"undefined"==typeof arguments[e]&&(s[e]=void 0)}),s.length>1&&s.index<o.length&&h.apply(c,F(s,1)),u=s[0].length,d=l,c.length>=g)));)p.lastIndex===s.index&&p.lastIndex++,s=p.exec(o);return d===o.length?(u||!p.test(""))&&$(c,""):$(c,K(o,d)),c.length>g?F(c,0,g):c}}():"0".split(void 0,0).length&&(u.split=function(e,t){return"undefined"==typeof e&&0===t?[]:Q(this,e,t)});var Mt=u.replace,Ct=function(){var e=[];return"x".replace(/x(.)?/g,function(t,n){$(e,n)}),1===e.length&&"undefined"==typeof e[0]}();Ct||(u.replace=function(n,r){var i=e(r),o=t(n)&&/\)[*?]/.test(n.source);if(i&&o){var a=function(e){var t=arguments.length,i=n.lastIndex;n.lastIndex=0;var o=n.exec(e)||[];return n.lastIndex=i,$(o,arguments[t-2],arguments[t-1]),r.apply(this,o)};return Mt.call(this,n,a)}return Mt.call(this,n,r)});var At=u.substr,St="".substr&&"b"!=="0b".substr(-1);O(u,{substr:function(e,t){var n=e;return 0>e&&(n=b(this.length+e,0)),At.call(this,n,t)}},St);var Et=" \n\f\r   ᠎              \u2028\u2029\ufeff",jt="​",Dt="["+Et+"]",Nt=new RegExp("^"+Dt+Dt+"*"),Lt=new RegExp(Dt+Dt+"*quot;),xt=u.trim&&(Et.trim()||!jt.trim());O(u,{trim:function(){if("undefined"==typeof this||null===this)throw new TypeError("can't convert "+this+" to object");return l(this).replace(Nt,"").replace(Lt,"")}},xt);var Tt=y.bind(String.prototype.trim),Zt=u.lastIndexOf&&-1!=="abcあい".lastIndexOf("あい",2);O(u,{lastIndexOf:function(e){if("undefined"==typeof this||null===this)throw new TypeError("can't convert "+this+" to object");for(var t=l(this),n=l(e),r=arguments.length>1?c(arguments[1]):NaN,i=R(r)?1/0:W.ToInteger(r),o=I(b(i,0),t.length),a=n.length,s=o+a;s>0;){s=b(0,s-a);var u=q(K(t,s,o+a),n);if(-1!==u)return s+u}return-1}},Zt);var Pt=u.lastIndexOf;if(O(u,{lastIndexOf:function(e){return Pt.apply(this,arguments)}},1!==u.lastIndexOf.length),(8!==parseInt(Et+"08")||22!==parseInt(Et+"0x16"))&&(parseInt=function(e){var t=/^[-+]?0[xX]/;return function(n,r){var i=Tt(String(n)),o=c(r)||(t.test(i)?16:10);return e(i,o)}}(parseInt)),1/parseFloat("-0")!==-(1/0)&&(parseFloat=function(e){return function(t){var n=Tt(String(t)),r=e(n);return 0===r&&"-"===K(n,0,1)?-0:r}}(parseFloat)),"RangeError: test"!==String(new RangeError("test"))){var kt=function(){if("undefined"==typeof this||null===this)throw new TypeError("can't convert "+this+" to object");var e=this.name;"undefined"==typeof e?e="Error":"string"!=typeof e&&(e=l(e));var t=this.message;return"undefined"==typeof t?t="":"string"!=typeof t&&(t=l(t)),e?t?e+": "+t:e:t};Error.prototype.toString=kt}if(z){var Yt=function(e,t){if(ee(e,t)){var n=Object.getOwnPropertyDescriptor(e,t);n.configurable&&(n.enumerable=!1,Object.defineProperty(e,t,n))}};Yt(Error.prototype,"message"),""!==Error.prototype.message&&(Error.prototype.message=""),Yt(Error.prototype,"name")}if("/a/gim"!==String(/a/gim)){var zt=function(){var e="/"+this.source+"/";return this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),e};RegExp.prototype.toString=zt}})},{}],39:[function(e,t,n){var r=[],i=r.forEach,o=r.slice;t.exports=function(e){return i.call(o.call(arguments,1),function(t){if(t)for(var n in t)e[n]=t[n]}),e}},{}],40:[function(e,t,n){n.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,l=(1<<s)-1,u=l>>1,c=-7,f=n?i-1:0,d=n?-1:1,p=e[t+f];for(f+=d,o=p&(1<<-c)-1,p>>=-c,c+=s;c>0;o=256*o+e[t+f],f+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+f],f+=d,c-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:(p?-1:1)*(1/0);a+=Math.pow(2,r),o-=u}return(p?-1:1)*a*Math.pow(2,o-r)},n.write=function(e,t,n,r,i,o){var a,s,l,u=8*o-i-1,c=(1<<u)-1,f=c>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,h=r?1:-1,g=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),t+=a+f>=1?d/l:d*Math.pow(2,1-f),t*l>=2&&(a++,l/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(t*l-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[n+p]=255&s,p+=h,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;e[n+p]=255&a,p+=h,a/=256,u-=8);e[n+p-h]|=128*g}},{}],41:[function(e,t,n){var r=[].indexOf;t.exports=function(e,t){if(r)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}},{}],42:[function(e,t,n){function r(e){var t=i.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}t.exports=r;var i=Object.prototype.toString},{}],43:[function(e,t,n){var r={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},{}],44:[function(t,n,r){(function(t){!function(i){function o(e){throw new RangeError(P[e])}function a(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function s(e,t){var n=e.split("@"),r="";n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace(Z,".");var i=e.split("."),o=a(i,t).join(".");return r+o}function l(e){for(var t,n,r=[],i=0,o=e.length;o>i;)t=e.charCodeAt(i++),t>=55296&&56319>=t&&o>i?(n=e.charCodeAt(i++),56320==(64512&n)?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--)):r.push(t);return r}function u(e){return a(e,function(e){var t="";return e>65535&&(e-=65536,t+=z(e>>>10&1023|55296),e=56320|1023&e),t+=z(e)}).join("")}function c(e){return 10>e-48?e-22:26>e-65?e-65:26>e-97?e-97:C}function f(e,t){return e+22+75*(26>e)-((0!=t)<<5)}function d(e,t,n){var r=0;for(e=n?Y(e/j):e>>1,e+=Y(e/t);e>k*S>>1;r+=C)e=Y(e/k);return Y(r+(k+1)*e/(e+E))}function p(e){var t,n,r,i,a,s,l,f,p,h,g=[],m=e.length,v=0,y=N,w=D;for(n=e.lastIndexOf(L),0>n&&(n=0),r=0;n>r;++r)e.charCodeAt(r)>=128&&o("not-basic"),g.push(e.charCodeAt(r));for(i=n>0?n+1:0;m>i;){for(a=v,s=1,l=C;i>=m&&o("invalid-input"),f=c(e.charCodeAt(i++)),(f>=C||f>Y((M-v)/s))&&o("overflow"),v+=f*s,p=w>=l?A:l>=w+S?S:l-w,!(p>f);l+=C)h=C-p,s>Y(M/h)&&o("overflow"),s*=h;t=g.length+1,w=d(v-a,t,0==a),Y(v/t)>M-y&&o("overflow"),y+=Y(v/t),v%=t,g.splice(v++,0,y)}return u(g)}function h(e){var t,n,r,i,a,s,u,c,p,h,g,m,v,y,w,b=[];for(e=l(e),m=e.length,t=N,n=0,a=D,s=0;m>s;++s)g=e[s],128>g&&b.push(z(g));for(r=i=b.length,i&&b.push(L);m>r;){for(u=M,s=0;m>s;++s)g=e[s],g>=t&&u>g&&(u=g);for(v=r+1,u-t>Y((M-n)/v)&&o("overflow"),n+=(u-t)*v,t=u,s=0;m>s;++s)if(g=e[s],t>g&&++n>M&&o("overflow"),g==t){for(c=n,p=C;h=a>=p?A:p>=a+S?S:p-a,!(h>c);p+=C)w=c-h,y=C-h,b.push(z(f(h+w%y,0))),c=Y(w/y);b.push(z(f(c,0))),a=d(n,v,r==i),n=0,++r}++n,++t}return b.join("")}function g(e){return s(e,function(e){return x.test(e)?p(e.slice(4).toLowerCase()):e})}function m(e){return s(e,function(e){return T.test(e)?"xn--"+h(e):e})}var v="object"==typeof r&&r&&!r.nodeType&&r,y="object"==typeof n&&n&&!n.nodeType&&n,w="object"==typeof t&&t;(w.global===w||w.window===w||w.self===w)&&(i=w);var b,I,M=2147483647,C=36,A=1,S=26,E=38,j=700,D=72,N=128,L="-",x=/^xn--/,T=/[^\x20-\x7E]/,Z=/[\x2E\u3002\uFF0E\uFF61]/g,P={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},k=C-A,Y=Math.floor,z=String.fromCharCode;if(b={version:"1.4.1",ucs2:{decode:l,encode:u},decode:p,encode:h,toASCII:m,toUnicode:g},"function"==typeof e&&"object"==typeof e.amd&&e.amd)e("punycode",function(){return b});else if(v&&y)if(n.exports==v)y.exports=b;else for(I in b)b.hasOwnProperty(I)&&(v[I]=b[I]);else i.punycode=b}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],45:[function(t,n,r){!function(t,r){"undefined"!=typeof n&&n.exports?n.exports=r():"function"==typeof e&&e.amd?e(r):this[t]=r()}("$script",function(){function e(e,t){for(var n=0,r=e.length;r>n;++n)if(!t(e[n]))return l;return 1}function t(t,n){e(t,function(e){return!n(e)})}function n(o,a,s){function l(e){return e.call?e():d[e]}function c(){if(!--y){d[v]=1,m&&m();for(var n in h)e(n.split("|"),l)&&!t(h[n],l)&&(h[n]=[])}}o=o[u]?o:[o];var f=a&&a.call,m=f?a:s,v=f?o.join(""):a,y=o.length;return setTimeout(function(){t(o,function e(t,n){return null===t?c():(n||/^https?:\/\//.test(t)||!i||(t=-1===t.indexOf(".js")?i+t+".js":i+t),g[t]?(v&&(p[v]=1),2==g[t]?c():setTimeout(function(){e(t,!0)},0)):(g[t]=1,v&&(p[v]=1),void r(t,c)))})},0),n}function r(e,t){var n,r=a.createElement("script");r.onload=r.onerror=r[f]=function(){r[c]&&!/^c|loade/.test(r[c])||n||(r.onload=r[f]=null,n=1,g[e]=2,t())},r.async=1,r.src=o?e+(-1===e.indexOf("?")?"?":"&")+o:e,s.insertBefore(r,s.lastChild)}var i,o,a=document,s=a.getElementsByTagName("head")[0],l=!1,u="push",c="readyState",f="onreadystatechange",d={},p={},h={},g={};return n.get=r,n.order=function(e,t,r){!function i(o){o=e.shift(),e.length?n(o,i):n(o,t,r)}()},n.path=function(e){i=e},n.urlArgs=function(e){o=e},n.ready=function(r,i,o){r=r[u]?r:[r];var a=[];return!t(r,function(e){d[e]||a[u](e)})&&e(r,function(e){return d[e]})?i():!function(e){h[e]=h[e]||[],h[e][u](i),o&&o(a)}(r.join("|")),n},n.done=function(e){n([null],e)},n})},{}]},{},[32])(32)});
11
12
13
+ /*! js-cookie v2.2.0 | MIT */
14
+ !function(e){var n=!1;if("function"==typeof define&&define.amd&&(define(e),n=!0),"object"==typeof exports&&(module.exports=e(),n=!0),!n){var o=window.Cookies,t=window.Cookies=e();t.noConflict=function(){return window.Cookies=o,t}}}(function(){function e(){for(var e=0,n={};e<arguments.length;e++){var o=arguments[e];for(var t in o)n[t]=o[t]}return n}function n(o){function t(n,r,i){var c;if("undefined"!=typeof document){if(arguments.length>1){if("number"==typeof(i=e({path:"/"},t.defaults,i)).expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*i.expires),i.expires=a}i.expires=i.expires?i.expires.toUTCString():"";try{c=JSON.stringify(r),/^[\{\[]/.test(c)&&(r=c)}catch(e){}r=o.write?o.write(r,n):encodeURIComponent(r+"").replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),n=(n=(n=encodeURIComponent(n+"")).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape);var s="";for(var f in i)i[f]&&(s+="; "+f,!0!==i[f]&&(s+="="+i[f]));return document.cookie=n+"="+r+s}n||(c={});for(var p=document.cookie?document.cookie.split("; "):[],d=/(%[0-9A-Z]{2})+/g,u=0;u<p.length;u++){var l=p[u].split("="),C=l.slice(1).join("=");this.json||'"'!==C.charAt(0)||(C=C.slice(1,-1));try{var m=l[0].replace(d,decodeURIComponent);if(C=o.read?o.read(C,m):o(C,m)||C.replace(d,decodeURIComponent),this.json)try{C=JSON.parse(C)}catch(e){}if(n===m){c=C;break}n||(c[m]=C)}catch(e){}}return c}}return t.set=t,t.get=function(e){return t.call(t,e)},t.getJSON=function(){return t.apply({json:!0},[].slice.call(arguments))},t.defaults={},t.remove=function(n,o){t(n,"",e(o,{expires:-1}))},t.withConverter=n,t}return n(function(){})});
15
16
17
/*
2272
$(document).on('click', "div.flowplayer.is-unSticky", function() {
2273
$("div.flowplayer").removeClass("is-unSticky");
2274
});
2275
+ });
2276
+
2277
+
2278
+ // Magnific Popup suppport
2279
+ jQuery(document).on('mfpClose', function() {
2280
+ if( typeof(jQuery('.flowplayer').data('flowplayer')) != "undefined" ) jQuery('.flowplayer').data('flowplayer').unload();
2281
+ } );
2282
+
2283
+
2284
+ /*
2285
+ * Video Position Store functionality
2286
+ */
2287
+ flowplayer( function(api,root) {
2288
+ // variables
2289
+ var
2290
+ // a jQuery representation of the root DIV element
2291
+ $root = jQuery(root),
2292
+ // whether or not we should enable position saving for this video only
2293
+ forceEnablePositionSaving = ($root.data('save-position') ? true : false),
2294
+ progressEventsCount = 0,
2295
+ // number of events to pass before we auto-send current video positions
2296
+ sendPositionsEvery = 60,
2297
+ // the actual AJAX object we use to send progress data, so we can cancel it,
2298
+ // should we encounter another timeout and the first AJAX did not complete yet
2299
+ // note: this is only used for logged-in users... everyone else will use cookie/localStorage
2300
+ ajaxCall = null,
2301
+ // maximum cookie size with saved video positions we should store
2302
+ maxCookieSize = 2500,
2303
+ // whether or not localStorage is enabled
2304
+ localStorageEnabled = null,
2305
+ // key name for cookie/localStorage lookup of video positions for guest visitors
2306
+ cookieKeyName = 'video_positions',
2307
+
2308
+ // methods
2309
+ // retrieves the original source of a video
2310
+ getOriginalSource = function(video) {
2311
+ // logged-in users will have position stored within that video
2312
+ return (
2313
+ (typeof(video.sources_original) != "undefined" && typeof(video.sources_original[0]) != "undefined") ?
2314
+ video.sources_original[0] :
2315
+ video.sources[0]
2316
+ );
2317
+ },
2318
+
2319
+ // calculates a cookie byte size
2320
+ getTextByteSize = function(txt) {
2321
+ return encodeURIComponent(txt).length;
2322
+ },
2323
+
2324
+ getCookieKey = function(key) {
2325
+ return (localStorageEnabled ? localStorage.getItem(key) : Cookies.get(key));
2326
+ },
2327
+
2328
+ setCookieKey = function(key, value) {
2329
+ return (localStorageEnabled ? localStorage.setItem(key, value) : Cookies.set(key, value));
2330
+ },
2331
+
2332
+ // stores currently played/paused/stopped video position
2333
+ storeVideoPosition = function (e, api) {
2334
+ if (api.video.sources) {
2335
+ if (typeof(flowplayer['playPositions']) == 'undefined') {
2336
+ flowplayer['playPositions'] = [];
2337
+ }
2338
+
2339
+ var
2340
+ originalVideoApiPath = getOriginalSource(api.video),
2341
+ playerSource = originalVideoApiPath.src,
2342
+ position = Math.round(api.video.time);
2343
+
2344
+ // only store position if we're going to save it somewhere
2345
+ if ((flowplayer.conf.video_position_save_enable || forceEnablePositionSaving)) {
2346
+ flowplayer['playPositions'][playerSource] = position;
2347
+ }
2348
+
2349
+ // store the new position in the instance itself as well
2350
+ if (originalVideoApiPath.position) {
2351
+ originalVideoApiPath.position = position;
2352
+ }
2353
+
2354
+ // make a call home every 30 seconds to make sure a browser crash doesn't affect the position save too much
2355
+ if (progressEventsCount++ >= sendPositionsEvery) {
2356
+ if ((flowplayer.conf.video_position_save_enable || forceEnablePositionSaving) && flowplayer.conf.is_logged_in == '1') {
2357
+ // cancel any old AJAX call that might be lingering in the air
2358
+ if (ajaxCall) {
2359
+ ajaxCall.abort();
2360
+ }
2361
+
2362
+ // send the call home
2363
+ ajaxCall = sendVideoPositions(true, function () {
2364
+ ajaxCall = null;
2365
+ });
2366
+ }
2367
+
2368
+ // reset counter
2369
+ progressEventsCount = 0;
2370
+ }
2371
+ }
2372
+ },
2373
+
2374
+ // used when video unloads and another video starts playing
2375
+ forceSavePosition = function (e, api) {
2376
+ var inPlaylist = false;
2377
+
2378
+ for (var i in api.conf.playlist) {
2379
+ inPlaylist = true;
2380
+ break;
2381
+ }
2382
+
2383
+ if (inPlaylist && !flowplayer.conf.closingPage) {
2384
+ progressEventsCount = sendPositionsEvery + 1;
2385
+ storeVideoPosition(e, api);
2386
+ sendVideoPositions();
2387
+ }
2388
+ },
2389
+
2390
+ // called when the video finishes playing - removes that video position from cache, as it's no longer needed
2391
+ removeVideoPosition = function (e, api) {
2392
+ if (api.video.sources) {
2393
+ if (typeof(flowplayer['playPositions']) == 'undefined') {
2394
+ flowplayer['playPositions'] = [];
2395
+ }
2396
+
2397
+ var
2398
+ originalVideoApiPath = getOriginalSource(api.video),
2399
+ playerSource = originalVideoApiPath.src,
2400
+ position = Math.round(api.video.time);
2401
+
2402
+ if ((flowplayer.conf.video_position_save_enable || forceEnablePositionSaving)) {
2403
+ flowplayer['playPositions'][playerSource] = 0;
2404
+ }
2405
+ }
2406
+ },
2407
+
2408
+ // used to seek into the desired last stored position when he video has started
2409
+ seekIntoPosition = function (e, api) {
2410
+ var
2411
+ originalVideoApiPath = getOriginalSource(api.video),
2412
+ position = originalVideoApiPath.position;
2413
+
2414
+ if (position) {
2415
+ var do_seek = setInterval( function() {
2416
+ if( api.loading ) return;
2417
+ api.seek(position);
2418
+ clearInterval(do_seek);
2419
+ }, 10 );
2420
+ } else {
2421
+ // try to lookup position of a guest visitor
2422
+ if ((flowplayer.conf.video_position_save_enable || forceEnablePositionSaving) && flowplayer.conf.is_logged_in != '1') {
2423
+ var data = getCookieKey(cookieKeyName);
2424
+
2425
+ if (data && typeof(data) !== 'undefined') {
2426
+ try {
2427
+ data = JSON.parse(data);
2428
+
2429
+ // check if we have the position
2430
+ if (data[originalVideoApiPath.src]) {
2431
+ var do_seek = setInterval( function() {
2432
+ if( api.loading ) return;
2433
+ api.seek(data[originalVideoApiPath.src]);
2434
+ clearInterval(do_seek);
2435
+ }, 10 );
2436
+ }
2437
+ } catch (e) {
2438
+ // something went wrong...
2439
+ // TODO: shall we try to reset guest data here?
2440
+ return;
2441
+ }
2442
+ }
2443
+ }
2444
+ }
2445
+ },
2446
+
2447
+ sendVideoPositions = function(async, callback) {
2448
+ if (async !== true) {
2449
+ async = false;
2450
+ }
2451
+
2452
+ if (!callback || typeof(callback) == 'undefined') {
2453
+ callback = function() {};
2454
+ }
2455
+
2456
+ postData = [];
2457
+
2458
+ for (var video_name in flowplayer['playPositions']) {
2459
+ postData.push({
2460
+ name: video_name,
2461
+ position: flowplayer['playPositions'][video_name]
2462
+ });
2463
+ }
2464
+
2465
+ if (!postData.length) {
2466
+ return;
2467
+ }
2468
+
2469
+ // decide between saving position with an AJAX request
2470
+ // or storing positions in a cookie / localStorage
2471
+ if ((flowplayer.conf.video_position_save_enable || forceEnablePositionSaving) && flowplayer.conf.is_logged_in == '1') {
2472
+ // logged-in user, store position in their metadata on server
2473
+ return jQuery.ajax({
2474
+ type: 'POST',
2475
+ async: async,
2476
+ url: fv_fp_ajaxurl,
2477
+ complete: callback,
2478
+ data: {
2479
+ action: 'fv_wp_flowplayer_video_position_save',
2480
+ videoTimes: postData
2481
+ }
2482
+ });
2483
+ } else if ((flowplayer.conf.video_position_save_enable || forceEnablePositionSaving) && flowplayer.conf.is_logged_in != '1') {
2484
+ // guest visitor, store position in a cookie / localStorage
2485
+ try {
2486
+ var data = getCookieKey(cookieKeyName);
2487
+
2488
+ // parse the stored JSON data or create a new object if empty
2489
+ if (data && typeof(data) !== 'undefined') {
2490
+ data = JSON.parse(data);
2491
+ } else {
2492
+ data = {};
2493
+ }
2494
+
2495
+ // add / edit our video positions
2496
+ for (var i in postData) {
2497
+ data[postData[i].name] = postData[i].position;
2498
+ }
2499
+
2500
+ // serialize
2501
+ var
2502
+ serialized = JSON.stringify(data),
2503
+ dataSize = getTextByteSize(serialized);
2504
+
2505
+ // check if we're not going over maximum cache size
2506
+ if (dataSize > maxCookieSize) {
2507
+ // we're over max cache size, let's delete some older videos
2508
+ while (dataSize > maxCookieSize) {
2509
+ // remove the first entry only
2510
+ for (var i in data) {
2511
+ delete data[i];
2512
+
2513
+ // re-serialize with the value removed
2514
+ serialized = JSON.stringify(data);
2515
+ // calculate new data size, so we can exit the while loop
2516
+ dataSize = getTextByteSize(serialized);
2517
+
2518
+ break;
2519
+ }
2520
+ }
2521
+ }
2522
+
2523
+ // store the serialize value
2524
+ setCookieKey(cookieKeyName, serialized);
2525
+ } catch (e) {
2526
+ // JSON object is native to all contemporary browsers
2527
+ // ... if somebody uses anything older, they would be missing out
2528
+ // on lot more features, so just don't bug them
2529
+ return;
2530
+ }
2531
+ }
2532
+ };
2533
+
2534
+ // pause/stop/progress events
2535
+ api.bind('progress', storeVideoPosition);
2536
+ api.bind('finish', removeVideoPosition);
2537
+
2538
+ // ready event, so we can seek into the last saved position
2539
+ api.bind('ready', seekIntoPosition);
2540
+
2541
+ // TODO: find out what event can be used to force saving of playlist video positions on video change
2542
+ //api.bind('finish', forceSavePosition);
2543
+
2544
+ jQuery(window).on('beforeunload', function () {
2545
+ flowplayer.conf.closingPage = true;
2546
+ sendVideoPositions();
2547
+ });
2548
+
2549
+ // check whether local storage is enabled
2550
+ if (localStorageEnabled !== null) {
2551
+ return localStorageEnabled;
2552
+ }
2553
+
2554
+ localStorageEnabled = true;
2555
+ try {
2556
+ localStorage.setItem('t', 't');
2557
+ if (localStorage.getItem('t') !== 't') {
2558
+ localStorageEnabled = false;
2559
+ }
2560
+ localStorage.removeItem('t');
2561
+ } catch (e) {
2562
+ localStorageEnabled = false;
2563
+ }
2564
+ });
flowplayer.php CHANGED
@@ -3,7 +3,7 @@
3
Plugin Name: FV Player
4
Plugin URI: http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer
5
Description: Formerly FV WordPress Flowplayer. Embed videos (MP4, WEBM, OGV, FLV) into posts or pages. Uses Flowplayer 6.
6
- Version: 6.4.2
7
Author URI: http://foliovision.com/
8
License: GPL-3.0
9
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
@@ -26,7 +26,7 @@ License URI: http://www.gnu.org/licenses/gpl-3.0.txt
26
along with this program. If not, see <http://www.gnu.org/licenses/>.
27
*/
28
29
- $fv_wp_flowplayer_ver = '6.4.2';
30
$fv_wp_flowplayer_core_ver = '6.0.5';
31
$fv_wp_flowplayer_core_ver_beta = '7.2.4';
32
@@ -56,7 +56,7 @@ include_once(dirname( __FILE__ ) . '/models/widget.php');
56
57
include_once(dirname( __FILE__ ) . '/models/conversion.php');
58
include_once(dirname( __FILE__ ) . '/models/email-subscription.php');
59
-
60
61
62
$fv_fp = new flowplayer_frontend();
3
Plugin Name: FV Player
4
Plugin URI: http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer
5
Description: Formerly FV WordPress Flowplayer. Embed videos (MP4, WEBM, OGV, FLV) into posts or pages. Uses Flowplayer 6.
6
+ Version: 6.5
7
Author URI: http://foliovision.com/
8
License: GPL-3.0
9
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
26
along with this program. If not, see <http://www.gnu.org/licenses/>.
27
*/
28
29
+ $fv_wp_flowplayer_ver = '6.5';
30
$fv_wp_flowplayer_core_ver = '6.0.5';
31
$fv_wp_flowplayer_core_ver_beta = '7.2.4';
32
56
57
include_once(dirname( __FILE__ ) . '/models/conversion.php');
58
include_once(dirname( __FILE__ ) . '/models/email-subscription.php');
59
+ include_once(dirname( __FILE__ ) . '/models/player-position-save.php');
60
61
62
$fv_fp = new flowplayer_frontend();
flowplayer/fv-flowplayer.min.js CHANGED
@@ -9,8 +9,8 @@ e=e.toLowerCase();var n=e.split("."),r=n.length;if(2>r||/^\d+#x2F;.test(n[r-1]))ret
9
return A.test(e)?p(e.slice(4).toLowerCase()):e})}function g(e){return l(e,function(e){return _.test(e)?"xn--"+m(e):e})}var h="object"==typeof r&&r,y="object"==typeof n&&n&&n.exports==h&&n,b="object"==typeof t&&t;(b.global===b||b.window===b)&&(o=b);var w,x,E=2147483647,k=36,T=1,S=26,N=38,C=700,j=72,O=128,P="-",A=/^xn--/,_=/[^ -~]/,D=/\x2E|\u3002|\uFF0E|\uFF61/g,M={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L=k-T,I=Math.floor,F=String.fromCharCode;if(w={version:"1.2.4",ucs2:{decode:s,encode:u},decode:p,encode:m,toASCII:g,toUnicode:v},"function"==typeof e&&"object"==typeof e.amd&&e.amd)e("punycode",function(){return w});else if(h&&!h.nodeType)if(y)y.exports=w;else for(x in w)w.hasOwnProperty(x)&&(h[x]=w[x]);else o.punycode=w}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[19])(19)});
10
11
12
-
13
-
14
15
16
/*
@@ -1957,21 +1957,11 @@ flowplayer( function(api,root) {
1957
1958
var bitrates = [];
1959
1960
- function dash_quality(api) {
1961
- var mediaPlayer = api.engine.dash;
1962
- mediaPlayer.retrieveManifest(mediaPlayer.getSource(), function(data) {
1963
- bitrates = mediaPlayer.getTracksForTypeFromManifest( 'video', data, mediaPlayer.getStreamsFromManifest(data)[0] )[0].bitrateList;
1964
- });
1965
- }
1966
-
1967
api.bind('ready', function(e,api) {
1968
if(api.engine.engineName == 'dash' ) {
1969
api.engine.dash.setLimitBitrateByPortal(true);
1970
api.engine.dash.setUsePixelRatioInLimitBitrateByPortal(true);
1971
-
1972
- //api.engine.dash.setQualityFor('video', 0);
1973
- // api.engine.dash.getQualityFor('video');
1974
- dash_quality(api);
1975
}
1976
});
1977
@@ -1980,7 +1970,9 @@ flowplayer( function(api,root) {
1980
api.bind('progress', function(e,api) {
1981
if(api.engine.engineName == 'dash' ) {
1982
var stream_info = bitrates[api.engine.dash.getQualityFor('video')];
1983
- debug_log.html( "Using "+stream_info.width+"x"+stream_info.height+" at "+Math.round(stream_info.bandwidth/1024)+" kbps" );
1984
}
1985
})
1986
}
@@ -2094,3 +2086,292 @@ jQuery(function($) {
2094
$("div.flowplayer").removeClass("is-unSticky");
2095
});
2096
});
9
return A.test(e)?p(e.slice(4).toLowerCase()):e})}function g(e){return l(e,function(e){return _.test(e)?"xn--"+m(e):e})}var h="object"==typeof r&&r,y="object"==typeof n&&n&&n.exports==h&&n,b="object"==typeof t&&t;(b.global===b||b.window===b)&&(o=b);var w,x,E=2147483647,k=36,T=1,S=26,N=38,C=700,j=72,O=128,P="-",A=/^xn--/,_=/[^ -~]/,D=/\x2E|\u3002|\uFF0E|\uFF61/g,M={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L=k-T,I=Math.floor,F=String.fromCharCode;if(w={version:"1.2.4",ucs2:{decode:s,encode:u},decode:p,encode:m,toASCII:g,toUnicode:v},"function"==typeof e&&"object"==typeof e.amd&&e.amd)e("punycode",function(){return w});else if(h&&!h.nodeType)if(y)y.exports=w;else for(x in w)w.hasOwnProperty(x)&&(h[x]=w[x]);else o.punycode=w}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[19])(19)});
10
11
12
+ /*! js-cookie v2.2.0 | MIT */
13
+ !function(e){var n=!1;if("function"==typeof define&&define.amd&&(define(e),n=!0),"object"==typeof exports&&(module.exports=e(),n=!0),!n){var o=window.Cookies,t=window.Cookies=e();t.noConflict=function(){return window.Cookies=o,t}}}(function(){function e(){for(var e=0,n={};e<arguments.length;e++){var o=arguments[e];for(var t in o)n[t]=o[t]}return n}function n(o){function t(n,r,i){var c;if("undefined"!=typeof document){if(arguments.length>1){if("number"==typeof(i=e({path:"/"},t.defaults,i)).expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*i.expires),i.expires=a}i.expires=i.expires?i.expires.toUTCString():"";try{c=JSON.stringify(r),/^[\{\[]/.test(c)&&(r=c)}catch(e){}r=o.write?o.write(r,n):encodeURIComponent(r+"").replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),n=(n=(n=encodeURIComponent(n+"")).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape);var s="";for(var f in i)i[f]&&(s+="; "+f,!0!==i[f]&&(s+="="+i[f]));return document.cookie=n+"="+r+s}n||(c={});for(var p=document.cookie?document.cookie.split("; "):[],d=/(%[0-9A-Z]{2})+/g,u=0;u<p.length;u++){var l=p[u].split("="),C=l.slice(1).join("=");this.json||'"'!==C.charAt(0)||(C=C.slice(1,-1));try{var m=l[0].replace(d,decodeURIComponent);if(C=o.read?o.read(C,m):o(C,m)||C.replace(d,decodeURIComponent),this.json)try{C=JSON.parse(C)}catch(e){}if(n===m){c=C;break}n||(c[m]=C)}catch(e){}}return c}}return t.set=t,t.get=function(e){return t.call(t,e)},t.getJSON=function(){return t.apply({json:!0},[].slice.call(arguments))},t.defaults={},t.remove=function(n,o){t(n,"",e(o,{expires:-1}))},t.withConverter=n,t}return n(function(){})});
14
15
16
/*
1957
1958
var bitrates = [];
1959
1960
api.bind('ready', function(e,api) {
1961
if(api.engine.engineName == 'dash' ) {
1962
api.engine.dash.setLimitBitrateByPortal(true);
1963
api.engine.dash.setUsePixelRatioInLimitBitrateByPortal(true);
1964
+ bitrates = api.engine.dash.getBitrateInfoListFor('video');
1965
}
1966
});
1967
1970
api.bind('progress', function(e,api) {
1971
if(api.engine.engineName == 'dash' ) {
1972
var stream_info = bitrates[api.engine.dash.getQualityFor('video')];
1973
+ debug_log.html( "Using "+stream_info.width+"x"+stream_info.height+" at "+Math.round(stream_info.bitrate/1024)+" kbps" );
1974
+ } else {
1975
+ debug_log.remove();
1976
}
1977
})
1978
}
2086
$("div.flowplayer").removeClass("is-unSticky");
2087
});
2088
});
2089
+
2090
+
2091
+ // Magnific Popup suppport
2092
+ jQuery(document).on('mfpClose', function() {
2093
+ if( typeof(jQuery('.flowplayer').data('flowplayer')) != "undefined" ) jQuery('.flowplayer').data('flowplayer').unload();
2094
+ } );
2095
+
2096
+
2097
+ /*
2098
+ * Video Position Store functionality
2099
+ */
2100
+ flowplayer( function(api,root) {
2101
+ // variables
2102
+ var
2103
+ // a jQuery representation of the root DIV element
2104
+ $root = jQuery(root),
2105
+ // whether or not we should enable position saving for this video only
2106
+ forceEnablePositionSaving = ($root.data('save-position') ? true : false),
2107
+ progressEventsCount = 0,
2108
+ // number of events to pass before we auto-send current video positions
2109
+ sendPositionsEvery = 60,
2110
+ // the actual AJAX object we use to send progress data, so we can cancel it,
2111
+ // should we encounter another timeout and the first AJAX did not complete yet
2112
+ // note: this is only used for logged-in users... everyone else will use cookie/localStorage
2113
+ ajaxCall = null,
2114
+ // maximum cookie size with saved video positions we should store
2115
+ maxCookieSize = 2500,
2116
+ // whether or not localStorage is enabled
2117
+ localStorageEnabled = null,
2118
+ // key name for cookie/localStorage lookup of video positions for guest visitors
2119
+ cookieKeyName = 'video_positions',
2120
+
2121
+ // methods
2122
+ // retrieves the original source of a video
2123
+ getOriginalSource = function(video) {
2124
+ // logged-in users will have position stored within that video
2125
+ return (
2126
+ (typeof(video.sources_original) != "undefined" && typeof(video.sources_original[0]) != "undefined") ?
2127
+ video.sources_original[0] :
2128
+ video.sources[0]
2129
+ );
2130
+ },
2131
+
2132
+ // calculates a cookie byte size
2133
+ getTextByteSize = function(txt) {
2134
+ return encodeURIComponent(txt).length;
2135
+ },
2136
+
2137
+ getCookieKey = function(key) {
2138
+ return (localStorageEnabled ? localStorage.getItem(key) : Cookies.get(key));
2139
+ },
2140
+
2141
+ setCookieKey = function(key, value) {
2142
+ return (localStorageEnabled ? localStorage.setItem(key, value) : Cookies.set(key, value));
2143
+ },
2144
+
2145
+ // stores currently played/paused/stopped video position
2146
+ storeVideoPosition = function (e, api) {
2147
+ if (api.video.sources) {
2148
+ if (typeof(flowplayer['playPositions']) == 'undefined') {
2149
+ flowplayer['playPositions'] = [];
2150
+ }
2151
+
2152
+ var
2153
+ originalVideoApiPath = getOriginalSource(api.video),
2154
+ playerSource = originalVideoApiPath.src,
2155
+ position = Math.round(api.video.time);
2156
+
2157
+ // only store position if we're going to save it somewhere
2158
+ if ((flowplayer.conf.video_position_save_enable || forceEnablePositionSaving)) {
2159
+ flowplayer['playPositions'][playerSource] = position;
2160
+ }
2161
+
2162
+ // store the new position in the instance itself as well
2163
+ if (originalVideoApiPath.position) {
2164
+ originalVideoApiPath.position = position;
2165
+ }
2166
+
2167
+ // make a call home every 30 seconds to make sure a browser crash doesn't affect the position save too much
2168
+ if (progressEventsCount++ >= sendPositionsEvery) {
2169
+ if ((flowplayer.conf.video_position_save_enable || forceEnablePositionSaving) && flowplayer.conf.is_logged_in == '1') {
2170
+ // cancel any old AJAX call that might be lingering in the air
2171
+ if (ajaxCall) {
2172
+ ajaxCall.abort();
2173
+ }
2174
+
2175
+ // send the call home
2176
+ ajaxCall = sendVideoPositions(true, function () {
2177
+ ajaxCall = null;
2178
+ });
2179
+ }
2180
+
2181
+ // reset counter
2182
+ progressEventsCount = 0;
2183
+ }
2184
+ }
2185
+ },
2186
+
2187
+ // used when video unloads and another video starts playing
2188
+ forceSavePosition = function (e, api) {
2189
+ var inPlaylist = false;
2190
+
2191
+ for (var i in api.conf.playlist) {
2192
+ inPlaylist = true;
2193
+ break;
2194
+ }
2195
+
2196
+ if (inPlaylist && !flowplayer.conf.closingPage) {
2197
+ progressEventsCount = sendPositionsEvery + 1;
2198
+ storeVideoPosition(e, api);
2199
+ sendVideoPositions();
2200
+ }
2201
+ },
2202
+
2203
+ // called when the video finishes playing - removes that video position from cache, as it's no longer needed
2204
+ removeVideoPosition = function (e, api) {
2205
+ if (api.video.sources) {
2206
+ if (typeof(flowplayer['playPositions']) == 'undefined') {
2207
+ flowplayer['playPositions'] = [];
2208
+ }
2209
+
2210
+ var
2211
+ originalVideoApiPath = getOriginalSource(api.video),
2212
+ playerSource = originalVideoApiPath.src,
2213
+ position = Math.round(api.video.time);
2214
+
2215
+ if ((flowplayer.conf.video_position_save_enable || forceEnablePositionSaving)) {
2216
+ flowplayer['playPositions'][playerSource] = 0;
2217
+ }
2218
+ }
2219
+ },
2220
+
2221
+ // used to seek into the desired last stored position when he video has started
2222
+ seekIntoPosition = function (e, api) {
2223
+ var
2224
+ originalVideoApiPath = getOriginalSource(api.video),
2225
+ position = originalVideoApiPath.position;
2226
+
2227
+ if (position) {
2228
+ var do_seek = setInterval( function() {
2229
+ if( api.loading ) return;
2230
+ api.seek(position);
2231
+ clearInterval(do_seek);
2232
+ }, 10 );
2233
+ } else {
2234
+ // try to lookup position of a guest visitor
2235
+ if ((flowplayer.conf.video_position_save_enable || forceEnablePositionSaving) && flowplayer.conf.is_logged_in != '1') {
2236
+ var data = getCookieKey(cookieKeyName);
2237
+
2238
+ if (data && typeof(data) !== 'undefined') {
2239
+ try {
2240
+ data = JSON.parse(data);
2241
+
2242
+ // check if we have the position
2243
+ if (data[originalVideoApiPath.src]) {
2244
+ var do_seek = setInterval( function() {
2245
+ if( api.loading ) return;
2246
+ api.seek(data[originalVideoApiPath.src]);
2247
+ clearInterval(do_seek);
2248
+ }, 10 );
2249
+ }
2250
+ } catch (e) {
2251
+ // something went wrong...
2252
+ // TODO: shall we try to reset guest data here?
2253
+ return;
2254
+ }
2255
+ }
2256
+ }
2257
+ }
2258
+ },
2259
+
2260
+ sendVideoPositions = function(async, callback) {
2261
+ if (async !== true) {
2262
+ async = false;
2263
+ }
2264
+
2265
+ if (!callback || typeof(callback) == 'undefined') {
2266
+ callback = function() {};
2267
+ }
2268
+
2269
+ postData = [];
2270
+
2271
+ for (var video_name in flowplayer['playPositions']) {
2272
+ postData.push({
2273
+ name: video_name,
2274
+ position: flowplayer['playPositions'][video_name]
2275
+ });
2276
+ }
2277
+
2278
+ if (!postData.length) {
2279
+ return;
2280
+ }
2281
+
2282
+ // decide between saving position with an AJAX request
2283
+ // or storing positions in a cookie / localStorage
2284
+ if ((flowplayer.conf.video_position_save_enable || forceEnablePositionSaving) && flowplayer.conf.is_logged_in == '1') {
2285
+ // logged-in user, store position in their metadata on server
2286
+ return jQuery.ajax({
2287
+ type: 'POST',
2288
+ async: async,
2289
+ url: fv_fp_ajaxurl,
2290
+ complete: callback,
2291
+ data: {
2292
+ action: 'fv_wp_flowplayer_video_position_save',
2293
+ videoTimes: postData
2294
+ }
2295
+ });
2296
+ } else if ((flowplayer.conf.video_position_save_enable || forceEnablePositionSaving) && flowplayer.conf.is_logged_in != '1') {
2297
+ // guest visitor, store position in a cookie / localStorage
2298
+ try {
2299
+ var data = getCookieKey(cookieKeyName);
2300
+
2301
+ // parse the stored JSON data or create a new object if empty
2302
+ if (data && typeof(data) !== 'undefined') {
2303
+ data = JSON.parse(data);
2304
+ } else {
2305
+ data = {};
2306
+ }
2307
+
2308
+ // add / edit our video positions
2309
+ for (var i in postData) {
2310
+ data[postData[i].name] = postData[i].position;
2311
+ }
2312
+
2313
+ // serialize
2314
+ var
2315
+ serialized = JSON.stringify(data),
2316
+ dataSize = getTextByteSize(serialized);
2317
+
2318
+ // check if we're not going over maximum cache size
2319
+ if (dataSize > maxCookieSize) {
2320
+ // we're over max cache size, let's delete some older videos
2321
+ while (dataSize > maxCookieSize) {
2322
+ // remove the first entry only
2323
+ for (var i in data) {
2324
+ delete data[i];
2325
+
2326
+ // re-serialize with the value removed
2327
+ serialized = JSON.stringify(data);
2328
+ // calculate new data size, so we can exit the while loop
2329
+ dataSize = getTextByteSize(serialized);
2330
+
2331
+ break;
2332
+ }
2333
+ }
2334
+ }
2335
+
2336
+ // store the serialize value
2337
+ setCookieKey(cookieKeyName, serialized);
2338
+ } catch (e) {
2339
+ // JSON object is native to all contemporary browsers
2340
+ // ... if somebody uses anything older, they would be missing out
2341
+ // on lot more features, so just don't bug them
2342
+ return;
2343
+ }
2344
+ }
2345
+ };
2346
+
2347
+ // pause/stop/progress events
2348
+ api.bind('progress', storeVideoPosition);
2349
+ api.bind('finish', removeVideoPosition);
2350
+
2351
+ // ready event, so we can seek into the last saved position
2352
+ api.bind('ready', seekIntoPosition);
2353
+
2354
+ // TODO: find out what event can be used to force saving of playlist video positions on video change
2355
+ //api.bind('finish', forceSavePosition);
2356
+
2357
+ jQuery(window).on('beforeunload', function () {
2358
+ flowplayer.conf.closingPage = true;
2359
+ sendVideoPositions();
2360
+ });
2361
+
2362
+ // check whether local storage is enabled
2363
+ if (localStorageEnabled !== null) {
2364
+ return localStorageEnabled;
2365
+ }
2366
+
2367
+ localStorageEnabled = true;
2368
+ try {
2369
+ localStorage.setItem('t', 't');
2370
+ if (localStorage.getItem('t') !== 't') {
2371
+ localStorageEnabled = false;
2372
+ }
2373
+ localStorage.removeItem('t');
2374
+ } catch (e) {
2375
+ localStorageEnabled = false;
2376
+ }
2377
+ });
js/shortcode-editor.js CHANGED
@@ -14,7 +14,7 @@ var fv_wp_fp_shortcode;
14
var fv_player_preview_single = -1;
15
var fv_player_preview_window;
16
17
-
18
19
var fv_player_shortcode_preview_unsupported = false;
20
@@ -24,7 +24,8 @@ jQuery(document).ready(function($){
24
fv_player_shortcode_preview_unsupported = ua.match(/edge/i) || ua.match(/safari/i) && !ua.match(/chrome/i) ;
25
26
if( jQuery().fv_player_box ) {
27
- $(document).on( 'click', '.fv-wordpress-flowplayer-button', function(e) {
28
e.preventDefault();
29
$.fv_player_box( {
30
top: "100px",
@@ -386,7 +387,11 @@ function fv_wp_flowplayer_init() {
386
fv_player_shortcode_preview = false;
387
fv_player_shortcode_editor_last_url = false;
388
389
- if( jQuery('#widget-widget_fvplayer-'+FVFP_sWidgetId+'-text').length ){
390
fv_wp_flowplayer_content = jQuery('#widget-widget_fvplayer-'+FVFP_sWidgetId+'-text').val();
391
} else if( typeof(FCKeditorAPI) == 'undefined' && jQuery('#content:not([aria-hidden=true])').length){
392
fv_wp_flowplayer_content = jQuery('#content:not([aria-hidden=true])').val();
@@ -443,7 +448,12 @@ function fv_wp_flowplayer_init() {
443
* Sends new shortcode to editor
444
*/
445
function fv_wp_flowplayer_insert( shortcode ) {
446
- if( typeof(FCKeditorAPI) == 'undefined' && jQuery('#content:not([aria-hidden=true])').length ) {
447
fv_wp_flowplayer_content = fv_wp_flowplayer_content .replace(/#fvp_placeholder#/,shortcode);
448
fv_wp_flowplayer_set_html( fv_wp_flowplayer_content );
449
}else if( fv_wp_flowplayer_content.match( fv_wp_flowplayer_re_edit ) ) {
@@ -636,7 +646,9 @@ function fv_wp_flowplayer_edit() {
636
jQuery("[name=fv_wp_flowplayer_field_splash_text]").each( function() { jQuery(this).val( '' ) } );
637
jQuery(".fv_player_field_insert-button").attr( 'value', 'Insert' );
638
639
- if(jQuery('#widget-widget_fvplayer-'+FVFP_sWidgetId+'-text').length){
640
if(fv_wp_flowplayer_content.match(/\[/) ) {
641
fv_wp_flowplayer_content = '[<'+fvwpflowplayer_helper_tag+' rel="FCKFVWPFlowplayerPlaceholder">&shy;</'+fvwpflowplayer_helper_tag+'>'+fv_wp_flowplayer_content.replace('[','')+'';
642
} else {
@@ -998,14 +1010,21 @@ function fv_wp_flowplayer_dialog_resize() {
998
999
1000
function fv_wp_flowplayer_on_close() {
1001
fv_wp_flowplayer_init();
1002
fv_wp_flowplayer_set_html( fv_wp_flowplayer_content.replace( fv_wp_flowplayer_re_insert, '' ) );
1003
jQuery('#fv-player-shortcode-editor-preview-target').html('');
1004
}
1005
1006
1007
- function fv_wp_flowplayer_set_html( html ) {
1008
- if( jQuery('#widget-widget_fvplayer-'+FVFP_sWidgetId+'-text').length ){
1009
jQuery('#widget-widget_fvplayer-'+FVFP_sWidgetId+'-text').val(html);
1010
jQuery('#widget-widget_fvplayer-'+FVFP_sWidgetId+'-text').trigger('fv_flowplayer_shortcode_insert', [ html ] );
1011
}else if( typeof(FCKeditorAPI) == 'undefined' && jQuery('#content:not([aria-hidden=true])').length ){
@@ -1158,7 +1177,14 @@ function fv_wp_flowplayer_submit( preview ) {
1158
1159
aSplashText.push(jQuery('[name=fv_wp_flowplayer_field_splash_text]', this).attr('value').trim().replace(/\;/gi,'\\;').replace(/"/gi,'&amp;quot;') );
1160
1161
- aPlaylistSubtitles.push(jQuery('[name=fv_wp_flowplayer_field_subtitles]', jQuery('.fv-player-tab-subtitles table').eq(i)).attr('value').trim().replace(/\;/gi,'\\;').replace(/"/gi,'&amp;quot;') );
1162
1163
if( i == 0 ) return;
1164
var aPlaylistItem = new Array();
@@ -1500,4 +1526,80 @@ function fv_flowplayer_shortcode_editor_cleanup(sInput) {
1500
1501
jQuery(document).on('fv_flowplayer_shortcode_insert', function(e) {
1502
jQuery(e.target).siblings('.button.fv-wordpress-flowplayer-button').val('Edit');
1503
- })
14
var fv_player_preview_single = -1;
15
var fv_player_preview_window;
16
17
+ var fv_player_editor_button_clicked = 0;
18
19
var fv_player_shortcode_preview_unsupported = false;
20
24
fv_player_shortcode_preview_unsupported = ua.match(/edge/i) || ua.match(/safari/i) && !ua.match(/chrome/i) ;
25
26
if( jQuery().fv_player_box ) {
27
+ $(document).on( 'click', '.fv-wordpress-flowplayer-button, .fv-player-editor-button', function(e) {
28
+ fv_player_editor_button_clicked = this;
29
e.preventDefault();
30
$.fv_player_box( {
31
top: "100px",
387
fv_player_shortcode_preview = false;
388
fv_player_shortcode_editor_last_url = false;
389
390
+ var field = jQuery(fv_player_editor_button_clicked).parents('.fv-player-editor-wrapper').find('.fv-player-editor-field');
391
+ if( field.length ) {
392
+ fv_wp_flowplayer_content = jQuery(field).val();
393
+
394
+ } else if( jQuery('#widget-widget_fvplayer-'+FVFP_sWidgetId+'-text').length ){
395
fv_wp_flowplayer_content = jQuery('#widget-widget_fvplayer-'+FVFP_sWidgetId+'-text').val();
396
} else if( typeof(FCKeditorAPI) == 'undefined' && jQuery('#content:not([aria-hidden=true])').length){
397
fv_wp_flowplayer_content = jQuery('#content:not([aria-hidden=true])').val();
448
* Sends new shortcode to editor
449
*/
450
function fv_wp_flowplayer_insert( shortcode ) {
451
+ var field = jQuery(fv_player_editor_button_clicked).parents('.fv-player-editor-wrapper').find('.fv-player-editor-field');
452
+ if( field.length ) {
453
+ field.val(shortcode);
454
+ field.trigger('fv_flowplayer_shortcode_insert', [ shortcode ] );
455
+
456
+ } else if( typeof(FCKeditorAPI) == 'undefined' && jQuery('#content:not([aria-hidden=true])').length ) {
457
fv_wp_flowplayer_content = fv_wp_flowplayer_content .replace(/#fvp_placeholder#/,shortcode);
458
fv_wp_flowplayer_set_html( fv_wp_flowplayer_content );
459
}else if( fv_wp_flowplayer_content.match( fv_wp_flowplayer_re_edit ) ) {
646
jQuery("[name=fv_wp_flowplayer_field_splash_text]").each( function() { jQuery(this).val( '' ) } );
647
jQuery(".fv_player_field_insert-button").attr( 'value', 'Insert' );
648
649
+ var field = jQuery(fv_player_editor_button_clicked).parents('.fv-player-editor-wrapper').find('.fv-player-editor-field');
650
+ if( field.length || jQuery('#widget-widget_fvplayer-'+FVFP_sWidgetId+'-text').length){
651
+ // this is a horrible hack as it adds the hidden marker to the otherwise clean text field value just to make sure the shortcode varible below is parsed properly. But it allows some extra text to be entered into the text widget, so for now - ok
652
if(fv_wp_flowplayer_content.match(/\[/) ) {
653
fv_wp_flowplayer_content = '[<'+fvwpflowplayer_helper_tag+' rel="FCKFVWPFlowplayerPlaceholder">&shy;</'+fvwpflowplayer_helper_tag+'>'+fv_wp_flowplayer_content.replace('[','')+'';
654
} else {
1010
1011
1012
function fv_wp_flowplayer_on_close() {
1013
+ //fv_player_editor_button_clicked = false; // todo: is it not too early?
1014
+
1015
fv_wp_flowplayer_init();
1016
fv_wp_flowplayer_set_html( fv_wp_flowplayer_content.replace( fv_wp_flowplayer_re_insert, '' ) );
1017
jQuery('#fv-player-shortcode-editor-preview-target').html('');
1018
}
1019
1020
1021
+ function fv_wp_flowplayer_set_html( html ) {
1022
+ var field = jQuery(fv_player_editor_button_clicked).parents('.fv-player-editor-wrapper').find('.fv-player-editor-field');
1023
+ if( field.length ) {
1024
+ field.val(html);
1025
+ field.trigger('fv_flowplayer_shortcode_insert', [ html ] );
1026
+
1027
+ } else if( jQuery('#widget-widget_fvplayer-'+FVFP_sWidgetId+'-text').length ){
1028
jQuery('#widget-widget_fvplayer-'+FVFP_sWidgetId+'-text').val(html);
1029
jQuery('#widget-widget_fvplayer-'+FVFP_sWidgetId+'-text').trigger('fv_flowplayer_shortcode_insert', [ html ] );
1030
}else if( typeof(FCKeditorAPI) == 'undefined' && jQuery('#content:not([aria-hidden=true])').length ){
1177
1178
aSplashText.push(jQuery('[name=fv_wp_flowplayer_field_splash_text]', this).attr('value').trim().replace(/\;/gi,'\\;').replace(/"/gi,'&amp;quot;') );
1179
1180
+ var video_subtitles = jQuery('.fv-player-tab-subtitles table').eq(i);
1181
+ video_subtitles.find('[name=fv_wp_flowplayer_field_subtitles]').each( function() {
1182
+ if( jQuery(this).prev('.fv_wp_flowplayer_field_subtitles_lang').val() ) {
1183
+ aPlaylistSubtitles.push('');
1184
+ return;
1185
+ }
1186
+ aPlaylistSubtitles.push( jQuery(this).attr('value').trim().replace(/\;/gi,'\\;').replace(/"/gi,'&amp;quot;') );
1187
+ });
1188
1189
if( i == 0 ) return;
1190
var aPlaylistItem = new Array();
1526
1527
jQuery(document).on('fv_flowplayer_shortcode_insert', function(e) {
1528
jQuery(e.target).siblings('.button.fv-wordpress-flowplayer-button').val('Edit');
1529
+ })
1530
+
1531
+
1532
+
1533
+ jQuery( function($) {
1534
+ $(document).ready( 'fv_wp_flowplayer_init' );
1535
+
1536
+ jQuery('.fv-player-editor-wrapper').each( function() { fv_show_video( jQuery(this) ) }); // show last add more button only
1537
+
1538
+ $(document).on( 'fv_flowplayer_shortcode_insert', '.fv-player-editor-field', function() {
1539
+ console.log('fv_flowplayer_shortcode_insert',fv_player_editor_button_clicked);
1540
+ fv_load_video_preview( jQuery(this).parents('.fv-player-editor-wrapper'));
1541
+ } );
1542
+
1543
+ function fv_show_video( wrapper ) {
1544
+ if( wrapper.find('.fv-player-editor-field').val() ) {
1545
+ wrapper.find('.edit-video').show();
1546
+ wrapper.find('.add-video').hide();
1547
+ }
1548
+ else {
1549
+ wrapper.find('.edit-video').hide();
1550
+ wrapper.find('.add-video').show();
1551
+ wrapper.find('.fv-player-editor-preview').html('');
1552
+ }
1553
+
1554
+ jQuery('[data-key='+wrapper.data('key')+'] .fv-player-editor-more').last().show(); // show last add more button only
1555
+ }
1556
+
1557
+ function fv_remove_video( id ) {
1558
+ $( '#widget-widget_fvplayer-'+id+'-text' ).val("");
1559
+ fv_show_video(id);
1560
+ $('#fv_edit_video-'+id+' .video-preview').html('');
1561
+ }
1562
+
1563
+ function fv_load_video_preview( wrapper ) {
1564
+ var shortcode = $(wrapper).find('.fv-player-editor-field').val();
1565
+ console.log('fv_load_video_preview',shortcode);
1566
+ if( shortcode && shortcode.length === 0 ) {
1567
+ return false;
1568
+ }
1569
+
1570
+ shortcode = shortcode.replace( /(width=[\'"])\d*([\'"])/, "$1320$2" ); // 320
1571
+ shortcode = shortcode.replace( /(height=[\'"])\d*([\'"])/, "$1240$2" ); // 240
1572
+
1573
+ var url = fv_Player_site_base + '?fv_player_embed=1&fv_player_preview=' + b64EncodeUnicode(shortcode);
1574
+ $.get(url, function(response) {
1575
+ wrapper.find('.fv-player-editor-preview').html( jQuery('#wrapper',response ) );
1576
+ $(document).trigger('fvp-preview-complete');
1577
+ } );
1578
+
1579
+ fv_show_video(wrapper);
1580
+ }
1581
+
1582
+ $(document).on('click','.fv-player-editor-remove', function(e) {console.log('.fv-player-editor-remove');
1583
+ var wrapper = $(this).parents('.fv-player-editor-wrapper');
1584
+ if( $('[data-key='+wrapper.data('key')+']').length == 1 ) { // if there is only single video
1585
+ wrapper.find('.fv-player-editor-field').val('');
1586
+ fv_show_video(wrapper);
1587
+ } else {
1588
+ wrapper.remove();
1589
+ jQuery('.fv-player-editor-wrapper').each( function() { fv_show_video( jQuery(this) ) }); // show last add more button only
1590
+ }
1591
+ return false;
1592
+ });
1593
+
1594
+ $(document).on('click','.fv-player-editor-more', function(e) {
1595
+ var wrapper = $(this).parents('.fv-player-editor-wrapper');
1596
+ var new_wrapper = wrapper.clone();
1597
+ new_wrapper.find('.fv-player-editor-field').val('');
1598
+ fv_show_video(new_wrapper);
1599
+ new_wrapper.insertAfter( $('[data-key='+wrapper.data('key')+']:last') ); // insert after last of the kind
1600
+ $(this).hide();
1601
+
1602
+ return false;
1603
+ });
1604
+
1605
+ });
models/custom-videos.php CHANGED
@@ -6,6 +6,8 @@ class FV_Player_Custom_Videos {
6
7
var $id;
8
9
public function __construct( $args ) {
10
global $post;
11
@@ -18,11 +20,6 @@ class FV_Player_Custom_Videos {
18
$this->id = $args['id'];
19
$this->meta = $args['meta'];
20
$this->type = $args['type'];
21
-
22
- }
23
-
24
- public function __get( $name ) {
25
- return $data;
26
}
27
28
private function esc_shortcode( $arg ) {
@@ -63,13 +60,13 @@ class FV_Player_Custom_Videos {
63
add_filter( 'fv_flowplayer_playlist_splash', array( $FV_Player_Pro, 'youtube_splash' ), 10, 3 );
64
65
add_action('admin_footer', array( $FV_Player_Pro, 'styles' ) );
66
- add_action('admin_footer', array( $FV_Player_Pro, 'scripts' ) );
67
}
68
69
add_action('admin_footer','flowplayer_prepare_scripts');
70
}
71
72
- add_action('admin_footer', array( $fv_fp, 'css_enqueue' ) );
73
}
74
75
if( !is_admin() && !$args['no_form'] ) $html .= "<form method='POST'>";
@@ -82,7 +79,7 @@ class FV_Player_Custom_Videos {
82
83
if( !is_admin() && !$args['no_form'] ) {
84
$html .= "<input type='hidden' name='action' value='fv-player-custom-videos-save' />";
85
- $html .= "<input type='submit' value='Save Videos' />"; // todo: don't show when in post form
86
$html .= "</form>";
87
}
88
@@ -90,14 +87,31 @@ class FV_Player_Custom_Videos {
90
$html .= '</div>';
91
}
92
93
- if( $args['edit'] ) {
94
- if( is_admin() ) {
95
- add_action( 'admin_footer', array( $this, 'scripts' ) );
96
- } else {
97
- add_action( 'wp_footer', array( $this, 'scripts' ) );
98
- }
99
- }
100
-
101
return $html;
102
}
103
@@ -108,48 +122,27 @@ class FV_Player_Custom_Videos {
108
$html = '';
109
$count = 0;
110
if( $this->have_videos() ) {
111
- foreach( $this->get_videos() AS $aVideo ) {
112
$count++;
113
-
114
- if( $args['wrapper'] ) $html .= '<'.$args['wrapper'].' class="fv-player-custom-video">';
115
-
116
- if( $args['edit'] ) {
117
- $html .= do_shortcode('[fvplayer src="'.$this->esc_shortcode($aVideo['url']).'" autoplay="false"]');
118
- } else {
119
-
120
- $sExtra = '';
121
- if( is_array($args['shortcode']) && count($args['shortcode']) ) {
122
- foreach( $args['shortcode'] AS $key => $value ) {
123
- $sExtra .= ' '.$this->esc_shortcode($key).'="'.$this->esc_shortcode($value).'"';
124
- }
125
- }
126
- $html .= do_shortcode('[fvplayer src="'.$this->esc_shortcode($aVideo['url']).'" caption="'.$this->esc_shortcode($aVideo['title']).'"'.$sExtra.']');
127
- }
128
-
129
- if( $args['edit'] ) {
130
- $html .= '<p><input class="fv_player_custom_video fv_player_custom_video_url regular-text" type="text" name="fv_player_videos['.$this->meta.'][]" placeholder="Video URL" value="'.esc_attr($aVideo['url']).'" /></p>'."\n";
131
- $html .= '<p><input class="fv_player_custom_video regular-text" type="text" name="fv_player_videos_titles['.$this->meta.'][]" value="'.esc_attr($aVideo['title']).'" placeholder="Video title" /></p>'."\n";
132
- if( count($this->get_videos()) == $count && $count < $args['limit'] ) $html .= '<a class="fv-player-custom-video-add" href="#">Add more</a> ';
133
- $html .= '<a class="fv-player-custom-video-remove" href="#">Remove</a> ';
134
-
135
- }
136
-
137
- if( $args['wrapper'] ) $html .= '</'.$args['wrapper'].'>'."\n";
138
-
139
}
140
141
} else if( $args['edit'] ) {
142
$html .= '<'.$args['wrapper'].' class="fv-player-custom-video">';
143
-
144
- $html .= "<input class='fv_player_custom_video fv_player_custom_video_url regular-text' placeholder='URL' type='text' name='fv_player_videos[".$this->meta."][]' /><br />\n";
145
- $html .= "<input class='fv_player_custom_video regular-text' placeholder='Title' type='text' name='fv_player_videos_titles[".$this->meta."][]' /><br />\n";
146
- if( 1 < $args['limit'] ) $html .= "<a class='fv-player-custom-video-add' href='#'>Add more</a>\n";
147
-
148
$html .= '</'.$args['wrapper'].'>';
149
}
150
151
$html .= "<input type='hidden' name='fv-player-custom-videos-entity-id[".$this->meta."]' value='".esc_attr($this->id)."' />";
152
- $html .= "<input type='hidden' name='fv-player-custom-videos-entity-type[".$this->meta."]' value='".esc_attr($this->type)."' />";
153
154
return $html;
155
}
@@ -164,7 +157,11 @@ class FV_Player_Custom_Videos {
164
$aVideos = array();
165
if( is_array($aMeta) && count($aMeta) > 0 ) {
166
foreach( $aMeta AS $aVideo ) {
167
- if( is_array($aVideo) && isset($aVideo['url']) && isset($aVideo['title']) ) $aVideos[] = $aVideo;
168
}
169
}
170
@@ -173,77 +170,13 @@ class FV_Player_Custom_Videos {
173
174
public function have_videos() {
175
return count($this->get_videos()) ? true : false;
176
- }
177
178
- public function scripts() {
179
- ?>
180
- <script>
181
- function fv_player_custom_video_add(row) {
182
- var row = jQuery(row);
183
- row.parents('.fv-player-custom-video').parent().append( row.parents('.fv-player-custom-video').clone() );
184
- row.parents('.fv-player-custom-video').parent().find('.fv-player-custom-video:last').find('input[type=text]').val('');
185
- row.parents('.fv-player-custom-video').parent().find('.fv-player-custom-video:last iframe').remove();
186
- row.parents('.fv-player-custom-video').parent().find('.fv-player-custom-video:last .flowplayer').remove();
187
- row.parents('.fv-player-custom-video').parent().find('.fv-player-custom-video:last .fv-player-custom-video-remove').remove();
188
- if( row.hasClass('fv-player-custom-video-add') ) row.remove();
189
- }
190
-
191
- jQuery(document).on('click','.fv-player-custom-video-remove', function(e) {
192
- e.preventDefault();
193
- if( jQuery(this).parents('.fv-player-custom-video-list').find('.fv-player-custom-video').length == 1 ) {
194
- fv_player_custom_video_add(this);
195
- }
196
- jQuery(this).parents('.fv-player-custom-video').remove();
197
- });
198
- jQuery(document).on('click','.fv-player-custom-video-add', function(e) {
199
- e.preventDefault();
200
-
201
- fv_player_custom_video_add(this);
202
- });
203
-
204
- var fv_player_preview = false;
205
- var fv_player_shortcode_preview_unsupported = false;
206
- jQuery(document).ready(function(){
207
- var ua = window.navigator.userAgent;
208
- fv_player_shortcode_preview_unsupported = ua.match(/edge/i) || ua.match(/safari/i) && !ua.match(/chrome/i) ;
209
- })
210
-
211
- jQuery(document).on('change', '.fv_player_custom_video_url', function() {
212
- if( !jQuery(this).val().match(/^(https?:)?\/\//) ){
213
- jQuery(this).siblings('iframe').remove();
214
- return;
215
- }
216
- if(fv_player_preview || fv_player_shortcode_preview_unsupported){
217
- return;
218
- }
219
- fv_player_preview = true;
220
-
221
- if( jQuery(this).siblings('iframe').length == 0 ) {
222
- jQuery(this).before('<iframe allowfullscreen class="fv_player_custom_video_preview" scrolling="no"></iframe>');
223
- jQuery(this).before('<p class="loading-preview"><?php _e('Loading preview...','fv-wordpress-flowplayer'); ?></p>');
224
- }
225
-
226
- jQuery(this).siblings('.flowplayer').remove();
227
-
228
- var url = '<?php echo home_url('/'); ?>?fv_player_embed=1&fv_player_preview=' + b64EncodeUnicode('[fvplayer src="'+jQuery(this).val()+'" embed="false"]');
229
- jQuery(this).siblings('iframe').attr('src',url).hide();
230
- jQuery(this).siblings('.loading-preview').show();
231
-
232
- });
233
-
234
- function b64EncodeUnicode(str) {
235
- return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function(match, p1) {
236
- return String.fromCharCode('0x' + p1);
237
- }));
238
- }
239
-
240
- jQuery(document).on('fvp-preview-complete', function() {
241
- jQuery('.fv_player_custom_video_preview').show();
242
- jQuery('.loading-preview').hide();
243
- fv_player_preview = false;
244
- });
245
- </script>
246
- <?php
247
}
248
249
@@ -254,6 +187,8 @@ class FV_Player_Custom_Videos {
254
255
class FV_Player_Custom_Videos_Master {
256
257
function __construct() {
258
259
add_action( 'init', array( $this, 'save' ) ); // saving of user profile, both front and back end
@@ -262,7 +197,7 @@ class FV_Player_Custom_Videos_Master {
262
add_filter( 'show_password_fields', array( $this, 'user_profile' ), 10, 2 );
263
add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ), 999, 2 );
264
265
- add_filter( 'the_content', array( $this, 'show' ) );
266
add_filter( 'get_the_author_description', array( $this, 'show_bio' ), 10, 2 );
267
268
// EDD
@@ -270,14 +205,29 @@ class FV_Player_Custom_Videos_Master {
270
add_action('edd_pre_update_user_profile', array($this, 'save'));
271
272
// bbPress
273
- add_filter( 'bbp_template_after_user_profile', array( $this, 'bbpress_profile' ), 10, 2 );
274
add_filter( 'bbp_user_edit_after_about', array( $this, 'bbpress_edit' ), 10, 2 );
275
}
276
277
function add_meta_boxes() {
278
global $fv_fp;
279
if( isset($fv_fp->conf['profile_videos_enable_bio']) && $fv_fp->conf['profile_videos_enable_bio'] == 'true' ) {
280
- global $post;
281
$aMeta = get_post_custom($post->ID);
282
if( $aMeta ) {
283
foreach( $aMeta AS $key => $aMetas ) {
@@ -308,12 +258,18 @@ class FV_Player_Custom_Videos_Master {
308
309
<div>
310
<?php
311
- $objVideos = new FV_Player_Custom_Videos(array( 'id' => bbp_get_displayed_user_field('id'), 'type' => 'user' ));
312
echo $objVideos->get_form( array('no_form' => true) );
313
?>
314
</div>
315
316
<?php
317
}
318
319
function bbpress_profile() {
@@ -322,7 +278,7 @@ class FV_Player_Custom_Videos_Master {
322
if( !isset($fv_fp->conf['profile_videos_enable_bio']) || $fv_fp->conf['profile_videos_enable_bio'] !== 'true' )
323
return;
324
325
- $objVideos = new FV_Player_Custom_Videos(array( 'id' => bbp_get_displayed_user_field('id'), 'type' => 'user' ));
326
if( $objVideos->have_videos() ) : ?>
327
<div id="bbp-user-profile" class="bbp-user-profile">
328
<h2 class="entry-title"><?php _e( 'Videos', 'bbpress' ); ?></h2>
@@ -337,31 +293,38 @@ class FV_Player_Custom_Videos_Master {
337
338
function meta_box( $aPosts, $args ) {
339
global $FV_Player_Custom_Videos_form_instances;
340
- unset($FV_Player_Custom_Videos_form_instances[$this->meta]);
341
-
342
- $objVideos = $args['args'];
343
echo $objVideos->get_form();
344
}
345
346
function save() {
347
if( !isset($_POST['fv_player_videos']) || !isset($_POST['fv-player-custom-videos-entity-type']) || !isset($_POST['fv-player-custom-videos-entity-id']) ) {
348
return;
349
}
350
351
- // todo: permission check!
352
353
- foreach( $_POST['fv_player_videos'] AS $meta => $aValues ) {
354
if( $_POST['fv-player-custom-videos-entity-type'][$meta] == 'user' ) {
355
delete_user_meta( $_POST['fv-player-custom-videos-entity-id'][$meta], $meta );
356
- foreach( $aValues AS $key => $value ) {
357
- if( strlen($value) == 0 ) continue;
358
- $aVideo = array(
359
- 'url' => trim(strip_tags($value)),
360
- 'title' => trim(htmlspecialchars($_POST['fv_player_videos_titles'][$meta][$key]))
361
- );
362
- add_user_meta( $_POST['fv-player-custom-videos-entity-id'][$meta], $meta, $aVideo );
363
}
364
-
365
}
366
367
}
@@ -375,18 +338,17 @@ class FV_Player_Custom_Videos_Master {
375
376
// todo: permission check!
377
378
- foreach( $_POST['fv_player_videos'] AS $meta => $aValues ) {
379
if( $_POST['fv-player-custom-videos-entity-type'][$meta] == 'post' ) {
380
delete_post_meta( $post_id, $meta );
381
- foreach( $aValues AS $key => $value ) {
382
- if( strlen($value) == 0 ) continue;
383
- $aVideo = array(
384
- 'url' => trim(strip_tags($value)),
385
- 'title' => trim(htmlspecialchars($_POST['fv_player_videos_titles'][$meta][$key]))
386
- );
387
- add_post_meta( $post_id, $meta, $aVideo );
388
}
389
-
390
}
391
392
}
@@ -399,9 +361,11 @@ class FV_Player_Custom_Videos_Master {
399
$aMeta = get_post_custom($post->ID);
400
if( $aMeta ) {
401
foreach( $aMeta AS $key => $aMetas ) {
402
- $objVideos = new FV_Player_Custom_Videos( array('id' => $post->ID, 'meta' => $key, 'type' => 'post' ) );
403
- if( $objVideos->have_videos() ) {
404
- $content .= $objVideos->get_html();
405
}
406
}
407
}
@@ -459,9 +423,27 @@ class FV_Player_Custom_Videos_Master {
459
<?php echo $user->get_form(array('no_form' => true));?>
460
</p>
461
<?php
462
}
463
464
}
465
466
467
$FV_Player_Custom_Videos_Master = new FV_Player_Custom_Videos_Master;
6
7
var $id;
8
9
+ var $instance_id;
10
+
11
public function __construct( $args ) {
12
global $post;
13
20
$this->id = $args['id'];
21
$this->meta = $args['meta'];
22
$this->type = $args['type'];
23
}
24
25
private function esc_shortcode( $arg ) {
60
add_filter( 'fv_flowplayer_playlist_splash', array( $FV_Player_Pro, 'youtube_splash' ), 10, 3 );
61
62
add_action('admin_footer', array( $FV_Player_Pro, 'styles' ) );
63
+ add_action('admin_footer', array( $FV_Player_Pro, 'scripts' ) ); // todo: not just for FV Player Pro
64
}
65
66
add_action('admin_footer','flowplayer_prepare_scripts');
67
}
68
69
+ add_action('admin_footer', array( $this, 'shortcode_editor_load' ), 0 );
70
}
71
72
if( !is_admin() && !$args['no_form'] ) $html .= "<form method='POST'>";
79
80
if( !is_admin() && !$args['no_form'] ) {
81
$html .= "<input type='hidden' name='action' value='fv-player-custom-videos-save' />";
82
+ $html .= "<input type='submit' value='Save Videos' />";
83
$html .= "</form>";
84
}
85
87
$html .= '</div>';
88
}
89
90
+ return $html;
91
+ }
92
+
93
+ public function get_html_part( $video, $edit = false ) {
94
+
95
+ // exp: what matters here is .fv-player-editor-field and .fv-player-editor-button wrapped in .fv-player-editor-wrapper and .fv-player-editor-preview
96
+ if( $edit ) {
97
+ $html = "<div class='fv-player-editor-wrapper' data-key='fv-player-editor-field-".$this->meta."'>
98
+ <div class='inside inside-child'>
99
+ <div class='fv-player-editor-preview'>".($video ? do_shortcode($video) : '')."</div>
100
+ <input class='attachement-shortcode fv-player-editor-field' name='fv_player_videos[".$this->meta."][]' type='hidden' value='".esc_attr($video)."' />
101
+ <div class='edit-video' ".(!$video ? 'style="display:none"' : '').">
102
+ <button class='button fv-player-editor-button'>Edit Video</button>
103
+ <button class='button fv-player-editor-remove'>Remove Video</button>
104
+ <button class='button fv-player-editor-more' style='display:none'>Add Another Video</button>
105
+ </div>
106
+
107
+ <div class='add-video' ".($video ? 'style="display:none"' : '').">
108
+ <button class='button fv-player-editor-button'>Add Video</button>
109
+ </div>
110
+ </div>
111
+ </div>";
112
+ } else {
113
+ $html = do_shortcode($video);
114
+ }
115
return $html;
116
}
117
122
$html = '';
123
$count = 0;
124
if( $this->have_videos() ) {
125
+
126
+ if( $args['wrapper'] ) $html .= '<'.$args['wrapper'].' class="fv-player-custom-video">';
127
+
128
+ foreach( $this->get_videos() AS $video ) {
129
$count++;
130
+ $html .= $this->get_html_part($video, $args['edit']);
131
}
132
133
+ $html .= '<div style="clear: both"></div>'."\n";
134
+
135
+ if( $args['wrapper'] ) $html .= '</'.$args['wrapper'].'>'."\n";
136
+
137
} else if( $args['edit'] ) {
138
$html .= '<'.$args['wrapper'].' class="fv-player-custom-video">';
139
+ $html .= $this->get_html_part(false, true);
140
+ $html .= '<div style="clear: both"></div>'."\n";
141
$html .= '</'.$args['wrapper'].'>';
142
}
143
144
$html .= "<input type='hidden' name='fv-player-custom-videos-entity-id[".$this->meta."]' value='".esc_attr($this->id)."' />";
145
+ $html .= "<input type='hidden' name='fv-player-custom-videos-entity-type[".$this->meta."]' value='".esc_attr($this->type)."' />";
146
147
return $html;
148
}
157
$aVideos = array();
158
if( is_array($aMeta) && count($aMeta) > 0 ) {
159
foreach( $aMeta AS $aVideo ) {
160
+ if( is_array($aVideo) && isset($aVideo['url']) && isset($aVideo['title']) ) {
161
+ $aVideos[] = '[fvplayer src="'.$this->esc_shortcode($aVideo['url']).'" caption="'.$this->esc_shortcode($aVideo['title']).'"]';
162
+ } else if( is_string($aVideo) && stripos($aVideo,'[fvplayer ') === 0 ) {
163
+ $aVideos[] = $aVideo;
164
+ }
165
}
166
}
167
170
171
public function have_videos() {
172
return count($this->get_videos()) ? true : false;
173
+ }
174
175
+ function shortcode_editor_load() {
176
+ if( !function_exists('fv_flowplayer_admin_select_popups') ) {
177
+ fv_wp_flowplayer_edit_form_after_editor();
178
+ fv_player_shortcode_editor_scripts_enqueue();
179
+ }
180
}
181
182
187
188
class FV_Player_Custom_Videos_Master {
189
190
+ var $aMetaBoxes = array();
191
+
192
function __construct() {
193
194
add_action( 'init', array( $this, 'save' ) ); // saving of user profile, both front and back end
197
add_filter( 'show_password_fields', array( $this, 'user_profile' ), 10, 2 );
198
add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ), 999, 2 );
199
200
+ add_filter( 'the_content', array( $this, 'show' ) ); // adding post videos after content automatically
201
add_filter( 'get_the_author_description', array( $this, 'show_bio' ), 10, 2 );
202
203
// EDD
205
add_action('edd_pre_update_user_profile', array($this, 'save'));
206
207
// bbPress
208
+ add_action( 'bbp_template_after_user_profile', array( $this, 'bbpress_profile' ), 10 );
209
add_filter( 'bbp_user_edit_after_about', array( $this, 'bbpress_edit' ), 10, 2 );
210
}
211
212
function add_meta_boxes() {
213
+ global $post;
214
+ if( !empty($this->aMetaBoxes[$post->post_type]) ) {
215
+ foreach( $this->aMetaBoxes[$post->post_type] AS $meta_key => $name ) {
216
+ $objVideos = new FV_Player_Custom_Videos( array('id' => $post->ID, 'meta' => $meta_key, 'type' => 'post' ) );
217
+ add_meta_box( 'fv_player_custom_videos-field_'.$meta_key,
218
+ $name,
219
+ array( $this, 'meta_box' ),
220
+ null,
221
+ 'normal',
222
+ 'high',
223
+ $objVideos );
224
+ }
225
+ }
226
+
227
+ // todo: following code should not add the meta boxes added by the above again!
228
+
229
global $fv_fp;
230
if( isset($fv_fp->conf['profile_videos_enable_bio']) && $fv_fp->conf['profile_videos_enable_bio'] == 'true' ) {
231
$aMeta = get_post_custom($post->ID);
232
if( $aMeta ) {
233
foreach( $aMeta AS $key => $aMetas ) {
258
259
<div>
260
<?php
261
+ $objVideos = new FV_Player_Custom_Videos(array( 'id' => bbp_get_displayed_user_field('ID'), 'type' => 'user' ));
262
echo $objVideos->get_form( array('no_form' => true) );
263
?>
264
</div>
265
266
<?php
267
+
268
+ if( !function_exists('is_plugin_active') ) include( ABSPATH . 'wp-admin/includes/plugin.php' );
269
+ if( !function_exists('fv_wp_flowplayer_edit_form_after_editor') ) include( dirname( __FILE__ ) . '/../controller/editor.php' );
270
+
271
+ fv_wp_flowplayer_edit_form_after_editor();
272
+ fv_player_shortcode_editor_scripts_enqueue();
273
}
274
275
function bbpress_profile() {
278
if( !isset($fv_fp->conf['profile_videos_enable_bio']) || $fv_fp->conf['profile_videos_enable_bio'] !== 'true' )
279
return;
280
281
+ $objVideos = new FV_Player_Custom_Videos(array( 'id' => bbp_get_displayed_user_field('ID'), 'type' => 'user' ));
282
if( $objVideos->have_videos() ) : ?>
283
<div id="bbp-user-profile" class="bbp-user-profile">
284
<h2 class="entry-title"><?php _e( 'Videos', 'bbpress' ); ?></h2>
293
294
function meta_box( $aPosts, $args ) {
295
global $FV_Player_Custom_Videos_form_instances;
296
+ $objVideos = $args['args'];
297
+ unset($FV_Player_Custom_Videos_form_instances[$objVideos->meta]);
298
echo $objVideos->get_form();
299
}
300
301
+ function register_metabox( $name, $meta_key, $post_type, $display ) {
302
+ if( !isset($this->aMetaBoxes[$post_type]) ) $this->aMetaBoxes[$post_type] = array();
303
+ if( !isset($this->aMetaBoxesDisplay[$post_type]) ) $this->aMetaBoxesDisplay[$post_type] = array();
304
+
305
+ $this->aMetaBoxes[$post_type][$meta_key] = $name;
306
+ $this->aMetaBoxesDisplay[$post_type][$meta_key] = $display;
307
+ }
308
+
309
+
310
function save() {
311
+
312
if( !isset($_POST['fv_player_videos']) || !isset($_POST['fv-player-custom-videos-entity-type']) || !isset($_POST['fv-player-custom-videos-entity-id']) ) {
313
return;
314
}
315
316
317
+
318
+ // todo: permission check!
319
+ foreach( $_POST['fv_player_videos'] AS $meta => $videos ) {
320
if( $_POST['fv-player-custom-videos-entity-type'][$meta] == 'user' ) {
321
delete_user_meta( $_POST['fv-player-custom-videos-entity-id'][$meta], $meta );
322
+
323
+ foreach( $videos AS $video ) {
324
+ if( strlen($video) == 0 ) continue;
325
+
326
+ add_user_meta( $_POST['fv-player-custom-videos-entity-id'][$meta], $meta, $video );
327
}
328
}
329
330
}
338
339
// todo: permission check!
340
341
+ foreach( $_POST['fv_player_videos'] AS $meta => $value ) {
342
if( $_POST['fv-player-custom-videos-entity-type'][$meta] == 'post' ) {
343
delete_post_meta( $post_id, $meta );
344
+
345
+ if( is_array($value) && count($value) > 0 ) {
346
+ foreach( $value AS $k => $v ) {
347
+ if( strlen($v) == 0 ) continue;
348
+
349
+ add_post_meta( $post_id, $meta, $v );
350
+ }
351
}
352
}
353
354
}
361
$aMeta = get_post_custom($post->ID);
362
if( $aMeta ) {
363
foreach( $aMeta AS $key => $aMetas ) {
364
+ if( !empty($this->aMetaBoxesDisplay[$post->post_type][$key]) && $this->aMetaBoxesDisplay[$post->post_type][$key] ) {
365
+ $objVideos = new FV_Player_Custom_Videos( array('id' => $post->ID, 'meta' => $key, 'type' => 'post' ) );
366
+ if( $objVideos->have_videos() ) {
367
+ $content .= $objVideos->get_html();
368
+ }
369
}
370
}
371
}
423
<?php echo $user->get_form(array('no_form' => true));?>
424
</p>
425
<?php
426
+
427
+ if( !function_exists('is_plugin_active') ) include( ABSPATH . 'wp-admin/includes/plugin.php' );
428
+ if( !function_exists('fv_wp_flowplayer_edit_form_after_editor') ) include( dirname( __FILE__ ) . '/../controller/editor.php' );
429
+
430
+ fv_wp_flowplayer_edit_form_after_editor();
431
+ fv_player_shortcode_editor_scripts_enqueue();
432
}
433
434
}
435
436
437
$FV_Player_Custom_Videos_Master = new FV_Player_Custom_Videos_Master;
438
+
439
+
440
+
441
+
442
+ class FV_Player_MetaBox {
443
+
444
+ function __construct( $name, $meta_key, $post_type, $display = false ) {
445
+ global $FV_Player_Custom_Videos_Master;
446
+ $FV_Player_Custom_Videos_Master->register_metabox( $name, $meta_key, $post_type, $display );
447
+ }
448
+
449
+ }
models/flowplayer-frontend.php CHANGED
@@ -980,7 +980,7 @@ class flowplayer_frontend extends flowplayer
980
}
981
982
$subtitles = explode( ";",$subtitles);
983
- if( empty($subtitles[$index]) ) return $aSubtitles;
984
985
$subtitles = $subtitles[$index];
986
980
}
981
982
$subtitles = explode( ";",$subtitles);
983
+ if( empty($subtitles[$index]) ) continue;
984
985
$subtitles = $subtitles[$index];
986
models/flowplayer.php CHANGED
@@ -572,6 +572,9 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
572
573
if( !isset( $conf['playlist-design'] ) ) $conf['playlist-design'] = '2017';
574
575
// apply existing colors from old config values to the new, skin-based config array
576
if (!isset($conf['skin-custom'])) {
577
$conf['skin-custom'] = array();
@@ -1233,10 +1236,11 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
1233
}
1234
1235
foreach( $posts AS $objPost ) {
1236
- if(
1237
- stripos($objPost->post_content,'[fvplayer') !== false ||
1238
- stripos($objPost->post_content,'[flowplayer') !== false ||
1239
- stripos($objPost->post_content,'[video') !== false
1240
) {
1241
$bFound = true;
1242
break;
@@ -1834,7 +1838,8 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
1834
if( stripos( __FILE__, '/themes/' ) !== false || stripos( __FILE__, '\\themes\\' ) !== false ) {
1835
return get_template_directory_uri().'/fv-wordpress-flowplayer';
1836
} else {
1837
- return plugins_url( '', str_replace( array('/models','\\models'), '', __FILE__ ) );
1838
}
1839
}
1840
@@ -1855,7 +1860,7 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
1855
1856
1857
1858
- function get_video_src($media, $aArgs ) {
1859
$aArgs = wp_parse_args( $aArgs, array(
1860
'dynamic' => false,
1861
'flash' => true,
@@ -2121,10 +2126,10 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
2121
</div>
2122
</div>
2123
2124
- <?php else : ?>
2125
- <?php while ( have_posts() ) : the_post(); //is this needed? ?>
2126
- <?php
2127
-
2128
$bFound = false;
2129
$rewrite = get_option('rewrite_rules');
2130
if( empty($rewrite) ) {
@@ -2133,10 +2138,7 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
2133
$sPostfix = get_query_var('fv_player_embed') > 1 ? 'fvp'.get_query_var('fv_player_embed') : 'fvp';
2134
$sLink = user_trailingslashit( trailingslashit( get_permalink() ).$sPostfix );
2135
}
2136
- //$content = apply_filters( 'the_content', get_the_content() );
2137
-
2138
-
2139
-
2140
$aPlayers = explode( '<!--fv player end-->', $content );
2141
if( $aPlayers ) {
2142
foreach( $aPlayers AS $k => $v ) {
@@ -2152,33 +2154,31 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
2152
echo "<p>Player not found, see the full article: <a href='".get_permalink()."' target='_blank'>".get_the_title()."</a>.</p>";
2153
}
2154
2155
- ?>
2156
- <?php endwhile;
2157
- endif;
2158
- ?>
2159
- </body>
2160
-
2161
- <?php wp_footer(); ?>
2162
-
2163
- <?php if( isset($_GET['fv_player_preview']) && !empty($_GET['fv_player_preview']) ) : ?>
2164
-
2165
- <script>
2166
- jQuery(document).ready( function(){
2167
- var parent = window.parent.jQuery(window.parent.document);
2168
- if( typeof(flowplayer) != "undefined" ) {
2169
- parent.trigger('fvp-preview-complete', [jQuery(document).width(),jQuery(document).height()]);
2170
-
2171
- } else {
2172
- parent.trigger('fvp-preview-error');
2173
}
2174
2175
- });
2176
2177
- if (window.top===window.self) {
2178
- jQuery('#wrapper').css('margin','25px 50px 0 50px');
2179
- }
2180
- </script>
2181
- <?php endif; ?>
2182
2183
</html>
2184
<?php
@@ -2244,4 +2244,3 @@ function fv_wp_flowplayer_save_post( $post_id ) {
2244
}
2245
}
2246
}
2247
-
572
573
if( !isset( $conf['playlist-design'] ) ) $conf['playlist-design'] = '2017';
574
575
+ if (!isset($conf['skin-slim'])) $conf['skin-slim'] = array();
576
+ if (!isset($conf['skin-youtuby'])) $conf['skin-youtuby'] = array();
577
+
578
// apply existing colors from old config values to the new, skin-based config array
579
if (!isset($conf['skin-custom'])) {
580
$conf['skin-custom'] = array();
1236
}
1237
1238
foreach( $posts AS $objPost ) {
1239
+ if( !empty($objPost->post_content) && (
1240
+ stripos($objPost->post_content,'[fvplayer') !== false ||
1241
+ stripos($objPost->post_content,'[flowplayer') !== false ||
1242
+ stripos($objPost->post_content,'[video') !== false
1243
+ )
1244
) {
1245
$bFound = true;
1246
break;
1838
if( stripos( __FILE__, '/themes/' ) !== false || stripos( __FILE__, '\\themes\\' ) !== false ) {
1839
return get_template_directory_uri().'/fv-wordpress-flowplayer';
1840
} else {
1841
+ $plugin_folder = basename(dirname(dirname(__FILE__))); // make fv-wordpress-flowplayer out of {anything}/fv-wordpress-flowplayer/models/flowplayer.php
1842
+ return plugins_url($plugin_folder);
1843
}
1844
}
1845
1860
1861
1862
1863
+ function get_video_src($media, $aArgs = array() ) {
1864
$aArgs = wp_parse_args( $aArgs, array(
1865
'dynamic' => false,
1866
'flash' => true,
2126
</div>
2127
</div>
2128
2129
+ <?php else :
2130
+
2131
+ if( stripos($content,'<!--fv player end-->') !== false ) {
2132
+
2133
$bFound = false;
2134
$rewrite = get_option('rewrite_rules');
2135
if( empty($rewrite) ) {
2138
$sPostfix = get_query_var('fv_player_embed') > 1 ? 'fvp'.get_query_var('fv_player_embed') : 'fvp';
2139
$sLink = user_trailingslashit( trailingslashit( get_permalink() ).$sPostfix );
2140
}
2141
+
2142
$aPlayers = explode( '<!--fv player end-->', $content );
2143
if( $aPlayers ) {
2144
foreach( $aPlayers AS $k => $v ) {
2154
echo "<p>Player not found, see the full article: <a href='".get_permalink()."' target='_blank'>".get_the_title()."</a>.</p>";
2155
}
2156
2157
}
2158
+ endif;
2159
2160
+ wp_footer();
2161
2162
+ if( isset($_GET['fv_player_preview']) && !empty($_GET['fv_player_preview']) ) : ?>
2163
+ <script>
2164
+ jQuery(document).ready( function(){
2165
+ var parent = window.parent.jQuery(window.parent.document);
2166
+ if( typeof(flowplayer) != "undefined" ) {
2167
+ parent.trigger('fvp-preview-complete', [jQuery(document).width(),jQuery(document).height()]);
2168
+
2169
+ } else {
2170
+ parent.trigger('fvp-preview-error');
2171
+ }
2172
+
2173
+ });
2174
+
2175
+ if (window.top===window.self) {
2176
+ jQuery('#wrapper').css('margin','25px 50px 0 50px');
2177
+ }
2178
+ </script>
2179
+ <?php endif; ?>
2180
+
2181
+ </body>
2182
2183
</html>
2184
<?php
2244
}
2245
}
2246
}
models/player-position-save.php ADDED
@@ -0,0 +1,57 @@
1
+ <?php
2
+ class FV_Player_Position_Save {
3
+
4
+ public function __construct() {
5
+ add_action( 'wp_ajax_fv_wp_flowplayer_video_position_save', array($this, 'video_position_save') );
6
+ add_filter('fv_player_item', array($this, 'set_last_position') );
7
+ add_filter('fv_flowplayer_admin_default_options_after', array( $this, 'player_position_save_admin_default_options_html' ) );
8
+
9
+ add_filter( 'fv_flowplayer_attributes', array( $this, 'shortcode' ), 10, 3 );
10
+ }
11
+
12
+ private function get_extensionless_file_name($path) {
13
+ return pathinfo($path, PATHINFO_FILENAME);
14
+ }
15
+
16
+ public function set_last_position($aItemArray) {
17
+ // we only use the first source to check for stored position,
18
+ // since other sources would be alternatives (in quality, etc.)
19
+ if (
20
+ is_user_logged_in() &&
21
+ is_array($aItemArray) &&
22
+ isset($aItemArray['sources']) &&
23
+ isset($aItemArray['sources'][0]) &&
24
+ ($metaPosition = get_user_meta( get_current_user_id(), 'fv_wp_flowplayer_position_' . $this->get_extensionless_file_name($aItemArray['sources'][0]['src']), true ))
25
+ ) {
26
+ $aItemArray['sources'][0]['position'] = $metaPosition;
27
+ }
28
+ return $aItemArray;
29
+ }
30
+
31
+ public function video_position_save() {
32
+ // TODO: XSS filter for POST values?
33
+ if (is_user_logged_in() && isset($_POST['videoTimes']) && ($times = $_POST['videoTimes']) && count($times)) {
34
+ $uid = get_current_user_id();
35
+ foreach ($times as $record) {
36
+ update_user_meta($uid, 'fv_wp_flowplayer_position_'.$this->get_extensionless_file_name($record['name']), $record['position']);
37
+ }
38
+ wp_send_json_success();
39
+ } else {
40
+ wp_send_json_error();
41
+ }
42
+ }
43
+
44
+ function player_position_save_admin_default_options_html() {
45
+ global $fv_fp;
46
+ $fv_fp->_get_checkbox(__('Remember video position', 'fv-wordpress-flowplayer').' (beta)', 'video_position_save_enable', __('Stores the last video play position for users, so they can continue watching from where they left.'), __('It stored in usermeta for logged in users and in a localStorage or cookie for guest users.'));
47
+ }
48
+
49
+ function shortcode( $attributes, $media, $fv_fp ) {
50
+ if( isset($fv_fp->aCurArgs['saveposition']) && $fv_fp->aCurArgs['saveposition'] == 'true' ) {
51
+ $attributes['data-save-position'] = 'true';
52
+ }
53
+ return $attributes;
54
+ }
55
+
56
+ }
57
+ $FV_Player_Position_Save = new FV_Player_Position_Save();
models/widget.php CHANGED
@@ -1,5 +1,7 @@
1
<?php
2
3
class FV_Player_Widget extends WP_Widget {
4
5
public function __construct() {
@@ -13,7 +15,7 @@ class FV_Player_Widget extends WP_Widget {
13
14
function widget_init() {
15
register_widget('FV_Player_widget');
16
- add_action('admin_footer-widgets.php', array($this, 'formFooter') );
17
}
18
19
/**
@@ -110,19 +112,17 @@ class FV_Player_Widget extends WP_Widget {
110
}
111
112
function formFooter() {
113
- if( function_exists('get_current_screen') ) { // fix for wp-page-widget
114
- $ojbScreen = get_current_screen();
115
- if( $ojbScreen && $ojbScreen->base == 'post' ) return;
116
}
117
118
- include dirname(__FILE__) . '/../view/wizard.php';
119
- ?>
120
- <script src="<?php echo FV_FP_RELATIVE_PATH; ?>/js/shortcode-editor.js"></script>
121
- <script src="<?php echo FV_FP_RELATIVE_PATH; ?>/js/jquery.colorbox-min.js"></script>
122
- <link rel = "stylesheet" type = "text/css" href = "<?php echo FV_FP_RELATIVE_PATH; ?>/css/colorbox.css"/>
123
- <?php
124
}
125
126
}
127
128
$FV_Player_Widget = new FV_Player_Widget();
1
<?php
2
3
+ if( class_exists('WP_Widget') ) :
4
+
5
class FV_Player_Widget extends WP_Widget {
6
7
public function __construct() {
15
16
function widget_init() {
17
register_widget('FV_Player_widget');
18
+ add_action('admin_footer', array($this, 'formFooter'), 0 );
19
}
20
21
/**
112
}
113
114
function formFooter() {
115
+ if( function_exists('get_current_screen') ) {
116
+ $objScreen = get_current_screen();
117
+ if( $objScreen && $objScreen->base != 'widgets' ) return;
118
}
119
120
+ fv_wp_flowplayer_edit_form_after_editor();
121
+ fv_player_shortcode_editor_scripts_enqueue();
122
}
123
124
}
125
126
$FV_Player_Widget = new FV_Player_Widget();
127
+
128
+ endif;
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: FolioVision
3
Donate link: https://foliovision.com/donate
4
Tags: video player, flowplayer, mobile video, html5 video, Vimeo, html5 player, youtube player, youtube playlist, video playlist, RTMP, Cloudfront, HLS
5
Requires at least: 3.5
6
- Tested up to: 4.9.2
7
Stable tag: trunk
8
License: GPLv3 or later
9
License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -16,6 +16,8 @@ Custom HTML 5 video on your own site with Flash fallback for legacy browsers is
16
17
FV Player is a free, easy-to-use, and complete solution for embedding FLV or MP4 videos into your posts or pages. With MP4 videos, FV Player offers 98% coverage even on mobile devices.
18
19
* **NEW** easy AB looped playback for your visitors (great for teaching sites)
20
* **NEW** improved and more powerful playlists (more playlist features coming soon).
21
* Automated checking of video encoding for logged in admins
@@ -354,6 +356,16 @@ Thank you for being part of the HMTL 5 mobile video revolution!
354
355
== Changelog ==
356
357
= 6.4.2 - 2018/02/23 =
358
359
* CSS - fixing the left and right alignment margin
@@ -382,7 +394,7 @@ Thank you for being part of the HMTL 5 mobile video revolution!
382
383
= 6.3.11 - 2017/11/20 =
384
385
- * New feature - Sticky Video - lets your viewers continue watching the video as they scroll past it. It applies to desktop computer displays - minimal width of 1200 pixels. See Setting -> FV Player -> Skin -> Sticky Video
386
* Lightbox - improving retina image parsing
387
388
= 6.3.10 - 2017/11/13 =
3
Donate link: https://foliovision.com/donate
4
Tags: video player, flowplayer, mobile video, html5 video, Vimeo, html5 player, youtube player, youtube playlist, video playlist, RTMP, Cloudfront, HLS
5
Requires at least: 3.5
6
+ Tested up to: 4.9.4
7
Stable tag: trunk
8
License: GPLv3 or later
9
License URI: http://www.gnu.org/licenses/gpl-3.0.html
16
17
FV Player is a free, easy-to-use, and complete solution for embedding FLV or MP4 videos into your posts or pages. With MP4 videos, FV Player offers 98% coverage even on mobile devices.
18
19
+ * Remembering video position both both guest users and members
20
+ * API for custom video fields
21
* **NEW** easy AB looped playback for your visitors (great for teaching sites)
22
* **NEW** improved and more powerful playlists (more playlist features coming soon).
23
* Automated checking of video encoding for logged in admins
356
357
== Changelog ==
358
359
+ = 6.5 - 2018/03/14 =
360
+
361
+ * New feature - Video position saving for both guest and logged in users - see Settings -> FV Player -> Sidewide Flowplayer Defaults -> Remember video position
362
+ * Custom video fields are now easy to add with the FV_Player_MetaBox PHP class
363
+ * DASH - updating to latest tested Dash.js version
364
+ * Bugfix - iframe embed code placing body closing tag in bad place
365
+ * Bugfix - fix for PHP warnings on AMP pages
366
+ * Bugfix - Shortcode editor bug when you select the subtitle language and it adds the subtitles twice
367
+ * Bugfix - Subtitles in playlist - making sure multilingual subtitles work for the first item at least
368
+
369
= 6.4.2 - 2018/02/23 =
370
371
* CSS - fixing the left and right alignment margin
394
395
= 6.3.11 - 2017/11/20 =
396
397
+ * New feature - Sticky Video - lets your viewers continue watching the video as they scroll past it. It applies to desktop computer displays - minimal width of 1200 pixels. See Setting -> FV Player -> Skin -> Sticky Video, thanks to Dan Hostettler
398
* Lightbox - improving retina image parsing
399
400
= 6.3.10 - 2017/11/13 =
test/integration/backend/profileVideosTest.php ADDED
@@ -0,0 +1,47 @@
1
+ <?php
2
+
3
+ require_once( dirname(__FILE__).'/../fv-player-unittest-case.php');
4
+
5
+ /**
6
+ * Tests WordPress integration of playlists without any advertisements present
7
+ * in the HTML markup.
8
+ */
9
+ final class FV_Player_ProfileVideosTestCase extends FV_Player_UnitTestCase {
10
+
11
+ public function testProfileScreen() {
12
+ global $fv_fp;
13
+ $fv_fp->conf['profile_videos_enable_bio'] = true;
14
+
15
+ // add new user and create last saved position metadata for this new user
16
+ $this->userID = $this->factory->user->create(array(
17
+ 'role' => 'admin'
18
+ ));
19
+
20
+ add_user_meta($this->userID, '_fv_player_user_video', '[fvplayer src="https://vimeo.com/255317467" playlist="https://vimeo.com/192934117" caption=";Talking about FV Player"]');
21
+ add_user_meta($this->userID, '_fv_player_user_video', '[fvplayer src="https://vimeo.com/255370388"]');
22
+ add_user_meta($this->userID, '_fv_player_user_video', '[fvplayer src="https://www.youtube.com/watch?v=6ZfuNTqbHE8"]]');
23
+
24
+ $profileuser = get_user_to_edit($this->userID);
25
+
26
+ ob_start();
27
+ apply_filters( 'show_password_fields', true, $profileuser );
28
+ $output = ob_get_clean();
29
+
30
+ $one = $this->fix_newlines(file_get_contents(dirname(__FILE__).'/testProfileScreen.html')); // this contains user ID of '4'
31
+ $two = explode("\n",$this->fix_newlines($output));
32
+ foreach( explode("\n",$one) as $k => $v ) {
33
+
34
+ /*if( $v != $two[$k]) {
35
+ for($i=0;$i<strlen($two[$k]);$i++) {
36
+ var_dump( $two[$k][$i].' '.ord($two[$k][$i]) );
37
+ }
38
+ }*/
39
+
40
+ //$this->assertEquals( $v, $two[$k] );
41
+ }
42
+
43
+ $this->assertEquals( $this->fix_newlines(file_get_contents(dirname(__FILE__).'/testProfileScreen.html')), $this->fix_newlines($output) );
44
+
45
+ }
46
+
47
+ }
test/integration/backend/settingsTest.php ADDED
@@ -0,0 +1,37 @@
1
+ <?php
2
+
3
+ require_once( dirname(__FILE__).'/../fv-player-unittest-case.php');
4
+
5
+ /**
6
+ * Tests WordPress integration of playlists without any advertisements present
7
+ * in the HTML markup.
8
+ */
9
+ final class FV_Player_SettingsTestCase extends FV_Player_UnitTestCase {
10
+
11
+ public function testSettingsScreen() {
12
+ include( '../../../fv-wordpress-flowplayer/controller/backend.php' );
13
+ include( '../../../fv-wordpress-flowplayer/controller/editor.php' );
14
+ include( '../../../fv-wordpress-flowplayer/controller/settings.php' );
15
+
16
+
17
+ ob_start();
18
+ fv_player_admin_page();
19
+ $output = ob_get_clean();
20
+
21
+ $one = $this->fix_newlines(file_get_contents(dirname(__FILE__).'/testSettingsScreen.html'));
22
+ $two = explode("\n",$this->fix_newlines($output));
23
+ foreach( explode("\n",$one) as $k => $v ) {
24
+
25
+ /*if( $v != $two[$k]) {
26
+ for($i=0;$i<strlen($two[$k]);$i++) {
27
+ var_dump( $two[$k][$i].' '.ord($two[$k][$i]) );
28
+ }
29
+ }*/
30
+
31
+ //$this->assertEquals( $v, $two[$k] );
32
+ }
33
+
34
+ $this->assertEquals( $this->fix_newlines(file_get_contents(dirname(__FILE__).'/testSettingsScreen.html')), $this->fix_newlines($output) );
35
+ }
36
+
37
+ }
test/integration/backend/testProfileScreen.html ADDED
@@ -0,0 +1,54 @@