FV Flowplayer Video Player - Version 6.2.10

Version Description

  • 2017/09/04 =

  • Google Analytics - fix for HLS streams turning up as "index" only - adding last directory name into it as well, so you will get my-video/index now.

Download this release

Release Info

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

Code changes from version 6.1.5 to 6.2.10

README.md ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # FV Player
2
+
3
+ WordPress's most reliable, easy to use and feature-rich video player. Supports responsive design, HTML5, playlists, ads, stats, Vimeo and YouTube.
4
+
5
+ * Core video engine: open source Flowplayer 6.
6
+ * Supported video formats are MP4, WebM and OGV ([read about HTML5 video formats](https://foliovision.com/player/encoding)).
7
+ * Supported video streaming formats are HLS (Flash and JavaScript fallback available for incompatible devices), MPEG DASH and RTMP.
8
+ * Default options for all the embedded videos can be set in comprehensive administration menu.
9
+
10
+ ## Documentation
11
+
12
+ [Change Log](https://foliovision.com/player/changelog) | [User Guide and How-Tos](https://foliovision.com/player) | [Demos](https://foliovision.com/player/demos) | [Installation](https://foliovision.com/player/installation)| [Support](https://foliovision.com/support/fv-wordpress-flowplayer/) |
13
+
14
+ ## License
15
+
16
+ GPLv3 or later
17
+
18
+ ## Thank you
19
+
20
+ Big thank you goes to all of our users who continue supporting our plugin and report any bugs they encounter. Thank you for being part of Foliovision!
21
+
22
+ [![BrowserStack logo](https://cdn.foliovision.com/images/graphics/browserstack-logo-300x77.png "FV Player user BrowserStack to ensure maximum device compatibilty")](https://www.browserstack.com)
controller/backend.php CHANGED
@@ -21,6 +21,7 @@
21
  /*
22
  * Video Checker support email
23
  */
 
24
  add_action('wp_ajax_fv_wp_flowplayer_support_mail', 'fv_wp_flowplayer_support_mail');
25
 
26
  function fv_wp_flowplayer_support_mail() {
21
  /*
22
  * Video Checker support email
23
  */
24
+
25
  add_action('wp_ajax_fv_wp_flowplayer_support_mail', 'fv_wp_flowplayer_support_mail');
26
 
27
  function fv_wp_flowplayer_support_mail() {
controller/editor.php CHANGED
@@ -3,7 +3,7 @@
3
  add_action( 'admin_enqueue_scripts', 'fv_player_shortcode_editor_scripts' );
4
 
5
  function fv_player_shortcode_editor_scripts( $page ) {
6
- if( $page !== 'post.php' && $page !== 'post-new.php' ) {
7
  return;
8
  }
9
 
3
  add_action( 'admin_enqueue_scripts', 'fv_player_shortcode_editor_scripts' );
4
 
5
  function fv_player_shortcode_editor_scripts( $page ) {
6
+ if( $page !== 'post.php' && $page !== 'post-new.php' && ( empty($_GET['page']) || $_GET['page'] != 'fvplayer' ) ) {
7
  return;
8
  }
9
 
controller/shortcodes.php CHANGED
@@ -129,6 +129,7 @@ function flowplayer_content_handle( $atts, $content = null, $tag ) {
129
  'liststyle' => '',
130
  'playlist_advance' => '',
131
  'linking' => '',
 
132
  ), $atts ) );
133
 
134
  if( $fv_fp->_get_option('parse_commas') && strcmp($tag,'flowplayer') == 0 ) {
@@ -209,6 +210,7 @@ function flowplayer_content_handle( $atts, $content = null, $tag ) {
209
  'liststyle' => '',
210
  'playlist_advance' => '',
211
  'linking' => '',
 
212
  ), $atts );
213
  }
214
 
129
  'liststyle' => '',
130
  'playlist_advance' => '',
131
  'linking' => '',
132
+ 'end_popup_preview' => ''
133
  ), $atts ) );
134
 
135
  if( $fv_fp->_get_option('parse_commas') && strcmp($tag,'flowplayer') == 0 ) {
210
  'liststyle' => '',
211
  'playlist_advance' => '',
212
  'linking' => '',
213
+ 'end_popup_preview' => '',
214
  ), $atts );
215
  }
216
 
css/admin.css CHANGED
@@ -47,9 +47,12 @@
47
  @media only screen and (max-width: 940px) {.flowplayer-wrapper { width: 100%; float: none;} .form-table2.flowplayer-settings {width: 100% !important;}}
48
 
49
 
50
- #fv-player-popups-settings tr.data:nth-child(even) { background-color: #eee; }
51
  .fv-player-popup-remove { visibility: hidden; }
52
  td:hover > .fv-player-popup-remove { visibility: visible; }
 
 
 
53
  table.fv-player-popup-formats td:first-child { width: 72px }
54
  #fv_flowplayer_popups .inside label {
55
  display: initial;
@@ -59,10 +62,34 @@ table.fv-player-popup-formats td:first-child { width: 72px }
59
  text-align: center;
60
  max-width: 7px;
61
  }
62
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  .fv-metabox-holder {
64
  padding-top:0!important;
65
  }
 
 
 
66
 
67
  .fv-nav-tab-wrapper {
68
  border-bottom: 0px!important;
@@ -100,4 +127,4 @@ table.fv-player-popup-formats td:first-child { width: 72px }
100
 
101
  #fp-preview-wrapper{height:360px;width:420px;position:absolute;top:0px;right:50px;}
102
  #fp-preview-wrapper>.flowplayer{position:relative; height:160px;}
103
- #fp-preview-wrapper .fp-subtitle{height:50px;}
47
  @media only screen and (max-width: 940px) {.flowplayer-wrapper { width: 100%; float: none;} .form-table2.flowplayer-settings {width: 100% !important;}}
48
 
49
 
50
+ #fv-player-popups-settings tr.data:nth-child(even) { background-color: #f6f6f6; }
51
  .fv-player-popup-remove { visibility: hidden; }
52
  td:hover > .fv-player-popup-remove { visibility: visible; }
53
+ .fv-player-list-remove { visibility: hidden; }
54
+ td:hover > .fv-player-list-remove { visibility: visible; }
55
+ #fv_flowplayer_popups table { -webkit-border-collapse:collapse;-moz-border-collapse:collapse;border-collapse:collapse }
56
  table.fv-player-popup-formats td:first-child { width: 72px }
57
  #fv_flowplayer_popups .inside label {
58
  display: initial;
62
  text-align: center;
63
  max-width: 7px;
64
  }
65
+ #fv-player-email_lists-settings tr td {
66
+ vertical-align: top;
67
+ }
68
+ #fv-player-email_lists-settings >tbody > tr > td {
69
+ padding: 2px;
70
+ }
71
+ #fv-player-email_lists-settings > tbody > tr:nth-child(even) {
72
+ background-color: #f6f6f6;
73
+ }
74
+ #fv-player-email_lists-settings,
75
+ #fv-player-email_lists-settings table {
76
+ -webkit-border-collapse: collapse;
77
+ -moz-border-collapse: collapse;
78
+ border-collapse: collapse;
79
+ }
80
+ #fv-player-email_lists-settings table tr td label {
81
+ line-height: 1.8;
82
+ }
83
+ #fv-player-email_lists-settings .id {
84
+ padding: 5px;
85
+ }
86
+ #fv-player-email_lists-settings table tr td,
87
  .fv-metabox-holder {
88
  padding-top:0!important;
89
  }
90
+ #fv-player-email_lists-settings select {
91
+ width: 95%;
92
+ }
93
 
94
  .fv-nav-tab-wrapper {
95
  border-bottom: 0px!important;
127
 
128
  #fp-preview-wrapper{height:360px;width:420px;position:absolute;top:0px;right:50px;}
129
  #fp-preview-wrapper>.flowplayer{position:relative; height:160px;}
130
+ #fp-preview-wrapper .fp-subtitle{height:50px;}
css/flowplayer.css CHANGED
@@ -23,7 +23,7 @@
23
  -moz-osx-font-smoothing: grayscale;
24
  }
25
  .flowplayer{position:relative;width:100%;counter-increment:flowplayer;background-size:contain;background-repeat:no-repeat;background-position:center center;display:inline-block;}
26
- .flowplayer *{font-weight:inherit;font-family:inherit;font-style:inherit;text-decoration:inherit;font-size:100%;padding:0;border:0;margin:0;list-style-type:none}
27
  .flowplayer a:focus{outline:0}
28
  .flowplayer video{width:100%;-ms-transform: translateY(0) translateX(0);-webkit-transform: translateY(0) translateX(0);transform: translateY(0) translateX(0);}
29
  .flowplayer.is-ipad video{-webkit-transform:translateX(-2048px);}
@@ -152,7 +152,7 @@
152
  .no-volume.flowplayer .fp-timeline{margin-right:160px}
153
  .no-mute.flowplayer .fp-timeline{margin-right:195px}
154
  .no-mute.no-volume.flowplayer .fp-timeline{margin-right:120px;}
155
- .has-menu.no-mute.no-volume.flowplayer .fp-timeline{margin-right:157px}
156
  .is-rtl.flowplayer .fp-timeline{margin:0 55px 0 225px;}
157
  .no-brand.is-rtl.flowplayer .fp-timeline{margin-left:160px;}
158
  .has-menu.no-brand.is-rtl.flowplayer .fp-timeline{margin-left:197px}
@@ -193,7 +193,7 @@
193
  .flowplayer.is-touch.is-mouseover .fp-progress:after{height:18px;width:18px;top:-4px;right:-10px;border:5px solid rgba(255,255,255,0.65);-webkit-box-shadow:1px 0 4px rgba(0,0,0,0.5);-moz-box-shadow:1px 0 4px rgba(0,0,0,0.5);box-shadow:1px 0 4px rgba(0,0,0,0.5)}
194
  .flowplayer.is-touch.is-mouseover .fp-timeline.is-dragging .fp-progress:after{border:10px solid #fff;-webkit-border-radius:20px;-moz-border-radius:20px;border-radius:20px;-webkit-transition:inherit;-moz-transition:inherit;transition:inherit;top:-5px;right:-10px}
195
  .flowplayer.is-touch.is-rtl.is-mouseover .fp-timeline.is-dragging .fp-progress:after{left:-15px;right:auto;border:10px solid #fff}
196
- .flowplayer .fp-volume{position:absolute;height:6px;bottom:12px;right:10px;}
197
  .has-menu.flowplayer .fp-volume{right:37px}
198
  .is-rtl.flowplayer .fp-volume{right:auto;left:10px}
199
  .is-rtl.has-menu.flowplayer .fp-volume{left:37px}
@@ -222,7 +222,7 @@
222
  .no-volume.flowplayer .fp-remaining,.no-volume.flowplayer .fp-duration{right:115px}
223
  .no-mute.flowplayer .fp-remaining,.no-mute.flowplayer .fp-duration{right:160px}
224
  .no-mute.no-volume.flowplayer .fp-remaining,.no-mute.no-volume.flowplayer .fp-duration{right:75px;}
225
- .has-menu.no-mute.no-volume.flowplayer .fp-remaining,.has-menu.no-mute.no-volume.flowplayer .fp-duration{right:112px}
226
  .is-rtl.flowplayer .fp-remaining,.is-rtl.flowplayer .fp-duration{right:auto;left:180px;}
227
  .no-brand.is-rtl.flowplayer .fp-remaining,.no-brand.is-rtl.flowplayer .fp-duration{left:115px;}
228
  .has-menu.no-brand.is-rtl.flowplayer .fp-remaining,.has-menu.no-brand.is-rtl.flowplayer .fp-duration{left:142px}
@@ -237,6 +237,7 @@
237
  .flowplayer.aside-time .fp-time .fp-elapsed::after{content:' / '}
238
  .flowplayer.is-splash,.flowplayer.is-poster{cursor:pointer;}
239
  .flowplayer.is-splash .fp-controls,.flowplayer.is-poster .fp-controls,.flowplayer.is-splash .fp-fullscreen,.flowplayer.is-poster .fp-fullscreen,.flowplayer.is-splash .fp-unload,.flowplayer.is-poster .fp-unload,.flowplayer.is-splash .fp-time,.flowplayer.is-poster .fp-time,.flowplayer.is-splash .fp-embed,.flowplayer.is-poster .fp-embed,.flowplayer.is-splash .fp-title,.flowplayer.is-poster .fp-title,.flowplayer.is-splash .fp-brand,.flowplayer.is-poster .fp-brand{display:none !important}
 
240
  .flowplayer.is-poster .fp-engine{top:-9999em}
241
  .flowplayer.is-loading .fp-waiting{display:block}
242
  .flowplayer.is-loading .fp-controls,.flowplayer.is-loading .fp-time{display:none}
@@ -291,6 +292,33 @@
291
  .flowplayer .fp-context-menu li a{color:#00a7c8 !important;font-size:12.100000000000001px !important}
292
  .flowplayer .fp-context-menu li:hover:not(.copyright){background-color:#eee}
293
  .flowplayer .fp-context-menu li.copyright{margin:0;padding-left:110px;background-image:url("img/flowplayer.png");background-repeat:no-repeat;background-size:100px 20px;background-position:5px 5px;border-bottom:1px solid #bbb;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
294
  @media (max-width: 40em){
295
  .flowplayer .fp-help p{font-size:9px;}
296
  .flowplayer .fp-logo{max-width: 130px;}
@@ -300,9 +328,13 @@
300
  @media (max-width: 30em) {
301
  .flowplayer .fp-subtitle{bottom:4px;line-height:12px !important}
302
  .flowplayer .fp-subtitle .fp-subtitle-line{font-size:12px !important;line-height:18px !important;-webkit-text-shadow:0 0 2px #666;-moz-text-shadow:0 0 2px #666;text-shadow:0 0 2px #666}
 
 
303
  }
304
  @media (max-width: 22.5em) {
305
  .flowplayer .fp-logo{max-width: 90px;}
 
 
306
  }
307
  @media (-webkit-min-device-pixel-ratio: 2),(min-resolution: 2dppx){.flowplayer .fp-context-menu li.copyright{background-image:url("img/flowplayer-2x.png")}
308
  }@-moz-keyframes pulse{0%{opacity:0}
@@ -366,7 +398,7 @@
366
  .fvp-share-bar .fvp-sharing,
367
  #content .fvp-share-bar .fvp-sharing {
368
  /*clear: both;
369
- width: 102px;*/
370
  min-height: 24px;
371
  margin: 3px auto !important;
372
  padding: 0 !important;
@@ -396,7 +428,7 @@
396
  }
397
  /*#content .flowplayer a,
398
  .flowplayer a,
399
- .flowplayer a:hover, viktor, please check */
400
  .fvp-share-bar .fvp-sharing a {
401
  color: #fff !important;
402
  text-shadow: none !important;
@@ -467,7 +499,7 @@
467
  font-weight: bold;
468
  text-shadow: 0 0 1px #000;
469
  cursor: pointer;
470
- z-index: 12; /* make clickable */
471
  opacity: 1;
472
  filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
473
  }
@@ -480,28 +512,50 @@
480
  .is-mouseout.flowplayer .fp-prev, .is-mouseout.flowplayer .fp-next {
481
  opacity: 0;
482
  filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
483
- /* same transition as other ui elements like fullscreen */
484
  -webkit-transition: opacity .15s .3s;
485
  -moz-transition: opacity .15s .3s;
486
  transition: opacity .15s .3s;
487
  }
488
 
489
- .fp-playlist-external { text-align:center; margin-bottom: 24px;}
490
- .fp-playlist-external a { width:140px; display:inline-block; vertical-align:top; margin:0 auto 12px auto; border: 0;box-shadow:none !important;text-align:center;font-size:13px;line-height:1.2;}
491
- .fp-playlist-external a span { display:block;width:120px;height:80px;margin:0 10px;-webkit-transition:all .3s;-moz-transition:all .3s;transition:all .3s;border:2px solid #fff;background:gray;background-size:auto 100px;background-position:center;}
492
- .fp-playlist-external a:hover span { border-color:#ccc }
493
- .fp-playlist-external a.is-active { -webkit-transition:all .3s;-moz-transition:all .3s;transition:all .3s; }
494
- #content .fp-playlist-external a { border: 0}
495
-
496
- .fp-playlist-vertical { text-align: left; overflow-x: hidden; background: #fff;max-width: 100%; }
497
- .fp-playlist-vertical-player{ float: left!important; max-width:calc( 100% - 156px)!important;}
498
- .fp-playlist-vertical-wrapper { margin-bottom: 24px; }
499
- .fp-playlist-vertical-wrapper:before,.fp-playlist-vertical-wrapper:after { content:"";display:table; }
500
- .fp-playlist-vertical-wrapper:after { clear: both; }
501
- .fp-playlist-vertical-wrapper .flowplayer { width:65%;float:left;margin-bottom:0;margin-top:2px; }
502
- .fp-playlist-vertical-wrapper .fp-playlist-vertical { width:34%;float:right;margin-bottom:0; }
503
- .fp-playlist-vertical-wrapper .fp-playlist-vertical a { display:block; }
504
- .css-videos .fp-playlist-vertical-wrapper video, .fp-playlist-vertical-wrapper video { min-height: 0 !important; height: 100% !important; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
505
 
506
  .add_media span.wp-media-buttons-icon {
507
  background: url("img/media-button.png") no-repeat scroll left top;
@@ -760,11 +814,11 @@ article .entry-content .fvfp_admin_error p { line-height: 18px; }
760
  }
761
 
762
 
763
- .flowplayer.chrome55fix video::-internal-media-controls-download-button {
764
  display:none;
765
  }
766
 
767
- .flowplayer.chrome55fix video::-webkit-media-controls-enclosure {
768
  overflow:hidden;
769
  }
770
 
@@ -772,15 +826,104 @@ article .entry-content .fvfp_admin_error p { line-height: 18px; }
772
  width: calc(100% + 48px);
773
  }
774
 
 
 
 
 
 
 
 
 
775
  .is-audio .fp-player {
776
  background-size: contain;
777
  background-position: top center;
778
  background-repeat: no-repeat;
779
  }
780
 
781
-
782
- .fvfp-notice { position: absolute; top: 10%; z-index: 20; text-align: center; width: 100%; color: #fff; text-shadow: 0 0 1px #000;}
783
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
784
  @media (max-width: 40em){
785
- .fv_fp_close a { width: 24px; height: 24px; background-size: 24px 24px; }
 
 
 
 
 
 
 
 
 
 
 
786
  }
23
  -moz-osx-font-smoothing: grayscale;
24
  }
25
  .flowplayer{position:relative;width:100%;counter-increment:flowplayer;background-size:contain;background-repeat:no-repeat;background-position:center center;display:inline-block;}
26
+ .flowplayer *{font-weight:inherit;font-family:inherit;font-style:inherit;text-decoration:inherit;font-size:100%;padding:0;border:0;margin:0;list-style-type:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}
27
  .flowplayer a:focus{outline:0}
28
  .flowplayer video{width:100%;-ms-transform: translateY(0) translateX(0);-webkit-transform: translateY(0) translateX(0);transform: translateY(0) translateX(0);}
29
  .flowplayer.is-ipad video{-webkit-transform:translateX(-2048px);}
152
  .no-volume.flowplayer .fp-timeline{margin-right:160px}
153
  .no-mute.flowplayer .fp-timeline{margin-right:195px}
154
  .no-mute.no-volume.flowplayer .fp-timeline{margin-right:120px;}
155
+ .has-menu.no-mute.no-volume.flowplayer .fp-timeline{margin-right:82px}
156
  .is-rtl.flowplayer .fp-timeline{margin:0 55px 0 225px;}
157
  .no-brand.is-rtl.flowplayer .fp-timeline{margin-left:160px;}
158
  .has-menu.no-brand.is-rtl.flowplayer .fp-timeline{margin-left:197px}
193
  .flowplayer.is-touch.is-mouseover .fp-progress:after{height:18px;width:18px;top:-4px;right:-10px;border:5px solid rgba(255,255,255,0.65);-webkit-box-shadow:1px 0 4px rgba(0,0,0,0.5);-moz-box-shadow:1px 0 4px rgba(0,0,0,0.5);box-shadow:1px 0 4px rgba(0,0,0,0.5)}
194
  .flowplayer.is-touch.is-mouseover .fp-timeline.is-dragging .fp-progress:after{border:10px solid #fff;-webkit-border-radius:20px;-moz-border-radius:20px;border-radius:20px;-webkit-transition:inherit;-moz-transition:inherit;transition:inherit;top:-5px;right:-10px}
195
  .flowplayer.is-touch.is-rtl.is-mouseover .fp-timeline.is-dragging .fp-progress:after{left:-15px;right:auto;border:10px solid #fff}
196
+ .flowplayer .fp-volume{position:absolute;height:6px;bottom:12px;right:10px;align-items:normal;display:block}
197
  .has-menu.flowplayer .fp-volume{right:37px}
198
  .is-rtl.flowplayer .fp-volume{right:auto;left:10px}
199
  .is-rtl.has-menu.flowplayer .fp-volume{left:37px}
222
  .no-volume.flowplayer .fp-remaining,.no-volume.flowplayer .fp-duration{right:115px}
223
  .no-mute.flowplayer .fp-remaining,.no-mute.flowplayer .fp-duration{right:160px}
224
  .no-mute.no-volume.flowplayer .fp-remaining,.no-mute.no-volume.flowplayer .fp-duration{right:75px;}
225
+ .has-menu.no-mute.no-volume.flowplayer .fp-remaining,.has-menu.no-mute.no-volume.flowplayer .fp-duration{right:35px}
226
  .is-rtl.flowplayer .fp-remaining,.is-rtl.flowplayer .fp-duration{right:auto;left:180px;}
227
  .no-brand.is-rtl.flowplayer .fp-remaining,.no-brand.is-rtl.flowplayer .fp-duration{left:115px;}
228
  .has-menu.no-brand.is-rtl.flowplayer .fp-remaining,.has-menu.no-brand.is-rtl.flowplayer .fp-duration{left:142px}
237
  .flowplayer.aside-time .fp-time .fp-elapsed::after{content:' / '}
238
  .flowplayer.is-splash,.flowplayer.is-poster{cursor:pointer;}
239
  .flowplayer.is-splash .fp-controls,.flowplayer.is-poster .fp-controls,.flowplayer.is-splash .fp-fullscreen,.flowplayer.is-poster .fp-fullscreen,.flowplayer.is-splash .fp-unload,.flowplayer.is-poster .fp-unload,.flowplayer.is-splash .fp-time,.flowplayer.is-poster .fp-time,.flowplayer.is-splash .fp-embed,.flowplayer.is-poster .fp-embed,.flowplayer.is-splash .fp-title,.flowplayer.is-poster .fp-title,.flowplayer.is-splash .fp-brand,.flowplayer.is-poster .fp-brand{display:none !important}
240
+ .flowplayer .fp-controls > * { margin:inherit }
241
  .flowplayer.is-poster .fp-engine{top:-9999em}
242
  .flowplayer.is-loading .fp-waiting{display:block}
243
  .flowplayer.is-loading .fp-controls,.flowplayer.is-loading .fp-time{display:none}
292
  .flowplayer .fp-context-menu li a{color:#00a7c8 !important;font-size:12.100000000000001px !important}
293
  .flowplayer .fp-context-menu li:hover:not(.copyright){background-color:#eee}
294
  .flowplayer .fp-context-menu li.copyright{margin:0;padding-left:110px;background-image:url("img/flowplayer.png");background-repeat:no-repeat;background-size:100px 20px;background-position:5px 5px;border-bottom:1px solid #bbb;}
295
+ /* Mailchimp integration */
296
+ .flowplayer .fv_player_popup p{margin:0 12px 6px;line-height:1.35}
297
+ .flowplayer .wpfp_custom_popup{width:100%;top:0;bottom:-4px}
298
+ .flowplayer .fv_player_popup {background-color:#222;position:relative;top:0;width:100%;height:100%;padding:2em 0 1%}
299
+ .flowplayer .fv_player_popup h1,.flowplayer .fv_player_popup h2,.flowplayer .fv_player_popup h3,.flowplayer .fv_player_popup h4,.flowplayer .fv_player_popup h5,.flowplayer .fv_player_popup h6{margin:0 0 6px !important}
300
+ .mailchimp-form input{width:31.33333333%;max-width:31.33333333%;margin:0 1%}
301
+ .mailchimp-form-1 input{width:48%;max-width:48%;margin:0 1%}
302
+ .mailchimp-form-2 input{width:31.33333333%;max-width:31.33333333%;margin:0 1%}
303
+ .mailchimp-form-3 input{width:23%;max-width:23%;margin:0 1%}
304
+
305
+ .mailchimp-form input[type="text"],.mailchimp-form input[type="email"]{padding:8px;line-height:1;border:0;float:left}
306
+ .mailchimp-form input[type="submit"]{background-color:#bf0000;float:right;padding:8px}
307
+ .mailchimp-form input[type="submit"]:hover{background-color:#af0000}
308
+ .flowplayer .mailchimp-form{background-color:#333;padding:30px 1.5%;position:absolute;bottom:0;margin:0 auto;width:100%}
309
+ .flowplayer .mailchimp-response{margin-top:6px;padding-top:6px;border-top:2px solid #00A7C8;display:inline-block}
310
+ .flowplayer .mailchimp-response.is-fv-error{border-color:#bf0000}
311
+ .flowplayer.is-fv-narrow .fv_player_popup{padding-top:1em;font-size:0.9em}
312
+ .flowplayer.is-fv-narrow .mailchimp-form{padding-top:20px}
313
+ .flowplayer.is-fv-narrow .fv_player_popup h1,.flowplayer.is-fv-narrow .fv_player_popup h2,.flowplayer.is-fv-narrow .fv_player_popup h3,.flowplayer.is-fv-narrow .fv_player_popup h4,.flowplayer.is-fv-narrow .fv_player_popup h5,.flowplayer.is-fv-narrow .fv_player_popup h6{font-size:1.2em}
314
+ .flowplayer.is-fullscreen .fv_player_popup{padding-top:10%}
315
+ .flowplayer.is-fullscreen .fv_player_popup p{margin:0 auto 6px}
316
+ .flowplayer.is-fullscreen .mailchimp-form{padding:30px 25%}
317
+ @media (max-width: 56.25em){
318
+ .flowplayer .fp-subtitle br{display:block}
319
+ .flowplayer .fp-subtitle .fp-subtitle-line:first-of-type,.flowplayer .fp-subtitle .fp-subtitle-line:last-of-type{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}
320
+ .flowplayer .fp-subtitle .fp-subtitle-line:last-of-type{padding-left:0.4em}
321
+ }
322
  @media (max-width: 40em){
323
  .flowplayer .fp-help p{font-size:9px;}
324
  .flowplayer .fp-logo{max-width: 130px;}
328
  @media (max-width: 30em) {
329
  .flowplayer .fp-subtitle{bottom:4px;line-height:12px !important}
330
  .flowplayer .fp-subtitle .fp-subtitle-line{font-size:12px !important;line-height:18px !important;-webkit-text-shadow:0 0 2px #666;-moz-text-shadow:0 0 2px #666;text-shadow:0 0 2px #666}
331
+ .flowplayer .fv_player_popup {width:99%;font-size:14px;top:50%;}
332
+ .flowplayer.is-fv-narrow .fv_player_popup{font-size:0.8em}
333
  }
334
  @media (max-width: 22.5em) {
335
  .flowplayer .fp-logo{max-width: 90px;}
336
+ .flowplayer.is-fv-narrow .mailchimp-form{padding:10px 1.5%}
337
+ .flowplayer.is-fv-narrow .fv_player_popup{font-size:0.7em}
338
  }
339
  @media (-webkit-min-device-pixel-ratio: 2),(min-resolution: 2dppx){.flowplayer .fp-context-menu li.copyright{background-image:url("img/flowplayer-2x.png")}
340
  }@-moz-keyframes pulse{0%{opacity:0}
398
  .fvp-share-bar .fvp-sharing,
399
  #content .fvp-share-bar .fvp-sharing {
400
  /*clear: both;
401
+ width: 102px;*/
402
  min-height: 24px;
403
  margin: 3px auto !important;
404
  padding: 0 !important;
428
  }
429
  /*#content .flowplayer a,
430
  .flowplayer a,
431
+ .flowplayer a:hover, viktor, please check */
432
  .fvp-share-bar .fvp-sharing a {
433
  color: #fff !important;
434
  text-shadow: none !important;
499
  font-weight: bold;
500
  text-shadow: 0 0 1px #000;
501
  cursor: pointer;
502
+ z-index: 12; /* make clickable */
503
  opacity: 1;
504
  filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
505
  }
512
  .is-mouseout.flowplayer .fp-prev, .is-mouseout.flowplayer .fp-next {
513
  opacity: 0;
514
  filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
515
+ /* same transition as other ui elements like fullscreen */
516
  -webkit-transition: opacity .15s .3s;
517
  -moz-transition: opacity .15s .3s;
518
  transition: opacity .15s .3s;
519
  }
520
 
521
+ .fp-playlist-external a,.entry-content .fp-playlist-external a {text-decoration:none;border-bottom:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;text-align:center;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}
522
+ .fp-playlist-external a:focus {outline:0}
523
+ .fp-playlist-external a,.fp-playlist-external a h4,.fp-playlist-vertical-wrapper .fp-playlist-external {-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}
524
+ .fp-playlist-external a div:empty,.fp-playlist-horizontal a.fvp-video-thumb-no-splash h4 {background-color:#aaa}
525
+
526
+ .fp-playlist-horizontal {text-align:center;display:block;margin-left:auto;margin-right:auto;margin-bottom: 24px;clear:both;font-size:0}
527
+ .fp-playlist-horizontal:before,.fp-playlist-horizontal:after {content:"";display:table}
528
+ .fp-playlist-horizontal:after {clear:both}
529
+ .fp-playlist-horizontal a,.entry-content .fp-playlist-horizontal a,.flowplayer.is-fv-narrow + .fp-playlist-horizontal a {width: 33.333333333%;display:inline-block;vertical-align:top;margin:0;padding:0;border:1px solid #fff;background-color:#fff;text-align:center;font-size:13px;line-height:1.2;position:relative}
530
+ .fp-playlist-horizontal a:hover,.entry-content .fp-playlist-horizontal a:hover {border:1px solid #fff}
531
+ .fp-playlist-horizontal a:nth-child(3n+1) {clear:both}
532
+ .fp-playlist-horizontal a div {display:block;position:relative;width:100%;height:auto;margin:0;-webkit-transition:all .3s;-moz-transition:all .3s;transition:all .3s;padding-top:56%;border:0;background-size:cover;background-position:center center;background-repeat:no-repeat}
533
+ .fp-playlist-horizontal a:nth-child(3n+1) div:before {display:none}
534
+ .fp-playlist-horizontal a h4 {opacity:0;position:absolute;top:0%;bottom:0;left:0;right:0;width:100%;margin:0 auto;padding:5px 10px;text-align:center;transition:all 0.3s ease-in-out 0.1s;font-size:13px;color:#fff;background-color:rgba(0, 0, 0, 0.75)}
535
+ .fp-playlist-horizontal a h4 span {position:absolute;top:50%;left:0;right:0;transform:translateY(-50%);border:0;padding:5px}
536
+ .fp-playlist-horizontal a:hover h4,.fp-playlist-horizontal a.fvp-video-thumb-no-splash h4 {opacity:1}
537
+ .fp-playlist-horizontal a.is-active {-webkit-transition:all .3s;-moz-transition:all .3s;transition:all .3s}
538
+ .is-touch + .fp-playlist-horizontal a h4 {opacity:1;background-color:transparent;text-shadow:0 0 12px #000;top:20%;bottom:20%;font-family:"myriad pro",Helvetica,Arial,sans-serif !important}
539
+ .is-touch + .fp-playlist-horizontal a h4 span {background-color:rgba(0,0,0,0.3)}
540
+ .fp-playlist-horizontal a.is-active div:after {position:absolute;content:"";top:0;bottom:0;left:0;right:0;width:100%;height:100%;background-color:#00a7c8;opacity:0.6}
541
+ .fp-playlist-horizontal.is-wide a,.entry-content .fp-playlist-horizontal.is-wide a {width: 20%}
542
+ .fp-playlist-horizontal.is-wide a:nth-child(3n+1) div:before {display: block}
543
+ .fp-playlist-horizontal.is-wide a:nth-child(5n+1) div:before {display: none}
544
+ .fp-playlist-horizontal.is-wide a:nth-child(3n+1) {clear:none}
545
+ .fp-playlist-horizontal.is-wide a:nth-child(5n+1) {clear:both}
546
+
547
+ .fp-playlist-vertical {text-align:left;overflow-x:hidden;max-width:100%;background-color:#fff}
548
+ .fp-playlist-vertical-player {float:left!important;max-width:calc( 100% - 156px)!important}
549
+ .fp-playlist-vertical-wrapper {margin-bottom:24px;overflow:hidden;display:block}
550
+ .fp-playlist-vertical-wrapper:before,.fp-playlist-vertical-wrapper:after {content:"";display:table}
551
+ .fp-playlist-vertical-wrapper:after {clear:both}
552
+ .fp-playlist-vertical a {margin:2px 0 8px}
553
+ .fp-playlist-vertical a div {display:block;position:relative;width:100%;height:auto;margin:0 0 1px;padding-top:55%;border:0;background-color:#fff;background-size:cover;background-position:center center;background-repeat:no-repeat}
554
+ .fp-playlist-vertical a h4 {margin:0;font-size:13px;font-weight:400;color:#000;}
555
+ .fp-playlist-vertical-wrapper .flowplayer {width:75%;float:left;margin-bottom:0}
556
+ .fp-playlist-vertical-wrapper .fp-playlist-vertical {width:25%;float:right;margin-bottom:0;padding:0 2px}
557
+ .fp-playlist-vertical-wrapper .fp-playlist-vertical a {display:block}
558
+ .css-videos .fp-playlist-vertical-wrapper video, .fp-playlist-vertical-wrapper video {min-height:0 !important;height:100% !important}
559
 
560
  .add_media span.wp-media-buttons-icon {
561
  background: url("img/media-button.png") no-repeat scroll left top;
814
  }
815
 
816
 
817
+ .flowplayer.chrome55fix video::-internal-media-controls-download-button, .flowplayer.chrome55fix-subtitles video::-internal-media-controls-download-button {
818
  display:none;
819
  }
820
 
821
+ .flowplayer.chrome55fix video::-webkit-media-controls-enclosure, .flowplayer.chrome55fix-subtitles video::-webkit-media-controls-enclosure {
822
  overflow:hidden;
823
  }
824
 
826
  width: calc(100% + 48px);
827
  }
828
 
829
+ .flowplayer.chrome55fix-subtitles video::-webkit-media-controls-panel {
830
+ width: calc(100% + 96px);
831
+ }
832
+
833
+ .flowplayer .fv-form-loading{
834
+ background:transparent url(loading.gif) 50% 50% no-repeat;
835
+ }
836
+
837
  .is-audio .fp-player {
838
  background-size: contain;
839
  background-position: top center;
840
  background-repeat: no-repeat;
841
  }
842
 
843
+ .fvfp-notice { position: absolute;top:10%;z-index:20;text-align:center;width:100%;color:#fff;text-shadow: 0 0 1px #000}
844
+
845
+ @media only screen and (max-width: 48em) {
846
+ .fp-playlist-horizontal {margin-left:-1px;margin-right:-1px}
847
+ .fp-playlist-horizontal a,.entry-content .fp-playlist-horizontal a, .flowplayer.is-fv-narrow + .fp-playlist-horizontal a {width: 50%}
848
+ .fp-playlist-horizontal a:nth-child(3n+1) {clear:none}
849
+ .fp-playlist-horizontal a:nth-child(2n+1) {clear:both}
850
+ }
851
+ @media only screen and (max-width: 40em) {
852
+ .fv_fp_close a {width:24px;height:24px;background-size:24px 24px}
853
+ .fp-playlist-horizontal a h4 {font-size:12px}
854
+ .fp-playlist-vertical-wrapper .flowplayer,.fp-playlist-vertical-wrapper .fp-playlist-vertical {width:100%;float:none;margin-bottom:0}
855
+ .fp-playlist-vertical a {width:49%;float:left;margin:0.75% 0.5%}
856
+ .fp-playlist-vertical a:nth-child(2n+1) {clear:both}
857
+ }
858
+
859
+
860
+
861
+
862
+ /* Audio player playlist */
863
+ .flowplayer.is-audio,.site-content .flowplayer.is-audio,.flowplayer.fixed-controls.is-audio {margin-top:40px}
864
+ .flowplayer.is-audio .fv-player-buttons li {margin:0}
865
+ .site-content .flowplayer.is-audio .fp-controls,.site-content .flowplayer.is-audio .fv-ab-loop,.site-content .fv-player-buttons a:active,.site-content .fv-player-buttons a { background-color:#888 !important }
866
+ .is-audio .fp-playlist-external { background-color:#eee }
867
+ .flowplayer.is-audio .fp-controls { height:40px;top:0;bottom:0 }
868
+ .flowplayer.is-audio .fp-play { height:40px !important; width:40px;line-height:40px !important }
869
+ .flowplayer.fvp-play-button.is-audio .fp-timeline { margin-left:82px }
870
+ .flowplayer.fvp-play-button.is-audio .fp-elapsed { left:35px }
871
+ .flowplayer.fixed-controls.is-audio .fp-time em { bottom:13px }
872
+ .flowplayer.is-audio .fp-waiting em {margin:0.8em 0.3em 0}
873
+ .flowplayer.is-audio .fp-timeline { top:15px }
874
+ .flowplayer.is-audio .fp-time { font-size:14px;text-shadow:none }
875
+ .flowplayer.is-audio .fp-volume { bottom:17px }
876
+ .flowplayer.is-audio .fp-mute { width:40px;height:40px }
877
+ .flowplayer.is-splash.is-audio .fp-controls,.flowplayer.is-poster.is-audio .fp-controls { display:block !important }
878
+ .is-audio + .fp-playlist-external { counter-reset: 'fv-playlist-counter';background-color:#f0f0f0;border-radius:0 0 10px 10px;border-top:1px solid #fff }
879
+ .flowplayer.is-audio .fp-waiting { margin:0 auto; }
880
+ .flowplayer.is-audio .fp-speed.fp-hilite { opacity:0;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=0); }
881
+ .is-audio + .fp-playlist-horizontal {margin-left:0;margin-right:0}
882
+ .is-audio + .fp-playlist-horizontal a div,.entry-content .is-audio + .fp-playlist-horizontal a div,.flowplayer.is-audio .fp-player + a { display:none;bottom:0;background-image:none !important }
883
+ .is-audio + .fp-playlist-external.fp-playlist-horizontal a,.entry-content .is-audio + .fp-playlist-external.fp-playlist-horizontal a,.flowplayer.is-fv-narrow.is-audio + .fp-playlist-external.fp-playlist-horizontal a { counter-increment:fv-playlist-counter;display:block;width:100%;display:block;text-align:left;line-height:1.15;margin:0;padding:6px 12px;border:0;color:#666;clear:both;min-height:26px }
884
+ .is-audio + .fp-playlist-external a:nth-child(odd),.entry-content .is-audio + .fp-playlist-external a:nth-child(odd) {background-color: #f8f8f8;}
885
+ .is-audio + .fp-playlist-external a h4,.entry-content .is-audio + .fp-playlist-external a h4 { display: block;opacity:1;position:relative;text-align:left;font-size:13px;padding:0;clear:none;left:auto;width:auto;background-color:transparent;color:inherit }
886
+ .is-audio + .fp-playlist-external a h4 span,.entry-content .is-audio + .fp-playlist-external a h4 span { position:relative;top:auto;padding:0;transform:none }
887
+ .is-audio + .fp-playlist-external a h4:before,.entry-content .is-audio + .fp-playlist-external a h4:before { content: counter(fv-playlist-counter, decimal-leading-zero) ". ";float:left;min-width:26px;color:#adadad;font-weight:400 }
888
+ .flowplayer.is-loading.is-audio .fp-controls, .flowplayer.is-loading.is-audio .fp-time { display:block }
889
+ .flowplayer.is-loading.is-audio .fp-waiting { position:relative;top:-3px;z-index:99 }
890
+ .flowplayer.fixed-controls.is-audio { margin-bottom:0;height:40px }
891
+ .flowplayer.is-audio .fv-ab-loop,.flowplayer.fixed-controls.is-audio .fv-ab-loop {bottom:-28px;padding-left:82px}
892
+
893
+ .flowplayer.is-audio .fp-fullscreen,.flowplayer.is-audio .fp-ratio,.flowplayer.is-audio.is-splash .fp-timeline-tooltip {display:none}
894
+ .flowplayer.is-audio .fp-controls {display:block !important}
895
+ .flowplayer.is-audio.is-error {border:0;margin-bottom:50px}
896
+ .flowplayer.is-audio.is-error h2,.entry-content .flowplayer.is-audio.is-error h2 {margin:0}
897
+ .flowplayer.is-audio .fp-message {padding-top:40px}
898
+ .flowplayer.is-audio .fp-time em {width:44px}
899
+ .flowplayer.is-audio .fp-message p {font-size:75%}
900
+
901
+ .flowplayer.is-audio .fp-duration, .flowplayer.is-audio .fp-elapsed, .flowplayer.is-audio a.fp-play, .flowplayer.is-audio a.fp-mute {color:#eee !important}
902
+ .flowplayer.is-audio .fp-volumelevel, .flowplayer.is-audio .fp-progress {background-color:#bb0000 !important}
903
+ .flowplayer.is-audio .fp-volumeslider, .flowplayer.is-audio .fp-buffer {background-color:#eeeeee !important}
904
+
905
+ .fp-playlist-external.is-audio a.is-active,.fp-playlist-external.is-audio a.is-active h4,.fp-playlist-external.is-audio a.is-active h4:before {color:#bb0000}
906
+
907
+ .is-audio .fp-player {background-size:contain;background-position:top center;background-repeat:no-repeat}
908
+
909
+
910
+ @media only screen and (max-width: 48em) {
911
+ .fp-playlist-horizontal {margin-left:-1px;margin-right:-1px}
912
+ .fp-playlist-horizontal a,.entry-content .fp-playlist-horizontal a, .flowplayer.is-fv-narrow + .fp-playlist-horizontal a {width: 50%}
913
+ .fp-playlist-horizontal a:nth-child(3n+1) {clear:none}
914
+ .fp-playlist-horizontal a:nth-child(2n+1) {clear:both}
915
+ }
916
  @media (max-width: 40em){
917
+ .fv_fp_close a {width:24px;height:24px;background-size:24px 24px}
918
+ .fp-playlist-horizontal a h4 {font-size:12px}
919
+ .fp-playlist-vertical-wrapper .flowplayer,.fp-playlist-vertical-wrapper .fp-playlist-vertical {width:100%;float:none;margin-bottom:0}
920
+ .fp-playlist-vertical a {width:49%;float:left;margin:0.75% 0.5%}
921
+ .fp-playlist-vertical a:nth-child(2n+1) {clear:both}
922
+ }
923
+ @media only screen and (max-width: 30em) {
924
+ .flowplayer.is-audio .fp-time em {font-size:12px}
925
+ .fp-playlist-horizontal a h4 {font-size:11px}
926
+ }
927
+ @media only screen and (max-width: 20em) {
928
+ .fp-playlist-horizontal a h4 {font-size:10px}
929
  }
css/lightbox.css CHANGED
@@ -163,3 +163,29 @@
163
  background-size: 100%;
164
  }
165
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
163
  background-size: 100%;
164
  }
165
  }
166
+
167
+ /* No chrome option */
168
+ .no-chrome #fv_player_pro_boxWrapper,
169
+ .no-chrome #fv_player_pro_boxMiddleLeft,
170
+ .no-chrome #fv_player_pro_boxMiddleRight,
171
+ .no-chrome #fv_player_pro_boxTopLeft,
172
+ .no-chrome #fv_player_pro_boxTopCenter,
173
+ .no-chrome #fv_player_pro_boxTopRight,
174
+ .no-chrome #fv_player_pro_boxBottomLeft,
175
+ .no-chrome #fv_player_pro_boxBottomRight,
176
+ .no-chrome #fv_player_pro_boxBottomCenter {
177
+ background: transparent;
178
+ }
179
+ .no-chrome #fv_player_pro_boxContent {
180
+ background: #fff;
181
+ }
182
+ .no-chrome .flowplayer.lightbox-starter,
183
+ .no-chrome .flowplayer.lightboxed {
184
+ background-color: transparent;
185
+ }
186
+ .no-chrome #fv_player_pro_boxClose,
187
+ .no-chrome #fv_player_pro_boxBottomLeft,
188
+ .no-chrome #fv_player_pro_boxBottomCenter,
189
+ .no-chrome #fv_player_pro_boxBottomRight {
190
+ display: none;
191
+ }
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.1.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,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.1.5';
30
  $fv_wp_flowplayer_core_ver = '6.0.5';
31
 
32
  include( dirname( __FILE__ ) . '/includes/extra-functions.php' );
@@ -53,6 +53,11 @@ include_once(dirname( __FILE__ ) . '/models/users-ultra-pro.php');
53
 
54
  include_once(dirname( __FILE__ ) . '/models/widget.php');
55
 
 
 
 
 
 
56
  $fv_fp = new flowplayer_frontend();
57
 
58
  if( is_admin() ) {
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.2.10
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.2.10';
30
  $fv_wp_flowplayer_core_ver = '6.0.5';
31
 
32
  include( dirname( __FILE__ ) . '/includes/extra-functions.php' );
53
 
54
  include_once(dirname( __FILE__ ) . '/models/widget.php');
55
 
56
+ include_once(dirname( __FILE__ ) . '/models/conversion.php');
57
+ include_once(dirname( __FILE__ ) . '/models/email-subscription.php');
58
+
59
+
60
+
61
  $fv_fp = new flowplayer_frontend();
62
 
63
  if( is_admin() ) {
flowplayer/fv-flowplayer.min.js CHANGED
@@ -4,7 +4,7 @@
4
 
5
  */
6
  !function(e){function t(e,t,n,r){for(var i,a=n.slice(),l=o(t,e),s=0,u=a.length;u>s&&(handler=a[s],"object"==typeof handler&&"function"==typeof handler.handleEvent?handler.handleEvent(l):handler.call(e,l),!l.stoppedImmediatePropagation);s++);return i=!l.stoppedPropagation,r&&i&&e.parentNode?e.parentNode.dispatchEvent(l):!l.defaultPrevented}function n(e,t){return{configurable:!0,get:e,set:t}}function r(e,t,r){var o=y(t||e,r);g(e,"textContent",n(function(){return o.get.call(this)},function(e){o.set.call(this,e)}))}function o(e,t){return e.currentTarget=t,e.eventPhase=e.target===e.currentTarget?2:3,e}function i(e,t){for(var n=e.length;n--&&e[n]!==t;);return n}function a(){if("BR"===this.tagName)return"\n";for(var e=this.firstChild,t=[];e;)8!==e.nodeType&&7!==e.nodeType&&t.push(e.textContent),e=e.nextSibling;return t.join("")}function l(e){!f&&k.test(document.readyState)&&(f=!f,document.detachEvent(d,l),e=document.createEvent("Event"),e.initEvent(p,!0,!0),document.dispatchEvent(e))}function s(e){for(var t;t=this.lastChild;)this.removeChild(t);null!=e&&this.appendChild(document.createTextNode(e))}function u(t,n){return n||(n=e.event),n.target||(n.target=n.srcElement||n.fromElement||document),n.timeStamp||(n.timeStamp=(new Date).getTime()),n}if(!document.createEvent){var c=!0,f=!1,d="onreadystatechange",p="DOMContentLoaded",m="__IE8__"+Math.random(),v=e.Object,g=v.defineProperty||function(e,t,n){e[t]=n.value},h=v.defineProperties||function(t,n){for(var r in n)if(b.call(n,r))try{g(t,r,n[r])}catch(o){e.console&&console.log(r+" failed on object:",t,o.message)}},y=v.getOwnPropertyDescriptor,b=v.prototype.hasOwnProperty,w=e.Element.prototype,x=e.Text.prototype,E=/^[a-z]+$/,k=/loaded|complete/,T={},S=document.createElement("div");r(e.HTMLCommentElement.prototype,w,"nodeValue"),r(e.HTMLScriptElement.prototype,null,"text"),r(x,null,"nodeValue"),r(e.HTMLTitleElement.prototype,null,"text"),g(e.HTMLStyleElement.prototype,"textContent",function(e){return n(function(){return e.get.call(this.styleSheet)},function(t){e.set.call(this.styleSheet,t)})}(y(e.CSSStyleSheet.prototype,"cssText"))),h(w,{textContent:{get:a,set:s},firstElementChild:{get:function(){for(var e=this.childNodes||[],t=0,n=e.length;n>t;t++)if(1==e[t].nodeType)return e[t]}},lastElementChild:{get:function(){for(var e=this.childNodes||[],t=e.length;t--;)if(1==e[t].nodeType)return e[t]}},previousElementSibling:{get:function(){for(var e=this.previousSibling;e&&1!=e.nodeType;)e=e.previousSibling;return e}},nextElementSibling:{get:function(){for(var e=this.nextSibling;e&&1!=e.nodeType;)e=e.nextSibling;return e}},childElementCount:{get:function(){for(var e=0,t=this.childNodes||[],n=t.length;n--;e+=1==t[n].nodeType);return e}},addEventListener:{value:function(e,n,r){var o,a=this,l="on"+e,s=a[m]||g(a,m,{value:{}})[m],c=s[l]||(s[l]={}),f=c.h||(c.h=[]);if(!b.call(c,"w")){if(c.w=function(e){return e[m]||t(a,u(a,e),f,!1)},!b.call(T,l))if(E.test(e))try{o=document.createEventObject(),o[m]=!0,9!=a.nodeType&&null==a.parentNode&&S.appendChild(a),a.fireEvent(l,o),T[l]=!0}catch(o){for(T[l]=!1;S.hasChildNodes();)S.removeChild(S.firstChild)}else T[l]=!1;(c.n=T[l])&&a.attachEvent(l,c.w)}i(f,n)<0&&f[r?"unshift":"push"](n)}},dispatchEvent:{value:function(e){var n,r=this,o="on"+e.type,i=r[m],a=i&&i[o],l=!!a;return e.target||(e.target=r),l?a.n?r.fireEvent(o,e):t(r,e,a.h,!0):(n=r.parentNode)?n.dispatchEvent(e):!0,!e.defaultPrevented}},removeEventListener:{value:function(e,t,n){var r=this,o="on"+e,a=r[m],l=a&&a[o],s=l&&l.h,u=s?i(s,t):-1;u>-1&&s.splice(u,1)}}}),h(x,{addEventListener:{value:w.addEventListener},dispatchEvent:{value:w.dispatchEvent},removeEventListener:{value:w.removeEventListener}}),h(e.XMLHttpRequest.prototype,{addEventListener:{value:function(e,t,n){var r=this,o="on"+e,a=r[m]||g(r,m,{value:{}})[m],l=a[o]||(a[o]={}),s=l.h||(l.h=[]);i(s,t)<0&&(r[o]||(r[o]=function(){var t=document.createEvent("Event");t.initEvent(e,!0,!0),r.dispatchEvent(t)}),s[n?"unshift":"push"](t))}},dispatchEvent:{value:function(e){var n=this,r="on"+e.type,o=n[m],i=o&&o[r],a=!!i;return a&&(i.n?n.fireEvent(r,e):t(n,e,i.h,!0))}},removeEventListener:{value:w.removeEventListener}}),h(e.Event.prototype,{bubbles:{value:!0,writable:!0},cancelable:{value:!0,writable:!0},preventDefault:{value:function(){this.cancelable&&(this.defaultPrevented=!0,this.returnValue=!1)}},stopPropagation:{value:function(){this.stoppedPropagation=!0,this.cancelBubble=!0}},stopImmediatePropagation:{value:function(){this.stoppedImmediatePropagation=!0,this.stopPropagation()}},initEvent:{value:function(e,t,n){this.type=e,this.bubbles=!!t,this.cancelable=!!n,this.bubbles||this.stopPropagation()}}}),h(e.HTMLDocument.prototype,{textContent:{get:function(){return 11===this.nodeType?a.call(this):null},set:function(e){11===this.nodeType&&s.call(this,e)}},addEventListener:{value:function(t,n,r){var o=this;w.addEventListener.call(o,t,n,r),c&&t===p&&!k.test(o.readyState)&&(c=!1,o.attachEvent(d,l),e==top&&function i(e){try{o.documentElement.doScroll("left"),l()}catch(t){setTimeout(i,50)}}())}},dispatchEvent:{value:w.dispatchEvent},removeEventListener:{value:w.removeEventListener},createEvent:{value:function(e){var t;if("Event"!==e)throw new Error("unsupported "+e);return t=document.createEventObject(),t.timeStamp=(new Date).getTime(),t}}}),h(e.Window.prototype,{getComputedStyle:{value:function(){function e(e){this._=e}function t(){}var n=/^(?:[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|))(?!px)[a-z%]+$/,r=/^(top|right|bottom|left)$/,o=/\-([a-z])/g,i=function(e,t){return t.toUpperCase()};return e.prototype.getPropertyValue=function(e){var t,a,l,s=this._,u=s.style,c=s.currentStyle,f=s.runtimeStyle;return e=("float"===e?"style-float":e).replace(o,i),t=c?c[e]:u[e],n.test(t)&&!r.test(e)&&(a=u.left,l=f&&f.left,l&&(f.left=c.left),u.left="fontSize"===e?"1em":t,t=u.pixelLeft+"px",u.left=a,l&&(f.left=l)),null==t?t:t+""||"auto"},t.prototype.getPropertyValue=function(){return null},function(n,r){return r?new t(n):new e(n)}}()},addEventListener:{value:function(n,r,o){var a,l=e,s="on"+n;l[s]||(l[s]=function(e){return t(l,u(l,e),a,!1)}),a=l[s][m]||(l[s][m]=[]),i(a,r)<0&&a[o?"unshift":"push"](r)}},dispatchEvent:{value:function(t){var n=e["on"+t.type];return n?n.call(e,t)!==!1&&!t.defaultPrevented:!0}},removeEventListener:{value:function(t,n,r){var o="on"+t,a=(e[o]||v)[m],l=a?i(a,n):-1;l>-1&&a.splice(l,1)}}})}}(this),!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.flowplayer=e()}}(function(){var e;return function t(e,n,r){function o(a,l){if(!n[a]){if(!e[a]){var s="function"==typeof require&&require;if(!l&&s)return s(a,!0);if(i)return i(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return o(n?n:t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e,t,n){"use strict";var r=t.exports={},o=e("class-list"),i=window.jQuery,a=e("punycode"),l=e("computed-style");r.noop=function(){},r.identity=function(e){return e},r.removeNode=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},r.find=function(e,t){return i?i(e,t).toArray():(t=t||document,Array.prototype.map.call(t.querySelectorAll(e),function(e){return e}))},r.text=function(e,t){e["innerText"in e?"innerText":"textContent"]=t},r.findDirect=function(e,t){return r.find(e,t).filter(function(e){return e.parentNode===t})},r.hasClass=function(e,t){return o(e).contains(t)},r.isSameDomain=function(e){var t=window.location,n=r.createElement("a",{href:e});return t.hostname===n.hostname&&t.protocol===n.protocol&&t.port===n.port},r.css=function(e,t,n){return"object"==typeof t?Object.keys(t).forEach(function(n){r.css(e,n,t[n])}):"undefined"!=typeof n?""===n?e?e.style.removeProperty(t):void 0:e?e.style.setProperty(t,n):void 0:e?l(e,t):void 0},r.createElement=function(e,t,n){try{var o=document.createElement(e);for(var a in t)t.hasOwnProperty(a)&&("css"===a?r.css(o,t[a]):r.attr(o,a,t[a]));return o.innerHTML=n||"",o}catch(l){if(!i)throw l;return i("<"+e+">"+n+"</"+e+">").attr(t)[0]}},r.toggleClass=function(e,t,n){if(e){var r=o(e);"undefined"==typeof n?r.toggle(t):n?r.add(t):n||r.remove(t)}},r.addClass=function(e,t){return r.toggleClass(e,t,!0)},r.removeClass=function(e,t){return r.toggleClass(e,t,!1)},r.append=function(e,t){return e.appendChild(t),e},r.appendTo=function(e,t){return r.append(t,e),e},r.prepend=function(e,t){e.insertBefore(t,e.firstChild)},r.insertAfter=function(e,t,n){t==r.lastChild(e)&&e.appendChild(n);var o=Array.prototype.indexOf.call(e.children,t);e.insertBefore(n,e.children[o+1])},r.html=function(e,t){e=e.length?e:[e],e.forEach(function(e){e.innerHTML=t})},r.attr=function(e,t,n){if("class"===t&&(t="className"),r.hasOwnOrPrototypeProperty(e,t))try{e[t]=n}catch(o){if(!i)throw o;i(e).attr(t,n)}else n===!1?e.removeAttribute(t):e.setAttribute(t,n);return e},r.prop=function(e,t,n){return"undefined"==typeof n?e&&e[t]:void(e[t]=n)},r.offset=function(e){var t=e.getBoundingClientRect();return e.offsetWidth/e.offsetHeight>e.clientWidth/e.clientHeight&&(t={left:100*t.left,right:100*t.right,top:100*t.top,bottom:100*t.bottom,width:100*t.width,height:100*t.height}),t},r.width=function(e,t){if(t)return e.style.width=(""+t).replace(/px$/,"")+"px";var n=r.offset(e).width;return"undefined"==typeof n?e.offsetWidth:n},r.height=function(e,t){if(t)return e.style.height=(""+t).replace(/px$/,"")+"px";var n=r.offset(e).height;return"undefined"==typeof n?e.offsetHeight:n},r.lastChild=function(e){return e.children[e.children.length-1]},r.hasParent=function(e,t){for(var n=e.parentElement;n;){if(r.matches(n,t))return!0;n=n.parentElement}return!1},r.createAbsoluteUrl=function(e){return r.createElement("a",{href:e}).href},r.xhrGet=function(e,t,n){var r=new XMLHttpRequest;r.onreadystatechange=function(){return 4===this.readyState?this.status>=400?n():void t(this.responseText):void 0},r.open("get",e,!0),r.send()},r.pick=function(e,t){var n={};return t.forEach(function(t){e.hasOwnProperty(t)&&(n[t]=e[t])}),n},r.hostname=function(e){return a.toUnicode(e||window.location.hostname)},r.browser={webkit:"WebkitAppearance"in document.documentElement.style},r.getPrototype=function(e){return Object.getPrototypeOf?Object.getPrototypeOf(e):e.__proto__},r.hasOwnOrPrototypeProperty=function(e,t){for(var n=e;n;){if(Object.prototype.hasOwnProperty.call(n,t))return!0;n=r.getPrototype(n)}return!1},r.matches=function(e,t){var n=Element.prototype,r=n.matches||n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector||function(e){for(var t=this,n=(t.document||t.ownerDocument).querySelectorAll(e),r=0;n[r]&&n[r]!==t;)r++;return n[r]?!0:!1};return r.call(e,t)},function(e){function t(e){return e.replace(/-[a-z]/g,function(e){return e[1].toUpperCase()})}"undefined"!=typeof e.setAttribute&&(e.setProperty=function(e,n){return this.setAttribute(t(e),String(n))},e.getPropertyValue=function(e){return this.getAttribute(t(e))||null},e.removeProperty=function(e){var n=this.getPropertyValue(e);return this.removeAttribute(t(e)),n})}(window.CSSStyleDeclaration.prototype)},{"class-list":21,"computed-style":23,punycode:29}],2:[function(e,t,n){"use strict";var r=e("../common");t.exports=function(e,t,n,o){n=n||"opaque";var i="obj"+(""+Math.random()).slice(2,15),a='<object class="fp-engine" id="'+i+'" name="'+i+'" ',l=navigator.userAgent.indexOf("MSIE")>-1;a+=l?'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">':' data="'+e+'" type="application/x-shockwave-flash">';var s={width:"100%",height:"100%",allowscriptaccess:"always",wmode:n,quality:"high",flashvars:"",movie:e+(l?"?"+i:""),name:i};"transparent"!==n&&(s.bgcolor=o||"#333333"),Object.keys(t).forEach(function(e){s.flashvars+=e+"="+t[e]+"&"}),Object.keys(s).forEach(function(e){a+='<param name="'+e+'" value="'+s[e]+'"/>'}),a+="</object>";var u=r.createElement("div",{},a);return r.find("object",u)},window.attachEvent&&window.attachEvent("onbeforeunload",function(){window.__flash_savedUnloadHandler=window.__flash_unloadHandler=function(){}})},{"../common":1}],3:[function(e,t,n){"use strict";function r(e){return/^https?:/.test(e)}var o,i=e("../flowplayer"),a=e("../common"),l=e("./embed"),s=e("extend-object"),u=e("bean");o=function(e,t){function n(e){function t(e){return("0"+parseInt(e).toString(16)).slice(-2)}return(e=e.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))?"#"+t(e[1])+t(e[2])+t(e[3]):void 0}function c(e){if(7===e.length)return e;var t=e.split("").slice(1);return"#"+t.map(function(e){return e+e}).join("")}function f(e){return/application\/x-mpegurl/i.test(e.type)}var d,p,m,v=e.conf,g=(e.video,window,{engineName:o.engineName,pick:function(t){var n=s({},function(){if(i.support.flashVideo){for(var n,r,o=0;o<t.length;o++)if(r=t[o],/mp4|flv|flash/i.test(r.type)&&(n=r),e.conf.swfHls&&/mpegurl/i.test(r.type)&&(n=r),n&&!/mp4/i.test(n.type))return n;return n}}());if(n)return!n.src||r(n.src)||e.conf.rtmp||n.rtmp||(n.src=a.createAbsoluteUrl(n.src)),n},load:function(o){function h(e){return e.replace(/&amp;/g,"%26").replace(/&/g,"%26").replace(/=/g,"%3D").replace(/%2A/,'%252A').replace(/%2F/,'%252F')}d=o;var y=a.findDirect("video",t)[0]||a.find(".fp-player > video",t)[0],b=o.src,w=r(b),x=function(){a.removeNode(y)},E=function(e){return e.some(function(e){return!!y.canPlayType(e.type)})};i.support.video&&a.prop(y,"autoplay")&&E(o.sources)?u.one(y,"timeupdate",x):x();var k=o.rtmp||v.rtmp;if(w||k||(b=a.createAbsoluteUrl(b)),m&&f(o)&&m.data!==v.swfHls&&g.unload(),m){["live","preload","loop"].forEach(function(e){o.hasOwnProperty(e)&&m.__set(e,o[e])}),Object.keys(o.flashls||{}).forEach(function(e){m.__set("hls_"+e,o.flashls[e])});var T=!1;if(!w&&k)m.__set("rtmp",k.url||k);else{var S=m.__get("rtmp");T=!!S,m.__set("rtmp",null)}m.__play(b,T||o.rtmp&&o.rtmp!==v.rtmp)}else{p="fpCallback"+(""+Math.random()).slice(3,15),b=h(b);var N={hostname:v.embedded?a.hostname(v.hostname):a.hostname(location.hostname),url:b,callback:p};t.getAttribute("data-origin")&&(N.origin=t.getAttribute("data-origin")),["proxy","key","autoplay","preload","subscribe","live","loop","debug","splash","poster","rtmpt"].forEach(function(e){v.hasOwnProperty(e)&&(N[e]=v[e]),o.hasOwnProperty(e)&&(N[e]=o[e]),(v.rtmp||{}).hasOwnProperty(e)&&(N[e]=(v.rtmp||{})[e]),(o.rtmp||{}).hasOwnProperty(e)&&(N[e]=(o.rtmp||{})[e])}),v.rtmp&&(N.rtmp=v.rtmp.url||v.rtmp),o.rtmp&&(N.rtmp=o.rtmp.url||o.rtmp),Object.keys(o.flashls||{}).forEach(function(e){var t=o.flashls[e];N["hls_"+e]=t}),void 0!==v.bufferTime&&(N.bufferTime=v.bufferTime),w&&delete N.rtmp,N.rtmp&&(N.rtmp=h(N.rtmp));var C,j=v.bgcolor||a.css(t,"background-color")||"";0===j.indexOf("rgb")?C=n(j):0===j.indexOf("#")&&(C=c(j)),N.initialVolume=e.volumeLevel;var O=f(o)?v.swfHls:v.swf;m=l(O,N,v.wmode,C)[0];var P=a.find(".fp-player",t)[0];a.prepend(P,m),setTimeout(function(){try{if(!m.PercentLoaded())return e.trigger("error",[e,{code:7,url:v.swf}])}catch(t){}},5e3),setTimeout(function(){"undefined"==typeof m.PercentLoaded&&e.trigger("flashdisabled",[e])},1e3),e.off("resume.flashhack").on("resume.flashhack",function(){var t=setTimeout(function(){e.playing&&e.trigger("flashdisabled",[e])},1e3);e.one("progress",function(){clearTimeout(t)})}),m.pollInterval=setInterval(function(){if(m){var t=m.__status?m.__status():null;t&&(e.playing&&t.time&&t.time!==e.video.time&&e.trigger("progress",[e,t.time]),o.buffer=t.buffer/o.bytes*o.duration,e.trigger("buffer",[e,o.buffer]),!o.buffered&&t.time>0&&(o.buffered=!0,e.trigger("buffered",[e])))}},250),window[p]=function(n,r){var o=d;v.debug&&(0===n.indexOf("debug")&&r&&r.length?console.log.apply(console,["-- "+n].concat(r)):console.log("--",n,r));var i={type:n};switch(n){case"ready":r=s(o,r);break;case"click":i.flash=!0;break;case"keydown":i.which=r;break;case"seek":o.time=r;break;case"status":e.trigger("progress",[e,r.time]),r.buffer<o.bytes&&!o.buffered?(o.buffer=r.buffer/o.bytes*o.duration,e.trigger("buffer",o.buffer)):o.buffered||(o.buffered=!0,e.trigger("buffered"))}"click"===n||"keydown"===n?(i.target=t,u.fire(t,n,[i])):"buffered"!=n&&"unload"!==n?setTimeout(function(){e.trigger(i,[e,r])},1):"unload"===n&&e.trigger(i,[e,r])}}},speed:a.noop,unload:function(){m&&m.__unload&&m.__unload();try{p&&window[p]&&delete window[p]}catch(n){}a.find("object",t).forEach(a.removeNode),m=0,e.off(".flashengine"),clearInterval(m.pollInterval)}});return["pause","resume","seek","volume"].forEach(function(t){g[t]=function(n){try{e.ready&&(void 0===n?m["__"+t]():m["__"+t](n))}catch(r){if("undefined"==typeof m["__"+t])return e.trigger("flashdisabled",[e]);throw r}}}),g},o.engineName="flash",o.canPlay=function(e,t){return i.support.flashVideo&&/video\/(mp4|flash|flv)/i.test(e)||i.support.flashVideo&&t.swfHls&&/mpegurl/i.test(e)},i.engines.push(o)},{"../common":1,"../flowplayer":18,"./embed":2,bean:20,"extend-object":25}],4:[function(e,t,n){"use strict";function r(e,t){return t=t||100,Math.round(e*t)/t}function o(e){return/mpegurl/i.test(e)?"application/x-mpegurl":e}function i(e){return/^(video|application)/i.test(e)||(e=o(e)),!!m.canPlayType(e).replace("no","")}function a(e,t){var n=e.filter(function(e){return e.type===t});return n.length?n[0]:null}var l,s,u=e("../flowplayer"),c=e("bean"),f=e("class-list"),d=e("extend-object"),p=e("../common"),m=document.createElement("video"),v={ended:"finish",pause:"pause",play:"resume",progress:"buffer",timeupdate:"progress",volumechange:"volume",ratechange:"speed",seeked:"seek",loadeddata:"ready",error:"error",dataunavailable:"error",webkitendfullscreen:!/iPhone OS 10/.test(navigator.userAgent) && !u.support.inlineVideo&&"unload"},g=function(e,t,n,r){if("undefined"==typeof t&&(t=!0),"undefined"==typeof n&&(n="none"),"undefined"==typeof r&&(r=!0),r&&l)return l.type=o(e.type),l.src=e.src,p.find("track",l).forEach(p.removeNode),l.removeAttribute("crossorigin"),l;var i=document.createElement("video");return i.src=e.src,i.type=o(e.type),i.className="fp-engine",i.autoplay=t?"autoplay":!1,i.preload=n,i.setAttribute("x-webkit-airplay","allow"),r&&(l=i),i};s=function(e,t){function n(n,o,a){var l=t.getAttribute("data-flowplayer-instance-id");if(n.listeners&&n.listeners.hasOwnProperty(l))return void(n.listeners[l]=a);(n.listeners||(n.listeners={}))[l]=a,c.on(o,"error",function(t){try{i(t.target.getAttribute("type"))&&e.trigger("error",[e,{code:4,video:d(a,{src:n.src,url:n.src})}])}catch(r){}}),e.on("shutdown",function(){c.off(o)});var s={};return Object.keys(v).forEach(function(o){var i=v[o];if(i){var u=function(s){if(a=n.listeners[l],s.target&&f(s.target).contains("fp-engine")&&(w.debug&&!/progress/.test(i)&&console.log(o,"->",i,s),(e.ready||/ready|error/.test(i))&&i&&p.find("video",t).length)){var u;if("unload"===i)return void e.unload();var c=function(){e.trigger(i,[e,u])};switch(i){case"ready":u=d(a,{duration:n.duration,width:n.videoWidth,height:n.videoHeight,url:n.currentSrc,src:n.currentSrc});try{u.seekable=!e.live&&/mpegurl/i.test(a?a.type||"":"")&&n.duration||n.seekable&&n.seekable.end(null)}catch(v){}if(m=m||setInterval(function(){try{u.buffer=n.buffered.end(null)}catch(t){}u.buffer&&(r(u.buffer,1e3)<r(u.duration,1e3)&&!u.buffered?e.trigger("buffer",s):u.buffered||(u.buffered=!0,e.trigger("buffer",s).trigger("buffered",s),clearInterval(m),m=0))},250),!e.live&&!u.duration&&!b.hlsDuration&&"loadeddata"===o){var g=function(){u.duration=n.duration;try{u.seekable=n.seekable&&n.seekable.end(null)}catch(e){}c(),n.removeEventListener("durationchange",g),f(t).remove("is-live")};n.addEventListener("durationchange",g);var h=function(){e.ready||n.duration||(u.duration=0,f(t).add("is-live"),c()),n.removeEventListener("timeupdate",h)};return void n.addEventListener("timeupdate",h)}break;case"progress":case"seek":e.video.duration;if(n.currentTime>0||e.live)u=Math.max(n.currentTime,0);else if("progress"==i)return;break;case"speed":u=r(n.playbackRate);break;case"volume":u=r(n.volume);break;case"error":try{u=(s.srcElement||s.originalTarget).error,u.video=d(a,{src:n.src,url:n.src})}catch(y){return}}c()}};t.addEventListener(o,u,!0),s[o]||(s[o]=[]),s[o].push(u)}}),s}var o,m,h,y=p.findDirect("video",t)[0]||p.find(".fp-player > video",t)[0],b=u.support,w=(p.find("track",y)[0],e.conf);return o={engineName:s.engineName,pick:function(e){var t=function(){if(b.video){if(w.videoTypePreference){var t=a(e,w.videoTypePreference);if(t)return t}for(var n=0;n<e.length;n++)if(i(e[n].type))return e[n]}}();if(t)return"string"==typeof t.src&&(t.src=p.createAbsoluteUrl(t.src)),t},load:function(r){var i=!1,a=p.find(".fp-player",t)[0],l=!1;w.splash&&!y?(y=g(r),p.prepend(a,y),i=!0):y?(f(y).add("fp-engine"),p.find("source,track",y).forEach(p.removeNode),e.conf.nativesubtitles||p.attr(y,"crossorigin",!1),l=y.src===r.src):(y=g(r,!!r.autoplay||!!w.autoplay,w.clip.preload||"metadata",!1),p.prepend(a,y),i=!0),b.inlineVideo||p.css(y,{position:"absolute",top:"-9999em"}),c.off(y,"timeupdate",p.noop),c.on(y,"timeupdate",p.noop),p.prop(y,"loop",!(!r.loop&&!w.loop)),"undefined"!=typeof h&&(y.volume=h),(e.video.src&&r.src!=e.video.src||r.index)&&p.attr(y,"autoplay","autoplay"),y.src=r.src,y.type=r.type,o._listeners=n(y,p.find("source",y).concat(y),r),("none"!=w.clip.preload&&"mpegurl"!=r.type||!b.zeropreload||!b.dataload)&&y.load(),(i||l)&&y.load(),y.paused&&(r.autoplay||w.autoplay)&&y.play()},pause:function(){y.pause()},resume:function(){y.play()},speed:function(e){y.playbackRate=e},seek:function(t){try{var n=e.paused;y.currentTime=t,n&&y.pause()}catch(r){}},volume:function(e){h=e,y&&(y.volume=e)},unload:function(){p.find("video.fp-engine",t).forEach(p.removeNode),b.cachedVideoTag||(l=null),m=clearInterval(m);var e=t.getAttribute("data-flowplayer-instance-id");delete y.listeners[e],y=0,o._listeners&&Object.keys(o._listeners).forEach(function(e){o._listeners[e].forEach(function(n){t.removeEventListener(e,n,!0)})})}}},s.canPlay=function(e){return u.support.video&&i(e)},s.engineName="html5",u.engines.push(s)},{"../common":1,"../flowplayer":18,bean:20,"class-list":21,"extend-object":25}],5:[function(e,t,n){"use strict";var r=e("../flowplayer"),o=e("./resolve").TYPE_RE,i=e("scriptjs"),a=e("bean");r(function(e,t){var n,r=e.conf.analytics,l=0,s=0;if(r){"undefined"==typeof _gat&&i("//google-analytics.com/ga.js");var u=function(){var e=_gat._getTracker(r); if( typeof e._setAllowLinker == 'undefined' ) return false; return e._setAllowLinker(!0),e},c=function(r,i,a){if(a=a||e.video,l&&"undefined"!=typeof _gat){var s=u(); if(!s) return; s._trackEvent("Video / Seconds played",e.engine.engineName+"/"+a.type,a.title||t.getAttribute("title")||a.src.split("/").slice(-1)[0].replace(o,""),Math.round(l/1e3)),l=0,n&&(clearTimeout(n),n=null)}};e.bind("load unload",c).bind("progress",function(){e.seeking||(l+=s?+new Date-s:0,s=+new Date),n||(n=setTimeout(function(){n=null;var e=u();e._trackEvent("Flowplayer heartbeat","Heartbeat","",0,!0)},6e5))}).bind("pause",function(){s=0}),e.bind("shutdown",function(){a.off(window,"unload",c)}),a.on(window,"unload",c)}})},{"../flowplayer":18,"./resolve":13,bean:20,scriptjs:28}],6:[function(e,t,n){"use strict";var r=e("../flowplayer"),o=e("class-list"),i=e("../common"),a=e("bean");r(function(e,t){function n(e){t.className=t.className.replace(l," "),e>=0&&o(t).add("cue"+e)}function r(t){var n=t&&!isNaN(t.time)?t.time:t;return 0>n&&(n=e.video.duration+n),.125*Math.round(n/.125)}var l=/ ?cue\d+ ?/,s=!1,u={},c=-.125,f=function(t){var r=e.cuepoints.indexOf(t);isNaN(t)||(t={time:t}),t.index=r,n(r),e.trigger("cuepoint",[e,t])};e.on("progress",function(e,t,n){if(!s)for(var o=r(n);o>c;)c+=.125,u[c]&&u[c].forEach(f)}).on("unload",n).on("beforeseek",function(e){setTimeout(function(){e.defaultPrevented||(s=!0)})}).on("seek",function(e,t,o){n(),c=r(o||0)-.125,s=!1,!o&&u[0]&&u[0].forEach(f)}).on("ready",function(t,n,r){c=-.125;var o=r.cuepoints||e.conf.cuepoints||[];e.setCuepoints(o)}).on("finish",function(){c=-.125}),e.conf.generate_cuepoints&&e.bind("load",function(){i.find(".fp-cuepoint",t).forEach(i.removeNode)}),e.setCuepoints=function(t){return e.cuepoints=[],u={},t.forEach(e.addCuepoint),e},e.addCuepoint=function(n){e.cuepoints||(e.cuepoints=[]);var o=r(n);if(u[o]||(u[o]=[]),u[o].push(n),e.cuepoints.push(n),e.conf.generate_cuepoints&&n.visible!==!1){var l=e.video.duration,s=i.find(".fp-timeline",t)[0];i.css(s,"overflow","visible");var c=n.time||n;0>c&&(c=l+c);var f=i.createElement("a",{className:"fp-cuepoint fp-cuepoint"+(e.cuepoints.length-1)});i.css(f,"left",c/l*100+"%"),s.appendChild(f),a.on(f,"mousedown",function(t){t.preventDefault(),t.stopPropagation(),e.seek(c)})}return e},e.removeCuepoint=function(t){var n=e.cuepoints.indexOf(t),o=r(t);if(-1!==n){e.cuepoints=e.cuepoints.slice(0,n).concat(e.cuepoints.slice(n+1));var i=u[o].indexOf(t);if(-1!==i)return u[o]=u[o].slice(0,i).concat(u[o].slice(i+1)),e}}})},{"../common":1,"../flowplayer":18,bean:20,"class-list":21}],7:[function(e,t,n){"use strict";var r=e("../flowplayer"),o=e("bean"),i=e("../common"),a=(e("is-object"),e("extend-object")),l=e("class-list");r(function(e,t){if(e.conf.embed!==!1){var n=(e.conf,i.find(".fp-ui",t)[0]),r=i.createElement("a",{"class":"fp-embed",title:"Copy to your site"}),l=i.createElement("div",{"class":"fp-embed-code"},"<label>Copy and paste this HTML code into your webpage to embed.</label><textarea></textarea>"),u=i.find("textarea",l)[0];n.appendChild(r),n.appendChild(l),e.embedCode=function(){var n=e.conf.embed||{},r=e.video;if(n.iframe){var o=(e.conf.embed.iframe,n.width||r.width||i.width(t)),l=n.height||r.height||i.height(t);return'<iframe src="'+e.conf.embed.iframe+'" allowfullscreen style="width:'+o+";height:"+l+';border:none;"></iframe>'}var s=["ratio","rtmp","live","bufferTime","origin","analytics","key","subscribe","swf","swfHls","embed","adaptiveRatio","logo"];n.playlist&&s.push("playlist");var u=i.pick(e.conf,s);u.logo&&(u.logo=i.createElement("img",{src:u.logo}).src),n.playlist&&e.conf.playlist.length||(u.clip=a({},e.conf.clip,i.pick(e.video,["sources"])));var c='var w=window,d=document,e;w._fpes||(w._fpes=[],w.addEventListener("load",function(){var s=d.createElement("script");s.src="//foliovision.com/flowplayer/6.0.5/embed.min.js",d.body.appendChild(s)})),e=[].slice.call(d.getElementsByTagName("script"),-1)[0].parentNode,w._fpes.push({e:e,l:"$library",c:$conf});\n'.replace("$conf",JSON.stringify(u)).replace("$library",n.library||"");return'<a href="$href">Watch video!\n<script>$script</script></a>'.replace("$href",e.conf.origin||window.location.href).replace("$script",c)},s(t,".fp-embed","is-embedding"),o.on(t,"click",".fp-embed-code textarea",function(){u.select()}),o.on(t,"click",".fp-embed",function(){u.textContent=e.embedCode().replace(/(\r\n|\n|\r)/gm,""),u.focus(),u.select()})}});var s=function(e,t,n){function r(){a.remove(n),o.off(document,".st")}var a=l(e);o.on(e,"click",t||"a",function(e){e.preventDefault(),a.toggle(n),a.contains(n)&&(o.on(document,"keydown.st",function(e){27==e.which&&r()}),o.on(document,"click.st",function(e){i.hasParent(e.target,"."+n)||r()}))})}},{"../common":1,"../flowplayer":18,bean:20,"class-list":21,"extend-object":25,"is-object":27}],8:[function(e,t,n){"use strict";t.exports=function(e,t){t||(t=document.createElement("div"));var n={},r={},o=function(e,o,i){var a=e.split(".")[0],l=function(s){i&&(t.removeEventListener(a,l),n[e].splice(n[e].indexOf(l),1));var u=[s].concat(r[s.timeStamp+s.type]||[]);o&&o.apply(void 0,u)};t.addEventListener(a,l),n[e]||(n[e]=[]),n[e].push(l)};e.on=e.bind=function(t,n){var r=t.split(" ");return r.forEach(function(e){o(e,n)}),e},e.one=function(t,n){var r=t.split(" ");return r.forEach(function(e){o(e,n,!0)}),e};var i=function(e,t){return 0===t.filter(function(t){return-1===e.indexOf(t)}).length};e.off=e.unbind=function(r){var o=r.split(" ");return o.forEach(function(e){var r=e.split(".").slice(1),o=e.split(".")[0];Object.keys(n).filter(function(e){var t=e.split(".").slice(1);return(!o||0===e.indexOf(o))&&i(t,r)}).forEach(function(e){var r=n[e],o=e.split(".")[0];r.forEach(function(e){t.removeEventListener(o,e),r.splice(r.indexOf(e),1)})})}),e},e.trigger=function(n,o,i){if(n){o=(o||[]).length?o||[]:[o];var a,l=document.createEvent("Event");return a=n.type||n,l.initEvent(a,!1,!0),Object.defineProperty&&(l.preventDefault=function(){Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}),r[l.timeStamp+l.type]=o,t.dispatchEvent(l),i?l:e}}},t.exports.EVENTS=["beforeseek","disable","error","finish","fullscreen","fullscreen-exit","load","mute","pause","progress","ready","resume","seek","speed","stop","unload","volume","boot","shutdown"]},{}],9:[function(e,t,n){"use strict";var r,o=e("../flowplayer"),i=e("bean"),a=e("class-list"),l=(e("extend-object"),e("../common")),s=(o.support.browser.mozilla?"moz":"webkit","fullscreen"),u="fullscreen-exit",c=o.support.fullscreen,f=("function"==typeof document.exitFullscreen,navigator.userAgent.toLowerCase()),d=/(safari)[ \/]([\w.]+)/.exec(f)&&!/(chrome)[ \/]([\w.]+)/.exec(f);i.on(document,"fullscreenchange.ffscr webkitfullscreenchange.ffscr mozfullscreenchange.ffscr MSFullscreenChange.ffscr",function(e){var t=document.webkitCurrentFullScreenElement||document.mozFullScreenElement||document.fullscreenElement||document.msFullscreenElement||e.target;if(r||t.parentNode&&t.parentNode.getAttribute("data-flowplayer-instance-id")){var n=r||o(t.parentNode);t&&!r?r=n.trigger(s,[t]):(r.trigger(u,[r]),r=null)}}),o(function(e,t){var n=l.createElement("div",{className:"fp-player"});if(Array.prototype.map.call(t.children,l.identity).forEach(function(e){l.matches(e,".fp-ratio,script")||n.appendChild(e)}),t.appendChild(n),e.conf.fullscreen){var o,i,f=window,p=a(t);e.isFullscreen=!1,e.fullscreen=function(t){return e.disabled?void 0:(void 0===t&&(t=!e.isFullscreen),t&&(o=f.scrollY,i=f.scrollX),c?t?["requestFullScreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullscreen"].forEach(function(e){return"function"==typeof n[e]?(n[e](Element.ALLOW_KEYBOARD_INPUT),!d||document.webkitCurrentFullScreenElement||document.mozFullScreenElement||n[e](),!1):void 0}):["exitFullscreen","webkitCancelFullScreen","mozCancelFullScreen","msExitFullscreen"].forEach(function(e){return"function"==typeof document[e]?(document[e](),!1):void 0}):e.trigger(t?s:u,[e]),e)};var m;e.on("mousedown.fs",function(){+new Date-m<150&&e.ready&&e.fullscreen(),m=+new Date}),e.on(s,function(n){p.add("is-fullscreen"),c||l.css(t,"position","fixed"),e.isFullscreen=!0}).on(u,function(n){var r;c||"html5"!==e.engine||(r=t.css("opacity")||"",l.css(t,"opacity",0)),c||l.css(t,"position",""),p.remove("is-fullscreen"),c||"html5"!==e.engine||setTimeout(function(){t.css("opacity",r)}),e.isFullscreen=!1,f.scrollTo(i,o)}).on("unload",function(){e.isFullscreen&&e.fullscreen()}),e.on("shutdown",function(){r=null})}})},{"../common":1,"../flowplayer":18,bean:20,"class-list":21,"extend-object":25}],10:[function(e,t,n){"use strict";var r,o,i=e("../flowplayer"),a=e("bean"),l="is-help",s=e("../common"),u=e("class-list");a.on(document,"keydown.fp",function(e){var t=r,n=e.ctrlKey||e.metaKey||e.altKey,i=e.which,a=t&&t.conf,s=o&&u(o);if(t&&a.keyboard&&!t.disabled){if(-1!=[63,187,191].indexOf(i))return s.toggle(l),!1;if(27==i&&s.contains(l))return s.toggle(l),!1;if(!n&&t.ready){if(e.preventDefault(),e.shiftKey)return void(39==i?t.speed(!0):37==i&&t.speed(!1));if(58>i&&i>47)return t.seekTo(i-48);switch(i){case 38:case 75:t.volume(t.volumeLevel+.15);break;case 40:case 74:t.volume(t.volumeLevel-.15);break;case 39:case 76:t.seeking=!0,t.seek(!0);break;case 37:case 72:t.seeking=!0,t.seek(!1);break;case 190:t.seekTo();break;case 32:t.toggle();break;case 70:a.fullscreen&&t.fullscreen();break;case 77:t.mute();break;case 81:t.unload()}}}}),i(function(e,t){if(e.conf.keyboard){a.on(t,"mouseenter mouseleave",function(n){r=e.disabled||"mouseover"!=n.type?0:e,r&&(o=t)});var n=i.support.video&&"flash"!==e.conf.engine&&document.createElement("video").playbackRate?"<p><em>shift</em> + <em>&#8592;</em><em>&#8594;</em>slower / faster</p>":"";if(t.appendChild(s.createElement("div",{
7
- className:"fp-help"},' <a class="fp-close"></a> <div class="fp-help-section fp-help-basics"> <p><em>space</em>play / pause</p> <p><em>q</em>unload | stop</p> <p><em>f</em>fullscreen</p>'+n+' </div> <div class="fp-help-section"> <p><em>&#8593;</em><em>&#8595;</em>volume</p> <p><em>m</em>mute</p> </div> <div class="fp-help-section"> <p><em>&#8592;</em><em>&#8594;</em>seek</p> <p><em>&nbsp;. </em>seek to previous </p><p><em>1</em><em>2</em>&hellip; <em>6</em> seek to 10%, 20% &hellip; 60% </p> </div> ')),e.conf.tooltip){var c=s.find(".fp-ui",t)[0];c.setAttribute("title","Hit ? for help"),a.one(t,"mouseout.tip",".fp-ui",function(){c.removeAttribute("title")})}a.on(t,"click",".fp-close",function(){u(t).toggle(l)}),e.bind("shutdown",function(){o==t&&(o=null)})}})},{"../common":1,"../flowplayer":18,bean:20,"class-list":21}],11:[function(e,t,n){"use strict";var r=e("../flowplayer"),o=/IEMobile/.test(window.navigator.userAgent),i=e("class-list"),a=e("../common"),l=e("bean"),s=e("./ui").format,u=window.navigator.userAgent;(r.support.touch||o)&&r(function(e,t){var n=/Android/.test(u)&&!/Firefox/.test(u)&&!/Opera/.test(u),c=/Silk/.test(u),f=n?parseFloat(/Android\ (\d\.\d)/.exec(u)[1],10):0,d=i(t);if(n&&!o){if(!/Chrome/.test(u)&&4>f){var p=e.load;e.load=function(t,n){var r=p.apply(e,arguments);return e.trigger("ready",[e,e.video]),r}}var m,v=0,g=function(e){m=setInterval(function(){e.video.time=++v,e.trigger("progress",[e,v])},1e3)};e.bind("ready pause unload",function(){m&&(clearInterval(m),m=null)}),e.bind("ready",function(){v=0}),e.bind("resume",function(t,n){return n.live?v?g(n):void e.one("progress",function(e,t,n){0===n&&g(t)}):void 0})}r.support.volume||(d.add("no-volume"),d.add("no-mute")),d.add("is-touch"),e.sliders&&e.sliders.timeline&&e.sliders.timeline.disableAnimation(),(!r.support.inlineVideo||e.conf.native_fullscreen)&&(e.conf.nativesubtitles=!0);var h=!1;l.on(t,"touchmove",function(){h=!0}),l.on(t,"touchend click",function(t){return h?void(h=!1):e.playing&&!d.contains("is-mouseover")?(d.add("is-mouseover"),d.remove("is-mouseout"),t.preventDefault(),void t.stopPropagation()):void(e.playing||e.splash||!d.contains("is-mouseout")||d.contains("is-mouseover")||setTimeout(function(){e.playing||e.splash||e.resume()},400))}),e.conf.native_fullscreen&&"function"==typeof document.createElement("video").webkitEnterFullScreen&&(e.fullscreen=function(){var e=a.find("video.fp-engine",t)[0];e.webkitEnterFullScreen(),l.one(e,"webkitendfullscreen",function(){a.prop(e,"controls",!0),a.prop(e,"controls",!1)})}),(n||c)&&e.bind("ready",function(){var n=a.find("video.fp-engine",t)[0];l.one(n,"canplay",function(){n.play()}),n.play(),e.bind("progress.dur",function(){var r=n.duration;1!==r&&(e.video.duration=r,a.find(".fp-duration",t)[0].innerHTML=s(r),e.unbind("progress.dur"))})})})},{"../common":1,"../flowplayer":18,"./ui":17,bean:20,"class-list":21}],12:[function(e,t,n){"use strict";var r=e("../flowplayer"),o=e("extend-object"),i=e("bean"),a=e("class-list"),l=e("../common"),s=e("./resolve"),u=new s,c=window.jQuery,f=/^#/;r(function(e,t){function n(){return l.find(v.query,r())}function r(){return f.test(v.query)?void 0:t}function d(){return l.find(v.query+"."+g,r())}function p(){var n=l.find(".fp-playlist",t)[0];if(!n){n=l.createElement("div",{className:"fp-playlist"});var r=l.find(".fp-next,.fp-prev",t);r.length?r[0].parentElement.insertBefore(n,r[0]):l.insertAfter(t,l.find("video",t)[0],n)}n.innerHTML="",e.conf.playlist[0].length&&(e.conf.playlist=e.conf.playlist.map(function(e){if("string"==typeof e){var t=e.split(s.TYPE_RE)[1];return{sources:[{type:"m3u8"===t.toLowerCase()?"application/x-mpegurl":"video/"+t,src:e}]}}return{sources:e.map(function(e){var t={};return Object.keys(e).forEach(function(n){t.type=/mpegurl/i.test(n)?"application/x-mpegurl":"video/"+n,t.src=e[n]}),t})}})),e.conf.playlist.forEach(function(e,t){var r=e.sources[0].src;n.appendChild(l.createElement("a",{href:r,"data-index":t}))})}function m(t){return"undefined"!=typeof t.index?t.index:"undefined"!=typeof e.video.index?e.video.index:e.conf.startIndex||0}var v=o({active:"is-active",advance:!0,query:".fp-playlist a"},e.conf),g=v.active,h=a(t);e.play=function(t){if(void 0===t)return e.resume();if("number"==typeof t&&!e.conf.playlist[t])return e;if("number"!=typeof t)return e.load.apply(null,arguments);var n=o({index:t},e.conf.playlist[t]);return t===e.video.index?e.load(n,function(){e.resume()}):(e.off("resume.fromfirst"),e.load(n,function(){e.video.index=t}),e)},e.next=function(t){t&&t.preventDefault();var n=e.video.index;return-1!=n&&(n=n===e.conf.playlist.length-1?0:n+1,e.play(n)),e},e.prev=function(t){t&&t.preventDefault();var n=e.video.index;return-1!=n&&(n=0===n?e.conf.playlist.length-1:n-1,e.play(n)),e},e.setPlaylist=function(t){return e.conf.playlist=t,delete e.video.index,p(),e},e.addPlaylistItem=function(t){return e.setPlaylist(e.conf.playlist.concat([t]))},e.removePlaylistItem=function(t){var n=e.conf.playlist;return e.setPlaylist(n.slice(0,t).concat(n.slice(t+1)))},i.on(t,"click",".fp-next",e.next),i.on(t,"click",".fp-prev",e.prev),v.advance&&e.off("finish.pl").on("finish.pl",function(e,t){if(t.video.loop)return t.seek(0,function(){t.resume()});var n=t.video.index>=0?t.video.index+1:void 0;n<t.conf.playlist.length||v.loop?(n=n===t.conf.playlist.length?0:n,h.remove("is-finished"),setTimeout(function(){t.play(n)})):t.conf.playlist.length>1&&t.one("resume.fromfirst",function(){return t.play(0),!1})});var y=!1;e.conf.playlist.length&&(y=!0,p(),e.conf.clip&&e.conf.clip.sources.length||(e.conf.clip=e.conf.playlist[e.conf.startIndex||0])),n().length&&!y&&(e.conf.playlist=[],delete e.conf.startIndex,n().forEach(function(t){var n=t.href;t.setAttribute("data-index",e.conf.playlist.length);var r=u.resolve(n,e.conf.clip.sources);c&&o(r,c(t).data()),e.conf.playlist.push(r)})),i.on(f.test(v.query)?document:t,"click",v.query,function(t){t.preventDefault();var n=t.currentTarget,r=Number(n.getAttribute("data-index"));-1!=r&&e.play(r)}),e.on("load",function(n,o,i){if(e.conf.playlist.length){var s=d()[0],u=s&&s.getAttribute("data-index"),c=i.index=m(i),f=l.find(v.query+'[data-index="'+c+'"]',r())[0],p=c==e.conf.playlist.length-1;s&&a(s).remove(g),f&&a(f).add(g),h.remove("video"+u),h.add("video"+c),l.toggleClass(t,"last-video",p),i.index=o.video.index=c,i.is_last=o.video.is_last=p}}).on("unload.pl",function(){e.conf.playlist.length&&(d().forEach(function(e){a(e).toggle(g)}),e.conf.playlist.forEach(function(e,t){h.remove("video"+t)}))}),e.conf.playlist.length&&(e.conf.loop=!1)})},{"../common":1,"../flowplayer":18,"./resolve":13,bean:20,"class-list":21,"extend-object":25}],13:[function(e,t,n){"use strict";function r(e){var t=e.attr("src"),n=e.attr("type")||"",r=t.split(i)[1];return n=n.toLowerCase(),a(e.data(),{src:t,suffix:r||n,type:n||r})}function o(e){return/mpegurl/i.test(e)?"application/x-mpegurl":"video/"+e}var i=/\.(\w{3,4})(\?.*)?$/i,a=e("extend-object");t.exports=function(){var e=this;e.sourcesFromVideoTag=function(e,t){var n=[];return t("source",e).each(function(){n.push(r(t(this)))}),!n.length&&e.length&&n.push(r(e)),n},e.resolve=function(e,t){return e?("string"==typeof e&&(e={src:e,sources:[]},e.sources=(t||[]).map(function(t){var n=t.src.split(i)[1];return{type:t.type,src:e.src.replace(i,"."+n+"$2")}})),e instanceof Array&&(e={sources:e.map(function(e){return e.type&&e.src?e:Object.keys(e).reduce(function(t,n){return a(t,{type:o(n),src:e[n]})},{})})}),e):{sources:t}}},t.exports.TYPE_RE=i},{"extend-object":25}],14:[function(e,t,n){"use strict";var r=e("class-list"),o=e("bean"),i=e("../common"),a=function(e,t){var n;return function(){n||(e.apply(this,arguments),n=1,setTimeout(function(){n=0},t))}},l=function(e,t){var n,l,s,u,c,f,d,p,m=(/iPad/.test(navigator.userAgent)&&!/CriOS/.test(navigator.userAgent),i.lastChild(e)),v=r(e),g=r(m),h=!1,y=function(){l=i.offset(e),s=i.width(e),u=i.height(e),f=c?u:s,p=E(d)},b=function(t){n||t==k.value||d&&!(d>t)||(o.fire(e,"slide",[t]),k.value=t)},w=function(e){var n=e.pageX||e.clientX;!n&&e.originalEvent&&e.originalEvent.touches&&e.originalEvent.touches.length&&(n=e.originalEvent.touches[0].pageX);var r=c?e.pageY-l.top:n-l.left;r=Math.max(0,Math.min(p||f,r));var o=r/f;return c&&(o=1-o),t&&(o=1-o),x(o,0,!0)},x=function(e,t){void 0===t&&(t=0),e>1&&(e=1);var n=Math.round(1e3*e)/10+"%";return(!d||d>=e)&&(g.remove("animated"),h?g.remove("animated"):(g.add("animated"),i.css(m,"transition-duration",(t||0)+"ms")),i.css(m,"width",n)),e},E=function(e){return Math.max(0,Math.min(f,c?(1-e)*u:e*s))},k={max:function(e){d=e},disable:function(e){n=e},slide:function(e,t,n){y(),n&&b(e),x(e,t)},disableAnimation:function(t,n){h=t!==!1,i.toggleClass(e,"no-animation",!!n)}};return y(),o.on(e,"mousedown.sld touchstart",function(e){if(e.preventDefault(),!n){var t=a(b,100);y(),k.dragging=!0,v.add("is-dragging"),b(w(e)),o.on(document,"mousemove.sld touchmove.sld",function(e){e.preventDefault(),t(w(e))}),o.one(document,"mouseup touchend",function(){k.dragging=!1,v.remove("is-dragging"),o.off(document,"mousemove.sld touchmove.sld")})}}),k};t.exports=l},{"../common":1,bean:20,"class-list":21}],15:[function(e,t,n){"use strict";var r=e("../flowplayer"),o=e("../common"),i=e("bean"),a=e("class-list");r.defaults.subtitleParser=function(e){function t(e){var t=e.split(":");return 2==t.length&&t.unshift(0),60*t[0]*60+60*t[1]+parseFloat(t[2].replace(",","."))}for(var n,r,o,i=/^(([0-9]{2}:){1,2}[0-9]{2}[,.][0-9]{3}) --\> (([0-9]{2}:){1,2}[0-9]{2}[,.][0-9]{3})(.*)/,a=[],l=0,s=e.split("\n"),u=s.length,c={};u>l;l++)if(r=i.exec(s[l])){for(n=s[l-1],o="<span class='fp-subtitle-line'>"+s[++l]+"</span><br/>";"string"==typeof s[++l]&&s[l].trim()&&l<s.length;)o+="<span class='fp-subtitle-line'>"+s[l]+"</span><br/>";c={title:n,startTime:t(r[1]),endTime:t(r[3]),text:o},a.push(c)}return a},r(function(e,t){var n,l,s,u,c=a(t),f=function(){u=o.createElement("a",{className:"fp-menu"});var n=o.createElement("ul",{className:"fp-dropdown fp-dropup"});return n.appendChild(o.createElement("li",{"data-subtitle-index":-1},"No subtitles")),(e.video.subtitles||[]).forEach(function(e,t){var r=e.srclang||"en",i=e.label||"Default ("+r+")",a=o.createElement("li",{"data-subtitle-index":t},i);n.appendChild(a)}),u.appendChild(n),o.find(".fp-controls",t)[0].appendChild(u),u};i.on(t,"click",".fp-menu",function(e){a(u).toggle("dropdown-open")}),i.on(t,"click",".fp-menu li[data-subtitle-index]",function(t){var n=t.target.getAttribute("data-subtitle-index");return"-1"===n?e.disableSubtitles():void e.loadSubtitles(n)});var d=function(){var e=o.find(".fp-player",t)[0];s=o.find(".fp-subtitle",t)[0],s=s||o.appendTo(o.createElement("div",{"class":"fp-subtitle"}),e),Array.prototype.forEach.call(s.children,o.removeNode),n=a(s),o.find(".fp-menu",t).forEach(o.removeNode),f()};e.on("ready",function(n,i,a){var l=i.conf;if(r.support.subtitles&&l.nativesubtitles&&"html5"==i.engine.engineName){var s=function(e){var n=o.find("video",t)[0].textTracks;n.length&&(n[0].mode=e)};if(!a.subtitles||!a.subtitles.length)return;var u=o.find("video.fp-engine",t)[0];return a.subtitles.some(function(e){return!o.isSameDomain(e.src)})&&o.attr(u,"crossorigin","anonymous"),u.textTracks.addEventListener("addtrack",function(){s("disabled"),s("showing")}),void a.subtitles.forEach(function(e){u.appendChild(o.createElement("track",{kind:"subtitles",srclang:e.srclang||"en",label:e.label||"en",src:e.src,"default":e["default"]}))})}if(i.subtitles=[],d(),c.remove("has-menu"),e.disableSubtitles(),a.subtitles&&a.subtitles.length){c.add("has-menu");var f=a.subtitles.filter(function(e){return e["default"]})[0];f&&i.loadSubtitles(a.subtitles.indexOf(f))}}),e.bind("cuepoint",function(e,t,r){r.subtitle?(l=r.index,o.html(s,r.subtitle.text),n.add("fp-active")):r.subtitleEnd&&(n.remove("fp-active"),l=r.index)}),e.bind("seek",function(t,r,o){l&&e.cuepoints[l]&&e.cuepoints[l].time>o&&(n.remove("fp-active"),l=null),(e.cuepoints||[]).forEach(function(t){var n=t.subtitle;n&&l!=t.index?o>=t.time&&(!n.endTime||o<=n.endTime)&&e.trigger("cuepoint",[e,t]):t.subtitleEnd&&o>=t.time&&t.index==l+1&&e.trigger("cuepoint",[e,t])})});var p=function(e){o.toggleClass(o.find("li.active",t)[0],"active"),o.toggleClass(o.find('li[data-subtitle-index="'+e+'"]',t)[0],"active")};e.disableSubtitles=function(){return e.subtitles=[],(e.cuepoints||[]).forEach(function(t){(t.subtitle||t.subtitleEnd)&&e.removeCuepoint(t)}),s&&Array.prototype.forEach.call(s.children,o.removeNode),p(-1),e},e.loadSubtitles=function(t){e.disableSubtitles();var n=e.video.subtitles[t],r=n.src;return r?(p(t),o.xhrGet(r,function(t){var n=e.conf.subtitleParser(t);n.forEach(function(t){var n={time:t.startTime,subtitle:t,visible:!1};e.subtitles.push(t),e.addCuepoint(n),e.addCuepoint({time:t.endTime,subtitleEnd:t.title,visible:!1}),0!==t.startTime||e.video.time||e.trigger("cuepoint",[e,n])})},function(){return e.trigger("error",{code:8,url:r}),!1}),e):void 0}})},{"../common":1,"../flowplayer":18,bean:20,"class-list":21}],16:[function(e,t,n){"use strict";var r=e("../flowplayer"),o=e("extend-object");!function(){var e=function(e){var t=/Version\/(\d\.\d)/.exec(e);return t&&t.length>1?parseFloat(t[1],10):0},t=function(){var e=document.createElement("video");return e.loop=!0,e.autoplay=!0,e.preload=!0,e},n={},i=navigator.userAgent.toLowerCase(),a=/(chrome)[ \/]([\w.]+)/.exec(i)||/(safari)[ \/]([\w.]+)/.exec(i)||/(webkit)[ \/]([\w.]+)/.exec(i)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(i)||/(msie) ([\w.]+)/.exec(i)||i.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(i)||[];a[1]&&(n[a[1]]=!0,n.version=a[2]||"0");var l=t(),s=navigator.userAgent,u=n.msie||/Trident\/7/.test(s),c=/iPad|MeeGo/.test(s)&&!/CriOS/.test(s),f=/iPad/.test(s)&&/CriOS/.test(s),d=/iP(hone|od)/i.test(s)&&!/iPad/.test(s)&&!/IEMobile/i.test(s),p=/Android/.test(s)&&!/Firefox/.test(s),m=/Android/.test(s)&&/Firefox/.test(s),v=/Silk/.test(s),g=/IEMobile/.test(s),h=g?parseFloat(/Windows\ Phone\ (\d+\.\d+)/.exec(s)[1],10):0,y=g?parseFloat(/IEMobile\/(\d+\.\d+)/.exec(s)[1],10):0,b=(c?e(s):0,p?parseFloat(/Android\ (\d\.\d)/.exec(s)[1],10):0),w=o(r.support,{browser:n,subtitles:!!l.addTextTrack,fullscreen:"function"==typeof document.webkitCancelFullScreen&&!/Mac OS X 10_5.+Version\/5\.0\.\d Safari/.test(s)||document.mozFullScreenEnabled||"function"==typeof document.exitFullscreen||"function"==typeof document.msExitFullscreen,inlineBlock:!(u&&n.version<8),touch:"ontouchstart"in window,dataload:!c&&!d&&!g,zeropreload:!u&&!p,volume:!(c||p||d||v||f),cachedVideoTag:!(c||d||f||g),firstframe:!(d||c||p||v||f||g||m),inlineVideo:!d&&(!g||h>=8.1&&y>=11)&&(!p||b>=3),hlsDuration:!p&&(!n.safari||c||d||f),seekable:!c&&!f});try{var x=navigator.plugins["Shockwave Flash"],E=u?new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version"):x.description;u||x[0].enabledPlugin?(E=E.split(/\D+/),E.length&&!E[0]&&(E=E.slice(1)),w.flashVideo=E[0]>9||9==E[0]&&E[3]>=115):w.flashVideo=!1}catch(k){}try{w.video=!!l.canPlayType,w.video&&l.canPlayType("video/mp4")}catch(T){w.video=!1}w.animation=function(){for(var e=["","Webkit","Moz","O","ms","Khtml"],t=document.createElement("p"),n=0;n<e.length;n++)if("undefined"!=typeof t.style[e[n]+"AnimationName"])return!0}()}()},{"../flowplayer":18,"extend-object":25}],17:[function(e,t,n){"use strict";function r(e){return e=parseInt(e,10),e>=10?e:"0"+e}function o(e){e=e||0;var t=Math.floor(e/3600),n=Math.floor(e/60);return e-=60*n,t>=1?(n-=60*t,t+":"+r(n)+":"+r(e)):r(n)+":"+r(e)}var i=e("../flowplayer"),a=e("../common"),l=e("class-list"),s=e("bean"),u=e("./slider");i(function(e,t){function n(e){return a.find(".fp-"+e,t)[0]}function r(e){a.css(w,"padding-top",100*e+"%"),p.inlineBlock||a.height(a.find("object",t)[0],a.height(t))}function c(e){e?(m.add("is-mouseover"),m.remove("is-mouseout")):(m.add("is-mouseout"),m.remove("is-mouseover"))}var f,d=e.conf,p=i.support,m=l(t);a.find(".fp-ratio,.fp-ui",t).forEach(a.removeNode),m.add("flowplayer"),t.appendChild(a.createElement("div",{className:"fp-ratio"}));var v=a.createElement("div",{className:"fp-ui"},' <div class="waiting"><em></em><em></em><em></em></div> <a class="fullscreen"></a> <a class="unload"></a> <p class="speed"></p> <div class="controls"> <a class="play"></a> <div class="timeline"> <div class="buffer"></div> <div class="progress"></div> </div> <div class="timeline-tooltip fp-tooltip"></div> <div class="volume"> <a class="mute"></a> <div class="volumeslider"> <div class="volumelevel"></div> </div> </div> </div> <div class="time"> <em class="elapsed">00:00</em> <em class="remaining"></em> <em class="duration">00:00</em> </div> <div class="message"><h2></h2><p></p></div>'.replace(/class="/g,'class="fp-'));t.appendChild(v);var g=(n("progress"),n("buffer")),h=n("elapsed"),y=n("remaining"),b=n("waiting"),w=n("ratio"),x=n("speed"),E=l(x),k=n("duration"),T=n("controls"),S=n("timeline-tooltip"),N=a.css(w,"padding-top"),C=n("timeline"),j=u(C,e.rtl),O=(n("volume"),n("fullscreen")),P=n("volumeslider"),A=u(P,e.rtl),_=m.contains("fixed-controls")||m.contains("no-toggle");j.disableAnimation(m.contains("is-touch")),e.sliders=e.sliders||{},e.sliders.timeline=j,e.sliders.volume=A,p.animation||a.html(b,"<p>loading &hellip;</p>"),d.ratio&&r(d.ratio);try{d.fullscreen||a.removeNode(O)}catch(D){a.removeNode(O)}e.on("ready",function(e,n,i){var l=n.video.duration;j.disable(n.disabled||!l),d.adaptiveRatio&&!isNaN(i.height/i.width)&&r(i.height/i.width,!0),a.html([k,y],o(l)),a.toggleClass(t,"is-long",l>=3600),A.slide(n.volumeLevel),"flash"===n.engine.engineName?j.disableAnimation(!0,!0):j.disableAnimation(!1),a.find(".fp-title",v).forEach(a.removeNode),i.title&&a.prepend(v,a.createElement("div",{className:"fp-title"},i.title))}).on("unload",function(){N||d.splash||a.css(w,"paddingTop",""),j.slide(0)}).on("buffer",function(){var t=e.video,n=t.buffer/t.duration;!t.seekable&&p.seekable&&j.max(n),1>n?a.css(g,"width",100*n+"%"):a.css(g,"width","100%")}).on("speed",function(e,t,n){a.text(x,n+"x"),E.add("fp-hilite"),setTimeout(function(){E.remove("fp-hilite")},1e3)}).on("buffered",function(){a.css(g,"width","100%"),j.max(1)}).on("progress",function(){var t=e.video.time,n=e.video.duration;j.dragging||j.slide(t/n,e.seeking?0:250),a.html(h,o(t)),a.html(y,"-"+o(n-t))}).on("finish resume seek",function(e){a.toggleClass(t,"is-finished","finish"==e.type)}).on("stop",function(){a.html(h,o(0)),j.slide(0,100)}).on("finish",function(){a.html(h,o(e.video.duration)),j.slide(1,100),m.remove("is-seeking")}).on("beforeseek",function(){}).on("volume",function(){A.slide(e.volumeLevel)}).on("disable",function(){var n=e.disabled;j.disable(n),A.disable(n),a.toggleClass(t,"is-disabled",e.disabled)}).on("mute",function(e,n,r){a.toggleClass(t,"is-muted",r)}).on("error",function(e,n,r){if(a.removeClass(t,"is-loading"),a.removeClass(t,"is-seeking"),a.addClass(t,"is-error"),r){r.message=d.errors[r.code],n.error=!0;var o=a.find(".fp-message",t)[0],i=r.video||n.video;a.find("h2",o)[0].innerHTML=(n.engine&&n.engine.engineName||"html5")+": "+r.message,a.find("p",o)[0].innerHTML=r.url||i.url||i.src||d.errorUrls[r.code],n.off("mouseenter click"),m.remove("is-mouseover")}}),s.on(t,"mouseenter mouseleave",function(n){if(!_){var r,o="mouseover"==n.type;if(c(o),o){var i=function(){c(!0),r=new Date};e.on("pause.x volume.x",i),s.on(t,"mousemove.x",i),f=setInterval(function(){new Date-r>d.mouseoutTimeout&&(c(!1),r=new Date)},100)}else s.off(t,"mousemove.x"),e.off("pause.x volume.x"),clearInterval(f)}}),s.on(t,"mouseleave",function(){(j.dragging||A.dragging)&&(m.add("is-mouseover"),m.remove("is-mouseout"))}),s.on(t,"click.player",function(t){if(!e.disabled){var n=l(t.target);return n.contains("fp-ui")||n.contains("fp-engine")||t.flash?(t.preventDefault&&t.preventDefault(),e.toggle()):void 0}}),s.on(t,"mousemove",".fp-timeline",function(t){var n=t.pageX||t.clientX,r=n-a.offset(C).left,i=r/a.width(C),l=i*e.video.duration;0>i||(a.html(S,o(l)),a.css(S,"left",n-a.offset(T).left-a.width(S)/2+"px"))}),s.on(t,"contextmenu",function(e){var n=a.offset(a.find(".fp-player",t)[0]),r=window,o=e.clientX-(n.left+r.scrollX),i=e.clientY-(n.top+r.scrollY);if(!m.contains("is-flash-disabled")){var l=a.find(".fp-context-menu",t)[0];l&&(e.preventDefault(),a.css(l,{left:o+"px",top:i+"px",display:"block"}),s.on(t,"click",".fp-context-menu",function(e){e.stopPropagation()}),s.on(document,"click.outsidemenu",function(e){a.css(l,"display","none"),s.off(document,"click.outsidemenu")}))}}),e.on("flashdisabled",function(){m.add("is-flash-disabled"),e.one("ready progress",function(){m.remove("is-flash-disabled"),a.find(".fp-flash-disabled",t).forEach(a.removeNode)}),t.appendChild(a.createElement("div",{className:"fp-flash-disabled"},"Adobe Flash is disabled for this page, click player area to enable"))}),d.poster&&a.css(t,"background-image","url("+d.poster+")");var M=a.css(t,"background-color"),L="none"!=a.css(t,"background-image")||M&&"rgba(0, 0, 0, 0)"!=M&&"transparent"!=M;L&&!d.splash&&(d.poster||(d.poster=!0),e.on("ready stop",function(){m.add("is-poster"),e.poster=!0,e.one("progress",function(){m.remove("is-poster"),e.poster=!1})})),"string"==typeof d.splash&&a.css(t,"background-image","url('"+d.splash+"')"),!L&&e.forcedSplash&&a.css(t,"background-color","#555"),s.on(t,"click",".fp-toggle, .fp-play",function(){e.disabled||e.toggle()}),s.on(t,"click",".fp-mute",function(){e.mute()}),s.on(t,"click",".fp-fullscreen",function(){e.fullscreen()}),s.on(t,"click",".fp-unload",function(){e.unload()}),s.on(C,"slide",function(t){e.seeking=!0,e.seek(t*e.video.duration)}),s.on(P,"slide",function(t){e.volume(t)});var I=n("time");s.on(t,"click",".fp-time",function(){l(I).toggle("is-inverted")}),c(_),e.on("shutdown",function(){s.off(C),s.off(P)})}),t.exports.format=o},{"../common":1,"../flowplayer":18,"./slider":14,bean:20,"class-list":21}],18:[function(e,t,n){"use strict";function r(e,t,n){t&&t.embed&&(t.embed=o({},y.defaults.embed,t.embed));var r,d,m=e,v=a(m),g=o({},y.defaults,y.conf,t),h={},x=new w;v.add("is-loading");try{h=p?window.localStorage:h}catch(E){}var k=m.currentStyle&&"rtl"===m.currentStyle.direction||window.getComputedStyle&&null!==window.getComputedStyle(m,null)&&"rtl"===window.getComputedStyle(m,null).getPropertyValue("direction");k&&v.add("is-rtl");var T={conf:g,currentSpeed:1,volumeLevel:g.muted?0:"undefined"==typeof g.volume?1*h.volume:g.volume,video:{},disabled:!1,finished:!1,loading:!1,muted:"true"==h.muted||g.muted,paused:!1,playing:!1,ready:!1,splash:!1,rtl:k,load:function(e,t){if(!T.error&&!T.loading){T.video={},T.finished=!1,e=e||g.clip,e=o({},x.resolve(e,g.clip.sources)),(T.playing||T.engine)&&(e.autoplay=!0);var n=S(e);if(!n)return T.trigger("error",[T,{code:y.support.flashVideo?5:10}]);if(!n.engineName)throw new Error("engineName property of factory should be exposed");if(T.engine&&n.engineName===T.engine.engineName||(T.ready=!1,T.engine&&(T.engine.unload(),T.conf.autoplay=!0),d=T.engine=n(T,m),T.one("ready",function(){d.volume(T.volumeLevel)})),o(e,d.pick(e.sources.filter(function(e){return e.engine?e.engine===d.engineName:!0}))),e.src){var r=T.trigger("load",[T,e,d],!0);r.defaultPrevented?T.loading=!1:(d.load(e),i(e)&&(t=e),t&&T.one("ready",t))}return T}},pause:function(e){return!T.ready||T.seeking||T.loading||(d.pause(),T.one("pause",e)),T},resume:function(){return T.ready&&T.paused&&(d.resume(),T.finished&&(T.trigger("resume",[T]),T.finished=!1)),T},toggle:function(){return T.ready?T.paused?T.resume():T.pause():T.load()},seek:function(e,t){if(T.ready&&!T.live){if("boolean"==typeof e){var n=.1*T.video.duration;e=T.video.time+(e?n:-n)}e=r=Math.min(Math.max(e,0),T.video.duration-.1).toFixed(1);var o=T.trigger("beforeseek",[T,e],!0);o.defaultPrevented?(T.seeking=!1,s.toggleClass(m,"is-seeking",T.seeking)):(d.seek(e),i(t)&&T.one("seek",t))}return T},seekTo:function(e,t){var n=void 0===e?r:.1*T.video.duration*e;return T.seek(n,t)},mute:function(e,t){return void 0===e&&(e=!T.muted),t||(h.muted=T.muted=e,h.volume=isNaN(h.volume)?g.volume:h.volume),T.volume(e?0:h.volume,!0),T.trigger("mute",[T,e]),T},volume:function(e,t){return T.ready&&(e=Math.min(Math.max(e,0),1),t||(h.volume=e),d.volume(e)),T},speed:function(e,t){return T.ready&&("boolean"==typeof e&&(e=g.speeds[g.speeds.indexOf(T.currentSpeed)+(e?1:-1)]||T.currentSpeed),d.speed(e),t&&m.one("speed",t)),T},stop:function(){return T.ready&&(T.pause(),T.seek(0,function(){T.trigger("stop",[T])})),T},unload:function(){return v.contains("is-embedding")||(g.splash?(T.trigger("unload",[T]),d&&(d.unload(),T.engine=d=0)):T.stop()),T},shutdown:function(){T.unload(),T.trigger("shutdown",[T]),l.off(m),delete c[m.getAttribute("data-flowplayer-instance-id")],m.removeAttribute("data-flowplayer-instance-id")},disable:function(e){return void 0===e&&(e=!T.disabled),e!=T.disabled&&(T.disabled=e,T.trigger("disable",e)),T}};T.conf=o(T.conf,g),u(T);var S=function(e){var t,n=y.engines;if(g.engine){var r=n.filter(function(e){return e.engineName===g.engine})[0];if(r&&e.sources.some(function(e){return e.engine&&e.engine!==r.engineName?!1:r.canPlay(e.type,T.conf)}))return r}return g.enginePreference&&(n=y.engines.filter(function(e){return g.enginePreference.indexOf(e.engineName)>-1}).sort(function(e,t){return g.enginePreference.indexOf(e.engineName)-g.enginePreference.indexOf(t.engineName)})),e.sources.some(function(e){var r=n.filter(function(t){return e.engine&&e.engine!==t.engineName?!1:t.canPlay(e.type,T.conf)}).shift();return r&&(t=r),!!r}),t};return m.getAttribute("data-flowplayer-instance-id")||(m.setAttribute("data-flowplayer-instance-id",b++),T.on("boot",function(){(g.splash||v.contains("is-splash")||!y.support.firstframe)&&(T.forcedSplash=!g.splash&&!v.contains("is-splash"),T.splash=g.autoplay=!0,g.splash||(g.splash=!0),v.add("is-splash")),g.splash&&s.find("video",m).forEach(s.removeNode),(g.live||v.contains("is-live"))&&(T.live=g.live=!0,v.add("is-live")),f.forEach(function(e){e(T,m)}),c.push(T),g.splash?T.unload():T.load(),g.disabled&&T.disable(),T.one("ready",n)}).on("load",function(e,t,n){g.splash&&s.find(".flowplayer.is-ready,.flowplayer.is-loading").forEach(function(e){var t=e.getAttribute("data-flowplayer-instance-id");if(t!==m.getAttribute("data-flowplayer-instance-id")){var n=c[Number(t)];n&&n.conf.splash&&n.unload()}}),v.add("is-loading"),t.loading=!0,"undefined"!=typeof n.live&&(s.toggleClass(m,"is-live",n.live),t.live=n.live)}).on("ready",function(e,t,n){n.time=0,t.video=n,v.remove("is-loading"),t.loading=!1,t.muted?t.mute(!0,!0):t.volume(t.volumeLevel);var r=t.conf.hlsFix&&/mpegurl/i.exec(n.type);s.toggleClass(m,"hls-fix",!!r)}).on("unload",function(e){v.remove("is-loading"),T.loading=!1}).on("ready unload",function(e){var t="ready"==e.type;s.toggleClass(m,"is-splash",!t),s.toggleClass(m,"is-ready",t),T.ready=t,T.splash=!t}).on("progress",function(e,t,n){t.video.time=n}).on("speed",function(e,t,n){t.currentSpeed=n}).on("volume",function(e,t,n){t.volumeLevel=Math.round(100*n)/100,t.muted?n&&t.mute(!1):h.volume=n}).on("beforeseek seek",function(e){T.seeking="beforeseek"==e.type,s.toggleClass(m,"is-seeking",T.seeking)}).on("ready pause resume unload finish stop",function(e,t,n){T.paused=/pause|finish|unload|stop/.test(e.type),T.paused=T.paused||"ready"===e.type&&!g.autoplay&&!T.playing,T.playing=!T.paused,s.toggleClass(m,"is-paused",T.paused),s.toggleClass(m,"is-playing",T.playing),T.load.ed||T.pause()}).on("finish",function(e){T.finished=!0}).on("error",function(){})),T.trigger("boot",[T,m]),T}var o=e("extend-object"),i=e("is-function"),a=e("class-list"),l=e("bean"),s=e("./common"),u=e("./ext/events"),c=[],f=[],d=(window.navigator.userAgent,window.onbeforeunload);window.onbeforeunload=function(e){return c.forEach(function(e){e.conf.splash?e.unload():e.bind("error",function(){s.find(".flowplayer.is-error .fp-message").forEach(s.removeNode)})}),d?d(e):void 0};var p=!1;try{"object"==typeof window.localStorage&&(window.localStorage.flowplayerTestStorage="test",p=!0)}catch(m){}var v=/Safari/.exec(navigator.userAgent)&&!/Chrome/.exec(navigator.userAgent),g=/(\d+\.\d+) Safari/.exec(navigator.userAgent),h=g?Number(g[1]):100,y=t.exports=function(e,t,n){if(i(e))return f.push(e);if("number"==typeof e||"undefined"==typeof e)return c[e||0];if(e.nodeType){if(null!==e.getAttribute("data-flowplayer-instance-id"))return c[e.getAttribute("data-flowplayer-instance-id")];if(!t)return;return r(e,t,n)}if(e.jquery)return y(e[0],t,n);if("string"==typeof e){var o=s.find(e)[0];return o&&y(o,t,n)}};o(y,{version:"6.0.5",engines:[],conf:{},set:function(e,t){"string"==typeof e?y.conf[e]=t:o(y.conf,e)},support:{},defaults:{debug:p?!!localStorage.flowplayerDebug:!1,disabled:!1,fullscreen:window==window.top,keyboard:!0,ratio:9/16,adaptiveRatio:!1,rtmp:0,proxy:"best",splash:!1,live:!1,swf:"//releases.flowplayer.org/6.0.5/commercial/flowplayer.swf",swfHls:"//releases.flowplayer.org/6.0.5/commercial/flowplayerhls.swf",speeds:[.25,.5,1,1.5,2],tooltip:!0,mouseoutTimeout:5e3,volume:p?"true"==localStorage.muted?0:isNaN(localStorage.volume)?1:localStorage.volume||1:1,errors:["","Video loading aborted","Network error","Video not properly encoded","Video file not found","Unsupported video","Skin not found","SWF file not found","Subtitles not found","Invalid RTMP URL","Unsupported video format. Try installing Adobe Flash."],errorUrls:["","","","","","","","","","","http://get.adobe.com/flashplayer/"],playlist:[],hlsFix:v&&8>h},bean:l,common:s,extend:o});var b=0,w=e("./ext/resolve");if("undefined"!=typeof window.jQuery){var x=window.jQuery;x(function(){"function"==typeof x.fn.flowplayer&&x('.flowplayer:has(video,script[type="application/json"])').flowplayer()});var E=function(e){if(!e.length)return{};var t=e.data()||{},n={};return x.each(["autoplay","loop","preload","poster"],function(r,o){var i=e.attr(o);void 0!==i&&-1!==["autoplay","poster"].indexOf(o)?n[o]=i?i:!0:void 0!==i&&(t[o]=i?i:!0)}),t.subtitles=e.find("track").map(function(){var e=x(this);return{src:e.attr("src"),kind:e.attr("kind"),label:e.attr("label"),srclang:e.attr("srclang"),"default":e.prop("default")}}).get(),t.sources=(new w).sourcesFromVideoTag(e,x),o(n,{clip:t})};x.fn.flowplayer=function(e,t){return this.each(function(){"string"==typeof e&&(e={swf:e}),i(e)&&(t=e,e={});var n=x(this),o=n.find('script[type="application/json"]'),a=o.length?JSON.parse(o.text()):E(n.find("video")),l=x.extend({},e||{},a,n.data()),s=r(this,l,t);u.EVENTS.forEach(function(e){s.on(e+".jquery",function(e){n.trigger.call(n,e.type,e.detail&&e.detail.args)})}),n.data("flowplayer",s)})}}},{"./common":1,"./ext/events":8,"./ext/resolve":13,bean:20,"class-list":21,"extend-object":25,"is-function":26}],19:[function(e,t,n){e("es5-shim");var r=t.exports=e("./flowplayer");e("./ext/support"),e("./engine/embed"),e("./engine/html5"),e("./engine/flash"),e("./ext/ui"),e("./ext/keyboard"),e("./ext/playlist"),e("./ext/cuepoint"),e("./ext/subtitle"),e("./ext/analytics"),e("./ext/embed"),e("./ext/fullscreen"),e("./ext/mobile"),r(function(e,t){function n(e){var t=document.createElement("a");return t.href=e,u.hostname(t.hostname)}function o(e){var t="ab.ca,ac.ac,ac.at,ac.be,ac.cn,ac.il,ac.in,ac.jp,ac.kr,ac.sg,ac.th,ac.uk,ad.jp,adm.br,adv.br,ah.cn,am.br,arq.br,art.br,arts.ro,asn.au,asso.fr,asso.mc,bc.ca,bio.br,biz.pl,biz.tr,bj.cn,br.com,cn.com,cng.br,cnt.br,co.ac,co.at,co.de,co.gl,co.hk,co.id,co.il,co.in,co.jp,co.kr,co.mg,co.ms,co.nz,co.th,co.uk,co.ve,co.vi,co.za,com.ag,com.ai,com.ar,com.au,com.br,com.cn,com.co,com.cy,com.de,com.do,com.ec,com.es,com.fj,com.fr,com.gl,com.gt,com.hk,com.hr,com.hu,com.kg,com.ki,com.lc,com.mg,com.mm,com.ms,com.mt,com.mu,com.mx,com.my,com.na,com.nf,com.ng,com.ni,com.pa,com.ph,com.pl,com.pt,com.qa,com.ro,com.ru,com.sb,com.sc,com.sg,com.sv,com.tr,com.tw,com.ua,com.uy,com.ve,com.vn,cp.tz,cq.cn,de.com,de.org,ecn.br,ed.jp,edu.au,edu.cn,edu.hk,edu.mm,edu.my,edu.pl,edu.pt,edu.qa,edu.sg,edu.tr,edu.tw,eng.br,ernet.in,esp.br,etc.br,eti.br,eu.com,eu.int,eu.lv,firm.in,firm.ro,fm.br,fot.br,fst.br,g12.br,gb.com,gb.net,gd.cn,gen.in,go.jp,go.kr,go.th,gov.au,gov.az,gov.br,gov.cn,gov.il,gov.in,gov.mm,gov.my,gov.qa,gov.sg,gov.tr,gov.tw,gov.uk,gr.jp,gs.cn,gv.ac,gv.at,gx.cn,gz.cn,he.cn,hi.cn,hk.cn,hl.cn,hu.com,id.au,idv.tw,in.ua,ind.br,ind.in,inf.br,info.pl,info.ro,info.tr,info.ve,iwi.nz,jl.cn,jor.br,js.cn,jus.br,k12.il,k12.tr,kr.com,lel.br,lg.jp,ln.cn,ltd.uk,maori.nz,mb.ca,me.uk,med.br,mi.th,mil.br,mil.uk,mo.cn,mod.uk,muni.il,nb.ca,ne.jp,ne.kr,net.ag,net.ai,net.au,net.br,net.cn,net.do,net.gl,net.hk,net.il,net.in,net.kg,net.ki,net.lc,net.mg,net.mm,net.mu,net.ni,net.nz,net.pl,net.ru,net.sb,net.sc,net.sg,net.th,net.tr,net.tw,net.uk,net.ve,nf.ca,nhs.uk,nm.cn,nm.kr,no.com,nom.br,nom.ni,nom.ro,ns.ca,nt.ca,nt.ro,ntr.br,nx.cn,odo.br,off.ai,on.ca,or.ac,or.at,or.jp,or.kr,or.th,org.ag,org.ai,org.au,org.br,org.cn,org.do,org.es,org.gl,org.hk,org.in,org.kg,org.ki,org.lc,org.mg,org.mm,org.ms,org.nf,org.ni,org.nz,org.pl,org.ro,org.ru,org.sb,org.sc,org.sg,org.tr,org.tw,org.uk,org.ve,pe.ca,plc.uk,police.uk,ppg.br,presse.fr,pro.br,psc.br,psi.br,qc.ca,qc.com,qh.cn,rec.br,rec.ro,res.in,sa.com,sc.cn,sch.uk,se.com,se.net,sh.cn,sk.ca,slg.br,sn.cn,store.ro,tj.cn,tm.fr,tm.mc,tm.ro,tmp.br,tur.br,tv.br,tv.tr,tw.cn,uk.com,uk.net,us.com,uy.com,vet.br,waw.pl,web.ve,www.ro,xj.cn,xz.cn,yk.ca,yn.cn,zj.cn,zlg.br".split(",");
8
  e=e.toLowerCase();var n=e.split("."),r=n.length;if(2>r||/^\d+$/.test(n[r-1]))return e;var o=n.slice(-2).join(".");return r>=3&&t.indexOf(o)>=0?n.slice(-3).join("."):o}function i(e,t){t=o(t);for(var n=0,r=t.length-1;r>=0;r--)n+=55436413178*t.charCodeAt(r);for(n=(""+n).substring(0,7),r=0;r<e.length;r++)if(n===e[r].substring(1,8))return 1}var a=function(e,t){var n=e.className.split(" ");-1===n.indexOf(t)&&(e.className+=" "+t)},l=function(e){return"none"!==window.getComputedStyle(e).display},s=e.conf,u=r.common,c=u.createElement,f=s.swf.indexOf("flowplayer.org")&&s.e&&t.getAttribute("data-origin"),d=f?n(f):u.hostname(),p=(document,s.key);"file:"==location.protocol&&(d="localhost"),e.load.ed=1,s.hostname=d,s.origin=f||location.href,f&&a(t,"is-embedded"),"string"==typeof p&&(p=p.split(/,\s*/));var m=function(e,n){var r=c("a",{href:n,className:"fp-brand"});r.innerHTML=e,u.find(".fp-controls",t)[0].appendChild(r)};if(p&&"function"==typeof i&&i(p,d)){if(s.logo){var v=u.find(".fp-player",t)[0],g=c("a",{className:"fp-logo"});f&&(g.href=f),s.embed&&s.embed.popup&&(g.target="_blank");var h=c("img",{src:s.logo});g.appendChild(h),(v||t).appendChild(g)}s.brand&&f||s.brand&&s.brand.showOnOrigin?m(s.brand.text||s.brand,f||location.href):u.addClass(t,"no-brand")}else{m("flowplayer","http://flowplayer.org");var g=c("a",{onclick:""});t.appendChild(g);var y=c("div",{className:"fp-context-menu"},'<ul><li class="copyright">&copy; 2015</li><li><a href="http://flowplayer.org">About Flowplayer</a></li><li><a href="http://flowplayer.org/license">GPL based license</a></li></ul>'),b=window.location.href.indexOf("localhost"),v=u.find(".fp-player",t)[0];7!==b&&(v||t).appendChild(y),e.on("pause resume finish unload ready",function(e,n){u.removeClass(t,"no-brand");var r=-1;if(n.video.src)for(var o=[["org","flowplayer","drive"],["org","flowplayer","my"],["org","flowplayer","cdn"]],i=0;i<o.length&&(r=n.video.src.indexOf("://"+o[i].reverse().join(".")),-1===r);i++);if((4===r||5===r)&&u.addClass(t,"no-brand"),/pause|resume/.test(e.type)&&"flash"!=n.engine.engineName&&4!=r&&5!=r){var a={display:"block",position:"absolute",left:"16px",bottom:"46px",zIndex:99999,width:"120px",height:"27px",backgroundImage:"url("+[".png","fplogo","/",".com","foliovision","//"].reverse().join("")+")"};for(var s in a)a.hasOwnProperty(s)&&(g.style[s]=a[s]);n.load.ed=l(g)&&(7===b||y.parentNode==t||y.parentNode==v)&&!u.hasClass(t,"no-brand"),n.load.ed||n.pause()}else g.style.display="none"})}})},{"./engine/embed":2,"./engine/flash":3,"./engine/html5":4,"./ext/analytics":5,"./ext/cuepoint":6,"./ext/embed":7,"./ext/fullscreen":9,"./ext/keyboard":10,"./ext/mobile":11,"./ext/playlist":12,"./ext/subtitle":15,"./ext/support":16,"./ext/ui":17,"./flowplayer":18,"es5-shim":24}],20:[function(t,n,r){!function(t,r,o){"undefined"!=typeof n&&n.exports?n.exports=o():"function"==typeof e&&e.amd?e(o):r[t]=o()}("bean",this,function(e,t){e=e||"bean",t=t||this;var n,r=window,o=t[e],i=/[^\.]*(?=\..*)\.|.*/,a=/\..*/,l="addEventListener",s="removeEventListener",u=document||{},c=u.documentElement||{},f=c[l],d=f?l:"attachEvent",p={},m=Array.prototype.slice,v=function(e,t){return e.split(t||" ")},g=function(e){return"string"==typeof e},h=function(e){return"function"==typeof e},y="click dblclick mouseup mousedown contextmenu mousewheel mousemultiwheel DOMMouseScroll mouseover mouseout mousemove selectstart selectend keydown keypress keyup orientationchange focus blur change reset select submit load unload beforeunload resize move DOMContentLoaded readystatechange message error abort scroll ",b="show input invalid touchstart touchmove touchend touchcancel gesturestart gesturechange gestureend textinput readystatechange pageshow pagehide popstate hashchange offline online afterprint beforeprint dragstart dragenter dragover dragleave drag drop dragend loadstart progress suspend emptied stalled loadmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate play pause ratechange volumechange cuechange checking noupdate downloading cached updateready obsolete ",w=function(e,t,n){for(n=0;n<t.length;n++)t[n]&&(e[t[n]]=1);return e}({},v(y+(f?b:""))),x=function(){var e="compareDocumentPosition"in c?function(e,t){return t.compareDocumentPosition&&16===(16&t.compareDocumentPosition(e))}:"contains"in c?function(e,t){return t=9===t.nodeType||t===window?c:t,t!==e&&t.contains(e)}:function(e,t){for(;e=e.parentNode;)if(e===t)return 1;return 0},t=function(t){var n=t.relatedTarget;return n?n!==this&&"xul"!==n.prefix&&!/document/.test(this.toString())&&!e(n,this):null==n};return{mouseenter:{base:"mouseover",condition:t},mouseleave:{base:"mouseout",condition:t},mousewheel:{base:/Firefox/.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel"}}}(),E=function(){var e=v("altKey attrChange attrName bubbles cancelable ctrlKey currentTarget detail eventPhase getModifierState isTrusted metaKey relatedNode relatedTarget shiftKey srcElement target timeStamp type view which propertyName"),t=e.concat(v("button buttons clientX clientY dataTransfer fromElement offsetX offsetY pageX pageY screenX screenY toElement")),n=t.concat(v("wheelDelta wheelDeltaX wheelDeltaY wheelDeltaZ axis")),o=e.concat(v("char charCode key keyCode keyIdentifier keyLocation location")),i=e.concat(v("data")),a=e.concat(v("touches targetTouches changedTouches scale rotation")),l=e.concat(v("data origin source")),s=e.concat(v("state")),f=/over|out/,d=[{reg:/key/i,fix:function(e,t){return t.keyCode=e.keyCode||e.which,o}},{reg:/click|mouse(?!(.*wheel|scroll))|menu|drag|drop/i,fix:function(e,n,r){return n.rightClick=3===e.which||2===e.button,n.pos={x:0,y:0},e.pageX||e.pageY?(n.clientX=e.pageX,n.clientY=e.pageY):(e.clientX||e.clientY)&&(n.clientX=e.clientX+u.body.scrollLeft+c.scrollLeft,n.clientY=e.clientY+u.body.scrollTop+c.scrollTop),f.test(r)&&(n.relatedTarget=e.relatedTarget||e[("mouseover"==r?"from":"to")+"Element"]),t}},{reg:/mouse.*(wheel|scroll)/i,fix:function(){return n}},{reg:/^text/i,fix:function(){return i}},{reg:/^touch|^gesture/i,fix:function(){return a}},{reg:/^message$/i,fix:function(){return l}},{reg:/^popstate$/i,fix:function(){return s}},{reg:/.*/,fix:function(){return e}}],p={},m=function(e,t,n){if(arguments.length&&(e=e||((t.ownerDocument||t.document||t).parentWindow||r).event,this.originalEvent=e,this.isNative=n,this.isBean=!0,e)){var o,i,a,l,s,u=e.type,c=e.target||e.srcElement;if(this.target=c&&3===c.nodeType?c.parentNode:c,n){if(s=p[u],!s)for(o=0,i=d.length;i>o;o++)if(d[o].reg.test(u)){p[u]=s=d[o].fix;break}for(l=s(e,this,u),o=l.length;o--;)!((a=l[o])in this)&&a in e&&(this[a]=e[a])}}};return m.prototype.preventDefault=function(){this.originalEvent.preventDefault?this.originalEvent.preventDefault():this.originalEvent.returnValue=!1},m.prototype.stopPropagation=function(){this.originalEvent.stopPropagation?this.originalEvent.stopPropagation():this.originalEvent.cancelBubble=!0},m.prototype.stop=function(){this.preventDefault(),this.stopPropagation(),this.stopped=!0},m.prototype.stopImmediatePropagation=function(){this.originalEvent.stopImmediatePropagation&&this.originalEvent.stopImmediatePropagation(),this.isImmediatePropagationStopped=function(){return!0}},m.prototype.isImmediatePropagationStopped=function(){return this.originalEvent.isImmediatePropagationStopped&&this.originalEvent.isImmediatePropagationStopped()},m.prototype.clone=function(e){var t=new m(this,this.element,this.isNative);return t.currentTarget=e,t},m}(),k=function(e,t){return f||t||e!==u&&e!==r?e:c},T=function(){var e=function(e,t,n,r){var o=function(n,o){return t.apply(e,r?m.call(o,n?0:1).concat(r):o)},i=function(n,r){return t.__beanDel?t.__beanDel.ft(n.target,e):r},a=n?function(e){var t=i(e,this);return n.apply(t,arguments)?(e&&(e.currentTarget=t),o(e,arguments)):void 0}:function(e){return t.__beanDel&&(e=e.clone(i(e))),o(e,arguments)};return a.__beanDel=t.__beanDel,a},t=function(t,n,r,o,i,a,l){var s,u=x[n];"unload"==n&&(r=O(P,t,n,r,o)),u&&(u.condition&&(r=e(t,r,u.condition,a)),n=u.base||n),this.isNative=s=w[n]&&!!t[d],this.customType=!f&&!s&&n,this.element=t,this.type=n,this.original=o,this.namespaces=i,this.eventType=f||s?n:"propertychange",this.target=k(t,s),this[d]=!!this.target[d],this.root=l,this.handler=e(t,r,null,a)};return t.prototype.inNamespaces=function(e){var t,n,r=0;if(!e)return!0;if(!this.namespaces)return!1;for(t=e.length;t--;)for(n=this.namespaces.length;n--;)e[t]==this.namespaces[n]&&r++;return e.length===r},t.prototype.matches=function(e,t,n){return!(this.element!==e||t&&this.original!==t||n&&this.handler!==n)},t}(),S=function(){var e={},t=function(n,r,o,i,a,l){var s=a?"r":"$";if(r&&"*"!=r){var u,c=0,f=e[s+r],d="*"==n;if(!f)return;for(u=f.length;u>c;c++)if((d||f[c].matches(n,o,i))&&!l(f[c],f,c,r))return}else for(var p in e)p.charAt(0)==s&&t(n,p.substr(1),o,i,a,l)},n=function(t,n,r,o){var i,a=e[(o?"r":"$")+n];if(a)for(i=a.length;i--;)if(!a[i].root&&a[i].matches(t,r,null))return!0;return!1},r=function(e,n,r,o){var i=[];return t(e,n,r,null,o,function(e){return i.push(e)}),i},o=function(t){var n=!t.root&&!this.has(t.element,t.type,null,!1),r=(t.root?"r":"$")+t.type;return(e[r]||(e[r]=[])).push(t),n},i=function(n){t(n.element,n.type,null,n.handler,n.root,function(t,n,r){return n.splice(r,1),t.removed=!0,0===n.length&&delete e[(t.root?"r":"$")+t.type],!1})},a=function(){var t,n=[];for(t in e)"$"==t.charAt(0)&&(n=n.concat(e[t]));return n};return{has:n,get:r,put:o,del:i,entries:a}}(),N=function(e){n=arguments.length?e:u.querySelectorAll?function(e,t){return t.querySelectorAll(e)}:function(){throw new Error("Bean: No selector engine installed")}},C=function(e,t){if(f||!t||!e||e.propertyName=="_on"+t){var n=S.get(this,t||e.type,null,!1),r=n.length,o=0;for(e=new E(e,this,!0),t&&(e.type=t);r>o&&!e.isImmediatePropagationStopped();o++)n[o].removed||n[o].handler.call(this,e)}},j=f?function(e,t,n){e[n?l:s](t,C,!1)}:function(e,t,n,r){var o;n?(S.put(o=new T(e,r||t,function(t){C.call(e,t,r)},C,null,null,!0)),r&&null==e["_on"+r]&&(e["_on"+r]=0),o.target.attachEvent("on"+o.eventType,o.handler)):(o=S.get(e,r||t,C,!0)[0],o&&(o.target.detachEvent("on"+o.eventType,o.handler),S.del(o)))},O=function(e,t,n,r,o){return function(){r.apply(this,arguments),e(t,n,o)}},P=function(e,t,n,r){var o,i,l=t&&t.replace(a,""),s=S.get(e,l,null,!1),u={};for(o=0,i=s.length;i>o;o++)n&&s[o].original!==n||!s[o].inNamespaces(r)||(S.del(s[o]),!u[s[o].eventType]&&s[o][d]&&(u[s[o].eventType]={t:s[o].eventType,c:s[o].type}));for(o in u)S.has(e,u[o].t,null,!1)||j(e,u[o].t,!1,u[o].c)},A=function(e,t){var r=function(t,r){for(var o,i=g(e)?n(e,r):e;t&&t!==r;t=t.parentNode)for(o=i.length;o--;)if(i[o]===t)return t},o=function(e){var n=r(e.target,this);n&&t.apply(n,arguments)};return o.__beanDel={ft:r,selector:e},o},_=f?function(e,t,n){var o=u.createEvent(e?"HTMLEvents":"UIEvents");o[e?"initEvent":"initUIEvent"](t,!0,!0,r,1),n.dispatchEvent(o)}:function(e,t,n){n=k(n,e),e?n.fireEvent("on"+t,u.createEventObject()):n["_on"+t]++},D=function(e,t,n){var r,o,l,s,u=g(t);if(u&&t.indexOf(" ")>0){for(t=v(t),s=t.length;s--;)D(e,t[s],n);return e}if(o=u&&t.replace(a,""),o&&x[o]&&(o=x[o].base),!t||u)(l=u&&t.replace(i,""))&&(l=v(l,".")),P(e,o,n,l);else if(h(t))P(e,null,t);else for(r in t)t.hasOwnProperty(r)&&D(e,r,t[r]);return e},M=function(e,t,r,o){var l,s,u,c,f,g,y;{if(void 0!==r||"object"!=typeof t){for(h(r)?(f=m.call(arguments,3),o=l=r):(l=o,f=m.call(arguments,4),o=A(r,l,n)),u=v(t),this===p&&(o=O(D,e,t,o,l)),c=u.length;c--;)y=S.put(g=new T(e,u[c].replace(a,""),o,l,v(u[c].replace(i,""),"."),f,!1)),g[d]&&y&&j(e,g.eventType,!0,g.customType);return e}for(s in t)t.hasOwnProperty(s)&&M.call(this,e,s,t[s])}},L=function(e,t,n,r){return M.apply(null,g(n)?[e,n,t,r].concat(arguments.length>3?m.call(arguments,5):[]):m.call(arguments))},I=function(){return M.apply(p,arguments)},F=function(e,t,n){var r,o,l,s,u,c=v(t);for(r=c.length;r--;)if(t=c[r].replace(a,""),(s=c[r].replace(i,""))&&(s=v(s,".")),s||n||!e[d])for(u=S.get(e,t,null,!1),n=[!1].concat(n),o=0,l=u.length;l>o;o++)u[o].inNamespaces(s)&&u[o].handler.apply(e,n);else _(w[t],t,e);return e},z=function(e,t,n){for(var r,o,i=S.get(t,n,null,!1),a=i.length,l=0;a>l;l++)i[l].original&&(r=[e,i[l].type],(o=i[l].handler.__beanDel)&&r.push(o.selector),r.push(i[l].original),M.apply(null,r));return e},R={on:M,add:L,one:I,off:D,remove:D,clone:z,fire:F,Event:E,setSelectorEngine:N,noConflict:function(){return t[e]=o,this}};if(r.attachEvent){var q=function(){var e,t=S.entries();for(e in t)t[e].type&&"unload"!==t[e].type&&D(t[e].element,t[e].type);r.detachEvent("onunload",q),r.CollectGarbage&&r.CollectGarbage()};r.attachEvent("onunload",q)}return N(),R})},{}],21:[function(e,t,n){function r(e){function t(e){var t=c();a(t,e)>-1||(t.push(e),f(t))}function n(e){var t=c(),n=a(t,e);-1!==n&&(t.splice(n,1),f(t))}function r(e){return a(c(),e)>-1}function l(e){return r(e)?(n(e),!1):(t(e),!0)}function s(){return e.className}function u(e){var t=c();return t[e]||null}function c(){var t=e.className;return o(t.split(" "),i)}function f(t){var n=t.length;e.className=t.join(" "),p.length=n;for(var r=0;r<t.length;r++)p[r]=t[r];delete t[n]}var d=e.classList;if(d)return d;var p={add:t,remove:n,contains:r,toggle:l,toString:s,length:0,item:u};return p}function o(e,t){for(var n=[],r=0;r<e.length;r++)t(e[r])&&n.push(e[r]);return n}function i(e){return!!e}var a=e("indexof");t.exports=r},{indexof:22}],22:[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}},{}],23:[function(e,t,n){function r(e,t,n,r){return n=window.getComputedStyle,r=n?n(e):e.currentStyle,r?r[t.replace(/-(\w)/gi,function(e,t){return t.toUpperCase()})]:void 0}t.exports=r},{}],24:[function(t,n,r){!function(t,o){"use strict";"function"==typeof e&&e.amd?e(o):"object"==typeof r?n.exports=o():t.returnExports=o()}(this,function(){var e,t=Array.prototype,n=Object.prototype,r=Function.prototype,o=String.prototype,i=Number.prototype,a=t.slice,l=t.splice,s=t.push,u=t.unshift,c=t.concat,f=r.call,d=n.toString,p=Array.isArray||function(e){return"[object Array]"===d.call(e)},m="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,v=Function.prototype.toString,g=function(e){try{return v.call(e),!0}catch(t){return!1}},h="[object Function]",y="[object GeneratorFunction]";e=function(e){if("function"!=typeof e)return!1;if(m)return g(e);var t=d.call(e);return t===h||t===y};var b,w=RegExp.prototype.exec,x=function(e){try{return w.call(e),!0}catch(t){return!1}},E="[object RegExp]";b=function(e){return"object"!=typeof e?!1:m?x(e):d.call(e)===E};var k,T=String.prototype.valueOf,S=function(e){try{return T.call(e),!0}catch(t){return!1}},N="[object String]";k=function(e){return"string"==typeof e?!0:"object"!=typeof e?!1:m?S(e):d.call(e)===N};var C=function(t){var n=d.call(t),r="[object Arguments]"===n;return r||(r=!p(t)&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&e(t.callee)),r},j=function(e){var t,n=Object.defineProperty&&function(){try{var e={};Object.defineProperty(e,"x",{enumerable:!1,value:e});for(var t in e)return!1;return e.x===e}catch(n){return!1}}();return t=n?function(e,t,n,r){!r&&t in e||Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:!0,value:n})}:function(e,t,n,r){!r&&t in e||(e[t]=n)},function(n,r,o){for(var i in r)e.call(r,i)&&t(n,i,r[i],o)}}(n.hasOwnProperty),O=function(e){var t=typeof e;return null===e||"object"!==t&&"function"!==t},P={ToInteger:function(e){var t=+e;return t!==t?t=0:0!==t&&t!==1/0&&t!==-(1/0)&&(t=(t>0||-1)*Math.floor(Math.abs(t))),t},ToPrimitive:function(t){var n,r,o;if(O(t))return t;if(r=t.valueOf,e(r)&&(n=r.call(t),O(n)))return n;if(o=t.toString,e(o)&&(n=o.call(t),O(n)))return n;throw new TypeError},ToObject:function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return Object(e)},ToUint32:function(e){return e>>>0}},A=function(){};j(r,{bind:function(t){var n=this;if(!e(n))throw new TypeError("Function.prototype.bind called on incompatible "+n);for(var r,o=a.call(arguments,1),i=function(){if(this instanceof r){var e=n.apply(this,c.call(o,a.call(arguments)));return Object(e)===e?e:this}return n.apply(t,c.call(o,a.call(arguments)))},l=Math.max(0,n.length-o.length),s=[],u=0;l>u;u++)s.push("$"+u);return r=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this, arguments); }")(i),n.prototype&&(A.prototype=n.prototype,r.prototype=new A,A.prototype=null),r}});var _=f.bind(n.hasOwnProperty),D=function(){var e=[1,2],t=e.splice();return 2===e.length&&p(t)&&0===t.length}();j(t,{splice:function(e,t){return 0===arguments.length?[]:l.apply(this,arguments)}},!D);var M=function(){var e={};return t.splice.call(e,0,0,1),1===e.length}();j(t,{splice:function(e,t){if(0===arguments.length)return[];var n=arguments;return this.length=Math.max(P.ToInteger(this.length),0),arguments.length>0&&"number"!=typeof t&&(n=a.call(arguments),n.length<2?n.push(this.length-e):n[1]=P.ToInteger(t)),l.apply(this,n)}},!M);var L=1!==[].unshift(0);j(t,{unshift:function(){return u.apply(this,arguments),this.length}},L),j(Array,{isArray:p});var I=Object("a"),F="a"!==I[0]||!(0 in I),z=function(e){var t=!0,n=!0;return e&&(e.call("foo",function(e,n,r){"object"!=typeof r&&(t=!1)}),e.call([1],function(){"use strict";n="string"==typeof this},"x")),!!e&&t&&n};j(t,{forEach:function(t){var n,r=P.ToObject(this),o=F&&k(this)?this.split(""):r,i=-1,a=o.length>>>0;if(arguments.length>1&&(n=arguments[1]),!e(t))throw new TypeError("Array.prototype.forEach callback must be a function");for(;++i<a;)i in o&&("undefined"!=typeof n?t.call(n,o[i],i,r):t(o[i],i,r))}},!z(t.forEach)),j(t,{map:function(t){var n,r=P.ToObject(this),o=F&&k(this)?this.split(""):r,i=o.length>>>0,a=Array(i);if(arguments.length>1&&(n=arguments[1]),!e(t))throw new TypeError("Array.prototype.map callback must be a function");for(var l=0;i>l;l++)l in o&&("undefined"!=typeof n?a[l]=t.call(n,o[l],l,r):a[l]=t(o[l],l,r));return a}},!z(t.map)),j(t,{filter:function(t){var n,r,o=P.ToObject(this),i=F&&k(this)?this.split(""):o,a=i.length>>>0,l=[];if(arguments.length>1&&(r=arguments[1]),!e(t))throw new TypeError("Array.prototype.filter callback must be a function");for(var s=0;a>s;s++)s in i&&(n=i[s],("undefined"==typeof r?t(n,s,o):t.call(r,n,s,o))&&l.push(n));return l}},!z(t.filter)),j(t,{every:function(t){var n,r=P.ToObject(this),o=F&&k(this)?this.split(""):r,i=o.length>>>0;if(arguments.length>1&&(n=arguments[1]),!e(t))throw new TypeError("Array.prototype.every callback must be a function");for(var a=0;i>a;a++)if(a in o&&!("undefined"==typeof n?t(o[a],a,r):t.call(n,o[a],a,r)))return!1;return!0}},!z(t.every)),j(t,{some:function(t){var n,r=P.ToObject(this),o=F&&k(this)?this.split(""):r,i=o.length>>>0;if(arguments.length>1&&(n=arguments[1]),!e(t))throw new TypeError("Array.prototype.some callback must be a function");for(var a=0;i>a;a++)if(a in o&&("undefined"==typeof n?t(o[a],a,r):t.call(n,o[a],a,r)))return!0;return!1}},!z(t.some));var R=!1;t.reduce&&(R="object"==typeof t.reduce.call("es5",function(e,t,n,r){return r})),j(t,{reduce:function(t){var n=P.ToObject(this),r=F&&k(this)?this.split(""):n,o=r.length>>>0;if(!e(t))throw new TypeError("Array.prototype.reduce callback must be a function");if(0===o&&1===arguments.length)throw new TypeError("reduce of empty array with no initial value");var i,a=0;if(arguments.length>=2)i=arguments[1];else for(;;){if(a in r){i=r[a++];break}if(++a>=o)throw new TypeError("reduce of empty array with no initial value")}for(;o>a;a++)a in r&&(i=t(i,r[a],a,n));return i}},!R);var q=!1;t.reduceRight&&(q="object"==typeof t.reduceRight.call("es5",function(e,t,n,r){return r})),j(t,{reduceRight:function(t){var n=P.ToObject(this),r=F&&k(this)?this.split(""):n,o=r.length>>>0;if(!e(t))throw new TypeError("Array.prototype.reduceRight callback must be a function");if(0===o&&1===arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var i,a=o-1;if(arguments.length>=2)i=arguments[1];else for(;;){if(a in r){i=r[a--];break}if(--a<0)throw new TypeError("reduceRight of empty array with no initial value")}if(0>a)return i;do a in r&&(i=t(i,r[a],a,n));while(a--);return i}},!q);var V=Array.prototype.indexOf&&-1!==[0,1].indexOf(1,2);j(t,{indexOf:function(e){var t=F&&k(this)?this.split(""):P.ToObject(this),n=t.length>>>0;if(0===n)return-1;var r=0;for(arguments.length>1&&(r=P.ToInteger(arguments[1])),r=r>=0?r:Math.max(0,n+r);n>r;r++)if(r in t&&t[r]===e)return r;return-1}},V);var H=Array.prototype.lastIndexOf&&-1!==[0,1].lastIndexOf(0,-3);j(t,{lastIndexOf:function(e){var t=F&&k(this)?this.split(""):P.ToObject(this),n=t.length>>>0;if(0===n)return-1;var r=n-1;for(arguments.length>1&&(r=Math.min(r,P.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}},H);var U=!{toString:null}.propertyIsEnumerable("toString"),$=function(){}.propertyIsEnumerable("prototype"),X=!_("x","0"),Y=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],B=Y.length;j(Object,{keys:function(t){var n=e(t),r=C(t),o=null!==t&&"object"==typeof t,i=o&&k(t);if(!o&&!n&&!r)throw new TypeError("Object.keys called on a non-object");var a=[],l=$&&n;if(i&&X||r)for(var s=0;s<t.length;++s)a.push(String(s));if(!r)for(var u in t)l&&"prototype"===u||!_(t,u)||a.push(String(u));if(U)for(var c=t.constructor,f=c&&c.prototype===t,d=0;B>d;d++){var p=Y[d];f&&"constructor"===p||!_(t,p)||a.push(p)}return a}});var W=Object.keys&&function(){return 2===Object.keys(arguments).length}(1,2),K=Object.keys;j(Object,{keys:function(e){return K(C(e)?t.slice.call(e):e)}},!W);var G=-621987552e5,Z="-000001",J=Date.prototype.toISOString&&-1===new Date(G).toISOString().indexOf(Z);j(Date.prototype,{toISOString:function(){var e,t,n,r,o;if(!isFinite(this))throw new RangeError("Date.prototype.toISOString called on non-finite value.");for(r=this.getUTCFullYear(),o=this.getUTCMonth(),r+=Math.floor(o/12),o=(o%12+12)%12,e=[o+1,this.getUTCDate(),this.getUTCHours(),this.getUTCMinutes(),this.getUTCSeconds()],r=(0>r?"-":r>9999?"+":"")+("00000"+Math.abs(r)).slice(r>=0&&9999>=r?-4:-6),t=e.length;t--;)n=e[t],10>n&&(e[t]="0"+n);return r+"-"+e.slice(0,2).join("-")+"T"+e.slice(2).join(":")+"."+("000"+this.getUTCMilliseconds()).slice(-3)+"Z"}},J);var Q=function(){try{return Date.prototype.toJSON&&null===new Date(NaN).toJSON()&&-1!==new Date(G).toJSON().indexOf(Z)&&Date.prototype.toJSON.call({toISOString:function(){return!0}})}catch(e){return!1}}();Q||(Date.prototype.toJSON=function(t){var n=Object(this),r=P.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 ee=1e15===Date.parse("+033658-09-27T01:46:40.000Z"),te=!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")),ne=isNaN(Date.parse("2000-01-01T00:00:00.000Z"));(!Date.parse||ne||te||!ee)&&(Date=function(e){var t=function(n,r,o,i,a,l,s){var u,c=arguments.length;return u=this instanceof e?1===c&&String(n)===n?new e(t.parse(n)):c>=7?new e(n,r,o,i,a,l,s):c>=6?new e(n,r,o,i,a,l):c>=5?new e(n,r,o,i,a):c>=4?new e(n,r,o,i):c>=3?new e(n,r,o):c>=2?new e(n,r):c>=1?new e(n):new e:e.apply(this,arguments),j(u,{constructor:t},!0),u},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})))?)?)?)?$"),r=[0,31,59,90,120,151,181,212,243,273,304,334,365],o=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)},i=function(t){return Number(new e(1970,0,1,0,0,0,t))};for(var a in e)_(e,a)&&(t[a]=e[a]);return j(t,{now:e.now,UTC:e.UTC},!0),t.prototype=e.prototype,j(t.prototype,{constructor:t},!0),t.parse=function(t){var r=n.exec(t);if(r){var a,l=Number(r[1]),s=Number(r[2]||1)-1,u=Number(r[3]||1)-1,c=Number(r[4]||0),f=Number(r[5]||0),d=Number(r[6]||0),p=Math.floor(1e3*Number(r[7]||0)),m=Boolean(r[4]&&!r[8]),v="-"===r[9]?1:-1,g=Number(r[10]||0),h=Number(r[11]||0);return(f>0||d>0||p>0?24:25)>c&&60>f&&60>d&&1e3>p&&s>-1&&12>s&&24>g&&60>h&&u>-1&&u<o(l,s+1)-o(l,s)&&(a=60*(24*(o(l,s)+u)+c+g*v),a=1e3*(60*(a+f+h*v)+d)+p,m&&(a=i(a)),a>=-864e13&&864e13>=a)?a:NaN}return e.parse.apply(this,arguments)},t}(Date)),Date.now||(Date.now=function(){return(new Date).getTime()});var re=i.toFixed&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==0xde0b6b3a7640080.toFixed(0)),oe={base:1e7,size:6,data:[0,0,0,0,0,0],multiply:function(e,t){for(var n=-1,r=t;++n<oe.size;)r+=e*oe.data[n],oe.data[n]=r%oe.base,r=Math.floor(r/oe.base)},divide:function(e){for(var t=oe.size,n=0;--t>=0;)n+=oe.data[t],oe.data[t]=Math.floor(n/e),n=n%e*oe.base},numToString:function(){for(var e=oe.size,t="";--e>=0;)if(""!==t||0===e||0!==oe.data[e]){var n=String(oe.data[e]);""===t?t=n:t+="0000000".slice(0,7-n.length)+n}return t},pow:function ge(e,t,n){return 0===t?n:t%2===1?ge(e,t-1,n*e):ge(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}};j(i,{toFixed:function(e){var t,n,r,o,i,a,l,s;if(t=Number(e),t=t!==t?0:Math.floor(t),0>t||t>20)throw new RangeError("Number.toFixed called with invalid number of decimals");if(n=Number(this),n!==n)return"NaN";if(-1e21>=n||n>=1e21)return String(n);if(r="",0>n&&(r="-",n=-n),o="0",n>1e-21)if(i=oe.log(n*oe.pow(2,69,1))-69,a=0>i?n*oe.pow(2,-i,1):n/oe.pow(2,i,1),a*=4503599627370496,i=52-i,i>0){for(oe.multiply(0,a),l=t;l>=7;)oe.multiply(1e7,0),l-=7;for(oe.multiply(oe.pow(10,l,1),0),l=i-1;l>=23;)oe.divide(1<<23),l-=23;oe.divide(1<<l),oe.multiply(1,1),oe.divide(2),o=oe.numToString()}else oe.multiply(0,a),oe.multiply(1<<-i,0),o=oe.numToString()+"0.00000000000000000000".slice(2,2+t);return t>0?(s=o.length,o=t>=s?r+"0.0000000000000000000".slice(0,t-s+2)+o:r+o.slice(0,s-t)+"."+o.slice(s-t)):o=r+o,o}},re);var ie=o.split;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];o.split=function(t,n){var r=this;if("undefined"==typeof t&&0===n)return[];if(!b(t))return ie.call(this,t,n);var o,i,a,l,u=[],c=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.extended?"x":"")+(t.sticky?"y":""),f=0,d=new RegExp(t.source,c+"g");r+="",e||(o=new RegExp("^"+d.source+"$(?!\\s)",c));var p="undefined"==typeof n?-1>>>0:P.ToUint32(n);for(i=d.exec(r);i&&(a=i.index+i[0].length,!(a>f&&(u.push(r.slice(f,i.index)),!e&&i.length>1&&i[0].replace(o,function(){for(var e=1;e<arguments.length-2;e++)"undefined"==typeof arguments[e]&&(i[e]=void 0)}),i.length>1&&i.index<r.length&&s.apply(u,i.slice(1)),l=i[0].length,f=a,u.length>=p)));)d.lastIndex===i.index&&d.lastIndex++,i=d.exec(r);return f===r.length?(l||!d.test(""))&&u.push(""):u.push(r.slice(f)),u.length>p?u.slice(0,p):u}}():"0".split(void 0,0).length&&(o.split=function(e,t){return"undefined"==typeof e&&0===t?[]:ie.call(this,e,t)});var ae=o.replace,le=function(){var e=[];return"x".replace(/x(.)?/g,function(t,n){e.push(n)}),1===e.length&&"undefined"==typeof e[0]}();le||(o.replace=function(t,n){var r=e(n),o=b(t)&&/\)[*?]/.test(t.source);if(r&&o){var i=function(e){var r=arguments.length,o=t.lastIndex;t.lastIndex=0;var i=t.exec(e)||[];return t.lastIndex=o,i.push(arguments[r-2],arguments[r-1]),n.apply(this,i)};return ae.call(this,t,i)}return ae.call(this,t,n)});var se=o.substr,ue="".substr&&"b"!=="0b".substr(-1);j(o,{substr:function(e,t){var n=e;return 0>e&&(n=Math.max(this.length+e,0)),se.call(this,n,t)}},ue);var ce=" \n\f\r   ᠎              \u2028\u2029\ufeff",fe="​",de="["+ce+"]",pe=new RegExp("^"+de+de+"*"),me=new RegExp(de+de+"*$"),ve=o.trim&&(ce.trim()||!fe.trim());j(o,{trim:function(){if("undefined"==typeof this||null===this)throw new TypeError("can't convert "+this+" to object");return String(this).replace(pe,"").replace(me,"")}},ve),(8!==parseInt(ce+"08")||22!==parseInt(ce+"0x16"))&&(parseInt=function(e){var t=/^0[xX]/;return function(n,r){var o=String(n).trim(),i=Number(r)||(t.test(o)?16:10);return e(o,i)}}(parseInt))})},{}],25:[function(e,t,n){var r=[],o=r.forEach,i=r.slice;t.exports=function(e){return o.call(i.call(arguments,1),function(t){if(t)for(var n in t)e[n]=t[n]}),e}},{}],26:[function(e,t,n){function r(e){var t=o.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 o=Object.prototype.toString},{}],27:[function(e,t,n){"use strict";t.exports=function(e){return"object"==typeof e&&null!==e}},{}],28:[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 s;return 1}function t(t,n){e(t,function(e){return!n(e)})}function n(i,a,l){function s(e){return e.call?e():d[e]}function c(){if(!--y){d[h]=1,g&&g();for(var n in m)e(n.split("|"),s)&&!t(m[n],s)&&(m[n]=[])}}i=i[u]?i:[i];var f=a&&a.call,g=f?a:l,h=f?i.join(""):a,y=i.length;return setTimeout(function(){t(i,function e(t,n){return null===t?c():(t=n||-1!==t.indexOf(".js")||/^https?:\/\//.test(t)||!o?t:o+t+".js",v[t]?(h&&(p[h]=1),2==v[t]?c():setTimeout(function(){e(t,!0)},0)):(v[t]=1,h&&(p[h]=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,v[e]=2,t())},r.async=1,r.src=i?e+(-1===e.indexOf("?")?"?":"&")+i:e,l.insertBefore(r,l.lastChild)}var o,i,a=document,l=a.getElementsByTagName("head")[0],s=!1,u="push",c="readyState",f="onreadystatechange",d={},p={},m={},v={};return n.get=r,n.order=function(e,t,r){!function o(i){i=e.shift(),e.length?n(i,o):n(i,t,r)}()},n.path=function(e){o=e},n.urlArgs=function(e){i=e},n.ready=function(r,o,i){r=r[u]?r:[r];var a=[];return!t(r,function(e){d[e]||a[u](e)})&&e(r,function(e){return d[e]})?o():!function(e){m[e]=m[e]||[],m[e][u](o),i&&i(a)}(r.join("|")),n},n.done=function(e){n([null],e)},n})},{}],29:[function(t,n,r){(function(t){!function(o){function i(e){throw RangeError(M[e])}function a(e,t){for(var n=e.length;n--;)e[n]=t(e[n]);return e}function l(e,t){return a(e.split(D),t).join(".")}function s(e){for(var t,n,r=[],o=0,i=e.length;i>o;)t=e.charCodeAt(o++),t>=55296&&56319>=t&&i>o?(n=e.charCodeAt(o++),56320==(64512&n)?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--)):r.push(t);return r}function u(e){return a(e,function(e){var t="";return e>65535&&(e-=65536,t+=F(e>>>10&1023|55296),e=56320|1023&e),t+=F(e)}).join("")}function c(e){return 10>e-48?e-22:26>e-65?e-65:26>e-97?e-97:k}function f(e,t){return e+22+75*(26>e)-((0!=t)<<5)}function d(e,t,n){var r=0;for(e=n?I(e/C):e>>1,e+=I(e/t);e>L*S>>1;r+=k)e=I(e/L);return I(r+(L+1)*e/(e+N))}function p(e){var t,n,r,o,a,l,s,f,p,m,v=[],g=e.length,h=0,y=O,b=j;for(n=e.lastIndexOf(P),0>n&&(n=0),r=0;n>r;++r)e.charCodeAt(r)>=128&&i("not-basic"),v.push(e.charCodeAt(r));for(o=n>0?n+1:0;g>o;){for(a=h,l=1,s=k;o>=g&&i("invalid-input"),f=c(e.charCodeAt(o++)),(f>=k||f>I((E-h)/l))&&i("overflow"),h+=f*l,p=b>=s?T:s>=b+S?S:s-b,!(p>f);s+=k)m=k-p,l>I(E/m)&&i("overflow"),l*=m;t=v.length+1,b=d(h-a,t,0==a),I(h/t)>E-y&&i("overflow"),y+=I(h/t),h%=t,v.splice(h++,0,y)}return u(v)}function m(e){var t,n,r,o,a,l,u,c,p,m,v,g,h,y,b,w=[];for(e=s(e),g=e.length,t=O,n=0,a=j,l=0;g>l;++l)v=e[l],128>v&&w.push(F(v));for(r=o=w.length,o&&w.push(P);g>r;){for(u=E,l=0;g>l;++l)v=e[l],v>=t&&u>v&&(u=v);for(h=r+1,u-t>I((E-n)/h)&&i("overflow"),n+=(u-t)*h,t=u,l=0;g>l;++l)if(v=e[l],t>v&&++n>E&&i("overflow"),v==t){for(c=n,p=k;m=a>=p?T:p>=a+S?S:p-a,!(m>c);p+=k)b=c-m,y=k-m,w.push(F(f(m+b%y,0))),c=I(b/y);w.push(F(f(c,0))),a=d(n,h,r==o),n=0,++r}++n,++t}return w.join("")}function v(e){return l(e,function(e){
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
 
@@ -29,11 +29,16 @@ if( typeof(fv_flowplayer_conf) != "undefined" ) {
29
  flowplayer.conf.native_fullscreen = true;
30
  }
31
 
32
- var isOldAndroid = /Android/.test(navigator.userAgent) && parseFloat(/Android\ (\d\.\d)/.exec(window.navigator.userAgent)[1], 10) < 4.4;
33
- var isiPad = /iPad/i.test(navigator.userAgent);
34
- var iOSVersion = isiPad ? parseFloat(/CPU (?:iPhone |iPod )?OS (\d+)/.exec(navigator.userAgent)[1], 10) : 0;
35
- if( !window.navigator.userAgent.match(/Chrome\/5[5-9]/) && ( isOldAndroid || iOSVersion < 7 ) && ('ontouchstart' in window) ) {
36
- flowplayer.conf.native_fullscreen = true;
 
 
 
 
 
37
  }
38
  }
39
  if( typeof(fv_flowplayer_translations) != "undefined" ) {
@@ -75,7 +80,7 @@ function fv_wp_flowplayer_admin_show_notice( id, link ) {
75
  }
76
  }
77
 
78
- function fv_wp_flowplayer_admin_support_mail( hash, button ) {
79
  jQuery('.fv_flowplayer_submit_error').remove();
80
 
81
  var comment_text = jQuery('#wpfp_support_'+hash).val();
@@ -351,7 +356,7 @@ function fv_flowplayer_safety_resize() {
351
  var fv_flowplayer_safety_resize_init = false;
352
 
353
  jQuery('.flowplayer').each( function() {
354
- if( !jQuery(this).is(":visible") || jQuery(this).hasClass('lightboxed') || jQuery(this).hasClass('lightbox-starter') ) return;
355
 
356
  if( jQuery(this).width() < 30 || jQuery(this).height() < 20 ) {
357
  fv_flowplayer_safety_resize_init = true
@@ -393,8 +398,43 @@ var fv_player_did_autoplay = false;
393
 
394
 
395
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
396
  jQuery(document).ready( function() {
397
 
 
 
 
 
398
  jQuery('.fp-playlist-external' ).each( function(i,el) {
399
  if( jQuery('a',el).length == 0 ) return;
400
  jQuery('a',el).click( function(e) {
@@ -427,12 +467,12 @@ jQuery(document).ready( function() {
427
  if( !api.conf.playlist && playlist.length && playlist.find('a[data-item]').length > 0 ) {
428
  var items = [];
429
  playlist.find('a[data-item]').each( function() {
430
- items.push( JSON.parse(jQuery(this).attr('data-item')) );
431
  });
432
  api.conf.playlist = items;
433
  api.conf.clip = items[0];
434
  } else if( !api.conf.clip ){
435
- api.conf.clip = JSON.parse(jQuery(root).attr('data-item'));
436
  }
437
 
438
  api.bind('load', function(e,api,video) {
@@ -489,13 +529,13 @@ jQuery(document).ready( function() {
489
 
490
  function fv_player_load() {
491
 
492
- // Sinle videos - new style
493
  jQuery('.flowplayer[data-item]' ).each( function(i,el) {
494
  var root = jQuery(el);
495
  var api = root.data('flowplayer');
496
  if( api ) return;
497
 
498
- root.flowplayer( { clip: JSON.parse(root.attr('data-item')) }); // todo: IE6-8
499
  } );
500
 
501
  // Playlist - new style
@@ -510,7 +550,7 @@ function fv_player_load() {
510
  if ( playlist.find('a[data-item]').length == 0 ) return; // respect old playlist script setup
511
 
512
  playlist.find('a[data-item]').each( function() {
513
- items.push( JSON.parse(jQuery(this).attr('data-item')) );
514
  });
515
  player.flowplayer( { playlist: items } );
516
  }
@@ -680,6 +720,13 @@ if( isIE11 ) {
680
  */
681
  flowplayer(function (api,root) {
682
  root = jQuery(root);
 
 
 
 
 
 
 
683
  var player_id = root.attr('id');
684
  api.bind("ready", function (e, api) {
685
  //console.log('ad ready to show',root.attr('class'));
@@ -693,7 +740,7 @@ flowplayer(function (api,root) {
693
  if( root.find('.wpfp_custom_popup').length > 0) {
694
  root.find('.wpfp_custom_popup').show();
695
  } else if( typeof(fv_flowplayer_popup) != "undefined" && typeof(fv_flowplayer_popup[player_id]) != "undefined" ) {
696
- root.append( '<div id="'+player_id+'_custom_popup" class="wpfp_custom_popup">'+fv_flowplayer_popup[player_id].html+'</div>' );
697
  }
698
  }
699
 
@@ -712,17 +759,14 @@ flowplayer(function (api,root) {
712
  });
713
  });
714
 
715
-
716
-
717
-
718
  /*
719
  * Popups form
720
  */
721
- jQuery(document).on('focus','.fv_player_popup input[type=text], .fv_player_popup textarea', function() {
722
  var api = jQuery(this).parents('.flowplayer').data('flowplayer');
723
  if( api ) api.disable(true);
724
  });
725
- jQuery(document).on('blur','.fv_player_popup input[type=text], .fv_player_popup textarea', function() {
726
  var api = jQuery(this).parents('.flowplayer').data('flowplayer');
727
  if( api ) api.disable(false);
728
  });
@@ -911,7 +955,10 @@ function fv_player_track( ga_id, event, engineType, name){
911
  function fv_player_track_name(root,video) {
912
  var name = root.attr("title");
913
  if( !name && typeof(video.fv_title) != "undefined" ) name = video.fv_title;
914
- if( !name && typeof(video.src) != "undefined" ) name = video.src.split("/").slice(-1)[0].replace(/\.(\w{3,4})(\?.*)?$/i, '');
 
 
 
915
  return name;
916
  }
917
 
@@ -1147,7 +1194,7 @@ if (typeof (flowplayer) !== "undefined" && typeof(fv_flowplayer_conf) != "undefi
1147
  flowplayer(function (api, root) {
1148
  if( jQuery(root).find('.sharing-link').length > 0 ) {
1149
  api.on('progress',function(e,api){
1150
- if( !api.video.sources ) {
1151
  return;
1152
  }
1153
 
@@ -1325,6 +1372,9 @@ flowplayer(function(player, root) {
1325
  * HLS.js fallback to Flowplayer Flash HLS
1326
  */
1327
  flowplayer(function(api, root) {
 
 
 
1328
  api.on("error", function (e, api, err) {
1329
  if( err.code != 4 || api.engine.engineName != 'hlsjs' ) return;
1330
 
@@ -1334,7 +1384,9 @@ flowplayer(function(api, root) {
1334
  jQuery(root).removeClass('is-error');
1335
  jQuery(flowplayer.engines).each( function(k,v) {
1336
  if( flowplayer.engines[k].engineName == 'hlsjs' ){
1337
- delete(flowplayer.engines[k]);
 
 
1338
  }
1339
  });
1340
 
@@ -1343,6 +1395,11 @@ flowplayer(function(api, root) {
1343
  video.index = index;
1344
 
1345
  api.load({ sources: video });
 
 
 
 
 
1346
  });
1347
  });
1348
 
@@ -1368,14 +1425,24 @@ flowplayer(function(api, root) {
1368
 
1369
 
1370
 
1371
- /*
1372
- * Chrome 55>= video download button fix
1373
- */
1374
  flowplayer(function(api, root) {
1375
- if( window.navigator.userAgent.match(/Chrome\/5[5-9]/) ) {
1376
- jQuery(root).addClass('chrome55fix');
1377
- }
 
 
 
 
 
 
 
 
 
1378
 
 
 
 
1379
  root = jQuery(root);
1380
  var image_src = root.css('background-image')
1381
  if( image_src ) {
@@ -1395,14 +1462,54 @@ flowplayer(function(api, root) {
1395
  }
1396
  });
1397
 
 
 
 
 
 
 
1398
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1399
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1400
 
1401
  /* *
1402
  * WARNINGS
1403
  */
1404
  if( typeof(flowplayer) != "undefined" ) { // stop lightbox from playing if it's closed
1405
- flowplayer(function (api,root) {
 
1406
 
1407
  // Subtitles which iPhone can't show
1408
  if( navigator.userAgent.match(/iPhone.* OS [0-6]_/i)){
@@ -1415,7 +1522,7 @@ if( typeof(flowplayer) != "undefined" ) { // stop lightbox from playing if it's
1415
 
1416
  // unstable Android
1417
  if( !navigator.userAgent.match(/Firefox/i) && navigator.userAgent.match(/Android ([123].[\d](.[\d])?|4.[321](.[\d])?).*((GT|SGH|SCH|SHV)-[a-z]\d{3}|samsung)/i)){
1418
- fv_player_warning(root,fv_flowplayer_translations.warning_unstable_android);
1419
  }
1420
 
1421
  // Vimeo misbehaving on Android 4.4
@@ -1426,7 +1533,7 @@ if( typeof(flowplayer) != "undefined" ) { // stop lightbox from playing if it's
1426
  fv_player_warning(root,fv_flowplayer_translations.warning_unstable_android,'firefox');
1427
 
1428
  api.on('progress', function(e,api) {
1429
- jQuery(root).prev().find('.fv-player-warning-firefox').remove();
1430
  });
1431
  }
1432
  }, 1500 );
@@ -1434,7 +1541,7 @@ if( typeof(flowplayer) != "undefined" ) { // stop lightbox from playing if it's
1434
 
1435
  api.on('error', function(e,api,error) { // works for Huawei Android 4.3
1436
  if( error.MEDIA_ERR_NETWORK == 2 && error.video.src.match(/fpdl.vimeocdn.com/) ) {
1437
- fv_player_warning(root,fv_flowplayer_translations.warning_unstable_android);
1438
  }
1439
  });
1440
  }
@@ -1459,58 +1566,92 @@ if( typeof(flowplayer) != "undefined" ) { // stop lightbox from playing if it's
1459
  wrapper = jQuery(root).prev('.fv-player-warning-wrapper');
1460
  }
1461
 
1462
- var latest = jQuery("<p style='display: none' "+(classname?" class='fv-player-warning-"+classname+"'" : "")+">"+warning+"</p>");
1463
- wrapper.append(latest);
1464
- latest.slideDown();
 
 
1465
  }
1466
  }
1467
 
1468
 
1469
  /*
1470
- * Subtitles .is-wide class
1471
  */
1472
  flowplayer(function(api, root) {
1473
  root = jQuery(root);
1474
- var checker = false;
1475
- api.on('ready resume',function(){
1476
- clearInterval(checker);
1477
- checker = setInterval(function(){
1478
- if(root.width() > 900){
1479
- jQuery('.fp-subtitle',root).addClass('is-wide');
1480
- }else{
1481
- jQuery('.fp-subtitle',root).removeClass('is-wide');
1482
- }
1483
- }, 100)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1484
  });
 
1485
  api.on('unload pause finish error',function(){
1486
- clearInterval(checker);
 
1487
  })
1488
  })
1489
 
1490
 
 
 
 
 
 
 
 
 
1491
 
1492
 
1493
  /*
1494
  * Audio support
1495
  */
1496
  flowplayer(function(api, root) {
 
1497
  var bean = flowplayer.bean;
1498
 
1499
- api.on('load',function(e,api,video) {
1500
- if( video.type.match(/audio\//) ) {
1501
- bean.off(root, "mouseenter");
1502
- bean.off(root, "mouseleave");
1503
- jQuery(root).addClass('is-mouseover');
1504
- jQuery(root).addClass('is-audio');
1505
-
1506
- jQuery('.fp-player',root).css('background-image', jQuery(root).css('background-image') );
1507
-
1508
- api.on('error', function (e,api, error) {
1509
- jQuery('.fp-message',root).html( jQuery('.fp-message',root).html().replace(/video/,'audio') );
1510
- });
1511
- }
1512
- });
1513
-
 
 
 
 
1514
  })
1515
 
1516
 
@@ -1543,7 +1684,7 @@ var fv_player_clipboard = function(text, successCallback, errorCallback) {
1543
  fv_player_doCopy(text);
1544
  successCallback();
1545
  } catch (e) {
1546
- if( typeof(errorCallback) != "undefined" )errorCallback(e);
1547
  }
1548
  };
1549
 
@@ -1684,7 +1825,7 @@ flowplayer.bean.on(document, "keydown.fp", function(e) {
1684
 
1685
  if( flowplayer.conf.mobile_force_fullscreen && ( 'ontouchstart' in window ) && !flowplayer.support.firstframe ) {
1686
  flowplayer(function(api, root) {
1687
- if( /iPad/.test(navigator.userAgent) ) {
1688
  api.bind('ready', function() {
1689
  api.fullscreen();
1690
  });
4
 
5
  */
6
  !function(e){function t(e,t,n,r){for(var i,a=n.slice(),l=o(t,e),s=0,u=a.length;u>s&&(handler=a[s],"object"==typeof handler&&"function"==typeof handler.handleEvent?handler.handleEvent(l):handler.call(e,l),!l.stoppedImmediatePropagation);s++);return i=!l.stoppedPropagation,r&&i&&e.parentNode?e.parentNode.dispatchEvent(l):!l.defaultPrevented}function n(e,t){return{configurable:!0,get:e,set:t}}function r(e,t,r){var o=y(t||e,r);g(e,"textContent",n(function(){return o.get.call(this)},function(e){o.set.call(this,e)}))}function o(e,t){return e.currentTarget=t,e.eventPhase=e.target===e.currentTarget?2:3,e}function i(e,t){for(var n=e.length;n--&&e[n]!==t;);return n}function a(){if("BR"===this.tagName)return"\n";for(var e=this.firstChild,t=[];e;)8!==e.nodeType&&7!==e.nodeType&&t.push(e.textContent),e=e.nextSibling;return t.join("")}function l(e){!f&&k.test(document.readyState)&&(f=!f,document.detachEvent(d,l),e=document.createEvent("Event"),e.initEvent(p,!0,!0),document.dispatchEvent(e))}function s(e){for(var t;t=this.lastChild;)this.removeChild(t);null!=e&&this.appendChild(document.createTextNode(e))}function u(t,n){return n||(n=e.event),n.target||(n.target=n.srcElement||n.fromElement||document),n.timeStamp||(n.timeStamp=(new Date).getTime()),n}if(!document.createEvent){var c=!0,f=!1,d="onreadystatechange",p="DOMContentLoaded",m="__IE8__"+Math.random(),v=e.Object,g=v.defineProperty||function(e,t,n){e[t]=n.value},h=v.defineProperties||function(t,n){for(var r in n)if(b.call(n,r))try{g(t,r,n[r])}catch(o){e.console&&console.log(r+" failed on object:",t,o.message)}},y=v.getOwnPropertyDescriptor,b=v.prototype.hasOwnProperty,w=e.Element.prototype,x=e.Text.prototype,E=/^[a-z]+$/,k=/loaded|complete/,T={},S=document.createElement("div");r(e.HTMLCommentElement.prototype,w,"nodeValue"),r(e.HTMLScriptElement.prototype,null,"text"),r(x,null,"nodeValue"),r(e.HTMLTitleElement.prototype,null,"text"),g(e.HTMLStyleElement.prototype,"textContent",function(e){return n(function(){return e.get.call(this.styleSheet)},function(t){e.set.call(this.styleSheet,t)})}(y(e.CSSStyleSheet.prototype,"cssText"))),h(w,{textContent:{get:a,set:s},firstElementChild:{get:function(){for(var e=this.childNodes||[],t=0,n=e.length;n>t;t++)if(1==e[t].nodeType)return e[t]}},lastElementChild:{get:function(){for(var e=this.childNodes||[],t=e.length;t--;)if(1==e[t].nodeType)return e[t]}},previousElementSibling:{get:function(){for(var e=this.previousSibling;e&&1!=e.nodeType;)e=e.previousSibling;return e}},nextElementSibling:{get:function(){for(var e=this.nextSibling;e&&1!=e.nodeType;)e=e.nextSibling;return e}},childElementCount:{get:function(){for(var e=0,t=this.childNodes||[],n=t.length;n--;e+=1==t[n].nodeType);return e}},addEventListener:{value:function(e,n,r){var o,a=this,l="on"+e,s=a[m]||g(a,m,{value:{}})[m],c=s[l]||(s[l]={}),f=c.h||(c.h=[]);if(!b.call(c,"w")){if(c.w=function(e){return e[m]||t(a,u(a,e),f,!1)},!b.call(T,l))if(E.test(e))try{o=document.createEventObject(),o[m]=!0,9!=a.nodeType&&null==a.parentNode&&S.appendChild(a),a.fireEvent(l,o),T[l]=!0}catch(o){for(T[l]=!1;S.hasChildNodes();)S.removeChild(S.firstChild)}else T[l]=!1;(c.n=T[l])&&a.attachEvent(l,c.w)}i(f,n)<0&&f[r?"unshift":"push"](n)}},dispatchEvent:{value:function(e){var n,r=this,o="on"+e.type,i=r[m],a=i&&i[o],l=!!a;return e.target||(e.target=r),l?a.n?r.fireEvent(o,e):t(r,e,a.h,!0):(n=r.parentNode)?n.dispatchEvent(e):!0,!e.defaultPrevented}},removeEventListener:{value:function(e,t,n){var r=this,o="on"+e,a=r[m],l=a&&a[o],s=l&&l.h,u=s?i(s,t):-1;u>-1&&s.splice(u,1)}}}),h(x,{addEventListener:{value:w.addEventListener},dispatchEvent:{value:w.dispatchEvent},removeEventListener:{value:w.removeEventListener}}),h(e.XMLHttpRequest.prototype,{addEventListener:{value:function(e,t,n){var r=this,o="on"+e,a=r[m]||g(r,m,{value:{}})[m],l=a[o]||(a[o]={}),s=l.h||(l.h=[]);i(s,t)<0&&(r[o]||(r[o]=function(){var t=document.createEvent("Event");t.initEvent(e,!0,!0),r.dispatchEvent(t)}),s[n?"unshift":"push"](t))}},dispatchEvent:{value:function(e){var n=this,r="on"+e.type,o=n[m],i=o&&o[r],a=!!i;return a&&(i.n?n.fireEvent(r,e):t(n,e,i.h,!0))}},removeEventListener:{value:w.removeEventListener}}),h(e.Event.prototype,{bubbles:{value:!0,writable:!0},cancelable:{value:!0,writable:!0},preventDefault:{value:function(){this.cancelable&&(this.defaultPrevented=!0,this.returnValue=!1)}},stopPropagation:{value:function(){this.stoppedPropagation=!0,this.cancelBubble=!0}},stopImmediatePropagation:{value:function(){this.stoppedImmediatePropagation=!0,this.stopPropagation()}},initEvent:{value:function(e,t,n){this.type=e,this.bubbles=!!t,this.cancelable=!!n,this.bubbles||this.stopPropagation()}}}),h(e.HTMLDocument.prototype,{textContent:{get:function(){return 11===this.nodeType?a.call(this):null},set:function(e){11===this.nodeType&&s.call(this,e)}},addEventListener:{value:function(t,n,r){var o=this;w.addEventListener.call(o,t,n,r),c&&t===p&&!k.test(o.readyState)&&(c=!1,o.attachEvent(d,l),e==top&&function i(e){try{o.documentElement.doScroll("left"),l()}catch(t){setTimeout(i,50)}}())}},dispatchEvent:{value:w.dispatchEvent},removeEventListener:{value:w.removeEventListener},createEvent:{value:function(e){var t;if("Event"!==e)throw new Error("unsupported "+e);return t=document.createEventObject(),t.timeStamp=(new Date).getTime(),t}}}),h(e.Window.prototype,{getComputedStyle:{value:function(){function e(e){this._=e}function t(){}var n=/^(?:[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|))(?!px)[a-z%]+$/,r=/^(top|right|bottom|left)$/,o=/\-([a-z])/g,i=function(e,t){return t.toUpperCase()};return e.prototype.getPropertyValue=function(e){var t,a,l,s=this._,u=s.style,c=s.currentStyle,f=s.runtimeStyle;return e=("float"===e?"style-float":e).replace(o,i),t=c?c[e]:u[e],n.test(t)&&!r.test(e)&&(a=u.left,l=f&&f.left,l&&(f.left=c.left),u.left="fontSize"===e?"1em":t,t=u.pixelLeft+"px",u.left=a,l&&(f.left=l)),null==t?t:t+""||"auto"},t.prototype.getPropertyValue=function(){return null},function(n,r){return r?new t(n):new e(n)}}()},addEventListener:{value:function(n,r,o){var a,l=e,s="on"+n;l[s]||(l[s]=function(e){return t(l,u(l,e),a,!1)}),a=l[s][m]||(l[s][m]=[]),i(a,r)<0&&a[o?"unshift":"push"](r)}},dispatchEvent:{value:function(t){var n=e["on"+t.type];return n?n.call(e,t)!==!1&&!t.defaultPrevented:!0}},removeEventListener:{value:function(t,n,r){var o="on"+t,a=(e[o]||v)[m],l=a?i(a,n):-1;l>-1&&a.splice(l,1)}}})}}(this),!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.flowplayer=e()}}(function(){var e;return function t(e,n,r){function o(a,l){if(!n[a]){if(!e[a]){var s="function"==typeof require&&require;if(!l&&s)return s(a,!0);if(i)return i(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return o(n?n:t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e,t,n){"use strict";var r=t.exports={},o=e("class-list"),i=window.jQuery,a=e("punycode"),l=e("computed-style");r.noop=function(){},r.identity=function(e){return e},r.removeNode=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},r.find=function(e,t){return i?i(e,t).toArray():(t=t||document,Array.prototype.map.call(t.querySelectorAll(e),function(e){return e}))},r.text=function(e,t){e["innerText"in e?"innerText":"textContent"]=t},r.findDirect=function(e,t){return r.find(e,t).filter(function(e){return e.parentNode===t})},r.hasClass=function(e,t){return o(e).contains(t)},r.isSameDomain=function(e){var t=window.location,n=r.createElement("a",{href:e});return t.hostname===n.hostname&&t.protocol===n.protocol&&t.port===n.port},r.css=function(e,t,n){return"object"==typeof t?Object.keys(t).forEach(function(n){r.css(e,n,t[n])}):"undefined"!=typeof n?""===n?e?e.style.removeProperty(t):void 0:e?e.style.setProperty(t,n):void 0:e?l(e,t):void 0},r.createElement=function(e,t,n){try{var o=document.createElement(e);for(var a in t)t.hasOwnProperty(a)&&("css"===a?r.css(o,t[a]):r.attr(o,a,t[a]));return o.innerHTML=n||"",o}catch(l){if(!i)throw l;return i("<"+e+">"+n+"</"+e+">").attr(t)[0]}},r.toggleClass=function(e,t,n){if(e){var r=o(e);"undefined"==typeof n?r.toggle(t):n?r.add(t):n||r.remove(t)}},r.addClass=function(e,t){return r.toggleClass(e,t,!0)},r.removeClass=function(e,t){return r.toggleClass(e,t,!1)},r.append=function(e,t){return e.appendChild(t),e},r.appendTo=function(e,t){return r.append(t,e),e},r.prepend=function(e,t){e.insertBefore(t,e.firstChild)},r.insertAfter=function(e,t,n){t==r.lastChild(e)&&e.appendChild(n);var o=Array.prototype.indexOf.call(e.children,t);e.insertBefore(n,e.children[o+1])},r.html=function(e,t){e=e.length?e:[e],e.forEach(function(e){e.innerHTML=t})},r.attr=function(e,t,n){if("class"===t&&(t="className"),r.hasOwnOrPrototypeProperty(e,t))try{e[t]=n}catch(o){if(!i)throw o;i(e).attr(t,n)}else n===!1?e.removeAttribute(t):e.setAttribute(t,n);return e},r.prop=function(e,t,n){return"undefined"==typeof n?e&&e[t]:void(e[t]=n)},r.offset=function(e){var t=e.getBoundingClientRect();return e.offsetWidth/e.offsetHeight>e.clientWidth/e.clientHeight&&(t={left:100*t.left,right:100*t.right,top:100*t.top,bottom:100*t.bottom,width:100*t.width,height:100*t.height}),t},r.width=function(e,t){if(t)return e.style.width=(""+t).replace(/px$/,"")+"px";var n=r.offset(e).width;return"undefined"==typeof n?e.offsetWidth:n},r.height=function(e,t){if(t)return e.style.height=(""+t).replace(/px$/,"")+"px";var n=r.offset(e).height;return"undefined"==typeof n?e.offsetHeight:n},r.lastChild=function(e){return e.children[e.children.length-1]},r.hasParent=function(e,t){for(var n=e.parentElement;n;){if(r.matches(n,t))return!0;n=n.parentElement}return!1},r.createAbsoluteUrl=function(e){return r.createElement("a",{href:e}).href},r.xhrGet=function(e,t,n){var r=new XMLHttpRequest;r.onreadystatechange=function(){return 4===this.readyState?this.status>=400?n():void t(this.responseText):void 0},r.open("get",e,!0),r.send()},r.pick=function(e,t){var n={};return t.forEach(function(t){e.hasOwnProperty(t)&&(n[t]=e[t])}),n},r.hostname=function(e){return a.toUnicode(e||window.location.hostname)},r.browser={webkit:"WebkitAppearance"in document.documentElement.style},r.getPrototype=function(e){return Object.getPrototypeOf?Object.getPrototypeOf(e):e.__proto__},r.hasOwnOrPrototypeProperty=function(e,t){for(var n=e;n;){if(Object.prototype.hasOwnProperty.call(n,t))return!0;n=r.getPrototype(n)}return!1},r.matches=function(e,t){var n=Element.prototype,r=n.matches||n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector||function(e){for(var t=this,n=(t.document||t.ownerDocument).querySelectorAll(e),r=0;n[r]&&n[r]!==t;)r++;return n[r]?!0:!1};return r.call(e,t)},function(e){function t(e){return e.replace(/-[a-z]/g,function(e){return e[1].toUpperCase()})}"undefined"!=typeof e.setAttribute&&(e.setProperty=function(e,n){return this.setAttribute(t(e),String(n))},e.getPropertyValue=function(e){return this.getAttribute(t(e))||null},e.removeProperty=function(e){var n=this.getPropertyValue(e);return this.removeAttribute(t(e)),n})}(window.CSSStyleDeclaration.prototype)},{"class-list":21,"computed-style":23,punycode:29}],2:[function(e,t,n){"use strict";var r=e("../common");t.exports=function(e,t,n,o){n=n||"opaque";var i="obj"+(""+Math.random()).slice(2,15),a='<object class="fp-engine" id="'+i+'" name="'+i+'" ',l=navigator.userAgent.indexOf("MSIE")>-1;a+=l?'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">':' data="'+e+'" type="application/x-shockwave-flash">';var s={width:"100%",height:"100%",allowscriptaccess:"always",wmode:n,quality:"high",flashvars:"",movie:e+(l?"?"+i:""),name:i};"transparent"!==n&&(s.bgcolor=o||"#333333"),Object.keys(t).forEach(function(e){s.flashvars+=e+"="+t[e]+"&"}),Object.keys(s).forEach(function(e){a+='<param name="'+e+'" value="'+s[e]+'"/>'}),a+="</object>";var u=r.createElement("div",{},a);return r.find("object",u)},window.attachEvent&&window.attachEvent("onbeforeunload",function(){window.__flash_savedUnloadHandler=window.__flash_unloadHandler=function(){}})},{"../common":1}],3:[function(e,t,n){"use strict";function r(e){return/^https?:/.test(e)}var o,i=e("../flowplayer"),a=e("../common"),l=e("./embed"),s=e("extend-object"),u=e("bean");o=function(e,t){function n(e){function t(e){return("0"+parseInt(e).toString(16)).slice(-2)}return(e=e.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))?"#"+t(e[1])+t(e[2])+t(e[3]):void 0}function c(e){if(7===e.length)return e;var t=e.split("").slice(1);return"#"+t.map(function(e){return e+e}).join("")}function f(e){return/application\/x-mpegurl/i.test(e.type)}var d,p,m,v=e.conf,g=(e.video,window,{engineName:o.engineName,pick:function(t){var n=s({},function(){if(i.support.flashVideo){for(var n,r,o=0;o<t.length;o++)if(r=t[o],/mp4|flv|flash/i.test(r.type)&&(n=r),e.conf.swfHls&&/mpegurl/i.test(r.type)&&(n=r),n&&!/mp4/i.test(n.type))return n;return n}}());if(n)return!n.src||r(n.src)||e.conf.rtmp||n.rtmp||(n.src=a.createAbsoluteUrl(n.src)),n},load:function(o){function h(e){return e.replace(/&amp;/g,"%26").replace(/&/g,"%26").replace(/=/g,"%3D").replace(/%2A/,'%252A').replace(/%2F/,'%252F')}d=o;var y=a.findDirect("video",t)[0]||a.find(".fp-player > video",t)[0],b=o.src,w=r(b),x=function(){a.removeNode(y)},E=function(e){return e.some(function(e){return!!y.canPlayType(e.type)})};i.support.video&&a.prop(y,"autoplay")&&E(o.sources)?u.one(y,"timeupdate",x):x();var k=o.rtmp||v.rtmp;if(w||k||(b=a.createAbsoluteUrl(b)),m&&f(o)&&m.data!==v.swfHls&&g.unload(),m){["live","preload","loop"].forEach(function(e){o.hasOwnProperty(e)&&m.__set(e,o[e])}),Object.keys(o.flashls||{}).forEach(function(e){m.__set("hls_"+e,o.flashls[e])});var T=!1;if(!w&&k)m.__set("rtmp",k.url||k);else{var S=m.__get("rtmp");T=!!S,m.__set("rtmp",null)}m.__play(b,T||o.rtmp&&o.rtmp!==v.rtmp)}else{p="fpCallback"+(""+Math.random()).slice(3,15),b=h(b);var N={hostname:v.embedded?a.hostname(v.hostname):a.hostname(location.hostname),url:b,callback:p};t.getAttribute("data-origin")&&(N.origin=t.getAttribute("data-origin")),["proxy","key","autoplay","preload","subscribe","live","loop","debug","splash","poster","rtmpt"].forEach(function(e){v.hasOwnProperty(e)&&(N[e]=v[e]),o.hasOwnProperty(e)&&(N[e]=o[e]),(v.rtmp||{}).hasOwnProperty(e)&&(N[e]=(v.rtmp||{})[e]),(o.rtmp||{}).hasOwnProperty(e)&&(N[e]=(o.rtmp||{})[e])}),v.rtmp&&(N.rtmp=v.rtmp.url||v.rtmp),o.rtmp&&(N.rtmp=o.rtmp.url||o.rtmp),Object.keys(o.flashls||{}).forEach(function(e){var t=o.flashls[e];N["hls_"+e]=t}),void 0!==v.bufferTime&&(N.bufferTime=v.bufferTime),w&&delete N.rtmp,N.rtmp&&(N.rtmp=h(N.rtmp));var C,j=v.bgcolor||a.css(t,"background-color")||"";0===j.indexOf("rgb")?C=n(j):0===j.indexOf("#")&&(C=c(j)),N.initialVolume=e.volumeLevel;var O=f(o)?v.swfHls:v.swf;m=l(O,N,v.wmode,C)[0];var P=a.find(".fp-player",t)[0];a.prepend(P,m),setTimeout(function(){try{if(!m.PercentLoaded())return e.trigger("error",[e,{code:7,url:v.swf}])}catch(t){}},5e3),setTimeout(function(){"undefined"==typeof m.PercentLoaded&&e.trigger("flashdisabled",[e])},1e3),e.off("resume.flashhack").on("resume.flashhack",function(){var t=setTimeout(function(){e.playing&&e.trigger("flashdisabled",[e])},1e3);e.one("progress",function(){clearTimeout(t)})}),m.pollInterval=setInterval(function(){if(m){var t=m.__status?m.__status():null;t&&(e.playing&&t.time&&t.time!==e.video.time&&e.trigger("progress",[e,t.time]),o.buffer=t.buffer/o.bytes*o.duration,e.trigger("buffer",[e,o.buffer]),!o.buffered&&t.time>0&&(o.buffered=!0,e.trigger("buffered",[e])))}},250),window[p]=function(n,r){var o=d;v.debug&&(0===n.indexOf("debug")&&r&&r.length?console.log.apply(console,["-- "+n].concat(r)):console.log("--",n,r));var i={type:n};switch(n){case"ready":r=s(o,r);break;case"click":i.flash=!0;break;case"keydown":i.which=r;break;case"seek":o.time=r;break;case"status":e.trigger("progress",[e,r.time]),r.buffer<o.bytes&&!o.buffered?(o.buffer=r.buffer/o.bytes*o.duration,e.trigger("buffer",o.buffer)):o.buffered||(o.buffered=!0,e.trigger("buffered"))}"click"===n||"keydown"===n?(i.target=t,u.fire(t,n,[i])):"buffered"!=n&&"unload"!==n?setTimeout(function(){e.trigger(i,[e,r])},1):"unload"===n&&e.trigger(i,[e,r])}}},speed:a.noop,unload:function(){m&&m.__unload&&m.__unload();try{p&&window[p]&&delete window[p]}catch(n){}a.find("object",t).forEach(a.removeNode),m=0,e.off(".flashengine"),clearInterval(m.pollInterval)}});return["pause","resume","seek","volume"].forEach(function(t){g[t]=function(n){try{e.ready&&(void 0===n?m["__"+t]():m["__"+t](n))}catch(r){if("undefined"==typeof m["__"+t])return e.trigger("flashdisabled",[e]);throw r}}}),g},o.engineName="flash",o.canPlay=function(e,t){return i.support.flashVideo&&/video\/(mp4|flash|flv)/i.test(e)||i.support.flashVideo&&t.swfHls&&/mpegurl/i.test(e)},i.engines.push(o)},{"../common":1,"../flowplayer":18,"./embed":2,bean:20,"extend-object":25}],4:[function(e,t,n){"use strict";function r(e,t){return t=t||100,Math.round(e*t)/t}function o(e){return/mpegurl/i.test(e)?"application/x-mpegurl":e}function i(e){return/^(video|application)/i.test(e)||(e=o(e)),!!m.canPlayType(e).replace("no","")}function a(e,t){var n=e.filter(function(e){return e.type===t});return n.length?n[0]:null}var l,s,u=e("../flowplayer"),c=e("bean"),f=e("class-list"),d=e("extend-object"),p=e("../common"),m=document.createElement("video"),v={ended:"finish",pause:"pause",play:"resume",progress:"buffer",timeupdate:"progress",volumechange:"volume",ratechange:"speed",seeked:"seek",loadeddata:"ready",error:"error",dataunavailable:"error",webkitendfullscreen:!/iPhone OS 10/.test(navigator.userAgent) && !u.support.inlineVideo&&"unload"},g=function(e,t,n,r){if("undefined"==typeof t&&(t=!0),"undefined"==typeof n&&(n="none"),"undefined"==typeof r&&(r=!0),r&&l)return l.type=o(e.type),l.src=e.src,p.find("track",l).forEach(p.removeNode),l.removeAttribute("crossorigin"),l;var i=document.createElement("video");return i.src=e.src,i.type=o(e.type),i.className="fp-engine",i.autoplay=t?"autoplay":!1,i.preload=n,i.setAttribute("x-webkit-airplay","allow"),r&&(l=i),i};s=function(e,t){function n(n,o,a){var l=t.getAttribute("data-flowplayer-instance-id");if(n.listeners&&n.listeners.hasOwnProperty(l))return void(n.listeners[l]=a);(n.listeners||(n.listeners={}))[l]=a,c.on(o,"error",function(t){try{i(t.target.getAttribute("type"))&&e.trigger("error",[e,{code:4,video:d(a,{src:n.src,url:n.src})}])}catch(r){}}),e.on("shutdown",function(){c.off(o)});var s={};return Object.keys(v).forEach(function(o){var i=v[o];if(i){var u=function(s){if(a=n.listeners[l],s.target&&f(s.target).contains("fp-engine")&&(w.debug&&!/progress/.test(i)&&console.log(o,"->",i,s),(e.ready||/ready|error/.test(i))&&i&&p.find("video",t).length)){var u;if("unload"===i)return void e.unload();var c=function(){e.trigger(i,[e,u])};switch(i){case"ready":u=d(a,{duration:n.duration,width:n.videoWidth,height:n.videoHeight,url:n.currentSrc,src:n.currentSrc});try{u.seekable=!e.live&&/mpegurl/i.test(a?a.type||"":"")&&n.duration||n.seekable&&n.seekable.end(null)}catch(v){}if(m=m||setInterval(function(){try{u.buffer=n.buffered.end(null)}catch(t){}u.buffer&&(r(u.buffer,1e3)<r(u.duration,1e3)&&!u.buffered?e.trigger("buffer",s):u.buffered||(u.buffered=!0,e.trigger("buffer",s).trigger("buffered",s),clearInterval(m),m=0))},250),!e.live&&!u.duration&&!b.hlsDuration&&"loadeddata"===o){var g=function(){u.duration=n.duration;try{u.seekable=n.seekable&&n.seekable.end(null)}catch(e){}c(),n.removeEventListener("durationchange",g),f(t).remove("is-live")};n.addEventListener("durationchange",g);var h=function(){e.ready||n.duration||(u.duration=0,f(t).add("is-live"),c()),n.removeEventListener("timeupdate",h)};return void n.addEventListener("timeupdate",h)}break;case"progress":case"seek":e.video.duration;if(n.currentTime>0||e.live)u=Math.max(n.currentTime,0);else if("progress"==i)return;break;case"speed":u=r(n.playbackRate);break;case"volume":u=r(n.volume);break;case"error":try{u=(s.srcElement||s.originalTarget).error,u.video=d(a,{src:n.src,url:n.src})}catch(y){return}}c()}};t.addEventListener(o,u,!0),s[o]||(s[o]=[]),s[o].push(u)}}),s}var o,m,h,y=p.findDirect("video",t)[0]||p.find(".fp-player > video",t)[0],b=u.support,w=(p.find("track",y)[0],e.conf);return o={engineName:s.engineName,pick:function(e){var t=function(){if(b.video){if(w.videoTypePreference){var t=a(e,w.videoTypePreference);if(t)return t}for(var n=0;n<e.length;n++)if(i(e[n].type))return e[n]}}();if(t)return"string"==typeof t.src&&(t.src=p.createAbsoluteUrl(t.src)),t},load:function(r){var i=!1,a=p.find(".fp-player",t)[0],l=!1;w.splash&&!y?(y=g(r),p.prepend(a,y),i=!0):y?(f(y).add("fp-engine"),p.find("source,track",y).forEach(p.removeNode),e.conf.nativesubtitles||p.attr(y,"crossorigin",!1),l=y.src===r.src):(y=g(r,!!r.autoplay||!!w.autoplay,w.clip.preload||"metadata",!1),p.prepend(a,y),i=!0),b.inlineVideo||p.css(y,{position:"absolute",top:"-9999em"}),c.off(y,"timeupdate",p.noop),c.on(y,"timeupdate",p.noop),p.prop(y,"loop",!(!r.loop&&!w.loop)),"undefined"!=typeof h&&(y.volume=h),(e.video.src&&r.src!=e.video.src||r.index)&&p.attr(y,"autoplay","autoplay"),y.src=r.src,y.type=r.type,o._listeners=n(y,p.find("source",y).concat(y),r),("none"!=w.clip.preload&&"mpegurl"!=r.type||!b.zeropreload||!b.dataload)&&y.load(),(i||l)&&y.load(),y.paused&&(r.autoplay||w.autoplay)&&y.play()},pause:function(){y.pause()},resume:function(){y.play()},speed:function(e){y.playbackRate=e},seek:function(t){try{var n=e.paused;y.currentTime=t,n&&y.pause()}catch(r){}},volume:function(e){h=e,y&&(y.volume=e)},unload:function(){p.find("video.fp-engine",t).forEach(p.removeNode),b.cachedVideoTag||(l=null),m=clearInterval(m);var e=t.getAttribute("data-flowplayer-instance-id");delete y.listeners[e],y=0,o._listeners&&Object.keys(o._listeners).forEach(function(e){o._listeners[e].forEach(function(n){t.removeEventListener(e,n,!0)})})}}},s.canPlay=function(e){return u.support.video&&i(e)},s.engineName="html5",u.engines.push(s)},{"../common":1,"../flowplayer":18,bean:20,"class-list":21,"extend-object":25}],5:[function(e,t,n){"use strict";var r=e("../flowplayer"),o=e("./resolve").TYPE_RE,i=e("scriptjs"),a=e("bean");r(function(e,t){var n,r=e.conf.analytics,l=0,s=0;if(r){"undefined"==typeof _gat&&i("//google-analytics.com/ga.js");var u=function(){var e=_gat._getTracker(r); if( typeof e._setAllowLinker == 'undefined' ) return false; return e._setAllowLinker(!0),e},c=function(r,i,a){if(a=a||e.video,l&&"undefined"!=typeof _gat){var s=u(); if(!s) return; s._trackEvent("Video / Seconds played",e.engine.engineName+"/"+a.type,a.title||t.getAttribute("title")||a.src.split("/").slice(-1)[0].replace(o,""),Math.round(l/1e3)),l=0,n&&(clearTimeout(n),n=null)}};e.bind("load unload",c).bind("progress",function(){e.seeking||(l+=s?+new Date-s:0,s=+new Date),n||(n=setTimeout(function(){n=null;var e=u();e._trackEvent("Flowplayer heartbeat","Heartbeat","",0,!0)},6e5))}).bind("pause",function(){s=0}),e.bind("shutdown",function(){a.off(window,"unload",c)}),a.on(window,"unload",c)}})},{"../flowplayer":18,"./resolve":13,bean:20,scriptjs:28}],6:[function(e,t,n){"use strict";var r=e("../flowplayer"),o=e("class-list"),i=e("../common"),a=e("bean");r(function(e,t){function n(e){t.className=t.className.replace(l," "),e>=0&&o(t).add("cue"+e)}function r(t){var n=t&&!isNaN(t.time)?t.time:t;return 0>n&&(n=e.video.duration+n),.125*Math.round(n/.125)}var l=/ ?cue\d+ ?/,s=!1,u={},c=-.125,f=function(t){var r=e.cuepoints.indexOf(t);isNaN(t)||(t={time:t}),t.index=r,n(r),e.trigger("cuepoint",[e,t])};e.on("progress",function(e,t,n){if(!s)for(var o=r(n);o>c;)c+=.125,u[c]&&u[c].forEach(f)}).on("unload",n).on("beforeseek",function(e){setTimeout(function(){e.defaultPrevented||(s=!0)})}).on("seek",function(e,t,o){n(),c=r(o||0)-.125,s=!1,!o&&u[0]&&u[0].forEach(f)}).on("ready",function(t,n,r){c=-.125;var o=r.cuepoints||e.conf.cuepoints||[];e.setCuepoints(o)}).on("finish",function(){c=-.125}),e.conf.generate_cuepoints&&e.bind("load",function(){i.find(".fp-cuepoint",t).forEach(i.removeNode)}),e.setCuepoints=function(t){return e.cuepoints=[],u={},t.forEach(e.addCuepoint),e},e.addCuepoint=function(n){e.cuepoints||(e.cuepoints=[]);var o=r(n);if(u[o]||(u[o]=[]),u[o].push(n),e.cuepoints.push(n),e.conf.generate_cuepoints&&n.visible!==!1){var l=e.video.duration,s=i.find(".fp-timeline",t)[0];i.css(s,"overflow","visible");var c=n.time||n;0>c&&(c=l+c);var f=i.createElement("a",{className:"fp-cuepoint fp-cuepoint"+(e.cuepoints.length-1)});i.css(f,"left",c/l*100+"%"),s.appendChild(f),a.on(f,"mousedown",function(t){t.preventDefault(),t.stopPropagation(),e.seek(c)})}return e},e.removeCuepoint=function(t){var n=e.cuepoints.indexOf(t),o=r(t);if(-1!==n){e.cuepoints=e.cuepoints.slice(0,n).concat(e.cuepoints.slice(n+1));var i=u[o].indexOf(t);if(-1!==i)return u[o]=u[o].slice(0,i).concat(u[o].slice(i+1)),e}}})},{"../common":1,"../flowplayer":18,bean:20,"class-list":21}],7:[function(e,t,n){"use strict";var r=e("../flowplayer"),o=e("bean"),i=e("../common"),a=(e("is-object"),e("extend-object")),l=e("class-list");r(function(e,t){if(e.conf.embed!==!1){var n=(e.conf,i.find(".fp-ui",t)[0]),r=i.createElement("a",{"class":"fp-embed",title:"Copy to your site"}),l=i.createElement("div",{"class":"fp-embed-code"},"<label>Copy and paste this HTML code into your webpage to embed.</label><textarea></textarea>"),u=i.find("textarea",l)[0];n.appendChild(r),n.appendChild(l),e.embedCode=function(){var n=e.conf.embed||{},r=e.video;if(n.iframe){var o=(e.conf.embed.iframe,n.width||r.width||i.width(t)),l=n.height||r.height||i.height(t);return'<iframe src="'+e.conf.embed.iframe+'" allowfullscreen style="width:'+o+";height:"+l+';border:none;"></iframe>'}var s=["ratio","rtmp","live","bufferTime","origin","analytics","key","subscribe","swf","swfHls","embed","adaptiveRatio","logo"];n.playlist&&s.push("playlist");var u=i.pick(e.conf,s);u.logo&&(u.logo=i.createElement("img",{src:u.logo}).src),n.playlist&&e.conf.playlist.length||(u.clip=a({},e.conf.clip,i.pick(e.video,["sources"])));var c='var w=window,d=document,e;w._fpes||(w._fpes=[],w.addEventListener("load",function(){var s=d.createElement("script");s.src="//foliovision.com/flowplayer/6.0.5/embed.min.js",d.body.appendChild(s)})),e=[].slice.call(d.getElementsByTagName("script"),-1)[0].parentNode,w._fpes.push({e:e,l:"$library",c:$conf});\n'.replace("$conf",JSON.stringify(u)).replace("$library",n.library||"");return'<a href="$href">Watch video!\n<script>$script</script></a>'.replace("$href",e.conf.origin||window.location.href).replace("$script",c)},s(t,".fp-embed","is-embedding"),o.on(t,"click",".fp-embed-code textarea",function(){u.select()}),o.on(t,"click",".fp-embed",function(){u.textContent=e.embedCode().replace(/(\r\n|\n|\r)/gm,""),u.focus(),u.select()})}});var s=function(e,t,n){function r(){a.remove(n),o.off(document,".st")}var a=l(e);o.on(e,"click",t||"a",function(e){e.preventDefault(),a.toggle(n),a.contains(n)&&(o.on(document,"keydown.st",function(e){27==e.which&&r()}),o.on(document,"click.st",function(e){i.hasParent(e.target,"."+n)||r()}))})}},{"../common":1,"../flowplayer":18,bean:20,"class-list":21,"extend-object":25,"is-object":27}],8:[function(e,t,n){"use strict";t.exports=function(e,t){t||(t=document.createElement("div"));var n={},r={},o=function(e,o,i){var a=e.split(".")[0],l=function(s){i&&(t.removeEventListener(a,l),n[e].splice(n[e].indexOf(l),1));var u=[s].concat(r[s.timeStamp+s.type]||[]);o&&o.apply(void 0,u)};t.addEventListener(a,l),n[e]||(n[e]=[]),n[e].push(l)};e.on=e.bind=function(t,n){var r=t.split(" ");return r.forEach(function(e){o(e,n)}),e},e.one=function(t,n){var r=t.split(" ");return r.forEach(function(e){o(e,n,!0)}),e};var i=function(e,t){return 0===t.filter(function(t){return-1===e.indexOf(t)}).length};e.off=e.unbind=function(r){var o=r.split(" ");return o.forEach(function(e){var r=e.split(".").slice(1),o=e.split(".")[0];Object.keys(n).filter(function(e){var t=e.split(".").slice(1);return(!o||0===e.indexOf(o))&&i(t,r)}).forEach(function(e){var r=n[e],o=e.split(".")[0];r.forEach(function(e){t.removeEventListener(o,e),r.splice(r.indexOf(e),1)})})}),e},e.trigger=function(n,o,i){if(n){o=(o||[]).length?o||[]:[o];var a,l=document.createEvent("Event");return a=n.type||n,l.initEvent(a,!1,!0),Object.defineProperty&&(l.preventDefault=function(){Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}),r[l.timeStamp+l.type]=o,t.dispatchEvent(l),i?l:e}}},t.exports.EVENTS=["beforeseek","disable","error","finish","fullscreen","fullscreen-exit","load","mute","pause","progress","ready","resume","seek","speed","stop","unload","volume","boot","shutdown"]},{}],9:[function(e,t,n){"use strict";var r,o=e("../flowplayer"),i=e("bean"),a=e("class-list"),l=(e("extend-object"),e("../common")),s=(o.support.browser.mozilla?"moz":"webkit","fullscreen"),u="fullscreen-exit",c=o.support.fullscreen,f=("function"==typeof document.exitFullscreen,navigator.userAgent.toLowerCase()),d=/(safari)[ \/]([\w.]+)/.exec(f)&&!/(chrome)[ \/]([\w.]+)/.exec(f);i.on(document,"fullscreenchange.ffscr webkitfullscreenchange.ffscr mozfullscreenchange.ffscr MSFullscreenChange.ffscr",function(e){var t=document.webkitCurrentFullScreenElement||document.mozFullScreenElement||document.fullscreenElement||document.msFullscreenElement||e.target;if(r||t.parentNode&&t.parentNode.getAttribute("data-flowplayer-instance-id")){var n=r||o(t.parentNode);t&&!r?r=n.trigger(s,[t]):(r.trigger(u,[r]),r=null)}}),o(function(e,t){var n=l.createElement("div",{className:"fp-player"});if(Array.prototype.map.call(t.children,l.identity).forEach(function(e){l.matches(e,".fp-ratio,script")||n.appendChild(e)}),t.appendChild(n),e.conf.fullscreen){var o,i,f=window,p=a(t);e.isFullscreen=!1,e.fullscreen=function(t){return e.disabled?void 0:(void 0===t&&(t=!e.isFullscreen),t&&(o=f.scrollY,i=f.scrollX),c?t?["requestFullScreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullscreen"].forEach(function(e){return"function"==typeof n[e]?(n[e](Element.ALLOW_KEYBOARD_INPUT),!d||document.webkitCurrentFullScreenElement||document.mozFullScreenElement||n[e](),!1):void 0}):["exitFullscreen","webkitCancelFullScreen","mozCancelFullScreen","msExitFullscreen"].forEach(function(e){return"function"==typeof document[e]?(document[e](),!1):void 0}):e.trigger(t?s:u,[e]),e)};var m;e.on("mousedown.fs",function(){+new Date-m<150&&e.ready&&e.fullscreen(),m=+new Date}),e.on(s,function(n){p.add("is-fullscreen"),c||l.css(t,"position","fixed"),e.isFullscreen=!0}).on(u,function(n){var r;c||"html5"!==e.engine||(r=t.css("opacity")||"",l.css(t,"opacity",0)),c||l.css(t,"position",""),p.remove("is-fullscreen"),c||"html5"!==e.engine||setTimeout(function(){t.css("opacity",r)}),e.isFullscreen=!1,f.scrollTo(i,o)}).on("unload",function(){e.isFullscreen&&e.fullscreen()}),e.on("shutdown",function(){r=null})}})},{"../common":1,"../flowplayer":18,bean:20,"class-list":21,"extend-object":25}],10:[function(e,t,n){"use strict";var r,o,i=e("../flowplayer"),a=e("bean"),l="is-help",s=e("../common"),u=e("class-list");a.on(document,"keydown.fp",function(e){var t=r,n=e.ctrlKey||e.metaKey||e.altKey,i=e.which,a=t&&t.conf,s=o&&u(o);if(t&&a.keyboard&&!t.disabled){if(-1!=[63,187,191].indexOf(i))return s.toggle(l),!1;if(27==i&&s.contains(l))return s.toggle(l),!1;if(!n&&t.ready){if(e.preventDefault(),e.shiftKey)return void(39==i?t.speed(!0):37==i&&t.speed(!1));if(58>i&&i>47)return t.seekTo(i-48);switch(i){case 38:case 75:t.volume(t.volumeLevel+.15);break;case 40:case 74:t.volume(t.volumeLevel-.15);break;case 39:case 76:t.seeking=!0,t.seek(!0);break;case 37:case 72:t.seeking=!0,t.seek(!1);break;case 190:t.seekTo();break;case 32:t.toggle();break;case 70:a.fullscreen&&t.fullscreen();break;case 77:t.mute();break;case 81:t.unload()}}}}),i(function(e,t){if(e.conf.keyboard){a.on(t,"mouseenter mouseleave",function(n){r=e.disabled||"mouseover"!=n.type?0:e,r&&(o=t)});var n=i.support.video&&"flash"!==e.conf.engine&&document.createElement("video").playbackRate?"<p><em>shift</em> + <em>&#8592;</em><em>&#8594;</em>slower / faster</p>":"";if(t.appendChild(s.createElement("div",{
7
+ className:"fp-help"},' <a class="fp-close"></a> <div class="fp-help-section fp-help-basics"> <p><em>space</em>play / pause</p> <p><em>q</em>unload | stop</p> <p><em>f</em>fullscreen</p>'+n+' </div> <div class="fp-help-section"> <p><em>&#8593;</em><em>&#8595;</em>volume</p> <p><em>m</em>mute</p> </div> <div class="fp-help-section"> <p><em>&#8592;</em><em>&#8594;</em>seek</p> <p><em>&nbsp;. </em>seek to previous </p><p><em>1</em><em>2</em>&hellip; <em>6</em> seek to 10%, 20% &hellip; 60% </p> </div> ')),e.conf.tooltip){var c=s.find(".fp-ui",t)[0];c.setAttribute("title","Hit ? for help"),a.one(t,"mouseout.tip",".fp-ui",function(){c.removeAttribute("title")})}a.on(t,"click",".fp-close",function(){u(t).toggle(l)}),e.bind("shutdown",function(){o==t&&(o=null)})}})},{"../common":1,"../flowplayer":18,bean:20,"class-list":21}],11:[function(e,t,n){"use strict";var r=e("../flowplayer"),o=/IEMobile/.test(window.navigator.userAgent),i=e("class-list"),a=e("../common"),l=e("bean"),s=e("./ui").format,u=window.navigator.userAgent;(r.support.touch||o)&&r(function(e,t){var n=/Android/.test(u)&&!/Firefox/.test(u)&&!/Opera/.test(u),c=/Silk/.test(u),f=n?parseFloat(/Android\ (\d\.\d)/.exec(u)[1],10):0,d=i(t);if(n&&!o){if(!/Chrome/.test(u)&&4>f){var p=e.load;e.load=function(t,n){var r=p.apply(e,arguments);return e.trigger("ready",[e,e.video]),r}}var m,v=0,g=function(e){m=setInterval(function(){e.video.time=++v,e.trigger("progress",[e,v])},1e3)};e.bind("ready pause unload",function(){m&&(clearInterval(m),m=null)}),e.bind("ready",function(){v=0}),e.bind("resume",function(t,n){return n.live?v?g(n):void e.one("progress",function(e,t,n){0===n&&g(t)}):void 0})}r.support.volume||(d.add("no-volume"),d.add("no-mute")),d.add("is-touch"),e.sliders&&e.sliders.timeline&&e.sliders.timeline.disableAnimation(),(!r.support.inlineVideo||e.conf.native_fullscreen)&&(e.conf.nativesubtitles=!0);var h=!1;l.on(t,"touchmove",function(){h=!0}),l.on(t,"touchend click",function(t){return h?void(h=!1):e.playing&&!d.contains("is-mouseover")?(d.add("is-mouseover"),d.remove("is-mouseout"),t.preventDefault(),void t.stopPropagation()):void(e.playing||e.splash||!d.contains("is-mouseout")||d.contains("is-mouseover")||setTimeout(function(){e.playing||e.splash||e.resume()},400))}),e.conf.native_fullscreen&&"function"==typeof document.createElement("video").webkitEnterFullScreen&&(e.fullscreen=function(){var e=a.find("video.fp-engine",t)[0];e.webkitEnterFullScreen(),l.one(e,"webkitendfullscreen",function(){a.prop(e,"controls",!0),a.prop(e,"controls",!1)})}),(n||c)&&e.bind("ready",function(){var n=a.find("video.fp-engine",t)[0];l.one(n,"canplay",function(){n.play()}),n.play(),e.bind("progress.dur",function(){var r=n.duration;1!==r&&(e.video.duration=r,a.find(".fp-duration",t)[0].innerHTML=s(r),e.unbind("progress.dur"))})})})},{"../common":1,"../flowplayer":18,"./ui":17,bean:20,"class-list":21}],12:[function(e,t,n){"use strict";var r=e("../flowplayer"),o=e("extend-object"),i=e("bean"),a=e("class-list"),l=e("../common"),s=e("./resolve"),u=new s,c=window.jQuery,f=/^#/;r(function(e,t){function n(){return l.find(v.query,r())}function r(){return f.test(v.query)?void 0:t}function d(){return l.find(v.query+"."+g,r())}function p(){var n=l.find(".fp-playlist",t)[0];if(!n){n=l.createElement("div",{className:"fp-playlist"});var r=l.find(".fp-next,.fp-prev",t);r.length?r[0].parentElement.insertBefore(n,r[0]):l.insertAfter(t,l.find("video",t)[0],n)}n.innerHTML="",e.conf.playlist[0].length&&(e.conf.playlist=e.conf.playlist.map(function(e){if("string"==typeof e){var t=e.split(s.TYPE_RE)[1];return{sources:[{type:"m3u8"===t.toLowerCase()?"application/x-mpegurl":"video/"+t,src:e}]}}return{sources:e.map(function(e){var t={};return Object.keys(e).forEach(function(n){t.type=/mpegurl/i.test(n)?"application/x-mpegurl":"video/"+n,t.src=e[n]}),t})}})),e.conf.playlist.forEach(function(e,t){var r=e.sources[0].src;n.appendChild(l.createElement("a",{href:r,"data-index":t}))})}function m(t){return"undefined"!=typeof t.index?t.index:"undefined"!=typeof e.video.index?e.video.index:e.conf.startIndex||0}var v=o({active:"is-active",advance:!0,query:".fp-playlist a"},e.conf),g=v.active,h=a(t);e.play=function(t){if(void 0===t)return e.resume();if("number"==typeof t&&!e.conf.playlist[t])return e;if("number"!=typeof t)return e.load.apply(null,arguments);var n=o({index:t},e.conf.playlist[t]);return t===e.video.index?e.load(n,function(){e.resume()}):(e.off("resume.fromfirst"),e.load(n,function(){e.video.index=t}),e)},e.next=function(t){t&&t.preventDefault();var n=e.video.index;return-1!=n&&(n=n===e.conf.playlist.length-1?0:n+1,e.play(n)),e},e.prev=function(t){t&&t.preventDefault();var n=e.video.index;return-1!=n&&(n=0===n?e.conf.playlist.length-1:n-1,e.play(n)),e},e.setPlaylist=function(t){return e.conf.playlist=t,delete e.video.index,p(),e},e.addPlaylistItem=function(t){return e.setPlaylist(e.conf.playlist.concat([t]))},e.removePlaylistItem=function(t){var n=e.conf.playlist;return e.setPlaylist(n.slice(0,t).concat(n.slice(t+1)))},i.on(t,"click",".fp-next",e.next),i.on(t,"click",".fp-prev",e.prev),v.advance&&e.off("finish.pl").on("finish.pl",function(e,t){if(t.video.loop)return t.seek(0,function(){t.resume()});var n=t.video.index>=0?t.video.index+1:void 0;n<t.conf.playlist.length||v.loop?(n=n===t.conf.playlist.length?0:n,h.remove("is-finished"),setTimeout(function(){t.play(n)})):t.conf.playlist.length>1&&t.one("resume.fromfirst",function(){return t.play(0),!1})});var y=!1;e.conf.playlist.length&&(y=!0,p(),e.conf.clip&&e.conf.clip.sources.length||(e.conf.clip=e.conf.playlist[e.conf.startIndex||0])),n().length&&!y&&(e.conf.playlist=[],delete e.conf.startIndex,n().forEach(function(t){var n=t.href;t.setAttribute("data-index",e.conf.playlist.length);var r=u.resolve(n,e.conf.clip.sources);c&&o(r,c(t).data()),e.conf.playlist.push(r)})),i.on(f.test(v.query)?document:t,"click",v.query,function(t){t.preventDefault();var n=t.currentTarget,r=Number(n.getAttribute("data-index"));-1!=r&&e.play(r)}),e.on("load",function(n,o,i){if(e.conf.playlist.length){var s=d()[0],u=s&&s.getAttribute("data-index"),c=i.index=m(i),f=l.find(v.query+'[data-index="'+c+'"]',r())[0],p=c==e.conf.playlist.length-1;s&&a(s).remove(g),f&&a(f).add(g),h.remove("video"+u),h.add("video"+c),l.toggleClass(t,"last-video",p),i.index=o.video.index=c,i.is_last=o.video.is_last=p}}).on("unload.pl",function(){e.conf.playlist.length&&(d().forEach(function(e){a(e).toggle(g)}),e.conf.playlist.forEach(function(e,t){h.remove("video"+t)}))}),e.conf.playlist.length&&(e.conf.loop=!1)})},{"../common":1,"../flowplayer":18,"./resolve":13,bean:20,"class-list":21,"extend-object":25}],13:[function(e,t,n){"use strict";function r(e){var t=e.attr("src"),n=e.attr("type")||"",r=t.split(i)[1];return n=n.toLowerCase(),a(e.data(),{src:t,suffix:r||n,type:n||r})}function o(e){return/mpegurl/i.test(e)?"application/x-mpegurl":"video/"+e}var i=/\.(\w{3,4})(\?.*)?$/i,a=e("extend-object");t.exports=function(){var e=this;e.sourcesFromVideoTag=function(e,t){var n=[];return t("source",e).each(function(){n.push(r(t(this)))}),!n.length&&e.length&&n.push(r(e)),n},e.resolve=function(e,t){return e?("string"==typeof e&&(e={src:e,sources:[]},e.sources=(t||[]).map(function(t){var n=t.src.split(i)[1];return{type:t.type,src:e.src.replace(i,"."+n+"$2")}})),e instanceof Array&&(e={sources:e.map(function(e){return e.type&&e.src?e:Object.keys(e).reduce(function(t,n){return a(t,{type:o(n),src:e[n]})},{})})}),e):{sources:t}}},t.exports.TYPE_RE=i},{"extend-object":25}],14:[function(e,t,n){"use strict";var r=e("class-list"),o=e("bean"),i=e("../common"),a=function(e,t){var n;return function(){n||(e.apply(this,arguments),n=1,setTimeout(function(){n=0},t))}},l=function(e,t){var n,l,s,u,c,f,d,p,m=(/iPad/.test(navigator.userAgent)&&!/CriOS/.test(navigator.userAgent),i.lastChild(e)),v=r(e),g=r(m),h=!1,y=function(){l=i.offset(e),s=i.width(e),u=i.height(e),f=c?u:s,p=E(d)},b=function(t){n||t==k.value||d&&!(d>t)||(o.fire(e,"slide",[t]),k.value=t)},w=function(e){var n=e.pageX||e.clientX;!n&&e.originalEvent&&e.originalEvent.touches&&e.originalEvent.touches.length&&(n=e.originalEvent.touches[0].pageX);var r=c?e.pageY-l.top:n-l.left;r=Math.max(0,Math.min(p||f,r));var o=r/f;return c&&(o=1-o),t&&(o=1-o),x(o,0,!0)},x=function(e,t){void 0===t&&(t=0),e>1&&(e=1);var n=Math.round(1e3*e)/10+"%";return(!d||d>=e)&&(g.remove("animated"),h?g.remove("animated"):(g.add("animated"),i.css(m,"transition-duration",(t||0)+"ms")),i.css(m,"width",n)),e},E=function(e){return Math.max(0,Math.min(f,c?(1-e)*u:e*s))},k={max:function(e){d=e},disable:function(e){n=e},slide:function(e,t,n){y(),n&&b(e),x(e,t)},disableAnimation:function(t,n){h=t!==!1,i.toggleClass(e,"no-animation",!!n)}};return y(),o.on(e,"mousedown.sld touchstart",function(e){if(e.preventDefault(),!n){var t=a(b,100);y(),k.dragging=!0,v.add("is-dragging"),b(w(e)),o.on(document,"mousemove.sld touchmove.sld",function(e){e.preventDefault(),t(w(e))}),o.one(document,"mouseup touchend",function(){k.dragging=!1,v.remove("is-dragging"),o.off(document,"mousemove.sld touchmove.sld")})}}),k};t.exports=l},{"../common":1,bean:20,"class-list":21}],15:[function(e,t,n){"use strict";var r=e("../flowplayer"),o=e("../common"),i=e("bean"),a=e("class-list");r.defaults.subtitleParser=function(e){function t(e){var t=e.split(":");return 2==t.length&&t.unshift(0),60*t[0]*60+60*t[1]+parseFloat(t[2].replace(",","."))}for(var n,r,o,i=/^(([0-9]{2}:){1,2}[0-9]{2}[,.][0-9]{3}) --\> (([0-9]{2}:){1,2}[0-9]{2}[,.][0-9]{3})(.*)/,a=[],l=0,s=e.split("\n"),u=s.length,c={};u>l;l++)if(r=i.exec(s[l])){for(n=s[l-1],o="<span class='fp-subtitle-line'>"+s[++l]+"</span><br/>";"string"==typeof s[++l]&&s[l].trim()&&l<s.length;)o+="<span class='fp-subtitle-line'>"+s[l]+"</span><br/>";c={title:n,startTime:t(r[1]),endTime:t(r[3]),text:o},a.push(c)}return a},r(function(e,t){var n,l,s,u,c=a(t),f=function(){u=o.createElement("a",{className:"fp-menu"});var n=o.createElement("ul",{className:"fp-dropdown fp-dropup"});return n.appendChild(o.createElement("li",{"data-subtitle-index":-1},"No subtitles")),(e.video.subtitles||[]).forEach(function(e,t){var r=e.srclang||"en",i=e.label||"Default ("+r+")",a=o.createElement("li",{"data-subtitle-index":t},i);n.appendChild(a)}),u.appendChild(n),o.find(".fp-controls",t)[0].appendChild(u),u};i.on(t,"click",".fp-menu",function(e){a(u).toggle("dropdown-open")}),i.on(t,"click",".fp-menu li[data-subtitle-index]",function(t){var n=t.target.getAttribute("data-subtitle-index");return"-1"===n?e.disableSubtitles():void e.loadSubtitles(n)});var d=function(){var e=o.find(".fp-player",t)[0];s=o.find(".fp-subtitle",t)[0],s=s||o.appendTo(o.createElement("div",{"class":"fp-subtitle"}),e),Array.prototype.forEach.call(s.children,o.removeNode),n=a(s),o.find(".fp-menu",t).forEach(o.removeNode),f()};e.on("ready",function(n,i,a){var l=i.conf;if(r.support.subtitles&&l.nativesubtitles&&"html5"==i.engine.engineName){var s=function(e){var n=o.find("video",t)[0].textTracks;n.length&&(n[0].mode=e)};if(!a.subtitles||!a.subtitles.length)return;var u=o.find("video.fp-engine",t)[0];return a.subtitles.some(function(e){return!o.isSameDomain(e.src)})&&o.attr(u,"crossorigin","anonymous"),u.textTracks.addEventListener("addtrack",function(){s("disabled"),s("showing")}),void a.subtitles.forEach(function(e){u.appendChild(o.createElement("track",{kind:"subtitles",srclang:e.srclang||"en",label:e.label||"en",src:e.src,"default":e["default"]}))})}if(i.subtitles=[],d(),c.remove("has-menu"),e.disableSubtitles(),a.subtitles&&a.subtitles.length){c.add("has-menu");var f=a.subtitles.filter(function(e){return e["default"]})[0];f&&i.loadSubtitles(a.subtitles.indexOf(f))}}),e.bind("cuepoint",function(e,t,r){r.subtitle?(l=r.index,o.html(s,r.subtitle.text),n.add("fp-active")):r.subtitleEnd&&(n.remove("fp-active"),l=r.index)}),e.bind("seek",function(t,r,o){l&&e.cuepoints[l]&&e.cuepoints[l].time>o&&(n.remove("fp-active"),l=null),(e.cuepoints||[]).forEach(function(t){var n=t.subtitle;n&&l!=t.index?o>=t.time&&(!n.endTime||o<=n.endTime)&&e.trigger("cuepoint",[e,t]):t.subtitleEnd&&o>=t.time&&t.index==l+1&&e.trigger("cuepoint",[e,t])})});var p=function(e){o.toggleClass(o.find("li.active",t)[0],"active"),o.toggleClass(o.find('li[data-subtitle-index="'+e+'"]',t)[0],"active")};e.disableSubtitles=function(){return e.subtitles=[],(e.cuepoints||[]).forEach(function(t){(t.subtitle||t.subtitleEnd)&&e.removeCuepoint(t)}),s&&Array.prototype.forEach.call(s.children,o.removeNode),p(-1),e},e.loadSubtitles=function(t){e.disableSubtitles();var n=e.video.subtitles[t],r=n.src;return r?(p(t),o.xhrGet(r,function(t){var n=e.conf.subtitleParser(t);n.forEach(function(t){var n={time:t.startTime,subtitle:t,visible:!1};e.subtitles.push(t),e.addCuepoint(n),e.addCuepoint({time:t.endTime,subtitleEnd:t.title,visible:!1}),0!==t.startTime||e.video.time||e.trigger("cuepoint",[e,n])})},function(){return e.trigger("error",{code:8,url:r}),!1}),e):void 0}})},{"../common":1,"../flowplayer":18,bean:20,"class-list":21}],16:[function(e,t,n){"use strict";var r=e("../flowplayer"),o=e("extend-object");!function(){var e=function(e){var t=/Version\/(\d\.\d)/.exec(e);return t&&t.length>1?parseFloat(t[1],10):0},t=function(){var e=document.createElement("video");return e.loop=!0,e.autoplay=!0,e.preload=!0,e},n={},i=navigator.userAgent.toLowerCase(),a=/(chrome)[ \/]([\w.]+)/.exec(i)||/(safari)[ \/]([\w.]+)/.exec(i)||/(webkit)[ \/]([\w.]+)/.exec(i)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(i)||/(msie) ([\w.]+)/.exec(i)||i.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(i)||[];a[1]&&(n[a[1]]=!0,n.version=a[2]||"0");var l=t(),s=navigator.userAgent,u=n.msie||/Trident\/7/.test(s),c=/iPad|MeeGo/.test(s)&&!/CriOS/.test(s),f=/iPad/.test(s)&&/CriOS/.test(s),d=/iP(hone|od)/i.test(s)&&!/iPad/.test(s)&&!/IEMobile/i.test(s),p=/Android/.test(s)&&!/Firefox/.test(s),m=/Android/.test(s)&&/Firefox/.test(s),v=/Silk/.test(s),g=/IEMobile/.test(s),h=g?parseFloat(/Windows\ Phone\ (\d+\.\d+)/.exec(s)[1],10):0,y=g?parseFloat(/IEMobile\/(\d+\.\d+)/.exec(s)[1],10):0,b=(c?e(s):0,p?parseFloat(/Android\ (\d\.\d)/.exec(s)[1],10):0),w=o(r.support,{browser:n,subtitles:!!l.addTextTrack,fullscreen:"function"==typeof document.webkitCancelFullScreen&&!/Mac OS X 10_5.+Version\/5\.0\.\d Safari/.test(s)||document.mozFullScreenEnabled||"function"==typeof document.exitFullscreen||"function"==typeof document.msExitFullscreen,inlineBlock:!(u&&n.version<8),touch:"ontouchstart"in window,dataload:!c&&!d&&!g,zeropreload:!u&&!p,volume:!(c||p||d||v||f),cachedVideoTag:!(c||d||f||g),firstframe:!(d||c||p||v||f||g||m),inlineVideo:!d&&(!g||h>=8.1&&y>=11)&&(!p||b>=3),hlsDuration:!p&&(!n.safari||c||d||f),seekable:!c&&!f});try{var x=navigator.plugins["Shockwave Flash"],E=u?new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version"):x.description;u||x[0].enabledPlugin?(E=E.split(/\D+/),E.length&&!E[0]&&(E=E.slice(1)),w.flashVideo=E[0]>9||9==E[0]&&E[3]>=115):w.flashVideo=!1}catch(k){}try{w.video=!!l.canPlayType,w.video&&l.canPlayType("video/mp4")}catch(T){w.video=!1}w.animation=function(){for(var e=["","Webkit","Moz","O","ms","Khtml"],t=document.createElement("p"),n=0;n<e.length;n++)if("undefined"!=typeof t.style[e[n]+"AnimationName"])return!0}()}()},{"../flowplayer":18,"extend-object":25}],17:[function(e,t,n){"use strict";function r(e){return e=parseInt(e,10),e>=10?e:"0"+e}function o(e){e=e||0;var t=Math.floor(e/3600),n=Math.floor(e/60);return e-=60*n,t>=1?(n-=60*t,t+":"+r(n)+":"+r(e)):r(n)+":"+r(e)}var i=e("../flowplayer"),a=e("../common"),l=e("class-list"),s=e("bean"),u=e("./slider");i(function(e,t){function n(e){return a.find(".fp-"+e,t)[0]}function r(e){a.css(w,"padding-top",100*e+"%"),p.inlineBlock||a.height(a.find("object",t)[0],a.height(t))}function c(e){e?(m.add("is-mouseover"),m.remove("is-mouseout")):(m.add("is-mouseout"),m.remove("is-mouseover"))}var f,d=e.conf,p=i.support,m=l(t);a.find(".fp-ratio,.fp-ui",t).forEach(a.removeNode),m.add("flowplayer"),t.appendChild(a.createElement("div",{className:"fp-ratio"}));var v=a.createElement("div",{className:"fp-ui"},' <div class="waiting"><em></em><em></em><em></em></div> <a class="fullscreen"></a> <a class="unload"></a> <p class="speed"></p> <div class="controls"> <a class="play"></a> <div class="timeline"> <div class="buffer"></div> <div class="progress"></div> </div> <div class="timeline-tooltip fp-tooltip"></div> <div class="volume"> <a class="mute"></a> <div class="volumeslider"> <div class="volumelevel"></div> </div> </div> </div> <div class="time"> <em class="elapsed">00:00</em> <em class="remaining"></em> <em class="duration">00:00</em> </div> <div class="message"><h2></h2><p></p></div>'.replace(/class="/g,'class="fp-'));t.appendChild(v);var g=(n("progress"),n("buffer")),h=n("elapsed"),y=n("remaining"),b=n("waiting"),w=n("ratio"),x=n("speed"),E=l(x),k=n("duration"),T=n("controls"),S=n("timeline-tooltip"),N=a.css(w,"padding-top"),C=n("timeline"),j=u(C,e.rtl),O=(n("volume"),n("fullscreen")),P=n("volumeslider"),A=u(P,e.rtl),_=m.contains("fixed-controls")||m.contains("no-toggle");j.disableAnimation(m.contains("is-touch")),e.sliders=e.sliders||{},e.sliders.timeline=j,e.sliders.volume=A,p.animation||a.html(b,"<p>loading &hellip;</p>"),d.ratio&&r(d.ratio);try{d.fullscreen||a.removeNode(O)}catch(D){a.removeNode(O)}e.on("ready",function(e,n,i){var l=n.video.duration;j.disable(n.disabled||!l),d.adaptiveRatio&&!isNaN(i.height/i.width)&&r(i.height/i.width,!0),a.html([k,y],o(l)),a.toggleClass(t,"is-long",l>=3600),A.slide(n.volumeLevel),"flash"===n.engine.engineName?j.disableAnimation(!0,!0):j.disableAnimation(!1),a.find(".fp-title",v).forEach(a.removeNode),i.title&&a.prepend(v,a.createElement("div",{className:"fp-title"},i.title))}).on("unload",function(){N||d.splash||a.css(w,"paddingTop",""),j.slide(0)}).on("buffer",function(){var t=e.video,n=t.buffer/t.duration;!t.seekable&&p.seekable&&j.max(n),1>n?a.css(g,"width",100*n+"%"):a.css(g,"width","100%")}).on("speed",function(e,t,n){a.text(x,n+"x"),E.add("fp-hilite"),setTimeout(function(){E.remove("fp-hilite")},1e3)}).on("buffered",function(){a.css(g,"width","100%"),j.max(1)}).on("progress",function(){var t=e.video.time,n=e.video.duration;j.dragging||j.slide(t/n,e.seeking?0:250),a.html(h,o(t)),a.html(y,"-"+o(n-t))}).on("finish resume seek",function(e){a.toggleClass(t,"is-finished","finish"==e.type)}).on("stop",function(){a.html(h,o(0)),j.slide(0,100)}).on("finish",function(){a.html(h,o(e.video.duration)),j.slide(1,100),m.remove("is-seeking")}).on("beforeseek",function(){}).on("volume",function(){A.slide(e.volumeLevel)}).on("disable",function(){var n=e.disabled;j.disable(n),A.disable(n),a.toggleClass(t,"is-disabled",e.disabled)}).on("mute",function(e,n,r){a.toggleClass(t,"is-muted",r)}).on("error",function(e,n,r){if(a.removeClass(t,"is-loading"),a.removeClass(t,"is-seeking"),a.addClass(t,"is-error"),r){ n.error=!0;var code = r.code; if( r.message && r.message.match(/DECODER_ERROR_NOT_SUPPORTED/) ) code = 3; var o=a.find(".fp-message",t)[0],i=r.video||n.video;a.find("h2",o)[0].innerHTML=(n.engine&&n.engine.engineName||"html5")+": "+d.errors[code],a.find("p",o)[0].innerHTML=r.url||i.url||i.src||d.errorUrls[r.code],n.off("mouseenter click"),m.remove("is-mouseover")}}),s.on(t,"mouseenter mouseleave",function(n){if(!_){var r,o="mouseover"==n.type;if(c(o),o){var i=function(){c(!0),r=new Date};e.on("pause.x volume.x",i),s.on(t,"mousemove.x",i),f=setInterval(function(){new Date-r>d.mouseoutTimeout&&(c(!1),r=new Date)},100)}else s.off(t,"mousemove.x"),e.off("pause.x volume.x"),clearInterval(f)}}),s.on(t,"mouseleave",function(){(j.dragging||A.dragging)&&(m.add("is-mouseover"),m.remove("is-mouseout"))}),s.on(t,"click.player",function(t){if(!e.disabled){var n=l(t.target);return n.contains("fp-ui")||n.contains("fp-engine")||t.flash?(t.preventDefault&&t.preventDefault(),e.toggle()):void 0}}),s.on(t,"mousemove",".fp-timeline",function(t){var n=t.pageX||t.clientX,r=n-a.offset(C).left,i=r/a.width(C),l=i*e.video.duration;0>i||(a.html(S,o(l)),a.css(S,"left",n-a.offset(T).left-a.width(S)/2+"px"))}),s.on(t,"contextmenu",function(e){var n=a.offset(a.find(".fp-player",t)[0]),r=window,o=e.clientX-(n.left+r.scrollX),i=e.clientY-(n.top+r.scrollY);if(!m.contains("is-flash-disabled")){var l=a.find(".fp-context-menu",t)[0];l&&(e.preventDefault(),a.css(l,{left:o+"px",top:i+"px",display:"block"}),s.on(t,"click",".fp-context-menu",function(e){e.stopPropagation()}),s.on(document,"click.outsidemenu",function(e){a.css(l,"display","none"),s.off(document,"click.outsidemenu")}))}}),e.on("flashdisabled",function(){m.add("is-flash-disabled"),e.one("ready progress",function(){m.remove("is-flash-disabled"),a.find(".fp-flash-disabled",t).forEach(a.removeNode)}),t.appendChild(a.createElement("div",{className:"fp-flash-disabled"},"Adobe Flash is disabled for this page, click player area to enable"))}),d.poster&&a.css(t,"background-image","url("+d.poster+")");var M=a.css(t,"background-color"),L="none"!=a.css(t,"background-image")||M&&"rgba(0, 0, 0, 0)"!=M&&"transparent"!=M;L&&!d.splash&&(d.poster||(d.poster=!0),e.on("ready stop",function(){m.add("is-poster"),e.poster=!0,e.one("progress",function(){m.remove("is-poster"),e.poster=!1})})),"string"==typeof d.splash&&a.css(t,"background-image","url('"+d.splash+"')"),!L&&e.forcedSplash&&a.css(t,"background-color","#555"),s.on(t,"click",".fp-toggle, .fp-play",function(){e.disabled||e.toggle()}),s.on(t,"click",".fp-mute",function(){e.mute()}),s.on(t,"click",".fp-fullscreen",function(){e.fullscreen()}),s.on(t,"click",".fp-unload",function(){e.unload()}),s.on(C,"slide",function(t){e.seeking=!0,e.seek(t*e.video.duration)}),s.on(P,"slide",function(t){e.volume(t)});var I=n("time");s.on(t,"click",".fp-time",function(){l(I).toggle("is-inverted")}),c(_),e.on("shutdown",function(){s.off(C),s.off(P)})}),t.exports.format=o},{"../common":1,"../flowplayer":18,"./slider":14,bean:20,"class-list":21}],18:[function(e,t,n){"use strict";function r(e,t,n){t&&t.embed&&(t.embed=o({},y.defaults.embed,t.embed));var r,d,m=e,v=a(m),g=o({},y.defaults,y.conf,t),h={},x=new w;v.add("is-loading");try{h=p?window.localStorage:h}catch(E){}var k=m.currentStyle&&"rtl"===m.currentStyle.direction||window.getComputedStyle&&null!==window.getComputedStyle(m,null)&&"rtl"===window.getComputedStyle(m,null).getPropertyValue("direction");k&&v.add("is-rtl");var T={conf:g,currentSpeed:1,volumeLevel:g.muted?0:"undefined"==typeof g.volume?1*h.volume:g.volume,video:{},disabled:!1,finished:!1,loading:!1,muted:"true"==h.muted||g.muted,paused:!1,playing:!1,ready:!1,splash:!1,rtl:k,load:function(e,t){if(!T.error&&!T.loading){T.video={},T.finished=!1,e=e||g.clip,e=o({},x.resolve(e,g.clip.sources)),(T.playing||T.engine)&&(e.autoplay=!0);var n=S(e);if(!n)return T.trigger("error",[T,{code:y.support.flashVideo?5:10}]);if(!n.engineName)throw new Error("engineName property of factory should be exposed");if(T.engine&&n.engineName===T.engine.engineName||(T.ready=!1,T.engine&&(T.engine.unload(),T.conf.autoplay=!0),d=T.engine=n(T,m),T.one("ready",function(){d.volume(T.volumeLevel)})),o(e,d.pick(e.sources.filter(function(e){return e.engine?e.engine===d.engineName:!0}))),e.src){var r=T.trigger("load",[T,e,d],!0);r.defaultPrevented?T.loading=!1:(d.load(e),i(e)&&(t=e),t&&T.one("ready",t))}return T}},pause:function(e){return!T.ready||T.seeking||T.loading||(d.pause(),T.one("pause",e)),T},resume:function(){return T.ready&&T.paused&&(d.resume(),T.finished&&(T.trigger("resume",[T]),T.finished=!1)),T},toggle:function(){return T.ready?T.paused?T.resume():T.pause():T.load()},seek:function(e,t){if(T.ready&&!T.live){if("boolean"==typeof e){var n=.1*T.video.duration;e=T.video.time+(e?n:-n)}e=r=Math.min(Math.max(e,0),T.video.duration-.1).toFixed(1);var o=T.trigger("beforeseek",[T,e],!0);o.defaultPrevented?(T.seeking=!1,s.toggleClass(m,"is-seeking",T.seeking)):(d.seek(e),i(t)&&T.one("seek",t))}return T},seekTo:function(e,t){var n=void 0===e?r:.1*T.video.duration*e;return T.seek(n,t)},mute:function(e,t){return void 0===e&&(e=!T.muted),t||(h.muted=T.muted=e,h.volume=isNaN(h.volume)?g.volume:h.volume),T.volume(e?0:h.volume,!0),T.trigger("mute",[T,e]),T},volume:function(e,t){return T.ready&&(e=Math.min(Math.max(e,0),1),t||(h.volume=e),d.volume(e)),T},speed:function(e,t){return T.ready&&("boolean"==typeof e&&(e=g.speeds[g.speeds.indexOf(T.currentSpeed)+(e?1:-1)]||T.currentSpeed),d.speed(e),t&&m.one("speed",t)),T},stop:function(){return T.ready&&(T.pause(),T.seek(0,function(){T.trigger("stop",[T])})),T},unload:function(){return v.contains("is-embedding")||(g.splash?(T.trigger("unload",[T]),d&&(d.unload(),T.engine=d=0)):T.stop()),T},shutdown:function(){T.unload(),T.trigger("shutdown",[T]),l.off(m),delete c[m.getAttribute("data-flowplayer-instance-id")],m.removeAttribute("data-flowplayer-instance-id")},disable:function(e){return void 0===e&&(e=!T.disabled),e!=T.disabled&&(T.disabled=e,T.trigger("disable",e)),T}};T.conf=o(T.conf,g),u(T);var S=function(e){var t,n=y.engines;if(g.engine){var r=n.filter(function(e){return e.engineName===g.engine})[0];if(r&&e.sources.some(function(e){return e.engine&&e.engine!==r.engineName?!1:r.canPlay(e.type,T.conf)}))return r}return g.enginePreference&&(n=y.engines.filter(function(e){return g.enginePreference.indexOf(e.engineName)>-1}).sort(function(e,t){return g.enginePreference.indexOf(e.engineName)-g.enginePreference.indexOf(t.engineName)})),e.sources.some(function(e){var r=n.filter(function(t){return e.engine&&e.engine!==t.engineName?!1:t.canPlay(e.type,T.conf)}).shift();return r&&(t=r),!!r}),t};return m.getAttribute("data-flowplayer-instance-id")||(m.setAttribute("data-flowplayer-instance-id",b++),T.on("boot",function(){(g.splash||v.contains("is-splash")||!y.support.firstframe)&&(T.forcedSplash=!g.splash&&!v.contains("is-splash"),T.splash=g.autoplay=!0,g.splash||(g.splash=!0),v.add("is-splash")),g.splash&&s.find("video",m).forEach(s.removeNode),(g.live||v.contains("is-live"))&&(T.live=g.live=!0,v.add("is-live")),f.forEach(function(e){e(T,m)}),c.push(T),g.splash?T.unload():T.load(),g.disabled&&T.disable(),T.one("ready",n)}).on("load",function(e,t,n){g.splash&&s.find(".flowplayer.is-ready,.flowplayer.is-loading").forEach(function(e){var t=e.getAttribute("data-flowplayer-instance-id");if(t!==m.getAttribute("data-flowplayer-instance-id")){var n=c[Number(t)];n&&n.conf.splash&&n.unload()}}),v.add("is-loading"),t.loading=!0,"undefined"!=typeof n.live&&(s.toggleClass(m,"is-live",n.live),t.live=n.live)}).on("ready",function(e,t,n){n.time=0,t.video=n,v.remove("is-loading"),t.loading=!1,t.muted?t.mute(!0,!0):t.volume(t.volumeLevel);var r=t.conf.hlsFix&&/mpegurl/i.exec(n.type);s.toggleClass(m,"hls-fix",!!r)}).on("unload",function(e){v.remove("is-loading"),T.loading=!1}).on("ready unload",function(e){var t="ready"==e.type;s.toggleClass(m,"is-splash",!t),s.toggleClass(m,"is-ready",t),T.ready=t,T.splash=!t}).on("progress",function(e,t,n){t.video.time=n}).on("speed",function(e,t,n){t.currentSpeed=n}).on("volume",function(e,t,n){t.volumeLevel=Math.round(100*n)/100,t.muted?n&&t.mute(!1):h.volume=n}).on("beforeseek seek",function(e){T.seeking="beforeseek"==e.type,s.toggleClass(m,"is-seeking",T.seeking)}).on("ready pause resume unload finish stop",function(e,t,n){T.paused=/pause|finish|unload|stop/.test(e.type),T.paused=T.paused||"ready"===e.type&&!g.autoplay&&!T.playing,T.playing=!T.paused,s.toggleClass(m,"is-paused",T.paused),s.toggleClass(m,"is-playing",T.playing),T.load.ed||T.pause()}).on("finish",function(e){T.finished=!0}).on("error",function(){})),T.trigger("boot",[T,m]),T}var o=e("extend-object"),i=e("is-function"),a=e("class-list"),l=e("bean"),s=e("./common"),u=e("./ext/events"),c=[],f=[],d=(window.navigator.userAgent,window.onbeforeunload);window.onbeforeunload=function(e){return c.forEach(function(e){e.conf.splash?e.unload():e.bind("error",function(){s.find(".flowplayer.is-error .fp-message").forEach(s.removeNode)})}),d?d(e):void 0};var p=!1;try{"object"==typeof window.localStorage&&(window.localStorage.flowplayerTestStorage="test",p=!0)}catch(m){}var v=/Safari/.exec(navigator.userAgent)&&!/Chrome/.exec(navigator.userAgent),g=/(\d+\.\d+) Safari/.exec(navigator.userAgent),h=g?Number(g[1]):100,y=t.exports=function(e,t,n){if(i(e))return f.push(e);if("number"==typeof e||"undefined"==typeof e)return c[e||0];if(e.nodeType){if(null!==e.getAttribute("data-flowplayer-instance-id"))return c[e.getAttribute("data-flowplayer-instance-id")];if(!t)return;return r(e,t,n)}if(e.jquery)return y(e[0],t,n);if("string"==typeof e){var o=s.find(e)[0];return o&&y(o,t,n)}};o(y,{version:"6.0.5",engines:[],conf:{},set:function(e,t){"string"==typeof e?y.conf[e]=t:o(y.conf,e)},support:{},defaults:{debug:p?!!localStorage.flowplayerDebug:!1,disabled:!1,fullscreen:window==window.top,keyboard:!0,ratio:9/16,adaptiveRatio:!1,rtmp:0,proxy:"best",splash:!1,live:!1,swf:"//releases.flowplayer.org/6.0.5/commercial/flowplayer.swf",swfHls:"//releases.flowplayer.org/6.0.5/commercial/flowplayerhls.swf",speeds:[.25,.5,1,1.5,2],tooltip:!0,mouseoutTimeout:5e3,volume:p?"true"==localStorage.muted?0:isNaN(localStorage.volume)?1:localStorage.volume||1:1,errors:["","Video loading aborted","Network error","Video not properly encoded","Video file not found","Unsupported video","Skin not found","SWF file not found","Subtitles not found","Invalid RTMP URL","Unsupported video format. Try installing Adobe Flash."],errorUrls:["","","","","","","","","","","http://get.adobe.com/flashplayer/"],playlist:[],hlsFix:v&&8>h},bean:l,common:s,extend:o});var b=0,w=e("./ext/resolve");if("undefined"!=typeof window.jQuery){var x=window.jQuery;x(function(){"function"==typeof x.fn.flowplayer&&x('.flowplayer:has(video,script[type="application/json"])').flowplayer()});var E=function(e){if(!e.length)return{};var t=e.data()||{},n={};return x.each(["autoplay","loop","preload","poster"],function(r,o){var i=e.attr(o);void 0!==i&&-1!==["autoplay","poster"].indexOf(o)?n[o]=i?i:!0:void 0!==i&&(t[o]=i?i:!0)}),t.subtitles=e.find("track").map(function(){var e=x(this);return{src:e.attr("src"),kind:e.attr("kind"),label:e.attr("label"),srclang:e.attr("srclang"),"default":e.prop("default")}}).get(),t.sources=(new w).sourcesFromVideoTag(e,x),o(n,{clip:t})};x.fn.flowplayer=function(e,t){return this.each(function(){"string"==typeof e&&(e={swf:e}),i(e)&&(t=e,e={});var n=x(this),o=n.find('script[type="application/json"]'),a=o.length?JSON.parse(o.text()):E(n.find("video")),l=x.extend({},e||{},a,n.data()),s=r(this,l,t);u.EVENTS.forEach(function(e){s.on(e+".jquery",function(e){n.trigger.call(n,e.type,e.detail&&e.detail.args)})}),n.data("flowplayer",s)})}}},{"./common":1,"./ext/events":8,"./ext/resolve":13,bean:20,"class-list":21,"extend-object":25,"is-function":26}],19:[function(e,t,n){e("es5-shim");var r=t.exports=e("./flowplayer");e("./ext/support"),e("./engine/embed"),e("./engine/html5"),e("./engine/flash"),e("./ext/ui"),e("./ext/keyboard"),e("./ext/playlist"),e("./ext/cuepoint"),e("./ext/subtitle"),e("./ext/analytics"),e("./ext/embed"),e("./ext/fullscreen"),e("./ext/mobile"),r(function(e,t){function n(e){var t=document.createElement("a");return t.href=e,u.hostname(t.hostname)}function o(e){var t="ab.ca,ac.ac,ac.at,ac.be,ac.cn,ac.il,ac.in,ac.jp,ac.kr,ac.sg,ac.th,ac.uk,ad.jp,adm.br,adv.br,ah.cn,am.br,arq.br,art.br,arts.ro,asn.au,asso.fr,asso.mc,bc.ca,bio.br,biz.pl,biz.tr,bj.cn,br.com,cn.com,cng.br,cnt.br,co.ac,co.at,co.de,co.gl,co.hk,co.id,co.il,co.in,co.jp,co.kr,co.mg,co.ms,co.nz,co.th,co.uk,co.ve,co.vi,co.za,com.ag,com.ai,com.ar,com.au,com.br,com.cn,com.co,com.cy,com.de,com.do,com.ec,com.es,com.fj,com.fr,com.gl,com.gt,com.hk,com.hr,com.hu,com.kg,com.ki,com.lc,com.mg,com.mm,com.ms,com.mt,com.mu,com.mx,com.my,com.na,com.nf,com.ng,com.ni,com.pa,com.ph,com.pl,com.pt,com.qa,com.ro,com.ru,com.sb,com.sc,com.sg,com.sv,com.tr,com.tw,com.ua,com.uy,com.ve,com.vn,cp.tz,cq.cn,de.com,de.org,ecn.br,ed.jp,edu.au,edu.cn,edu.hk,edu.mm,edu.my,edu.pl,edu.pt,edu.qa,edu.sg,edu.tr,edu.tw,eng.br,ernet.in,esp.br,etc.br,eti.br,eu.com,eu.int,eu.lv,firm.in,firm.ro,fm.br,fot.br,fst.br,g12.br,gb.com,gb.net,gd.cn,gen.in,go.jp,go.kr,go.th,gov.au,gov.az,gov.br,gov.cn,gov.il,gov.in,gov.mm,gov.my,gov.qa,gov.sg,gov.tr,gov.tw,gov.uk,gr.jp,gs.cn,gv.ac,gv.at,gx.cn,gz.cn,he.cn,hi.cn,hk.cn,hl.cn,hu.com,id.au,idv.tw,in.ua,ind.br,ind.in,inf.br,info.pl,info.ro,info.tr,info.ve,iwi.nz,jl.cn,jor.br,js.cn,jus.br,k12.il,k12.tr,kr.com,lel.br,lg.jp,ln.cn,ltd.uk,maori.nz,mb.ca,me.uk,med.br,mi.th,mil.br,mil.uk,mo.cn,mod.uk,muni.il,nb.ca,ne.jp,ne.kr,net.ag,net.ai,net.au,net.br,net.cn,net.do,net.gl,net.hk,net.il,net.in,net.kg,net.ki,net.lc,net.mg,net.mm,net.mu,net.ni,net.nz,net.pl,net.ru,net.sb,net.sc,net.sg,net.th,net.tr,net.tw,net.uk,net.ve,nf.ca,nhs.uk,nm.cn,nm.kr,no.com,nom.br,nom.ni,nom.ro,ns.ca,nt.ca,nt.ro,ntr.br,nx.cn,odo.br,off.ai,on.ca,or.ac,or.at,or.jp,or.kr,or.th,org.ag,org.ai,org.au,org.br,org.cn,org.do,org.es,org.gl,org.hk,org.in,org.kg,org.ki,org.lc,org.mg,org.mm,org.ms,org.nf,org.ni,org.nz,org.pl,org.ro,org.ru,org.sb,org.sc,org.sg,org.tr,org.tw,org.uk,org.ve,pe.ca,plc.uk,police.uk,ppg.br,presse.fr,pro.br,psc.br,psi.br,qc.ca,qc.com,qh.cn,rec.br,rec.ro,res.in,sa.com,sc.cn,sch.uk,se.com,se.net,sh.cn,sk.ca,slg.br,sn.cn,store.ro,tj.cn,tm.fr,tm.mc,tm.ro,tmp.br,tur.br,tv.br,tv.tr,tw.cn,uk.com,uk.net,us.com,uy.com,vet.br,waw.pl,web.ve,www.ro,xj.cn,xz.cn,yk.ca,yn.cn,zj.cn,zlg.br".split(",");
8
  e=e.toLowerCase();var n=e.split("."),r=n.length;if(2>r||/^\d+$/.test(n[r-1]))return e;var o=n.slice(-2).join(".");return r>=3&&t.indexOf(o)>=0?n.slice(-3).join("."):o}function i(e,t){t=o(t);for(var n=0,r=t.length-1;r>=0;r--)n+=55436413178*t.charCodeAt(r);for(n=(""+n).substring(0,7),r=0;r<e.length;r++)if(n===e[r].substring(1,8))return 1}var a=function(e,t){var n=e.className.split(" ");-1===n.indexOf(t)&&(e.className+=" "+t)},l=function(e){return"none"!==window.getComputedStyle(e).display},s=e.conf,u=r.common,c=u.createElement,f=s.swf.indexOf("flowplayer.org")&&s.e&&t.getAttribute("data-origin"),d=f?n(f):u.hostname(),p=(document,s.key);"file:"==location.protocol&&(d="localhost"),e.load.ed=1,s.hostname=d,s.origin=f||location.href,f&&a(t,"is-embedded"),"string"==typeof p&&(p=p.split(/,\s*/));var m=function(e,n){var r=c("a",{href:n,className:"fp-brand"});r.innerHTML=e,u.find(".fp-controls",t)[0].appendChild(r)};if(p&&"function"==typeof i&&i(p,d)){if(s.logo){var v=u.find(".fp-player",t)[0],g=c("a",{className:"fp-logo"});f&&(g.href=f),s.embed&&s.embed.popup&&(g.target="_blank");var h=c("img",{src:s.logo});g.appendChild(h),(v||t).appendChild(g)}s.brand&&f||s.brand&&s.brand.showOnOrigin?m(s.brand.text||s.brand,f||location.href):u.addClass(t,"no-brand")}else{m("flowplayer","http://flowplayer.org");var g=c("a",{onclick:""});t.appendChild(g);var y=c("div",{className:"fp-context-menu"},'<ul><li class="copyright">&copy; 2015</li><li><a href="http://flowplayer.org">About Flowplayer</a></li><li><a href="http://flowplayer.org/license">GPL based license</a></li></ul>'),b=window.location.href.indexOf("localhost"),v=u.find(".fp-player",t)[0];7!==b&&(v||t).appendChild(y),e.on("pause resume finish unload ready",function(e,n){u.removeClass(t,"no-brand");var r=-1;if(n.video.src)for(var o=[["org","flowplayer","drive"],["org","flowplayer","my"],["org","flowplayer","cdn"]],i=0;i<o.length&&(r=n.video.src.indexOf("://"+o[i].reverse().join(".")),-1===r);i++);if((4===r||5===r)&&u.addClass(t,"no-brand"),/pause|resume/.test(e.type)&&"flash"!=n.engine.engineName&&4!=r&&5!=r){var a={display:"block",position:"absolute",left:"16px",bottom:"46px",zIndex:99999,width:"120px",height:"27px",backgroundImage:"url("+[".png","fplogo","/",".com","foliovision","//"].reverse().join("")+")"};for(var s in a)a.hasOwnProperty(s)&&(g.style[s]=a[s]);n.load.ed=l(g)&&(7===b||y.parentNode==t||y.parentNode==v)&&!u.hasClass(t,"no-brand"),n.load.ed||n.pause()}else g.style.display="none"})}})},{"./engine/embed":2,"./engine/flash":3,"./engine/html5":4,"./ext/analytics":5,"./ext/cuepoint":6,"./ext/embed":7,"./ext/fullscreen":9,"./ext/keyboard":10,"./ext/mobile":11,"./ext/playlist":12,"./ext/subtitle":15,"./ext/support":16,"./ext/ui":17,"./flowplayer":18,"es5-shim":24}],20:[function(t,n,r){!function(t,r,o){"undefined"!=typeof n&&n.exports?n.exports=o():"function"==typeof e&&e.amd?e(o):r[t]=o()}("bean",this,function(e,t){e=e||"bean",t=t||this;var n,r=window,o=t[e],i=/[^\.]*(?=\..*)\.|.*/,a=/\..*/,l="addEventListener",s="removeEventListener",u=document||{},c=u.documentElement||{},f=c[l],d=f?l:"attachEvent",p={},m=Array.prototype.slice,v=function(e,t){return e.split(t||" ")},g=function(e){return"string"==typeof e},h=function(e){return"function"==typeof e},y="click dblclick mouseup mousedown contextmenu mousewheel mousemultiwheel DOMMouseScroll mouseover mouseout mousemove selectstart selectend keydown keypress keyup orientationchange focus blur change reset select submit load unload beforeunload resize move DOMContentLoaded readystatechange message error abort scroll ",b="show input invalid touchstart touchmove touchend touchcancel gesturestart gesturechange gestureend textinput readystatechange pageshow pagehide popstate hashchange offline online afterprint beforeprint dragstart dragenter dragover dragleave drag drop dragend loadstart progress suspend emptied stalled loadmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate play pause ratechange volumechange cuechange checking noupdate downloading cached updateready obsolete ",w=function(e,t,n){for(n=0;n<t.length;n++)t[n]&&(e[t[n]]=1);return e}({},v(y+(f?b:""))),x=function(){var e="compareDocumentPosition"in c?function(e,t){return t.compareDocumentPosition&&16===(16&t.compareDocumentPosition(e))}:"contains"in c?function(e,t){return t=9===t.nodeType||t===window?c:t,t!==e&&t.contains(e)}:function(e,t){for(;e=e.parentNode;)if(e===t)return 1;return 0},t=function(t){var n=t.relatedTarget;return n?n!==this&&"xul"!==n.prefix&&!/document/.test(this.toString())&&!e(n,this):null==n};return{mouseenter:{base:"mouseover",condition:t},mouseleave:{base:"mouseout",condition:t},mousewheel:{base:/Firefox/.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel"}}}(),E=function(){var e=v("altKey attrChange attrName bubbles cancelable ctrlKey currentTarget detail eventPhase getModifierState isTrusted metaKey relatedNode relatedTarget shiftKey srcElement target timeStamp type view which propertyName"),t=e.concat(v("button buttons clientX clientY dataTransfer fromElement offsetX offsetY pageX pageY screenX screenY toElement")),n=t.concat(v("wheelDelta wheelDeltaX wheelDeltaY wheelDeltaZ axis")),o=e.concat(v("char charCode key keyCode keyIdentifier keyLocation location")),i=e.concat(v("data")),a=e.concat(v("touches targetTouches changedTouches scale rotation")),l=e.concat(v("data origin source")),s=e.concat(v("state")),f=/over|out/,d=[{reg:/key/i,fix:function(e,t){return t.keyCode=e.keyCode||e.which,o}},{reg:/click|mouse(?!(.*wheel|scroll))|menu|drag|drop/i,fix:function(e,n,r){return n.rightClick=3===e.which||2===e.button,n.pos={x:0,y:0},e.pageX||e.pageY?(n.clientX=e.pageX,n.clientY=e.pageY):(e.clientX||e.clientY)&&(n.clientX=e.clientX+u.body.scrollLeft+c.scrollLeft,n.clientY=e.clientY+u.body.scrollTop+c.scrollTop),f.test(r)&&(n.relatedTarget=e.relatedTarget||e[("mouseover"==r?"from":"to")+"Element"]),t}},{reg:/mouse.*(wheel|scroll)/i,fix:function(){return n}},{reg:/^text/i,fix:function(){return i}},{reg:/^touch|^gesture/i,fix:function(){return a}},{reg:/^message$/i,fix:function(){return l}},{reg:/^popstate$/i,fix:function(){return s}},{reg:/.*/,fix:function(){return e}}],p={},m=function(e,t,n){if(arguments.length&&(e=e||((t.ownerDocument||t.document||t).parentWindow||r).event,this.originalEvent=e,this.isNative=n,this.isBean=!0,e)){var o,i,a,l,s,u=e.type,c=e.target||e.srcElement;if(this.target=c&&3===c.nodeType?c.parentNode:c,n){if(s=p[u],!s)for(o=0,i=d.length;i>o;o++)if(d[o].reg.test(u)){p[u]=s=d[o].fix;break}for(l=s(e,this,u),o=l.length;o--;)!((a=l[o])in this)&&a in e&&(this[a]=e[a])}}};return m.prototype.preventDefault=function(){this.originalEvent.preventDefault?this.originalEvent.preventDefault():this.originalEvent.returnValue=!1},m.prototype.stopPropagation=function(){this.originalEvent.stopPropagation?this.originalEvent.stopPropagation():this.originalEvent.cancelBubble=!0},m.prototype.stop=function(){this.preventDefault(),this.stopPropagation(),this.stopped=!0},m.prototype.stopImmediatePropagation=function(){this.originalEvent.stopImmediatePropagation&&this.originalEvent.stopImmediatePropagation(),this.isImmediatePropagationStopped=function(){return!0}},m.prototype.isImmediatePropagationStopped=function(){return this.originalEvent.isImmediatePropagationStopped&&this.originalEvent.isImmediatePropagationStopped()},m.prototype.clone=function(e){var t=new m(this,this.element,this.isNative);return t.currentTarget=e,t},m}(),k=function(e,t){return f||t||e!==u&&e!==r?e:c},T=function(){var e=function(e,t,n,r){var o=function(n,o){return t.apply(e,r?m.call(o,n?0:1).concat(r):o)},i=function(n,r){return t.__beanDel?t.__beanDel.ft(n.target,e):r},a=n?function(e){var t=i(e,this);return n.apply(t,arguments)?(e&&(e.currentTarget=t),o(e,arguments)):void 0}:function(e){return t.__beanDel&&(e=e.clone(i(e))),o(e,arguments)};return a.__beanDel=t.__beanDel,a},t=function(t,n,r,o,i,a,l){var s,u=x[n];"unload"==n&&(r=O(P,t,n,r,o)),u&&(u.condition&&(r=e(t,r,u.condition,a)),n=u.base||n),this.isNative=s=w[n]&&!!t[d],this.customType=!f&&!s&&n,this.element=t,this.type=n,this.original=o,this.namespaces=i,this.eventType=f||s?n:"propertychange",this.target=k(t,s),this[d]=!!this.target[d],this.root=l,this.handler=e(t,r,null,a)};return t.prototype.inNamespaces=function(e){var t,n,r=0;if(!e)return!0;if(!this.namespaces)return!1;for(t=e.length;t--;)for(n=this.namespaces.length;n--;)e[t]==this.namespaces[n]&&r++;return e.length===r},t.prototype.matches=function(e,t,n){return!(this.element!==e||t&&this.original!==t||n&&this.handler!==n)},t}(),S=function(){var e={},t=function(n,r,o,i,a,l){var s=a?"r":"$";if(r&&"*"!=r){var u,c=0,f=e[s+r],d="*"==n;if(!f)return;for(u=f.length;u>c;c++)if((d||f[c].matches(n,o,i))&&!l(f[c],f,c,r))return}else for(var p in e)p.charAt(0)==s&&t(n,p.substr(1),o,i,a,l)},n=function(t,n,r,o){var i,a=e[(o?"r":"$")+n];if(a)for(i=a.length;i--;)if(!a[i].root&&a[i].matches(t,r,null))return!0;return!1},r=function(e,n,r,o){var i=[];return t(e,n,r,null,o,function(e){return i.push(e)}),i},o=function(t){var n=!t.root&&!this.has(t.element,t.type,null,!1),r=(t.root?"r":"$")+t.type;return(e[r]||(e[r]=[])).push(t),n},i=function(n){t(n.element,n.type,null,n.handler,n.root,function(t,n,r){return n.splice(r,1),t.removed=!0,0===n.length&&delete e[(t.root?"r":"$")+t.type],!1})},a=function(){var t,n=[];for(t in e)"$"==t.charAt(0)&&(n=n.concat(e[t]));return n};return{has:n,get:r,put:o,del:i,entries:a}}(),N=function(e){n=arguments.length?e:u.querySelectorAll?function(e,t){return t.querySelectorAll(e)}:function(){throw new Error("Bean: No selector engine installed")}},C=function(e,t){if(f||!t||!e||e.propertyName=="_on"+t){var n=S.get(this,t||e.type,null,!1),r=n.length,o=0;for(e=new E(e,this,!0),t&&(e.type=t);r>o&&!e.isImmediatePropagationStopped();o++)n[o].removed||n[o].handler.call(this,e)}},j=f?function(e,t,n){e[n?l:s](t,C,!1)}:function(e,t,n,r){var o;n?(S.put(o=new T(e,r||t,function(t){C.call(e,t,r)},C,null,null,!0)),r&&null==e["_on"+r]&&(e["_on"+r]=0),o.target.attachEvent("on"+o.eventType,o.handler)):(o=S.get(e,r||t,C,!0)[0],o&&(o.target.detachEvent("on"+o.eventType,o.handler),S.del(o)))},O=function(e,t,n,r,o){return function(){r.apply(this,arguments),e(t,n,o)}},P=function(e,t,n,r){var o,i,l=t&&t.replace(a,""),s=S.get(e,l,null,!1),u={};for(o=0,i=s.length;i>o;o++)n&&s[o].original!==n||!s[o].inNamespaces(r)||(S.del(s[o]),!u[s[o].eventType]&&s[o][d]&&(u[s[o].eventType]={t:s[o].eventType,c:s[o].type}));for(o in u)S.has(e,u[o].t,null,!1)||j(e,u[o].t,!1,u[o].c)},A=function(e,t){var r=function(t,r){for(var o,i=g(e)?n(e,r):e;t&&t!==r;t=t.parentNode)for(o=i.length;o--;)if(i[o]===t)return t},o=function(e){var n=r(e.target,this);n&&t.apply(n,arguments)};return o.__beanDel={ft:r,selector:e},o},_=f?function(e,t,n){var o=u.createEvent(e?"HTMLEvents":"UIEvents");o[e?"initEvent":"initUIEvent"](t,!0,!0,r,1),n.dispatchEvent(o)}:function(e,t,n){n=k(n,e),e?n.fireEvent("on"+t,u.createEventObject()):n["_on"+t]++},D=function(e,t,n){var r,o,l,s,u=g(t);if(u&&t.indexOf(" ")>0){for(t=v(t),s=t.length;s--;)D(e,t[s],n);return e}if(o=u&&t.replace(a,""),o&&x[o]&&(o=x[o].base),!t||u)(l=u&&t.replace(i,""))&&(l=v(l,".")),P(e,o,n,l);else if(h(t))P(e,null,t);else for(r in t)t.hasOwnProperty(r)&&D(e,r,t[r]);return e},M=function(e,t,r,o){var l,s,u,c,f,g,y;{if(void 0!==r||"object"!=typeof t){for(h(r)?(f=m.call(arguments,3),o=l=r):(l=o,f=m.call(arguments,4),o=A(r,l,n)),u=v(t),this===p&&(o=O(D,e,t,o,l)),c=u.length;c--;)y=S.put(g=new T(e,u[c].replace(a,""),o,l,v(u[c].replace(i,""),"."),f,!1)),g[d]&&y&&j(e,g.eventType,!0,g.customType);return e}for(s in t)t.hasOwnProperty(s)&&M.call(this,e,s,t[s])}},L=function(e,t,n,r){return M.apply(null,g(n)?[e,n,t,r].concat(arguments.length>3?m.call(arguments,5):[]):m.call(arguments))},I=function(){return M.apply(p,arguments)},F=function(e,t,n){var r,o,l,s,u,c=v(t);for(r=c.length;r--;)if(t=c[r].replace(a,""),(s=c[r].replace(i,""))&&(s=v(s,".")),s||n||!e[d])for(u=S.get(e,t,null,!1),n=[!1].concat(n),o=0,l=u.length;l>o;o++)u[o].inNamespaces(s)&&u[o].handler.apply(e,n);else _(w[t],t,e);return e},z=function(e,t,n){for(var r,o,i=S.get(t,n,null,!1),a=i.length,l=0;a>l;l++)i[l].original&&(r=[e,i[l].type],(o=i[l].handler.__beanDel)&&r.push(o.selector),r.push(i[l].original),M.apply(null,r));return e},R={on:M,add:L,one:I,off:D,remove:D,clone:z,fire:F,Event:E,setSelectorEngine:N,noConflict:function(){return t[e]=o,this}};if(r.attachEvent){var q=function(){var e,t=S.entries();for(e in t)t[e].type&&"unload"!==t[e].type&&D(t[e].element,t[e].type);r.detachEvent("onunload",q),r.CollectGarbage&&r.CollectGarbage()};r.attachEvent("onunload",q)}return N(),R})},{}],21:[function(e,t,n){function r(e){function t(e){var t=c();a(t,e)>-1||(t.push(e),f(t))}function n(e){var t=c(),n=a(t,e);-1!==n&&(t.splice(n,1),f(t))}function r(e){return a(c(),e)>-1}function l(e){return r(e)?(n(e),!1):(t(e),!0)}function s(){return e.className}function u(e){var t=c();return t[e]||null}function c(){var t=e.className;return o(t.split(" "),i)}function f(t){var n=t.length;e.className=t.join(" "),p.length=n;for(var r=0;r<t.length;r++)p[r]=t[r];delete t[n]}var d=e.classList;if(d)return d;var p={add:t,remove:n,contains:r,toggle:l,toString:s,length:0,item:u};return p}function o(e,t){for(var n=[],r=0;r<e.length;r++)t(e[r])&&n.push(e[r]);return n}function i(e){return!!e}var a=e("indexof");t.exports=r},{indexof:22}],22:[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}},{}],23:[function(e,t,n){function r(e,t,n,r){return n=window.getComputedStyle,r=n?n(e):e.currentStyle,r?r[t.replace(/-(\w)/gi,function(e,t){return t.toUpperCase()})]:void 0}t.exports=r},{}],24:[function(t,n,r){!function(t,o){"use strict";"function"==typeof e&&e.amd?e(o):"object"==typeof r?n.exports=o():t.returnExports=o()}(this,function(){var e,t=Array.prototype,n=Object.prototype,r=Function.prototype,o=String.prototype,i=Number.prototype,a=t.slice,l=t.splice,s=t.push,u=t.unshift,c=t.concat,f=r.call,d=n.toString,p=Array.isArray||function(e){return"[object Array]"===d.call(e)},m="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,v=Function.prototype.toString,g=function(e){try{return v.call(e),!0}catch(t){return!1}},h="[object Function]",y="[object GeneratorFunction]";e=function(e){if("function"!=typeof e)return!1;if(m)return g(e);var t=d.call(e);return t===h||t===y};var b,w=RegExp.prototype.exec,x=function(e){try{return w.call(e),!0}catch(t){return!1}},E="[object RegExp]";b=function(e){return"object"!=typeof e?!1:m?x(e):d.call(e)===E};var k,T=String.prototype.valueOf,S=function(e){try{return T.call(e),!0}catch(t){return!1}},N="[object String]";k=function(e){return"string"==typeof e?!0:"object"!=typeof e?!1:m?S(e):d.call(e)===N};var C=function(t){var n=d.call(t),r="[object Arguments]"===n;return r||(r=!p(t)&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&e(t.callee)),r},j=function(e){var t,n=Object.defineProperty&&function(){try{var e={};Object.defineProperty(e,"x",{enumerable:!1,value:e});for(var t in e)return!1;return e.x===e}catch(n){return!1}}();return t=n?function(e,t,n,r){!r&&t in e||Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:!0,value:n})}:function(e,t,n,r){!r&&t in e||(e[t]=n)},function(n,r,o){for(var i in r)e.call(r,i)&&t(n,i,r[i],o)}}(n.hasOwnProperty),O=function(e){var t=typeof e;return null===e||"object"!==t&&"function"!==t},P={ToInteger:function(e){var t=+e;return t!==t?t=0:0!==t&&t!==1/0&&t!==-(1/0)&&(t=(t>0||-1)*Math.floor(Math.abs(t))),t},ToPrimitive:function(t){var n,r,o;if(O(t))return t;if(r=t.valueOf,e(r)&&(n=r.call(t),O(n)))return n;if(o=t.toString,e(o)&&(n=o.call(t),O(n)))return n;throw new TypeError},ToObject:function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return Object(e)},ToUint32:function(e){return e>>>0}},A=function(){};j(r,{bind:function(t){var n=this;if(!e(n))throw new TypeError("Function.prototype.bind called on incompatible "+n);for(var r,o=a.call(arguments,1),i=function(){if(this instanceof r){var e=n.apply(this,c.call(o,a.call(arguments)));return Object(e)===e?e:this}return n.apply(t,c.call(o,a.call(arguments)))},l=Math.max(0,n.length-o.length),s=[],u=0;l>u;u++)s.push("$"+u);return r=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this, arguments); }")(i),n.prototype&&(A.prototype=n.prototype,r.prototype=new A,A.prototype=null),r}});var _=f.bind(n.hasOwnProperty),D=function(){var e=[1,2],t=e.splice();return 2===e.length&&p(t)&&0===t.length}();j(t,{splice:function(e,t){return 0===arguments.length?[]:l.apply(this,arguments)}},!D);var M=function(){var e={};return t.splice.call(e,0,0,1),1===e.length}();j(t,{splice:function(e,t){if(0===arguments.length)return[];var n=arguments;return this.length=Math.max(P.ToInteger(this.length),0),arguments.length>0&&"number"!=typeof t&&(n=a.call(arguments),n.length<2?n.push(this.length-e):n[1]=P.ToInteger(t)),l.apply(this,n)}},!M);var L=1!==[].unshift(0);j(t,{unshift:function(){return u.apply(this,arguments),this.length}},L),j(Array,{isArray:p});var I=Object("a"),F="a"!==I[0]||!(0 in I),z=function(e){var t=!0,n=!0;return e&&(e.call("foo",function(e,n,r){"object"!=typeof r&&(t=!1)}),e.call([1],function(){"use strict";n="string"==typeof this},"x")),!!e&&t&&n};j(t,{forEach:function(t){var n,r=P.ToObject(this),o=F&&k(this)?this.split(""):r,i=-1,a=o.length>>>0;if(arguments.length>1&&(n=arguments[1]),!e(t))throw new TypeError("Array.prototype.forEach callback must be a function");for(;++i<a;)i in o&&("undefined"!=typeof n?t.call(n,o[i],i,r):t(o[i],i,r))}},!z(t.forEach)),j(t,{map:function(t){var n,r=P.ToObject(this),o=F&&k(this)?this.split(""):r,i=o.length>>>0,a=Array(i);if(arguments.length>1&&(n=arguments[1]),!e(t))throw new TypeError("Array.prototype.map callback must be a function");for(var l=0;i>l;l++)l in o&&("undefined"!=typeof n?a[l]=t.call(n,o[l],l,r):a[l]=t(o[l],l,r));return a}},!z(t.map)),j(t,{filter:function(t){var n,r,o=P.ToObject(this),i=F&&k(this)?this.split(""):o,a=i.length>>>0,l=[];if(arguments.length>1&&(r=arguments[1]),!e(t))throw new TypeError("Array.prototype.filter callback must be a function");for(var s=0;a>s;s++)s in i&&(n=i[s],("undefined"==typeof r?t(n,s,o):t.call(r,n,s,o))&&l.push(n));return l}},!z(t.filter)),j(t,{every:function(t){var n,r=P.ToObject(this),o=F&&k(this)?this.split(""):r,i=o.length>>>0;if(arguments.length>1&&(n=arguments[1]),!e(t))throw new TypeError("Array.prototype.every callback must be a function");for(var a=0;i>a;a++)if(a in o&&!("undefined"==typeof n?t(o[a],a,r):t.call(n,o[a],a,r)))return!1;return!0}},!z(t.every)),j(t,{some:function(t){var n,r=P.ToObject(this),o=F&&k(this)?this.split(""):r,i=o.length>>>0;if(arguments.length>1&&(n=arguments[1]),!e(t))throw new TypeError("Array.prototype.some callback must be a function");for(var a=0;i>a;a++)if(a in o&&("undefined"==typeof n?t(o[a],a,r):t.call(n,o[a],a,r)))return!0;return!1}},!z(t.some));var R=!1;t.reduce&&(R="object"==typeof t.reduce.call("es5",function(e,t,n,r){return r})),j(t,{reduce:function(t){var n=P.ToObject(this),r=F&&k(this)?this.split(""):n,o=r.length>>>0;if(!e(t))throw new TypeError("Array.prototype.reduce callback must be a function");if(0===o&&1===arguments.length)throw new TypeError("reduce of empty array with no initial value");var i,a=0;if(arguments.length>=2)i=arguments[1];else for(;;){if(a in r){i=r[a++];break}if(++a>=o)throw new TypeError("reduce of empty array with no initial value")}for(;o>a;a++)a in r&&(i=t(i,r[a],a,n));return i}},!R);var q=!1;t.reduceRight&&(q="object"==typeof t.reduceRight.call("es5",function(e,t,n,r){return r})),j(t,{reduceRight:function(t){var n=P.ToObject(this),r=F&&k(this)?this.split(""):n,o=r.length>>>0;if(!e(t))throw new TypeError("Array.prototype.reduceRight callback must be a function");if(0===o&&1===arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var i,a=o-1;if(arguments.length>=2)i=arguments[1];else for(;;){if(a in r){i=r[a--];break}if(--a<0)throw new TypeError("reduceRight of empty array with no initial value")}if(0>a)return i;do a in r&&(i=t(i,r[a],a,n));while(a--);return i}},!q);var V=Array.prototype.indexOf&&-1!==[0,1].indexOf(1,2);j(t,{indexOf:function(e){var t=F&&k(this)?this.split(""):P.ToObject(this),n=t.length>>>0;if(0===n)return-1;var r=0;for(arguments.length>1&&(r=P.ToInteger(arguments[1])),r=r>=0?r:Math.max(0,n+r);n>r;r++)if(r in t&&t[r]===e)return r;return-1}},V);var H=Array.prototype.lastIndexOf&&-1!==[0,1].lastIndexOf(0,-3);j(t,{lastIndexOf:function(e){var t=F&&k(this)?this.split(""):P.ToObject(this),n=t.length>>>0;if(0===n)return-1;var r=n-1;for(arguments.length>1&&(r=Math.min(r,P.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}},H);var U=!{toString:null}.propertyIsEnumerable("toString"),$=function(){}.propertyIsEnumerable("prototype"),X=!_("x","0"),Y=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],B=Y.length;j(Object,{keys:function(t){var n=e(t),r=C(t),o=null!==t&&"object"==typeof t,i=o&&k(t);if(!o&&!n&&!r)throw new TypeError("Object.keys called on a non-object");var a=[],l=$&&n;if(i&&X||r)for(var s=0;s<t.length;++s)a.push(String(s));if(!r)for(var u in t)l&&"prototype"===u||!_(t,u)||a.push(String(u));if(U)for(var c=t.constructor,f=c&&c.prototype===t,d=0;B>d;d++){var p=Y[d];f&&"constructor"===p||!_(t,p)||a.push(p)}return a}});var W=Object.keys&&function(){return 2===Object.keys(arguments).length}(1,2),K=Object.keys;j(Object,{keys:function(e){return K(C(e)?t.slice.call(e):e)}},!W);var G=-621987552e5,Z="-000001",J=Date.prototype.toISOString&&-1===new Date(G).toISOString().indexOf(Z);j(Date.prototype,{toISOString:function(){var e,t,n,r,o;if(!isFinite(this))throw new RangeError("Date.prototype.toISOString called on non-finite value.");for(r=this.getUTCFullYear(),o=this.getUTCMonth(),r+=Math.floor(o/12),o=(o%12+12)%12,e=[o+1,this.getUTCDate(),this.getUTCHours(),this.getUTCMinutes(),this.getUTCSeconds()],r=(0>r?"-":r>9999?"+":"")+("00000"+Math.abs(r)).slice(r>=0&&9999>=r?-4:-6),t=e.length;t--;)n=e[t],10>n&&(e[t]="0"+n);return r+"-"+e.slice(0,2).join("-")+"T"+e.slice(2).join(":")+"."+("000"+this.getUTCMilliseconds()).slice(-3)+"Z"}},J);var Q=function(){try{return Date.prototype.toJSON&&null===new Date(NaN).toJSON()&&-1!==new Date(G).toJSON().indexOf(Z)&&Date.prototype.toJSON.call({toISOString:function(){return!0}})}catch(e){return!1}}();Q||(Date.prototype.toJSON=function(t){var n=Object(this),r=P.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 ee=1e15===Date.parse("+033658-09-27T01:46:40.000Z"),te=!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")),ne=isNaN(Date.parse("2000-01-01T00:00:00.000Z"));(!Date.parse||ne||te||!ee)&&(Date=function(e){var t=function(n,r,o,i,a,l,s){var u,c=arguments.length;return u=this instanceof e?1===c&&String(n)===n?new e(t.parse(n)):c>=7?new e(n,r,o,i,a,l,s):c>=6?new e(n,r,o,i,a,l):c>=5?new e(n,r,o,i,a):c>=4?new e(n,r,o,i):c>=3?new e(n,r,o):c>=2?new e(n,r):c>=1?new e(n):new e:e.apply(this,arguments),j(u,{constructor:t},!0),u},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})))?)?)?)?$"),r=[0,31,59,90,120,151,181,212,243,273,304,334,365],o=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)},i=function(t){return Number(new e(1970,0,1,0,0,0,t))};for(var a in e)_(e,a)&&(t[a]=e[a]);return j(t,{now:e.now,UTC:e.UTC},!0),t.prototype=e.prototype,j(t.prototype,{constructor:t},!0),t.parse=function(t){var r=n.exec(t);if(r){var a,l=Number(r[1]),s=Number(r[2]||1)-1,u=Number(r[3]||1)-1,c=Number(r[4]||0),f=Number(r[5]||0),d=Number(r[6]||0),p=Math.floor(1e3*Number(r[7]||0)),m=Boolean(r[4]&&!r[8]),v="-"===r[9]?1:-1,g=Number(r[10]||0),h=Number(r[11]||0);return(f>0||d>0||p>0?24:25)>c&&60>f&&60>d&&1e3>p&&s>-1&&12>s&&24>g&&60>h&&u>-1&&u<o(l,s+1)-o(l,s)&&(a=60*(24*(o(l,s)+u)+c+g*v),a=1e3*(60*(a+f+h*v)+d)+p,m&&(a=i(a)),a>=-864e13&&864e13>=a)?a:NaN}return e.parse.apply(this,arguments)},t}(Date)),Date.now||(Date.now=function(){return(new Date).getTime()});var re=i.toFixed&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==0xde0b6b3a7640080.toFixed(0)),oe={base:1e7,size:6,data:[0,0,0,0,0,0],multiply:function(e,t){for(var n=-1,r=t;++n<oe.size;)r+=e*oe.data[n],oe.data[n]=r%oe.base,r=Math.floor(r/oe.base)},divide:function(e){for(var t=oe.size,n=0;--t>=0;)n+=oe.data[t],oe.data[t]=Math.floor(n/e),n=n%e*oe.base},numToString:function(){for(var e=oe.size,t="";--e>=0;)if(""!==t||0===e||0!==oe.data[e]){var n=String(oe.data[e]);""===t?t=n:t+="0000000".slice(0,7-n.length)+n}return t},pow:function ge(e,t,n){return 0===t?n:t%2===1?ge(e,t-1,n*e):ge(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}};j(i,{toFixed:function(e){var t,n,r,o,i,a,l,s;if(t=Number(e),t=t!==t?0:Math.floor(t),0>t||t>20)throw new RangeError("Number.toFixed called with invalid number of decimals");if(n=Number(this),n!==n)return"NaN";if(-1e21>=n||n>=1e21)return String(n);if(r="",0>n&&(r="-",n=-n),o="0",n>1e-21)if(i=oe.log(n*oe.pow(2,69,1))-69,a=0>i?n*oe.pow(2,-i,1):n/oe.pow(2,i,1),a*=4503599627370496,i=52-i,i>0){for(oe.multiply(0,a),l=t;l>=7;)oe.multiply(1e7,0),l-=7;for(oe.multiply(oe.pow(10,l,1),0),l=i-1;l>=23;)oe.divide(1<<23),l-=23;oe.divide(1<<l),oe.multiply(1,1),oe.divide(2),o=oe.numToString()}else oe.multiply(0,a),oe.multiply(1<<-i,0),o=oe.numToString()+"0.00000000000000000000".slice(2,2+t);return t>0?(s=o.length,o=t>=s?r+"0.0000000000000000000".slice(0,t-s+2)+o:r+o.slice(0,s-t)+"."+o.slice(s-t)):o=r+o,o}},re);var ie=o.split;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];o.split=function(t,n){var r=this;if("undefined"==typeof t&&0===n)return[];if(!b(t))return ie.call(this,t,n);var o,i,a,l,u=[],c=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.extended?"x":"")+(t.sticky?"y":""),f=0,d=new RegExp(t.source,c+"g");r+="",e||(o=new RegExp("^"+d.source+"$(?!\\s)",c));var p="undefined"==typeof n?-1>>>0:P.ToUint32(n);for(i=d.exec(r);i&&(a=i.index+i[0].length,!(a>f&&(u.push(r.slice(f,i.index)),!e&&i.length>1&&i[0].replace(o,function(){for(var e=1;e<arguments.length-2;e++)"undefined"==typeof arguments[e]&&(i[e]=void 0)}),i.length>1&&i.index<r.length&&s.apply(u,i.slice(1)),l=i[0].length,f=a,u.length>=p)));)d.lastIndex===i.index&&d.lastIndex++,i=d.exec(r);return f===r.length?(l||!d.test(""))&&u.push(""):u.push(r.slice(f)),u.length>p?u.slice(0,p):u}}():"0".split(void 0,0).length&&(o.split=function(e,t){return"undefined"==typeof e&&0===t?[]:ie.call(this,e,t)});var ae=o.replace,le=function(){var e=[];return"x".replace(/x(.)?/g,function(t,n){e.push(n)}),1===e.length&&"undefined"==typeof e[0]}();le||(o.replace=function(t,n){var r=e(n),o=b(t)&&/\)[*?]/.test(t.source);if(r&&o){var i=function(e){var r=arguments.length,o=t.lastIndex;t.lastIndex=0;var i=t.exec(e)||[];return t.lastIndex=o,i.push(arguments[r-2],arguments[r-1]),n.apply(this,i)};return ae.call(this,t,i)}return ae.call(this,t,n)});var se=o.substr,ue="".substr&&"b"!=="0b".substr(-1);j(o,{substr:function(e,t){var n=e;return 0>e&&(n=Math.max(this.length+e,0)),se.call(this,n,t)}},ue);var ce=" \n\f\r   ᠎              \u2028\u2029\ufeff",fe="​",de="["+ce+"]",pe=new RegExp("^"+de+de+"*"),me=new RegExp(de+de+"*$"),ve=o.trim&&(ce.trim()||!fe.trim());j(o,{trim:function(){if("undefined"==typeof this||null===this)throw new TypeError("can't convert "+this+" to object");return String(this).replace(pe,"").replace(me,"")}},ve),(8!==parseInt(ce+"08")||22!==parseInt(ce+"0x16"))&&(parseInt=function(e){var t=/^0[xX]/;return function(n,r){var o=String(n).trim(),i=Number(r)||(t.test(o)?16:10);return e(o,i)}}(parseInt))})},{}],25:[function(e,t,n){var r=[],o=r.forEach,i=r.slice;t.exports=function(e){return o.call(i.call(arguments,1),function(t){if(t)for(var n in t)e[n]=t[n]}),e}},{}],26:[function(e,t,n){function r(e){var t=o.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 o=Object.prototype.toString},{}],27:[function(e,t,n){"use strict";t.exports=function(e){return"object"==typeof e&&null!==e}},{}],28:[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 s;return 1}function t(t,n){e(t,function(e){return!n(e)})}function n(i,a,l){function s(e){return e.call?e():d[e]}function c(){if(!--y){d[h]=1,g&&g();for(var n in m)e(n.split("|"),s)&&!t(m[n],s)&&(m[n]=[])}}i=i[u]?i:[i];var f=a&&a.call,g=f?a:l,h=f?i.join(""):a,y=i.length;return setTimeout(function(){t(i,function e(t,n){return null===t?c():(t=n||-1!==t.indexOf(".js")||/^https?:\/\//.test(t)||!o?t:o+t+".js",v[t]?(h&&(p[h]=1),2==v[t]?c():setTimeout(function(){e(t,!0)},0)):(v[t]=1,h&&(p[h]=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,v[e]=2,t())},r.async=1,r.src=i?e+(-1===e.indexOf("?")?"?":"&")+i:e,l.insertBefore(r,l.lastChild)}var o,i,a=document,l=a.getElementsByTagName("head")[0],s=!1,u="push",c="readyState",f="onreadystatechange",d={},p={},m={},v={};return n.get=r,n.order=function(e,t,r){!function o(i){i=e.shift(),e.length?n(i,o):n(i,t,r)}()},n.path=function(e){o=e},n.urlArgs=function(e){i=e},n.ready=function(r,o,i){r=r[u]?r:[r];var a=[];return!t(r,function(e){d[e]||a[u](e)})&&e(r,function(e){return d[e]})?o():!function(e){m[e]=m[e]||[],m[e][u](o),i&&i(a)}(r.join("|")),n},n.done=function(e){n([null],e)},n})},{}],29:[function(t,n,r){(function(t){!function(o){function i(e){throw RangeError(M[e])}function a(e,t){for(var n=e.length;n--;)e[n]=t(e[n]);return e}function l(e,t){return a(e.split(D),t).join(".")}function s(e){for(var t,n,r=[],o=0,i=e.length;i>o;)t=e.charCodeAt(o++),t>=55296&&56319>=t&&i>o?(n=e.charCodeAt(o++),56320==(64512&n)?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--)):r.push(t);return r}function u(e){return a(e,function(e){var t="";return e>65535&&(e-=65536,t+=F(e>>>10&1023|55296),e=56320|1023&e),t+=F(e)}).join("")}function c(e){return 10>e-48?e-22:26>e-65?e-65:26>e-97?e-97:k}function f(e,t){return e+22+75*(26>e)-((0!=t)<<5)}function d(e,t,n){var r=0;for(e=n?I(e/C):e>>1,e+=I(e/t);e>L*S>>1;r+=k)e=I(e/L);return I(r+(L+1)*e/(e+N))}function p(e){var t,n,r,o,a,l,s,f,p,m,v=[],g=e.length,h=0,y=O,b=j;for(n=e.lastIndexOf(P),0>n&&(n=0),r=0;n>r;++r)e.charCodeAt(r)>=128&&i("not-basic"),v.push(e.charCodeAt(r));for(o=n>0?n+1:0;g>o;){for(a=h,l=1,s=k;o>=g&&i("invalid-input"),f=c(e.charCodeAt(o++)),(f>=k||f>I((E-h)/l))&&i("overflow"),h+=f*l,p=b>=s?T:s>=b+S?S:s-b,!(p>f);s+=k)m=k-p,l>I(E/m)&&i("overflow"),l*=m;t=v.length+1,b=d(h-a,t,0==a),I(h/t)>E-y&&i("overflow"),y+=I(h/t),h%=t,v.splice(h++,0,y)}return u(v)}function m(e){var t,n,r,o,a,l,u,c,p,m,v,g,h,y,b,w=[];for(e=s(e),g=e.length,t=O,n=0,a=j,l=0;g>l;++l)v=e[l],128>v&&w.push(F(v));for(r=o=w.length,o&&w.push(P);g>r;){for(u=E,l=0;g>l;++l)v=e[l],v>=t&&u>v&&(u=v);for(h=r+1,u-t>I((E-n)/h)&&i("overflow"),n+=(u-t)*h,t=u,l=0;g>l;++l)if(v=e[l],t>v&&++n>E&&i("overflow"),v==t){for(c=n,p=k;m=a>=p?T:p>=a+S?S:p-a,!(m>c);p+=k)b=c-m,y=k-m,w.push(F(f(m+b%y,0))),c=I(b/y);w.push(F(f(c,0))),a=d(n,h,r==o),n=0,++r}++n,++t}return w.join("")}function v(e){return l(e,function(e){
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
 
29
  flowplayer.conf.native_fullscreen = true;
30
  }
31
 
32
+ if( 'ontouchstart' in window ) {
33
+ if( /Android/.test(navigator.userAgent) && parseFloat(/Android\ (\d\.\d)/.exec(window.navigator.userAgent)[1], 10) < 4.4 && ! ( /Chrome/.test(navigator.userAgent) && parseFloat(/Chrome\/(\d\d)/.exec(navigator.userAgent)[1], 10) > 54 ) ) {
34
+ flowplayer.conf.native_fullscreen = true;
35
+ }
36
+
37
+ var isiOS = /iPad/i.test(navigator.userAgent) || /iPhone/.test(navigator.userAgent);
38
+ var iOSVersion = isiOS ? parseFloat(/CPU (?:iPhone |iPod )?OS (\d+)/.exec(navigator.userAgent)[1], 10) : 0;
39
+ if( isiOS && iOSVersion < 7 ) {
40
+ flowplayer.conf.native_fullscreen = true;
41
+ }
42
  }
43
  }
44
  if( typeof(fv_flowplayer_translations) != "undefined" ) {
80
  }
81
  }
82
 
83
+ function fv_wp_flowplayer_admin_support_mail( hash, button ) {
84
  jQuery('.fv_flowplayer_submit_error').remove();
85
 
86
  var comment_text = jQuery('#wpfp_support_'+hash).val();
356
  var fv_flowplayer_safety_resize_init = false;
357
 
358
  jQuery('.flowplayer').each( function() {
359
+ if( !jQuery(this).is(":visible") || jQuery(this).hasClass('lightboxed') || jQuery(this).hasClass('lightbox-starter') || jQuery(this).hasClass('is-audio') ) return;
360
 
361
  if( jQuery(this).width() < 30 || jQuery(this).height() < 20 ) {
362
  fv_flowplayer_safety_resize_init = true
398
 
399
 
400
 
401
+ function fv_player_videos_parse(args, root) {
402
+ var videos = JSON.parse(args);
403
+
404
+ var regex = new RegExp("[\\?&]fv_flowplayer_mobile=([^&#]*)");
405
+ var results = regex.exec(location.search);
406
+ if(
407
+ (
408
+ (results != null && results[1] == 'yes') ||
409
+ (jQuery(window).width() <= 480 || jQuery(window).height() <= 480) // todo: improve for Android with 1.5 pixel ratio
410
+ )
411
+ &&
412
+ (results == null || results[1] != 'no')
413
+ ) {
414
+ var fv_fp_mobile = false;
415
+ jQuery(videos.sources).each( function(k,v) {
416
+ if(v.mobile) {
417
+ videos.sources[k] = videos.sources[0];
418
+ videos.sources[0] = v;
419
+ fv_fp_mobile = true;
420
+ }
421
+ if( fv_fp_mobile ) {
422
+ jQuery(root).after('<p class="fv-flowplayer-mobile-switch">'+fv_flowplayer_translations.mobile_browser_detected_1+' <a href="'+document.URL+'?fv_flowplayer_mobile=no">'+fv_flowplayer_translations.mobile_browser_detected_2+'</a> '+fv_flowplayer_translations.mobile_browser_detected_3+'</p>');
423
+ }
424
+ });
425
+ }
426
+ return videos;
427
+ }
428
+
429
+
430
+
431
+
432
  jQuery(document).ready( function() {
433
 
434
+ if( flowplayer.support.touch ) {
435
+ jQuery('.fp-playlist-external').addClass('is-touch');
436
+ }
437
+
438
  jQuery('.fp-playlist-external' ).each( function(i,el) {
439
  if( jQuery('a',el).length == 0 ) return;
440
  jQuery('a',el).click( function(e) {
467
  if( !api.conf.playlist && playlist.length && playlist.find('a[data-item]').length > 0 ) {
468
  var items = [];
469
  playlist.find('a[data-item]').each( function() {
470
+ items.push( fv_player_videos_parse(jQuery(this).attr('data-item'), root) );
471
  });
472
  api.conf.playlist = items;
473
  api.conf.clip = items[0];
474
  } else if( !api.conf.clip ){
475
+ api.conf.clip = fv_player_videos_parse(jQuery(root).attr('data-item'), root);
476
  }
477
 
478
  api.bind('load', function(e,api,video) {
529
 
530
  function fv_player_load() {
531
 
532
+ // Single videos - new style
533
  jQuery('.flowplayer[data-item]' ).each( function(i,el) {
534
  var root = jQuery(el);
535
  var api = root.data('flowplayer');
536
  if( api ) return;
537
 
538
+ root.flowplayer( { clip: fv_player_videos_parse(root.attr('data-item'), root) }); // todo: IE6-8
539
  } );
540
 
541
  // Playlist - new style
550
  if ( playlist.find('a[data-item]').length == 0 ) return; // respect old playlist script setup
551
 
552
  playlist.find('a[data-item]').each( function() {
553
+ items.push( fv_player_videos_parse(jQuery(this).attr('data-item'), player) );
554
  });
555
  player.flowplayer( { playlist: items } );
556
  }
720
  */
721
  flowplayer(function (api,root) {
722
  root = jQuery(root);
723
+
724
+ if( root.data('end_popup_preview') ){
725
+ jQuery(document).ready( function() {
726
+ api.trigger('finish', [ api] );
727
+ });
728
+ }
729
+
730
  var player_id = root.attr('id');
731
  api.bind("ready", function (e, api) {
732
  //console.log('ad ready to show',root.attr('class'));
740
  if( root.find('.wpfp_custom_popup').length > 0) {
741
  root.find('.wpfp_custom_popup').show();
742
  } else if( typeof(fv_flowplayer_popup) != "undefined" && typeof(fv_flowplayer_popup[player_id]) != "undefined" ) {
743
+ root.find('.fp-player').append( '<div id="'+player_id+'_custom_popup" class="wpfp_custom_popup">'+fv_flowplayer_popup[player_id].html+'</div>' );
744
  }
745
  }
746
 
759
  });
760
  });
761
 
 
 
 
762
  /*
763
  * Popups form
764
  */
765
+ jQuery(document).on('focus','.fv_player_popup input[type=text], .fv_player_popup input[type=email], .fv_player_popup textarea', function() {
766
  var api = jQuery(this).parents('.flowplayer').data('flowplayer');
767
  if( api ) api.disable(true);
768
  });
769
+ jQuery(document).on('blur','.fv_player_popup input[type=text], .fv_player_popup input[type=email], .fv_player_popup textarea', function() {
770
  var api = jQuery(this).parents('.flowplayer').data('flowplayer');
771
  if( api ) api.disable(false);
772
  });
955
  function fv_player_track_name(root,video) {
956
  var name = root.attr("title");
957
  if( !name && typeof(video.fv_title) != "undefined" ) name = video.fv_title;
958
+ if( !name && typeof(video.src) != "undefined" ) {
959
+ name = video.src.split("/").slice(-1)[0].replace(/\.(\w{3,4})(\?.*)?$/i, '');
960
+ if( video.type.match(/mpegurl/) ) name = video.src.split("/").slice(-2)[0].replace(/\.(\w{3,4})(\?.*)?$/i, '') + '/' + name;
961
+ }
962
  return name;
963
  }
964
 
1194
  flowplayer(function (api, root) {
1195
  if( jQuery(root).find('.sharing-link').length > 0 ) {
1196
  api.on('progress',function(e,api){
1197
+ if( !api.video.sources || !api.video.sources[0] ) {
1198
  return;
1199
  }
1200
 
1372
  * HLS.js fallback to Flowplayer Flash HLS
1373
  */
1374
  flowplayer(function(api, root) {
1375
+ var store_engine_pos = -1;
1376
+ var store_engine = false;
1377
+
1378
  api.on("error", function (e, api, err) {
1379
  if( err.code != 4 || api.engine.engineName != 'hlsjs' ) return;
1380
 
1384
  jQuery(root).removeClass('is-error');
1385
  jQuery(flowplayer.engines).each( function(k,v) {
1386
  if( flowplayer.engines[k].engineName == 'hlsjs' ){
1387
+ store_engine_pos = k;
1388
+ store_engine = flowplayer.engines[k];
1389
+ delete(flowplayer.engines[k]);
1390
  }
1391
  });
1392
 
1395
  video.index = index;
1396
 
1397
  api.load({ sources: video });
1398
+
1399
+ // without this any further HLS playback won't use HLS.js
1400
+ api.bind('unload error', function() {
1401
+ flowplayer.engines[store_engine_pos] = store_engine;
1402
+ });
1403
  });
1404
  });
1405
 
1425
 
1426
 
1427
 
1428
+
 
 
1429
  flowplayer(function(api, root) {
1430
+ /*
1431
+ * Chrome 55>= video download button fix
1432
+ */
1433
+ api.bind('ready', function() {
1434
+ if( /Chrome/.test(navigator.userAgent) && parseFloat(/Chrome\/(\d\d)/.exec(navigator.userAgent)[1], 10) > 54 ) {
1435
+ if( api.video.subtitles ) {
1436
+ jQuery(root).addClass('chrome55fix-subtitles');
1437
+ } else {
1438
+ jQuery(root).addClass('chrome55fix');
1439
+ }
1440
+ }
1441
+ });
1442
 
1443
+ /*
1444
+ * Splash dimension bugfix
1445
+ */
1446
  root = jQuery(root);
1447
  var image_src = root.css('background-image')
1448
  if( image_src ) {
1462
  }
1463
  });
1464
 
1465
+ /*
1466
+ * MAILCHIMP FORM
1467
+ */
1468
+ (function($){
1469
+ flowplayer(function(api, root) {
1470
+ if( jQuery(root).hasClass('is-cva') ) return;
1471
 
1472
+ $(document).on('submit','#' + jQuery(root).attr('id') + ' .mailchimp-form' ,function(e){
1473
+ e.preventDefault();
1474
+
1475
+ $('.mailchimp-response',root).remove();
1476
+ $('input[type=submit]',root).attr('disabled','disabled').addClass('fv-form-loading');
1477
+
1478
+ var data = {action:"fv_wp_flowplayer_email_signup"};
1479
+ $('[name]',this).each(function(){
1480
+ data[this.name] = $(this).val();
1481
+ });
1482
+ $.post(fv_fp_ajaxurl,data,function( response ) {
1483
+ response = JSON.parse(response);
1484
+ $('<div class="mailchimp-response"></div>').insertAfter('.mailchimp-form',root);
1485
+
1486
+ if( response.text.match(/already subscribed/) ) {
1487
+ response.status = 'ERROR';
1488
+ }
1489
 
1490
+ if(response.status === 'OK'){
1491
+ $('.mailchimp-form input[type=text],.mailchimp-form input[type=email]',root).val('');
1492
+ $('.mailchimp-response',root).removeClass('is-fv-error').html(response.text);
1493
+
1494
+ setTimeout( function() {
1495
+ $('.wpfp_custom_popup',root).fadeOut();
1496
+ }, 2000 );
1497
+
1498
+ }else{
1499
+ $('.mailchimp-response',root).addClass('is-fv-error').html(response.text);
1500
+ }
1501
+ $('input[type=submit]',root).removeAttr('disabled').removeClass('fv-form-loading');
1502
+ });
1503
+ });
1504
+ });
1505
+ }(jQuery));
1506
 
1507
  /* *
1508
  * WARNINGS
1509
  */
1510
  if( typeof(flowplayer) != "undefined" ) { // stop lightbox from playing if it's closed
1511
+ flowplayer(function (api,root) {
1512
+ root = jQuery(root);
1513
 
1514
  // Subtitles which iPhone can't show
1515
  if( navigator.userAgent.match(/iPhone.* OS [0-6]_/i)){
1522
 
1523
  // unstable Android
1524
  if( !navigator.userAgent.match(/Firefox/i) && navigator.userAgent.match(/Android ([123].[\d](.[\d])?|4.[321](.[\d])?).*((GT|SGH|SCH|SHV)-[a-z]\d{3}|samsung)/i)){
1525
+ fv_player_warning(root,fv_flowplayer_translations.warning_unstable_android,'firefox');
1526
  }
1527
 
1528
  // Vimeo misbehaving on Android 4.4
1533
  fv_player_warning(root,fv_flowplayer_translations.warning_unstable_android,'firefox');
1534
 
1535
  api.on('progress', function(e,api) {
1536
+ root.prev().find('.fv-player-warning-firefox').remove();
1537
  });
1538
  }
1539
  }, 1500 );
1541
 
1542
  api.on('error', function(e,api,error) { // works for Huawei Android 4.3
1543
  if( error.MEDIA_ERR_NETWORK == 2 && error.video.src.match(/fpdl.vimeocdn.com/) ) {
1544
+ fv_player_warning(root,fv_flowplayer_translations.warning_unstable_android,'firefox');
1545
  }
1546
  });
1547
  }
1566
  wrapper = jQuery(root).prev('.fv-player-warning-wrapper');
1567
  }
1568
 
1569
+ if( wrapper.find('.fv-player-warning-'+classname).length == 0 ) {
1570
+ var latest = jQuery("<p style='display: none' "+(classname?" class='fv-player-warning-"+classname+"'" : "")+">"+warning+"</p>");
1571
+ wrapper.append(latest);
1572
+ latest.slideDown();
1573
+ }
1574
  }
1575
  }
1576
 
1577
 
1578
  /*
1579
+ * Player size dependent classes - .is-wide, .is-fv-narrow
1580
  */
1581
  flowplayer(function(api, root) {
1582
  root = jQuery(root);
1583
+ var active = false;
1584
+
1585
+ function check_size() {
1586
+ if(root.width() > 900) {
1587
+ jQuery('.fp-subtitle',root).addClass('is-wide');
1588
+ } else {
1589
+ jQuery('.fp-subtitle',root).removeClass('is-wide');
1590
+ }
1591
+
1592
+ if(root.width() <= 560) {
1593
+ root.addClass('is-fv-narrow');
1594
+ } else {
1595
+ root.removeClass('is-fv-narrow');
1596
+ }
1597
+ }
1598
+
1599
+ check_size();
1600
+
1601
+ setInterval(function(){
1602
+ if( !active ) return;
1603
+ active = false;
1604
+
1605
+ check_size();
1606
+ }, 50);
1607
+
1608
+ jQuery(window).on('resize',function(){
1609
+ active = true;
1610
  });
1611
+
1612
  api.on('unload pause finish error',function(){
1613
+ if(typeof(checker) !== 'undefined')
1614
+ clearInterval(checker);
1615
  })
1616
  })
1617
 
1618
 
1619
+ jQuery(window).on('resize',function(){
1620
+ jQuery('.fp-playlist-external').each(function(){
1621
+ var playlist = jQuery(this);
1622
+ if( playlist.parent().width() >= 900 ) playlist.addClass('is-wide');
1623
+ else playlist.removeClass('is-wide');
1624
+ })
1625
+ }).trigger('resize');
1626
+
1627
 
1628
 
1629
  /*
1630
  * Audio support
1631
  */
1632
  flowplayer(function(api, root) {
1633
+ root = jQuery(root);
1634
  var bean = flowplayer.bean;
1635
 
1636
+ if( root.hasClass('is-audio') ) {
1637
+ bean.off(root[0], "mouseenter");
1638
+ bean.off(root[0], "mouseleave");
1639
+ root.removeClass('is-mouseout');
1640
+ root.addClass('fixed-controls').addClass('is-mouseover');
1641
+
1642
+ api.on('error', function (e,api, error) {
1643
+ jQuery('.fp-message',root).html( jQuery('.fp-message',root).html().replace(/video/,'audio') );
1644
+ });
1645
+
1646
+ root.click( function(e) {
1647
+ if( !api.ready) {
1648
+ e.preventDefault();
1649
+ e.stopPropagation();
1650
+ api.load();
1651
+ }
1652
+ })
1653
+ }
1654
+
1655
  })
1656
 
1657
 
1684
  fv_player_doCopy(text);
1685
  successCallback();
1686
  } catch (e) {
1687
+ if( typeof(errorCallback) != "undefined" ) errorCallback(e);
1688
  }
1689
  };
1690
 
1825
 
1826
  if( flowplayer.conf.mobile_force_fullscreen && ( 'ontouchstart' in window ) && !flowplayer.support.firstframe ) {
1827
  flowplayer(function(api, root) {
1828
+ if( /iPad/.test(navigator.userAgent) || /iPhone OS 10/.test(navigator.userAgent) ) {
1829
  api.bind('ready', function() {
1830
  api.fullscreen();
1831
  });
includes/mailchimp-api/LICENSE ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2013 Drew McLellan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
includes/mailchimp-api/README.md ADDED
@@ -0,0 +1,223 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MailChimp API
2
+ =============
3
+
4
+ Super-simple, minimum abstraction MailChimp API v3 wrapper, in PHP.
5
+
6
+ I hate complex wrappers. This lets you get from the MailChimp API docs to the code as directly as possible.
7
+
8
+ Requires PHP 5.3 and a pulse. Abstraction is for chimps.
9
+
10
+ [![Build Status](https://travis-ci.org/drewm/mailchimp-api.svg?branch=master)](https://travis-ci.org/drewm/mailchimp-api)
11
+ [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/drewm/mailchimp-api/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/drewm/mailchimp-api/?branch=master)
12
+ [![Packagist](https://img.shields.io/packagist/dt/drewm/mailchimp-api.svg?maxAge=2592000)](https://packagist.org/packages/drewm/mailchimp-api)
13
+
14
+ Installation
15
+ ------------
16
+
17
+ You can install mailchimp-api using Composer:
18
+
19
+ ```
20
+ composer require drewm/mailchimp-api
21
+ ```
22
+
23
+ You will then need to:
24
+ * run ``composer install`` to get these dependencies added to your vendor directory
25
+ * add the autoloader to your application with this line: ``require("vendor/autoload.php")``
26
+
27
+ Alternatively you can just download the `MailChimp.php` file and include it manually:
28
+
29
+ ```php
30
+ include('./MailChimp.php');
31
+ ```
32
+
33
+ If you wish to use the batch request or webhook interfaces, you'll also need to download and include the `Batch.php` or `Webhook.php` files:
34
+
35
+ ```php
36
+ include('./Batch.php');
37
+ include('./Webhook.php');
38
+ ```
39
+
40
+ These are optional. If you're not using batches or webhooks you can just skip them. You can always come back and add them later.
41
+
42
+ Examples
43
+ --------
44
+
45
+ Start by `use`-ing the class and creating an instance with your API key
46
+
47
+ ```php
48
+ use \DrewM\MailChimp\MailChimp;
49
+
50
+ $MailChimp = new MailChimp('abc123abc123abc123abc123abc123-us1');
51
+ ```
52
+
53
+ Then, list all the mailing lists (with a `get` on the `lists` method)
54
+
55
+ ```php
56
+ $result = $MailChimp->get('lists');
57
+
58
+ print_r($result);
59
+ ```
60
+
61
+ Subscribe someone to a list (with a `post` to the `lists/{listID}/members` method):
62
+
63
+ ```php
64
+ $list_id = 'b1234346';
65
+
66
+ $result = $MailChimp->post("lists/$list_id/members", [
67
+ 'email_address' => 'davy@example.com',
68
+ 'status' => 'subscribed',
69
+ ]);
70
+
71
+ print_r($result);
72
+ ```
73
+
74
+ Update a list member with more information (using `patch` to update):
75
+
76
+ ```php
77
+ $list_id = 'b1234346';
78
+ $subscriber_hash = $MailChimp->subscriberHash('davy@example.com');
79
+
80
+ $result = $MailChimp->patch("lists/$list_id/members/$subscriber_hash", [
81
+ 'merge_fields' => ['FNAME'=>'Davy', 'LNAME'=>'Jones'],
82
+ 'interests' => ['2s3a384h' => true],
83
+ ]);
84
+
85
+ print_r($result);
86
+ ```
87
+
88
+ Remove a list member using the `delete` method:
89
+
90
+ ```php
91
+ $list_id = 'b1234346';
92
+ $subscriber_hash = $MailChimp->subscriberHash('davy@example.com');
93
+
94
+ $MailChimp->delete("lists/$list_id/members/$subscriber_hash");
95
+ ```
96
+
97
+ Quickly test for a successful action with the `success()` method:
98
+
99
+ ```php
100
+ $list_id = 'b1234346';
101
+
102
+ $result = $MailChimp->post("lists/$list_id/members", [
103
+ 'email_address' => 'davy@example.com',
104
+ 'status' => 'subscribed',
105
+ ]);
106
+
107
+ if ($MailChimp->success()) {
108
+ print_r($result);
109
+ } else {
110
+ echo $MailChimp->getLastError();
111
+ }
112
+ ```
113
+
114
+ Batch Operations
115
+ ----------------
116
+
117
+ The MailChimp [Batch Operations](http://developer.mailchimp.com/documentation/mailchimp/guides/how-to-use-batch-operations/) functionality enables you to complete multiple operations with a single call. A good example is adding thousands of members to a list - you can perform this in one request rather than thousands.
118
+
119
+ ```php
120
+ use \DrewM\MailChimp\MailChimp;
121
+ use \DrewM\MailChimp\Batch;
122
+
123
+ $MailChimp = new MailChimp('abc123abc123abc123abc123abc123-us1');
124
+ $Batch = $MailChimp->new_batch();
125
+ ```
126
+
127
+ You can then make requests on the `Batch` object just as you would normally with the `MailChimp` object. The difference is that you need to set an ID for the operation as the first argument, and also that you won't get a response. The ID is used for finding the result of this request in the combined response from the batch operation.
128
+
129
+ ```php
130
+ $Batch->post("op1", "lists/$list_id/members", [
131
+ 'email_address' => 'micky@example.com',
132
+ 'status' => 'subscribed',
133
+ ]);
134
+
135
+ $Batch->post("op2", "lists/$list_id/members", [
136
+ 'email_address' => 'michael@example.com',
137
+ 'status' => 'subscribed',
138
+ ]);
139
+
140
+ $Batch->post("op3", "lists/$list_id/members", [
141
+ 'email_address' => 'peter@example.com',
142
+ 'status' => 'subscribed',
143
+ ]);
144
+ ```
145
+
146
+ Once you've finished all the requests that should be in the batch, you need to execute it.
147
+
148
+ ```php
149
+ $result = $Batch->execute();
150
+ ```
151
+
152
+ The result includes a batch ID. At a later point, you can check the status of your batch:
153
+
154
+ ```php
155
+ $MailChimp->new_batch($batch_id);
156
+ $result = $Batch->check_status();
157
+ ```
158
+
159
+ When your batch is finished, you can download the results from the URL given in the response. In the JSON, the result of each operation will be keyed by the ID you used as the first argument for the request.
160
+
161
+ Webhooks
162
+ --------
163
+
164
+ **Note:** Use of the Webhooks functionality requires at least PHP 5.4.
165
+
166
+ MailChimp [webhooks](http://kb.mailchimp.com/integrations/other-integrations/how-to-set-up-webhooks) enable your code to be notified of changes to lists and campaigns.
167
+
168
+ When you set up a webhook you specify a URL on your server for the data to be sent to. This wrapper's Webhook class helps you catch that incoming webhook in a tidy way. It uses a subscription model, with your code subscribing to whichever webhook events it wants to listen for. You provide a callback function that the webhook data is passed to.
169
+
170
+ To listen for the `unsubscribe` webhook:
171
+
172
+ ```php
173
+ use \DrewM\MailChimp\Webhook;
174
+
175
+ Webhook::subscribe('unsubscribe', function($data){
176
+ print_r($data);
177
+ });
178
+ ```
179
+
180
+ At first glance the _subscribe/unsubscribe_ looks confusing - your code is subscribing to the MailChimp `unsubscribe` webhook event. The callback function is passed as single argument - an associative array containing the webhook data.
181
+
182
+ If you'd rather just catch all webhooks and deal with them yourself, you can use:
183
+
184
+ ```php
185
+ use \DrewM\MailChimp\Webhook;
186
+
187
+ $result = Webhook::receive();
188
+ print_r($result);
189
+ ```
190
+
191
+ There doesn't appear to be any documentation for the content of the webhook data. It's helpful to use something like [ngrok](https://ngrok.com) for tunneling the webhooks to your development machine - you can then use its web interface to inspect what's been sent and to replay incoming webhooks while you debug your code.
192
+
193
+ Troubleshooting
194
+ ---------------
195
+
196
+ To get the last error returned by either the HTTP client or by the API, use `getLastError()`:
197
+
198
+ ```php
199
+ echo $MailChimp->getLastError();
200
+ ```
201
+
202
+ For further debugging, you can inspect the headers and body of the response:
203
+
204
+ ```php
205
+ print_r($MailChimp->getLastResponse());
206
+ ```
207
+
208
+ If you suspect you're sending data in the wrong format, you can look at what was sent to MailChimp by the wrapper:
209
+
210
+ ```php
211
+ print_r($MailChimp->getLastRequest());
212
+ ```
213
+
214
+ If your server's CA root certificates are not up to date you may find that SSL verification fails and you don't get a response. The correction solution for this [is not to disable SSL verification](http://snippets.webaware.com.au/howto/stop-turning-off-curlopt_ssl_verifypeer-and-fix-your-php-config/). The solution is to update your certificates. If you can't do that, there's an option at the top of the class file. Please don't just switch it off without at least attempting to update your certs -- that's lazy and dangerous. You're not a lazy, dangerous developer are you?
215
+
216
+ Contributing
217
+ ------------
218
+
219
+ This is a fairly simple wrapper, but it has been made much better by contributions from those using it. If you'd like to suggest an improvement, please raise an issue to discuss it before making your pull request.
220
+
221
+ Pull requests for bugs are more than welcome - please explain the bug you're trying to fix in the message.
222
+
223
+ There are a small number of PHPUnit unit tests. To get up and running, copy `.env.example` to `.env` and add your API key details. Unit testing against an API is obviously a bit tricky, but I'd welcome any contributions to this. It would be great to have more test coverage.
includes/mailchimp-api/composer.json ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "drewm/mailchimp-api",
3
+ "description": "Super-simple, minimum abstraction MailChimp API v3 wrapper",
4
+ "license": "MIT",
5
+ "require": {
6
+ "php": ">=5.3",
7
+ "ext-curl": "*"
8
+ },
9
+ "require-dev": {
10
+ "phpunit/phpunit": "4.0.*",
11
+ "vlucas/phpdotenv": "^2.0"
12
+ },
13
+ "autoload": {
14
+ "psr-4": {
15
+ "DrewM\\MailChimp\\": "src"
16
+ }
17
+ },
18
+ "homepage": "https://github.com/drewm/mailchimp-api",
19
+ "authors": [
20
+ {
21
+ "name": "Drew McLellan",
22
+ "email": "drew.mclellan@gmail.com",
23
+ "homepage": "http://allinthehead.com/"
24
+
25
+ }
26
+ ]
27
+
28
+ }
includes/mailchimp-api/src/Batch.php ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace DrewM\MailChimp;
4
+
5
+ /**
6
+ * A MailChimp Batch operation.
7
+ * http://developer.mailchimp.com/documentation/mailchimp/reference/batches/
8
+ *
9
+ * @author Drew McLellan <drew.mclellan@gmail.com>
10
+ */
11
+ class Batch
12
+ {
13
+ private $MailChimp;
14
+
15
+ private $operations = array();
16
+ private $batch_id;
17
+
18
+ public function __construct(MailChimp $MailChimp, $batch_id = null)
19
+ {
20
+ $this->MailChimp = $MailChimp;
21
+ $this->batch_id = $batch_id;
22
+ }
23
+
24
+ /**
25
+ * Add an HTTP DELETE request operation to the batch - for deleting data
26
+ * @param string $id ID for the operation within the batch
27
+ * @param string $method URL of the API request method
28
+ * @return void
29
+ */
30
+ public function delete($id, $method)
31
+ {
32
+ $this->queueOperation('DELETE', $id, $method);
33
+ }
34
+
35
+ /**
36
+ * Add an HTTP GET request operation to the batch - for retrieving data
37
+ * @param string $id ID for the operation within the batch
38
+ * @param string $method URL of the API request method
39
+ * @param array $args Assoc array of arguments (usually your data)
40
+ * @return void
41
+ */
42
+ public function get($id, $method, $args = array())
43
+ {
44
+ $this->queueOperation('GET', $id, $method, $args);
45
+ }
46
+
47
+ /**
48
+ * Add an HTTP PATCH request operation to the batch - for performing partial updates
49
+ * @param string $id ID for the operation within the batch
50
+ * @param string $method URL of the API request method
51
+ * @param array $args Assoc array of arguments (usually your data)
52
+ * @return void
53
+ */
54
+ public function patch($id, $method, $args = array())
55
+ {
56
+ $this->queueOperation('PATCH', $id, $method, $args);
57
+ }
58
+
59
+ /**
60
+ * Add an HTTP POST request operation to the batch - for creating and updating items
61
+ * @param string $id ID for the operation within the batch
62
+ * @param string $method URL of the API request method
63
+ * @param array $args Assoc array of arguments (usually your data)
64
+ * @return void
65
+ */
66
+ public function post($id, $method, $args = array())
67
+ {
68
+ $this->queueOperation('POST', $id, $method, $args);
69
+ }
70
+
71
+ /**
72
+ * Add an HTTP PUT request operation to the batch - for creating new items
73
+ * @param string $id ID for the operation within the batch
74
+ * @param string $method URL of the API request method
75
+ * @param array $args Assoc array of arguments (usually your data)
76
+ * @return void
77
+ */
78
+ public function put($id, $method, $args = array())
79
+ {
80
+ $this->queueOperation('PUT', $id, $method, $args);
81
+ }
82
+
83
+ /**
84
+ * Execute the batch request
85
+ * @param int $timeout Request timeout in seconds (optional)
86
+ * @return array|false Assoc array of API response, decoded from JSON
87
+ */
88
+ public function execute($timeout = 10)
89
+ {
90
+ $req = array('operations' => $this->operations);
91
+
92
+ $result = $this->MailChimp->post('batches', $req, $timeout);
93
+
94
+ if ($result && isset($result['id'])) {
95
+ $this->batch_id = $result['id'];
96
+ }
97
+
98
+ return $result;
99
+ }
100
+
101
+ /**
102
+ * Check the status of a batch request. If the current instance of the Batch object
103
+ * was used to make the request, the batch_id is already known and is therefore optional.
104
+ * @param string $batch_id ID of the batch about which to enquire
105
+ * @return array|false Assoc array of API response, decoded from JSON
106
+ */
107
+ public function check_status($batch_id = null)
108
+ {
109
+ if ($batch_id === null && $this->batch_id) {
110
+ $batch_id = $this->batch_id;
111
+ }
112
+
113
+ return $this->MailChimp->get('batches/' . $batch_id);
114
+ }
115
+
116
+ /**
117
+ * Get operations
118
+ * @return array
119
+ */
120
+ public function get_operations()
121
+ {
122
+ return $this->operations;
123
+ }
124
+
125
+ /**
126
+ * Add an operation to the internal queue.
127
+ * @param string $http_verb GET, POST, PUT, PATCH or DELETE
128
+ * @param string $id ID for the operation within the batch
129
+ * @param string $method URL of the API request method
130
+ * @param array $args Assoc array of arguments (usually your data)
131
+ * @return void
132
+ */
133
+ private function queueOperation($http_verb, $id, $method, $args = null)
134
+ {
135
+ $operation = array(
136
+ 'operation_id' => $id,
137
+ 'method' => $http_verb,
138
+ 'path' => $method,
139
+ );
140
+
141
+ if ($args) {
142
+ $key = ($http_verb == 'GET' ? 'params' : 'body');
143
+ $operation[$key] = json_encode($args);
144
+ }
145
+
146
+ $this->operations[] = $operation;
147
+ }
148
+ }
includes/mailchimp-api/src/MailChimp.php ADDED
@@ -0,0 +1,412 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace DrewM\MailChimp;
4
+
5
+ /**
6
+ * Super-simple, minimum abstraction MailChimp API v3 wrapper
7
+ * MailChimp API v3: http://developer.mailchimp.com
8
+ * This wrapper: https://github.com/drewm/mailchimp-api
9
+ *
10
+ * @author Drew McLellan <drew.mclellan@gmail.com>
11
+ * @version 2.2
12
+ */
13
+ class MailChimp
14
+ {
15
+ private $api_key;
16
+ private $api_endpoint = 'https://<dc>.api.mailchimp.com/3.0';
17
+
18
+ /* SSL Verification
19
+ Read before disabling:
20
+ http://snippets.webaware.com.au/howto/stop-turning-off-curlopt_ssl_verifypeer-and-fix-your-php-config/
21
+ */
22
+ public $verify_ssl = true;
23
+
24
+ private $request_successful = false;
25
+ private $last_error = '';
26
+ private $last_response = array();
27
+ private $last_request = array();
28
+
29
+ /**
30
+ * Create a new instance
31
+ * @param string $api_key Your MailChimp API key
32
+ * @param string $api_endpoint Optional custom API endpoint
33
+ * @throws \Exception
34
+ */
35
+ public function __construct($api_key, $api_endpoint = null)
36
+ {
37
+ $this->api_key = $api_key;
38
+
39
+ if ($api_endpoint === null) {
40
+ if (strpos($this->api_key, '-') === false) {
41
+ throw new \Exception("Invalid MailChimp API key `{$api_key}` supplied.");
42
+ }
43
+ list(, $data_center) = explode('-', $this->api_key);
44
+ $this->api_endpoint = str_replace('<dc>', $data_center, $this->api_endpoint);
45
+ } else {
46
+ $this->api_endpoint = $api_endpoint;
47
+ }
48
+
49
+ $this->last_response = array('headers' => null, 'body' => null);
50
+ }
51
+
52
+ /**
53
+ * Create a new instance of a Batch request. Optionally with the ID of an existing batch.
54
+ * @param string $batch_id Optional ID of an existing batch, if you need to check its status for example.
55
+ * @return Batch New Batch object.
56
+ */
57
+ public function new_batch($batch_id = null)
58
+ {
59
+ return new Batch($this, $batch_id);
60
+ }
61
+
62
+ /**
63
+ * Convert an email address into a 'subscriber hash' for identifying the subscriber in a method URL
64
+ * @param string $email The subscriber's email address
65
+ * @return string Hashed version of the input
66
+ */
67
+ public function subscriberHash($email)
68
+ {
69
+ return md5(strtolower($email));
70
+ }
71
+
72
+ /**
73
+ * Was the last request successful?
74
+ * @return bool True for success, false for failure
75
+ */
76
+ public function success()
77
+ {
78
+ return $this->request_successful;
79
+ }
80
+
81
+ /**
82
+ * Get the last error returned by either the network transport, or by the API.
83
+ * If something didn't work, this should contain the string describing the problem.
84
+ * @return array|false describing the error
85
+ */
86
+ public function getLastError()
87
+ {
88
+ return $this->last_error ?: false;
89
+ }
90
+
91
+ /**
92
+ * Get an array containing the HTTP headers and the body of the API response.
93
+ * @return array Assoc array with keys 'headers' and 'body'
94
+ */
95
+ public function getLastResponse()
96
+ {
97
+ return $this->last_response;
98
+ }
99
+
100
+ /**
101
+ * Get an array containing the HTTP headers and the body of the API request.
102
+ * @return array Assoc array
103
+ */
104
+ public function getLastRequest()
105
+ {
106
+ return $this->last_request;
107
+ }
108
+
109
+ /**
110
+ * Make an HTTP DELETE request - for deleting data
111
+ * @param string $method URL of the API request method
112
+ * @param array $args Assoc array of arguments (if any)
113
+ * @param int $timeout Timeout limit for request in seconds
114
+ * @return array|false Assoc array of API response, decoded from JSON
115
+ */
116
+ public function delete($method, $args = array(), $timeout = 10)
117
+ {
118
+ return $this->makeRequest('delete', $method, $args, $timeout);
119
+ }
120
+
121
+ /**
122
+ * Make an HTTP GET request - for retrieving data
123
+ * @param string $method URL of the API request method
124
+ * @param array $args Assoc array of arguments (usually your data)
125
+ * @param int $timeout Timeout limit for request in seconds
126
+ * @return array|false Assoc array of API response, decoded from JSON
127
+ */
128
+ public function get($method, $args = array(), $timeout = 10)
129
+ {
130
+ return $this->makeRequest('get', $method, $args, $timeout);
131
+ }
132
+
133
+ /**
134
+ * Make an HTTP PATCH request - for performing partial updates
135
+ * @param string $method URL of the API request method
136
+ * @param array $args Assoc array of arguments (usually your data)
137
+ * @param int $timeout Timeout limit for request in seconds
138
+ * @return array|false Assoc array of API response, decoded from JSON
139
+ */
140
+ public function patch($method, $args = array(), $timeout = 10)
141
+ {
142
+ return $this->makeRequest('patch', $method, $args, $timeout);
143
+ }
144
+
145
+ /**
146
+ * Make an HTTP POST request - for creating and updating items
147
+ * @param string $method URL of the API request method
148
+ * @param array $args Assoc array of arguments (usually your data)
149
+ * @param int $timeout Timeout limit for request in seconds
150
+ * @return array|false Assoc array of API response, decoded from JSON
151
+ */
152
+ public function post($method, $args = array(), $timeout = 10)
153
+ {
154
+ return $this->makeRequest('post', $method, $args, $timeout);
155
+ }
156
+
157
+ /**
158
+ * Make an HTTP PUT request - for creating new items
159
+ * @param string $method URL of the API request method
160
+ * @param array $args Assoc array of arguments (usually your data)
161
+ * @param int $timeout Timeout limit for request in seconds
162
+ * @return array|false Assoc array of API response, decoded from JSON
163
+ */
164
+ public function put($method, $args = array(), $timeout = 10)
165
+ {
166
+ return $this->makeRequest('put', $method, $args, $timeout);
167
+ }
168
+
169
+ /**
170
+ * Performs the underlying HTTP request. Not very exciting.
171
+ * @param string $http_verb The HTTP verb to use: get, post, put, patch, delete
172
+ * @param string $method The API method to be called
173
+ * @param array $args Assoc array of parameters to be passed
174
+ * @param int $timeout
175
+ * @return array|false Assoc array of decoded result
176
+ * @throws \Exception
177
+ */
178
+ private function makeRequest($http_verb, $method, $args = array(), $timeout = 10)
179
+ {
180
+ if (!function_exists('curl_init') || !function_exists('curl_setopt')) {
181
+ throw new \Exception("cURL support is required, but can't be found.");
182
+ }
183
+
184
+ $url = $this->api_endpoint . '/' . $method;
185
+
186
+ $this->last_error = '';
187
+ $this->request_successful = false;
188
+ $response = array(
189
+ 'headers' => null, // array of details from curl_getinfo()
190
+ 'httpHeaders' => null, // array of HTTP headers
191
+ 'body' => null // content of the response
192
+ );
193
+ $this->last_response = $response;
194
+
195
+ $this->last_request = array(
196
+ 'method' => $http_verb,
197
+ 'path' => $method,
198
+ 'url' => $url,
199
+ 'body' => '',
200
+ 'timeout' => $timeout,
201
+ );
202
+
203
+ $ch = curl_init();
204
+ curl_setopt($ch, CURLOPT_URL, $url);
205
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array(
206
+ 'Accept: application/vnd.api+json',
207
+ 'Content-Type: application/vnd.api+json',
208
+ 'Authorization: apikey ' . $this->api_key
209
+ ));
210
+ curl_setopt($ch, CURLOPT_USERAGENT, 'DrewM/MailChimp-API/3.0 (github.com/drewm/mailchimp-api)');
211
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
212
+ curl_setopt($ch, CURLOPT_VERBOSE, true);
213
+ curl_setopt($ch, CURLOPT_HEADER, true);
214
+ curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
215
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->verify_ssl);
216
+ curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
217
+ curl_setopt($ch, CURLOPT_ENCODING, '');
218
+ curl_setopt($ch, CURLINFO_HEADER_OUT, true);
219
+
220
+ switch ($http_verb) {
221
+ case 'post':
222
+ curl_setopt($ch, CURLOPT_POST, true);
223
+ $this->attachRequestPayload($ch, $args);
224
+ break;
225
+
226
+ case 'get':
227
+ $query = http_build_query($args, '', '&');
228
+ curl_setopt($ch, CURLOPT_URL, $url . '?' . $query);
229
+ break;
230
+
231
+ case 'delete':
232
+ curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
233
+ break;
234
+
235
+ case 'patch':
236
+ curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH');
237
+ $this->attachRequestPayload($ch, $args);
238
+ break;
239
+
240
+ case 'put':
241
+ curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
242
+ $this->attachRequestPayload($ch, $args);
243
+ break;
244
+ }
245
+
246
+ $responseContent = curl_exec($ch);
247
+
248
+ if ($responseContent === false) {
249
+ $this->last_error = curl_error($ch);
250
+ } else {
251
+ $response['headers'] = curl_getinfo($ch);
252
+ $headerSize = $response['headers']['header_size'];
253
+
254
+ $response['httpHeaders'] = $this->getHeadersAsArray(substr($responseContent, 0, $headerSize));
255
+ $response['body'] = substr($responseContent, $headerSize);
256
+
257
+ if (isset($response['headers']['request_header'])) {
258
+ $this->last_request['headers'] = $response['headers']['request_header'];
259
+ }
260
+ }
261
+
262
+ curl_close($ch);
263
+
264
+ $formattedResponse = $this->formatResponse($response);
265
+
266
+ $this->determineSuccess($response, $formattedResponse);
267
+
268
+ return $formattedResponse;
269
+ }
270
+
271
+ /**
272
+ * @return string The url to the API endpoint
273
+ */
274
+ public function getApiEndpoint()
275
+ {
276
+ return $this->api_endpoint;
277
+ }
278
+
279
+ /**
280
+ * Get the HTTP headers as an array of header-name => header-value pairs.
281
+ *
282
+ * The "Link" header is parsed into an associative array based on the
283
+ * rel names it contains. The original value is available under
284
+ * the "_raw" key.
285
+ *
286
+ * @param string $headersAsString
287
+ * @return array
288
+ */
289
+ private function getHeadersAsArray($headersAsString)
290
+ {
291
+ $headers = array();
292
+
293
+ foreach (explode("\r\n", $headersAsString) as $i => $line) {
294
+ if ($i === 0) { // HTTP code
295
+ continue;
296
+ }
297
+
298
+ $line = trim($line);
299
+ if (empty($line)) {
300
+ continue;
301
+ }
302
+
303
+ list($key, $value) = explode(': ', $line);
304
+
305
+ if ($key == 'Link') {
306
+ $value = array_merge(
307
+ array('_raw' => $value),
308
+ $this->getLinkHeaderAsArray($value)
309
+ );
310
+ }
311
+
312
+ $headers[$key] = $value;
313
+ }
314
+
315
+ return $headers;
316
+ }
317
+
318
+ /**
319
+ * Extract all rel => URL pairs from the provided Link header value
320
+ *
321
+ * Mailchimp only implements the URI reference and relation type from
322
+ * RFC 5988, so the value of the header is something like this:
323
+ *
324
+ * 'https://us13.api.mailchimp.com/schema/3.0/Lists/Instance.json; rel="describedBy", <https://us13.admin.mailchimp.com/lists/members/?id=XXXX>; rel="dashboard"'
325
+ *
326
+ * @param string $linkHeaderAsString
327
+ * @return array
328
+ */
329
+ private function getLinkHeaderAsArray($linkHeaderAsString)
330
+ {
331
+ $urls = array();
332
+
333
+ if (preg_match_all('/<(.*?)>\s*;\s*rel="(.*?)"\s*/', $linkHeaderAsString, $matches)) {
334
+ foreach ($matches[2] as $i => $relName) {
335
+ $urls[$relName] = $matches[1][$i];
336
+ }
337
+ }
338
+
339
+ return $urls;
340
+ }
341
+
342
+ /**
343
+ * Encode the data and attach it to the request
344
+ * @param resource $ch cURL session handle, used by reference
345
+ * @param array $data Assoc array of data to attach
346
+ */
347
+ private function attachRequestPayload(&$ch, $data)
348
+ {
349
+ $encoded = json_encode($data);
350
+ $this->last_request['body'] = $encoded;
351
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $encoded);
352
+ }
353
+
354
+ /**
355
+ * Decode the response and format any error messages for debugging
356
+ * @param array $response The response from the curl request
357
+ * @return array|false The JSON decoded into an array
358
+ */
359
+ private function formatResponse($response)
360
+ {
361
+ $this->last_response = $response;
362
+
363
+ if (!empty($response['body'])) {
364
+ return json_decode($response['body'], true);
365
+ }
366
+
367
+ return false;
368
+ }
369
+
370
+ /**
371
+ * Check if the response was successful or a failure. If it failed, store the error.
372
+ * @param array $response The response from the curl request
373
+ * @param array|false $formattedResponse The response body payload from the curl request
374
+ * @return bool If the request was successful
375
+ */
376
+ private function determineSuccess($response, $formattedResponse)
377
+ {
378
+ $status = $this->findHTTPStatus($response, $formattedResponse);
379
+
380
+ if ($status >= 200 && $status <= 299) {
381
+ $this->request_successful = true;
382
+ return true;
383
+ }
384
+
385
+ if (isset($formattedResponse['detail'])) {
386
+ $this->last_error = sprintf('%d: %s', $formattedResponse['status'], $formattedResponse['detail']);
387
+ return false;
388
+ }
389
+
390
+ $this->last_error = 'Unknown error, call getLastResponse() to find out what happened.';
391
+ return false;
392
+ }
393
+
394
+ /**
395
+ * Find the HTTP status code from the headers or API response body
396
+ * @param array $response The response from the curl request
397
+ * @param array|false $formattedResponse The response body payload from the curl request
398
+ * @return int HTTP status code
399
+ */
400
+ private function findHTTPStatus($response, $formattedResponse)
401
+ {
402
+ if (!empty($response['headers']) && isset($response['headers']['http_code'])) {
403
+ return (int) $response['headers']['http_code'];
404
+ }
405
+
406
+ if (!empty($response['body']) && isset($formattedResponse['status'])) {
407
+ return (int) $formattedResponse['status'];
408
+ }
409
+
410
+ return 418;
411
+ }
412
+ }
includes/mailchimp-api/src/Webhook.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace DrewM\MailChimp;
4
+
5
+ /**
6
+ * A MailChimp Webhook request.
7
+ * How to Set Up Webhooks: http://eepurl.com/bs-j_T
8
+ *
9
+ * @author Drew McLellan <drew.mclellan@gmail.com>
10
+ */
11
+ class Webhook
12
+ {
13
+ private static $eventSubscriptions = array();
14
+ private static $receivedWebhook = null;
15
+
16
+ /**
17
+ * Subscribe to an incoming webhook request. The callback will be invoked when a matching webhook is received.
18
+ * @param string $event Name of the webhook event, e.g. subscribe, unsubscribe, campaign
19
+ * @param callable $callback A callable function to invoke with the data from the received webhook
20
+ * @return void
21
+ */
22
+ public static function subscribe($event, callable $callback)
23
+ {
24
+ if (!isset(self::$eventSubscriptions[$event])) self::$eventSubscriptions[$event] = array();
25
+ self::$eventSubscriptions[$event][] = $callback;
26
+
27
+ self::receive();
28
+ }
29
+
30
+ /**
31
+ * Retrieve the incoming webhook request as sent.
32
+ * @param string $input An optional raw POST body to use instead of php://input - mainly for unit testing.
33
+ * @return array|false An associative array containing the details of the received webhook
34
+ */
35
+ public static function receive($input = null)
36
+ {
37
+ if (is_null($input)) {
38
+ if (self::$receivedWebhook !== null) {
39
+ $input = self::$receivedWebhook;
40
+ } else {
41
+ $input = file_get_contents("php://input");
42
+ }
43
+ }
44
+
45
+ if (!is_null($input) && $input != '') {
46
+ return self::processWebhook($input);
47
+ }
48
+
49
+ return false;
50
+ }
51
+
52
+ /**
53
+ * Process the raw request into a PHP array and dispatch any matching subscription callbacks
54
+ * @param string $input The raw HTTP POST request
55
+ * @return array|false An associative array containing the details of the received webhook
56
+ */
57
+ private static function processWebhook($input)
58
+ {
59
+ self::$receivedWebhook = $input;
60
+ parse_str($input, $result);
61
+ if ($result && isset($result['type'])) {
62
+ self::dispatchWebhookEvent($result['type'], $result['data']);
63
+ return $result;
64
+ }
65
+
66
+ return false;
67
+ }
68
+
69
+ /**
70
+ * Call any subscribed callbacks for this event
71
+ * @param string $event The name of the callback event
72
+ * @param array $data An associative array of the webhook data
73
+ * @return void
74
+ */
75
+ private static function dispatchWebhookEvent($event, $data)
76
+ {
77
+ if (isset(self::$eventSubscriptions[$event])) {
78
+ foreach(self::$eventSubscriptions[$event] as $callback) {
79
+ $callback($data);
80
+ }
81
+ // reset subscriptions
82
+ self::$eventSubscriptions[$event] = array();
83
+ }
84
+ }
85
+ }
js/lightbox.js CHANGED
@@ -15,6 +15,18 @@ jQuery(document).ready(function(){
15
 
16
  if( typeof(jQuery().fv_player_pro_colorbox) == "undefined" ) return;
17
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  function fv_player_colorbox_title( that ) {
19
  that = jQuery(that);
20
  if( typeof(that.attr('title')) == "undefined" && typeof(that.find('img').attr('alt')) == "undefined" ) {
@@ -26,62 +38,52 @@ jQuery(document).ready(function(){
26
  } else {
27
  return false;
28
  }
29
- }
 
 
 
 
 
 
 
 
 
 
30
 
31
  /*
32
  * Lightbox
33
  */
34
- if(fv_player_lightbox.lightbox_images ) {
35
 
36
  jQuery("a[data-colorbox]").each( function() {
37
  jQuery(this).attr('href', jQuery(this).attr('data-colorbox') );
38
  });
39
 
40
  //Lightbox for images href="*.jpg"
 
 
 
 
 
 
41
  jQuery(".colorbox").filter(function() {
42
  return this.href.match(/\.(png|jpg|jpeg|gif)/i);
43
- }).fv_player_pro_colorbox( {
44
- rel: 'group1',
45
- current: "{current} of {total}",
46
- maxHeight: '100%',
47
- maxWidth: '100%',
48
- initialHeight: 48,
49
- initialWidth: 96,
50
- scrolling: false,
51
- onLoad: fv_lightbox_flowplayer_shutdown,
52
- onCleanup: fv_lightbox_flowplayer_shutdown,
53
- title: function() { return fv_player_colorbox_title(this) },
54
- href: function() { return fv_player_colorbox_scrset(this) }
55
- } );
56
-
57
- //Lightbox external sites href="example.com"
58
  jQuery(".colorbox").filter(function() {
59
  return !this.href.match(/\.(png|jpg|jpeg|gif)/i)
60
- }).not('[href^="#"]').fv_player_pro_colorbox( {
61
- rel: 'group1',
62
- current: "{current} of {total}",
63
- height: '80%',
64
- width: '80%',
65
- onLoad: fv_lightbox_flowplayer_shutdown,
66
- onCleanup: fv_lightbox_flowplayer_shutdown,
67
- iframe: true,
68
- title: function() { return fv_player_colorbox_title(this) }
69
- } );
70
 
71
- //Lightbox for non image divs href="#loginForm"
72
- jQuery(".colorbox[href^='#']").fv_player_pro_colorbox( {
73
- rel: 'group1',
74
- current: "{current} of {total}",
75
- maxHeight: '100%',
76
- maxWidth: '100%',
77
- initialHeight: 48,
78
- initialWidth: 96,
79
- scrolling: false,
80
- onLoad: fv_lightbox_flowplayer_shutdown,
81
- onCleanup: fv_lightbox_flowplayer_shutdown,
82
- inline: true,
83
- title: function() { return fv_player_colorbox_title(this) }
84
- } );
85
  }
86
 
87
  /*
@@ -101,26 +103,18 @@ jQuery(document).ready(function(){
101
  //if (!support.inlineBlock) $("object", root).height(root.height());
102
  } );
103
 
 
 
 
 
 
 
 
 
 
 
104
 
105
- jQuery("a[id ^=fv_flowplayer_][id $=_lightbox_starter], .flowplayer.lightbox-starter").fv_player_pro_colorbox(
106
- {
107
- href:function(){
108
- return this.getAttribute('data-fv-lightbox')||this.getAttribute('href');
109
- },
110
- rel: 'group1',
111
- current: "{current} of {total}",
112
- inline: true,
113
- maxWidth: '100%',
114
- maxHeight: '100%',
115
- initialHeight: 48,
116
- initialWidth: 96,
117
- innerWidth: fv_player_lightbox_width,
118
- innerHeight: 'auto',
119
- scrolling: false,
120
- onLoad: fv_lightbox_flowplayer_shutdown,
121
- onCleanup: fv_lightbox_flowplayer_shutdown
122
- }
123
- ).addClass('et_smooth_scroll_disabled');
124
 
125
 
126
  var fv_player_lightbox_fresh = true;
15
 
16
  if( typeof(jQuery().fv_player_pro_colorbox) == "undefined" ) return;
17
 
18
+ function fv_player_colorbox_class( that ) {
19
+ that = jQuery(that);
20
+ if( that.attr('data-class') && that.attr('data-class').length > 0 ) return that.attr('data-class');
21
+ return false;
22
+ }
23
+
24
+ function fv_player_colorbox_rel( that ) {
25
+ that = jQuery(that);
26
+ if( that.attr('rel') && that.attr('rel').length > 0 ) return that.attr('rel');
27
+ return 'group1';
28
+ }
29
+
30
  function fv_player_colorbox_title( that ) {
31
  that = jQuery(that);
32
  if( typeof(that.attr('title')) == "undefined" && typeof(that.find('img').attr('alt')) == "undefined" ) {
38
  } else {
39
  return false;
40
  }
41
+ }
42
+
43
+ var defaults = {
44
+ rel: function() { return fv_player_colorbox_rel(this) },
45
+ current: "{current} of {total}",
46
+ onLoad: fv_lightbox_flowplayer_shutdown,
47
+ onCleanup: fv_lightbox_flowplayer_shutdown,
48
+ title: function() { return fv_player_colorbox_title(this) },
49
+ href: function() { return fv_player_colorbox_scrset(this) },
50
+ className: function() { return fv_player_colorbox_class(this) }
51
+ };
52
 
53
  /*
54
  * Lightbox
55
  */
56
+ if( fv_player_lightbox.lightbox_images ) {
57
 
58
  jQuery("a[data-colorbox]").each( function() {
59
  jQuery(this).attr('href', jQuery(this).attr('data-colorbox') );
60
  });
61
 
62
  //Lightbox for images href="*.jpg"
63
+ var args = jQuery.extend( {}, defaults );
64
+ args.maxHeight = '100%';
65
+ args.maxWidth = '100%';
66
+ args.initialHeight = 48;
67
+ args.initialWidth = 96;
68
+ args.scrolling = false;
69
  jQuery(".colorbox").filter(function() {
70
  return this.href.match(/\.(png|jpg|jpeg|gif)/i);
71
+ }).fv_player_pro_colorbox( args );
72
+
73
+ //Lightbox for non image divs href="#loginForm"
74
+ args.inline = true;
75
+ jQuery(".colorbox[href^='#']").fv_player_pro_colorbox( args );
76
+
77
+ //Lightbox external sites href="example.com"
78
+ var args2 = jQuery.extend( {}, defaults );
79
+ args2.height = '80%';
80
+ args2.width = '80%';
81
+ args2.iframe = true;
82
+
 
 
 
83
  jQuery(".colorbox").filter(function() {
84
  return !this.href.match(/\.(png|jpg|jpeg|gif)/i)
85
+ }).not('[href^="#"]').fv_player_pro_colorbox( args2 );
 
 
 
 
 
 
 
 
 
86
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  }
88
 
89
  /*
103
  //if (!support.inlineBlock) $("object", root).height(root.height());
104
  } );
105
 
106
+ var args3 = jQuery.extend( {}, defaults );
107
+ args3.href = function(){ return this.getAttribute('data-fv-lightbox')||this.getAttribute('href'); }
108
+ args3.inline = true;
109
+ args3.maxHeight = '100%';
110
+ args3.maxWidth = '100%';
111
+ args3.initialHeight = 48;
112
+ args3.initialWidth = 96;
113
+ args3.scrolling = false;
114
+ args3.innerWidth = fv_player_lightbox_width;
115
+ args3.innerHeight = 'auto';
116
 
117
+ jQuery("a[id ^=fv_flowplayer_][id $=_lightbox_starter], .flowplayer.lightbox-starter").fv_player_pro_colorbox(args3).addClass('et_smooth_scroll_disabled');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
 
119
 
120
  var fv_player_lightbox_fresh = true;
js/shortcode-editor.js CHANGED
@@ -53,9 +53,9 @@ jQuery(document).ready(function($){
53
  e.preventDefault();
54
  $('.fv-player-tabs-header a').removeClass('nav-tab-active');
55
  $(this).addClass('nav-tab-active')
56
- $( '.fv-player-tabs > .fv-player-tab' ).hide();
57
- $( '.' + $(this).data('tab') ).show();
58
-
59
  fv_wp_flowplayer_dialog_resize();
60
  });
61
 
@@ -76,9 +76,9 @@ jQuery(document).ready(function($){
76
  var video_tab = $('.fv-player-tab-video-files table').eq(new_index).show();
77
 
78
  $('.fv-player-tab-subtitles table').hide();
79
- $('.fv-player-tab-subtitles table').eq(new_index).show();
80
-
81
 
 
82
  if($('.fv-player-tab-playlist [data-index]').length > 1){
83
  $('.fv-player-playlist-item-title').html('Playlist item no. ' + ++new_index);
84
  $('.playlist_edit').html($('.playlist_edit').data('edit')).removeClass('button').addClass('button-primary');
@@ -149,7 +149,7 @@ jQuery(document).ready(function($){
149
  $(e.target).parents('[data-index]').remove();
150
  jQuery('.fv-player-tab-video-files table[data-index=' + index + ']').remove();
151
  jQuery('.fv-player-tab-subtitles table[data-index=' + index + ']').remove();
152
- if(!jQuery('.fv-player-tab-subtitles table[data-index').length){
153
  fv_flowplayer_playlist_add();
154
  jQuery('.fv-player-tab-playlist tr td').click();
155
  }
@@ -328,7 +328,6 @@ jQuery(document).ready(function($){
328
  jQuery('#fv_wp_flowplayer_field_end_actions').change(function(){
329
  var value = jQuery(this).val();
330
  jQuery('.fv_player_actions_end-toggle').hide().find('[name]').val('');
331
-
332
  switch(value){
333
  case 'redirect':
334
  jQuery('#fv_wp_flowplayer_field_' + value).parents('tr').show();
@@ -337,6 +336,9 @@ jQuery(document).ready(function($){
337
  jQuery('#fv_wp_flowplayer_field_' + value).parents('tr').show();
338
  jQuery('#fv_wp_flowplayer_field_' + value + '_id').parents('tr').show();
339
  break;
 
 
 
340
  default:
341
  fv_wp_flowplayer_submit('refresh-button');
342
  break;
@@ -499,7 +501,7 @@ function fv_flowplayer_playlist_add( sInput, sCaption, sSubtitles ) {
499
  //jQuery('.fv-player-tab-video-files table').hover( function() { jQuery(this).find('.fv_wp_flowplayer_playlist_remove').show(); }, function() { jQuery(this).find('.fv_wp_flowplayer_playlist_remove').hide(); } );
500
 
501
  if( sInput ) {
502
- aInput = sInput.split(',');
503
  var count = 0;
504
  for( var i in aInput ) {
505
  if( aInput[i].match(/^rtmp:/) ) new_item.find('.fv_wp_flowplayer_field_rtmp_path').val(aInput[i].replace(/^rtmp:/,''));
@@ -700,7 +702,7 @@ function fv_wp_flowplayer_edit() {
700
 
701
  if( shortcode != null ) {
702
  shortcode = shortcode.join('');
703
- shortcode = shortcode.replace(/^\[|\]+$/gm,'');
704
  shortcode = shortcode.replace( fv_wp_flowplayer_re_insert, '' );
705
 
706
  shortcode = shortcode.replace( /\\'/g,'&#039;' );
@@ -871,9 +873,15 @@ function fv_wp_flowplayer_edit() {
871
  spopup = spopup.replace(/&amp;/g,'&');
872
 
873
  jQuery("#fv_wp_flowplayer_field_popup_id").parents('tr').show();
874
- if (spopup === null || !isNaN(parseInt(spopup)) || spopup === 'no' || spopup === 'random') {
 
875
  jQuery("#fv_wp_flowplayer_field_popup_id").val(spopup)
876
- } else {
 
 
 
 
 
877
  jQuery("#fv_wp_flowplayer_field_popup").val(spopup).parent().show();
878
  }
879
 
@@ -1099,6 +1107,12 @@ function fv_wp_flowplayer_submit( preview ) {
1099
  fv_wp_flowplayer_shortcode_write_arg('fv_wp_flowplayer_field_popup_id', 'popup', false, false, ['no','random','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16'] );
1100
  }
1101
  break;
 
 
 
 
 
 
1102
  }
1103
 
1104
 
@@ -1117,6 +1131,7 @@ function fv_wp_flowplayer_submit( preview ) {
1117
  if( fv_player_preview_single == -1 && jQuery('.fv-player-tab-video-files table').length > 0 ) {
1118
  var aPlaylistItems = new Array();
1119
  var aPlaylistCaptions = new Array();
 
1120
  var aPlaylistSubtitles = new Array();
1121
  jQuery('.fv-player-tab-video-files table').each(function(i,e) {
1122
  aPlaylistCaptions.push(jQuery('[name=fv_wp_flowplayer_field_caption]',this).attr('value').trim().replace(/\;/gi,'\\;').replace(/"/gi,'&amp;quot;') );
@@ -1125,6 +1140,7 @@ function fv_wp_flowplayer_submit( preview ) {
1125
 
1126
  if( i == 0 ) return;
1127
  var aPlaylistItem = new Array();
 
1128
  jQuery(this).find('input').each( function() {
1129
  if( jQuery(this).attr('name').match(/fv_wp_flowplayer_field_caption/) ) return;
1130
  if( jQuery(this).hasClass('fv_wp_flowplayer_field_rtmp') || jQuery(this).hasClass('fv_wp_flowplayer_field_width') || jQuery(this).hasClass('fv_wp_flowplayer_field_height') ) return;
@@ -1146,7 +1162,7 @@ function fv_wp_flowplayer_submit( preview ) {
1146
  if( sPlaylistItems.length > 0 ) {
1147
  fv_wp_fp_shortcode += ' playlist="'+sPlaylistItems+'"';
1148
  }
1149
-
1150
  var bPlaylistCaptionExists = false;
1151
  for( var i in aPlaylistCaptions ){
1152
  if( typeof(aPlaylistCaptions[i]) == "string" && aPlaylistCaptions[i].trim().length > 0 ) {
@@ -1225,7 +1241,8 @@ function b64EncodeUnicode(str) {
1225
  function fv_player_open_preview_window(url, width, height){
1226
  height = Math.min(window.screen.availHeight * 0.80, height + 25);
1227
  width = Math.min(window.screen.availWidth * 0.66, width + 100);
1228
- if(fv_player_preview_window == null || fv_player_preview_window.self == null){
 
1229
  fv_player_preview_window = window.open(url,'window','toolbar=no, menubar=no, resizable=yes width=' + width + ' height=' + height);
1230
  }else{
1231
  fv_player_preview_window.location.assign(url);
@@ -1327,7 +1344,7 @@ function fv_wp_flowplayer_shortcode_parse_arg( sShortcode, sArg, bHTML, sCallbac
1327
  fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( rMatch, '' );
1328
 
1329
  if( bHTML ) {
1330
- aOutput[1] = aOutput[1].replace(/\\"/g, '"').replace(/\\(\[|\])/g, '$1');
1331
  }
1332
 
1333
  if( sCallback ) {
@@ -1364,7 +1381,7 @@ function fv_wp_flowplayer_shortcode_write_args( sField, sArg, sKind, bCheckbox,
1364
  jQuery('[id='+sField+']').each( function(k,v) {
1365
  k = (k==0) ? '' : k;
1366
  fv_wp_flowplayer_shortcode_write_arg(jQuery(this)[0],sArg+k, sKind, bCheckbox, aValues);
1367
- });
1368
  }
1369
 
1370
  function fv_wp_flowplayer_shortcode_write_arg( sField, sArg, sKind, bCheckbox, aValues ) {
@@ -1416,7 +1433,7 @@ function fv_wp_flowplayer_shortcode_write_arg( sField, sArg, sKind, bCheckbox, a
1416
  }
1417
 
1418
  if( sValue.match(/"/) || sKind == 'html' ){
1419
- sOutput = '"'+sValue.replace(/"/g, '\\"').replace(/(\[|\])/g, '\\$1')+'"';
1420
  } else {
1421
  sOutput = '"'+sValue+'"';
1422
  }
53
  e.preventDefault();
54
  $('.fv-player-tabs-header a').removeClass('nav-tab-active');
55
  $(this).addClass('nav-tab-active')
56
+ $('.fv-player-tabs > .fv-player-tab').hide();
57
+ $('.' + $(this).data('tab')).show();
58
+
59
  fv_wp_flowplayer_dialog_resize();
60
  });
61
 
76
  var video_tab = $('.fv-player-tab-video-files table').eq(new_index).show();
77
 
78
  $('.fv-player-tab-subtitles table').hide();
79
+ var subtitles_tab = $('.fv-player-tab-subtitles table').eq(new_index).show();
 
80
 
81
+
82
  if($('.fv-player-tab-playlist [data-index]').length > 1){
83
  $('.fv-player-playlist-item-title').html('Playlist item no. ' + ++new_index);
84
  $('.playlist_edit').html($('.playlist_edit').data('edit')).removeClass('button').addClass('button-primary');
149
  $(e.target).parents('[data-index]').remove();
150
  jQuery('.fv-player-tab-video-files table[data-index=' + index + ']').remove();
151
  jQuery('.fv-player-tab-subtitles table[data-index=' + index + ']').remove();
152
+ if(!jQuery('.fv-player-tab-subtitles table[data-index]').length){
153
  fv_flowplayer_playlist_add();
154
  jQuery('.fv-player-tab-playlist tr td').click();
155
  }
328
  jQuery('#fv_wp_flowplayer_field_end_actions').change(function(){
329
  var value = jQuery(this).val();
330
  jQuery('.fv_player_actions_end-toggle').hide().find('[name]').val('');
 
331
  switch(value){
332
  case 'redirect':
333
  jQuery('#fv_wp_flowplayer_field_' + value).parents('tr').show();
336
  jQuery('#fv_wp_flowplayer_field_' + value).parents('tr').show();
337
  jQuery('#fv_wp_flowplayer_field_' + value + '_id').parents('tr').show();
338
  break;
339
+ case 'email_list':
340
+ jQuery('#fv_wp_flowplayer_field_' + value).parents('tr').show();
341
+ break;
342
  default:
343
  fv_wp_flowplayer_submit('refresh-button');
344
  break;
501
  //jQuery('.fv-player-tab-video-files table').hover( function() { jQuery(this).find('.fv_wp_flowplayer_playlist_remove').show(); }, function() { jQuery(this).find('.fv_wp_flowplayer_playlist_remove').hide(); } );
502
 
503
  if( sInput ) {
504
+ var aInput = sInput.split(',');
505
  var count = 0;
506
  for( var i in aInput ) {
507
  if( aInput[i].match(/^rtmp:/) ) new_item.find('.fv_wp_flowplayer_field_rtmp_path').val(aInput[i].replace(/^rtmp:/,''));
702
 
703
  if( shortcode != null ) {
704
  shortcode = shortcode.join('');
705
+ shortcode = shortcode.replace(/^\[|]+$/gm,'');
706
  shortcode = shortcode.replace( fv_wp_flowplayer_re_insert, '' );
707
 
708
  shortcode = shortcode.replace( /\\'/g,'&#039;' );
873
  spopup = spopup.replace(/&amp;/g,'&');
874
 
875
  jQuery("#fv_wp_flowplayer_field_popup_id").parents('tr').show();
876
+
877
+ if (spopup === null || !isNaN(parseInt(spopup)) || spopup === 'no' || spopup === 'random' || spopup === 'email_list') {
878
  jQuery("#fv_wp_flowplayer_field_popup_id").val(spopup)
879
+ } else if( spopup.match(/email-[0-9]*/)){
880
+ jQuery("#fv_wp_flowplayer_field_popup_id").parent().parent().hide();
881
+ jQuery("#fv_wp_flowplayer_field_email_list").parent().parent().show();
882
+ jQuery("#fv_wp_flowplayer_field_end_actions").val('email_list');
883
+ jQuery("#fv_wp_flowplayer_field_email_list").val(spopup.match(/email-([0-9]*)/)[1]);
884
+ }else {
885
  jQuery("#fv_wp_flowplayer_field_popup").val(spopup).parent().show();
886
  }
887
 
1107
  fv_wp_flowplayer_shortcode_write_arg('fv_wp_flowplayer_field_popup_id', 'popup', false, false, ['no','random','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16'] );
1108
  }
1109
  break;
1110
+ case 'email_list':
1111
+ var value = jQuery('#fv_wp_flowplayer_field_email_list').val();
1112
+ if(value)
1113
+ fv_wp_fp_shortcode += ' popup="email-' + value + '"';
1114
+ break;
1115
+
1116
  }
1117
 
1118
 
1131
  if( fv_player_preview_single == -1 && jQuery('.fv-player-tab-video-files table').length > 0 ) {
1132
  var aPlaylistItems = new Array();
1133
  var aPlaylistCaptions = new Array();
1134
+
1135
  var aPlaylistSubtitles = new Array();
1136
  jQuery('.fv-player-tab-video-files table').each(function(i,e) {
1137
  aPlaylistCaptions.push(jQuery('[name=fv_wp_flowplayer_field_caption]',this).attr('value').trim().replace(/\;/gi,'\\;').replace(/"/gi,'&amp;quot;') );
1140
 
1141
  if( i == 0 ) return;
1142
  var aPlaylistItem = new Array();
1143
+
1144
  jQuery(this).find('input').each( function() {
1145
  if( jQuery(this).attr('name').match(/fv_wp_flowplayer_field_caption/) ) return;
1146
  if( jQuery(this).hasClass('fv_wp_flowplayer_field_rtmp') || jQuery(this).hasClass('fv_wp_flowplayer_field_width') || jQuery(this).hasClass('fv_wp_flowplayer_field_height') ) return;
1162
  if( sPlaylistItems.length > 0 ) {
1163
  fv_wp_fp_shortcode += ' playlist="'+sPlaylistItems+'"';
1164
  }
1165
+
1166
  var bPlaylistCaptionExists = false;
1167
  for( var i in aPlaylistCaptions ){
1168
  if( typeof(aPlaylistCaptions[i]) == "string" && aPlaylistCaptions[i].trim().length > 0 ) {
1241
  function fv_player_open_preview_window(url, width, height){
1242
  height = Math.min(window.screen.availHeight * 0.80, height + 25);
1243
  width = Math.min(window.screen.availWidth * 0.66, width + 100);
1244
+
1245
+ if(fv_player_preview_window == null || fv_player_preview_window.self == null || fv_player_preview_window.closed ){
1246
  fv_player_preview_window = window.open(url,'window','toolbar=no, menubar=no, resizable=yes width=' + width + ' height=' + height);
1247
  }else{
1248
  fv_player_preview_window.location.assign(url);
1344
  fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( rMatch, '' );
1345
 
1346
  if( bHTML ) {
1347
+ aOutput[1] = aOutput[1].replace(/\\"/g, '"').replace(/\\(\[|])/g, '$1');
1348
  }
1349
 
1350
  if( sCallback ) {
1381
  jQuery('[id='+sField+']').each( function(k,v) {
1382
  k = (k==0) ? '' : k;
1383
  fv_wp_flowplayer_shortcode_write_arg(jQuery(this)[0],sArg+k, sKind, bCheckbox, aValues);
1384
+ });
1385
  }
1386
 
1387
  function fv_wp_flowplayer_shortcode_write_arg( sField, sArg, sKind, bCheckbox, aValues ) {
1433
  }
1434
 
1435
  if( sValue.match(/"/) || sKind == 'html' ){
1436
+ sOutput = '"'+sValue.replace(/"/g, '\\"').replace(/(\[|])/g, '\\$1')+'"';
1437
  } else {
1438
  sOutput = '"'+sValue+'"';
1439
  }
models/conversion.php ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FV_Player_Conversion {
4
+
5
+ private $lightboxHtml;
6
+
7
+ public $bCSSLoaded = false;
8
+
9
+ public $bLoad = false;
10
+
11
+ public function __construct() {
12
+ add_action( 'admin_notices', array( $this, 'convert__start') );
13
+ add_action( 'admin_init', array($this, 'admin__add_meta_boxes'), 999 );
14
+ }
15
+
16
+ public function admin__add_meta_boxes() {
17
+ add_meta_box('fv_flowplayer_conversion', __('Conversion', 'fv-wordpress-flowplayer'), array($this, 'settings_box_conversion'), 'fv_flowplayer_settings', 'normal', 'low');
18
+ }
19
+
20
+ public function settings_box_conversion () {
21
+ global $fv_fp;
22
+ ?>
23
+ <p><?php _e('This section allows you to convert videos posted using other plugins to FV Player shortcodes.', 'fv-wordpress-flowplayer'); ?></p>
24
+ <table class="form-table2" style="margin: 5px; ">
25
+ <tr>
26
+ <td>
27
+ <input type="button" class="button" value="<?php _e('Convert JW Player shortcodes', 'fv-player-pro'); ?>" style="margin-top: 2ex;" onclick="if( confirm('<?php _e('This converts the [jwplayer] shortcodes into [fvplayer] shortcodes.\n\n Please make sure you backup your database before continuing. You can use revisions to get back to previos versions of your posts as well.', 'fv-player-pro'); ?>') ) location.href='<?php echo wp_nonce_url( site_url('wp-admin/options-general.php?page=fvplayer'), 'convert_jwplayer', 'convert_jwplayer'); ?>'; "/>
28
+ </td>
29
+ </tr>
30
+ </table>
31
+ <?php
32
+ }
33
+
34
+ function convert__start() {
35
+ if( current_user_can('manage_options') && isset($_GET['convert_jwplayer']) && wp_verify_nonce($_GET['convert_jwplayer'],'convert_jwplayer') ) {
36
+ $this->convert__process('jwplayer');
37
+ }
38
+ }
39
+
40
+ function convert__process( $type = false ) {
41
+ echo '<p>Running the conversion process for '.$type.'. If anything fails, remember to restore your backup or revert the change of the post to the previous revision.</p>';
42
+ echo '<p>Scroll down to the end of the list to see the status.</p>';
43
+
44
+ $sType = sanitize_title($type);
45
+
46
+ global $wpdb;
47
+ $aPosts = $wpdb->get_results( "SELECT * FROM {$wpdb->posts} WHERE post_status != 'inherit' AND post_content LIKE '%".$sType."%' ORDER BY post_date DESC" );
48
+
49
+ $tMax = ini_get('max_execution_time') ? ini_get('max_execution_time') : 30;
50
+ $tStart = microtime(true);
51
+ $iCount = 0;
52
+ $iFound = 0;
53
+
54
+ echo "<ul>\n";
55
+ foreach( $aPosts AS $objPost ) {
56
+ if( microtime(true) - $tStart > ($tMax - 2) ) {
57
+ break;
58
+ }
59
+
60
+ echo "<li><strong>".$objPost->post_title.'</strong> ('.$objPost->ID.') ';
61
+
62
+ $method = 'convert__'.$sType.'_callback';
63
+ $new_content = $this->$method($objPost->post_content);
64
+
65
+ if( strlen($new_content) != strlen($objPost->post_content) || $new_content != $objPost->post_content ) {
66
+ $iFound++;
67
+
68
+ $post_id = wp_update_post( array( 'ID' => $objPost->ID, 'post_content' => $new_content ) );
69
+ if( is_wp_error($post_id) ) {
70
+ $errors = $post_id->get_error_messages();
71
+ echo "Error: ";
72
+ foreach ($errors as $error) {
73
+ echo $error;
74
+ }
75
+ echo "</li>";
76
+ } else {
77
+ $iCount++;
78
+ echo "<a target='_blank' href='".get_permalink($objPost->ID)."'>".$objPost->post_title."</a> updated ok</li>\n";
79
+ }
80
+ }
81
+
82
+ }
83
+ echo "</ul>\n";
84
+
85
+ if( $iFound == 0 ) {
86
+ echo "<p>No more posts with ".$type." embeds found!</p>\n";
87
+ } else {
88
+ echo "<p>Updated ".$iCount." posts out of ".$iFound." posts with ".$type." embeds.</p>\n";
89
+ }
90
+
91
+ if( microtime(true) - $tStart > ($tMax - 5) ) {
92
+ echo "<p><strong>Execution terminated</strong>: PHP max_execution_time reached, run this process again to process the remaining posts!</p>\n";
93
+ } else {
94
+ echo "<p>All done!</p>\n";
95
+ }
96
+
97
+ die();
98
+ }
99
+
100
+ function convert__jwplayer_callback( $content ) {
101
+ $content = preg_replace_callback( '~\[jwplayer.*?\]~', array( $this, 'convert__jwplayer_callback_parse' ), $content );
102
+ return $content;
103
+ }
104
+
105
+ function convert__jwplayer_callback_parse( $aMatch ) {
106
+
107
+ echo '<p>Replacing <code>'.$aMatch[0].'</code><p>';
108
+
109
+ $bGotSomething = false;
110
+
111
+ $aFVPlayer = array();
112
+
113
+ $shortcode = rtrim($aMatch[0],']');
114
+
115
+ $aJW = shortcode_parse_atts($shortcode);
116
+
117
+ if( !empty($aJW['playlist']) ) {
118
+ echo "<p><code>playlist</code> argument not supported!</p>";
119
+ return $aMatch[0];
120
+ }
121
+
122
+ if( !empty($aJW['file']) ) {
123
+ if( stripos($aJW['file'],'.xml') !== false ) {
124
+ echo "<p><code>XML MRSS</code> not supported!</p>";
125
+ return $aMatch[0];
126
+ }
127
+
128
+ $bGotSomething = true;
129
+ $aFVPlayer['src'] = $aJW['file'];
130
+ }
131
+ if( !empty($aJW['image']) ) $aFVPlayer['splash'] = $aJW['image'];
132
+
133
+ if( !empty($aJW['playlistid']) ) {
134
+ $sPlaylistItems = get_post_meta( $aJW['playlistid'], 'jwplayermodule_playlist_items', true );
135
+ if( !$sPlaylistItems ) $sPlaylistItems = get_post_meta( $aJW['playlistid'], 'jwplayermodule_playlist_items', true );
136
+
137
+ $aAttachments = get_posts( array( 'include' => $sPlaylistItems, 'orderby' => 'post__in', 'post_type' => 'attachment' ) );
138
+ if( count($aAttachments) > 0 ) {
139
+ $iCount = 0;
140
+ $aFVPlaylist = array();
141
+ $aFVCaptions = array();
142
+ foreach( $aAttachments AS $objAttachment ) {
143
+ $src = get_post_meta($objAttachment->ID,'_wp_attached_file',true);
144
+ $src = $this->get_full_url($src);
145
+
146
+ $splash = get_post_meta($objAttachment->ID,'jwplayermodule_thumbnail',true);
147
+ $splash = $this->get_full_url($splash);
148
+
149
+ if( $iCount == 0 ) {
150
+ $aFVPlayer['src'] = $src;
151
+ if( $splash ) $aFVPlayer['splash'] = $splash;
152
+ }
153
+ else {
154
+ $item = $src;
155
+ if( $splash ) {
156
+ $src .= ','.$splash;
157
+ }
158
+ $aFVPlaylist[] = $src;
159
+ }
160
+
161
+ $aFVCaptions[] = str_replace( array('"',';'), '', $objAttachment->post_title );
162
+ $iCount++;
163
+ }
164
+ $aFVPlayer['playlist'] = implode(';',$aFVPlaylist);
165
+ $aFVPlayer['caption'] = implode(';',$aFVCaptions);
166
+ $bGotSomething = true;
167
+ }
168
+ }
169
+
170
+ if( !$bGotSomething ) {
171
+ echo "<p>No arguments recognized!</p>";
172
+ return $aMatch[0];
173
+ }
174
+
175
+ $aShortcode = array();
176
+ foreach( $aFVPlayer AS $k => $v ) {
177
+ $aShortcode[] = $k.'="'.$v.'"';
178
+ }
179
+
180
+ $out = '[fvplayer '.implode(' ',$aShortcode).']';
181
+ echo '<p>With <code>'.$out.'</code><p>';
182
+ return $out;
183
+ }
184
+
185
+
186
+ function get_full_url( $url ) {
187
+ if( stripos($url,'://') === false && stripos($url,'/') !== 0 ) {
188
+ $aUploads = wp_upload_dir();
189
+ $url = trailingslashit($aUploads['baseurl']).$url;
190
+ }
191
+ return $url;
192
+ }
193
+
194
+ }
195
+
196
+ $FV_Player_Conversion = new FV_Player_Conversion();
models/email-subscription-mailchimp.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ global $fv_fp, $fv_player_MailChimp;
4
+
5
+ $fv_player_MailChimp = new \DrewM\MailChimp\MailChimp($fv_fp->conf['mailchimp_api']);
6
+ $fv_player_MailChimp->verify_ssl = false;
7
+
8
+ function fv_player_mailchimp_result() {
9
+ global $fv_player_MailChimp;
10
+ var_dump($fv_player_MailChimp);
11
+ return $fv_player_MailChimp->get('lists');
12
+ }
13
+
14
+ function fv_player_mailchimp_last_error() {
15
+ global $fv_player_MailChimp;
16
+ return $fv_player_MailChimp->getLastError();
17
+ }
18
+
19
+ function fv_player_mailchimp_post($list_id, $email, $merge_fields ) {
20
+ global $fv_player_MailChimp;
21
+ return $fv_player_MailChimp->post("lists/$list_id/members", array(
22
+ 'email_address' => $email,
23
+ 'status' => 'subscribed',
24
+ 'merge_fields' => (object)$merge_fields));
25
+ }
26
+
27
+ function fv_player_mailchimp_get($list_id ) {
28
+ global $fv_player_MailChimp;
29
+ return $fv_player_MailChimp->get("lists/{$list_id}/merge-fields");
30
+ }
models/email-subscription.php ADDED
@@ -0,0 +1,672 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FV_Player_Email_Subscription {
4
+
5
+ public function __construct() {
6
+ add_action( 'admin_init', array($this, 'init_options') );
7
+
8
+ add_action( 'admin_init', array($this, 'admin__add_meta_boxes') );
9
+ add_filter( 'fv_flowplayer_popup_html', array($this, 'popup_html') );
10
+ add_filter( 'fv_player_conf_defaults', array($this, 'conf_defaults') );
11
+ add_filter( 'fv_flowplayer_settings_save', array($this, 'fv_flowplayer_settings_save'), 10, 2 );
12
+ add_action( 'wp_ajax_nopriv_fv_wp_flowplayer_email_signup', array($this, 'email_signup') );
13
+ add_action( 'wp_ajax_fv_wp_flowplayer_email_signup', array($this, 'email_signup') );
14
+ add_filter( 'fv_player_admin_popups_defaults', array($this,'fv_player_admin_popups_defaults') );
15
+
16
+ add_action( 'wp_ajax_fv_player_email_subscription_save', array($this, 'save_settings') );
17
+
18
+ if( !empty($_GET['fv-email-export']) && !empty($_GET['page']) && $_GET['page'] === 'fvplayer'){
19
+ add_action('admin_init', array( $this, 'csv_export' ) );
20
+ }
21
+
22
+ if( !empty($_GET['fv-email-export-screen']) && !empty($_GET['page']) && $_GET['page'] === 'fvplayer'){
23
+ add_action('in_admin_header',array($this,'admin_export_screen'));
24
+ }
25
+
26
+ add_filter( 'fv_flowplayer_attributes', array( $this, 'popup_preview' ), 10, 3 );
27
+
28
+ }
29
+
30
+ /*
31
+ * SETTINGS
32
+ */
33
+
34
+ public function conf_defaults($conf) {
35
+ $conf += array(
36
+ 'mailchimp_api' => '',
37
+ 'mailchimp_list' => '',
38
+ 'mailchimp_label' => 'Subscribe for updates',
39
+ );
40
+ return $conf;
41
+ }
42
+
43
+ public function init_options() {
44
+ if( !get_option('fv_player_email_lists') ) {
45
+ update_option('fv_player_email_lists', array( 1 => array('first_name' => true,
46
+ 'last_name' => false,
47
+ 'integration' => false,
48
+ 'title' => 'Subscribe to list one',
49
+ 'description' => 'Two good reasons to subscribe right now',
50
+ 'disabled' => false
51
+ ) ) );
52
+ }
53
+ }
54
+
55
+ public function admin__add_meta_boxes() {
56
+ add_meta_box('fv_flowplayer_email_lists', __('Email Popups', 'fv-wordpress-flowplayer'), array($this, 'settings_box_lists'), 'fv_flowplayer_settings_actions', 'normal');
57
+ add_meta_box('fv_flowplayer_email_integration', __('Email Integration', 'fv-wordpress-flowplayer'), array($this, 'settings_box_integration'), 'fv_flowplayer_settings_actions', 'normal');
58
+ }
59
+
60
+ public function fv_flowplayer_settings_save($param1,$param2){
61
+
62
+ if(isset($_POST['email_lists'])){
63
+ $aOptions = $_POST['email_lists'];
64
+ unset($aOptions['#fv_popup_dummy_key#']);
65
+
66
+ foreach( $aOptions AS $key => $value ) {
67
+ $aOptions[$key]['first_name'] = stripslashes($value['first_name']);
68
+ $aOptions[$key]['last_name'] = stripslashes($value['last_name']);
69
+ $aOptions[$key]['integration'] = isset($value['integration']) ? stripslashes($value['integration']) : false;
70
+ $aOptions[$key]['title'] = stripslashes($value['title']);
71
+ $aOptions[$key]['description'] = stripslashes($value['description']);
72
+
73
+ }
74
+ update_option('fv_player_email_lists',$aOptions);
75
+ }
76
+
77
+ return $param1;
78
+ }
79
+
80
+ public function fv_player_admin_popups_defaults($aData){
81
+ $aPopupData = get_option('fv_player_email_lists');
82
+ unset($aPopupData['#fv_list_dummy_key#']);
83
+
84
+ if( is_array($aPopupData) ) {
85
+ foreach( $aPopupData AS $key => $aPopupAd ) {
86
+ $aData['email-' . $key] = $aPopupAd;
87
+ }
88
+ }
89
+
90
+ return $aData;
91
+ }
92
+
93
+ public function settings_box_integration () {
94
+ global $fv_fp;
95
+ ?>
96
+ <p><?php _e('Enter your service API key and then assign it to a list which you create above.', 'fv-wordpress-flowplayer'); ?></p>
97
+ <?php if( version_compare(phpversion(),'5.3.0') >= 0 ) : ?>
98
+ <table class="form-table2" style="margin: 5px; ">
99
+ <tr>
100
+ <td style="width: 250px"><label for="mailchimp_api"><?php _e('Mailchimp API key', 'fv-wordpress-flowplayer'); ?>:</label></td>
101
+ <td>
102
+ <p class="description">
103
+ <input type="text" name="mailchimp_api" id="mailchimp_api" value="<?php echo esc_attr($fv_fp->_get_option('mailchimp_api')); ?>" />
104
+ </p>
105
+ </td>
106
+ </tr>
107
+ <tr>
108
+ <td></td>
109
+ <td>
110
+ <input type="submit" name="fv-wp-flowplayer-submit" class="button-primary" value="<?php _e('Save All Changes', 'fv-wordpress-flowplayer'); ?>" />
111
+ </td>
112
+ </tr>
113
+ </table>
114
+ <?php else : ?>
115
+ <p><?php _e('Please upgrade to PHP 5.3 or above to use the Mailchimp integration.', 'fv-wordpress-flowplayer'); ?></p>
116
+ <?php endif;
117
+ }
118
+
119
+ public function settings_box_lists () {
120
+ global $fv_fp;
121
+
122
+ $aListData = get_option('fv_player_email_lists');
123
+ if( empty($aListData) ) {
124
+ $aListData = array( 1 => array() );
125
+ }
126
+ if(!isset($aListData['#fv_list_dummy_key#'])){
127
+ $aListData = array( '#fv_list_dummy_key#' => array() ) + $aListData ;
128
+ }
129
+ $aMailchimpLists = $this->get_mailchimp_lists();
130
+ ?>
131
+ <p><?php _e('Lists defined here can be used for subscription box for each video or for Default Popup above.', 'fv-wordpress-flowplayer'); ?></p>
132
+ <table class="form-table2" style="margin: 5px; ">
133
+ <tr>
134
+ <td>
135
+ <table id="fv-player-email_lists-settings">
136
+ <thead>
137
+ <tr>
138
+ <td>ID</td>
139
+ <td style="width: 40%"><?php _e('Properties', 'fv-wordpress-flowplayer'); ?></td>
140
+ <?php if( !empty($aMailchimpLists['result']) ) : ?>
141
+ <td><?php _e('Target List', 'fv-wordpress-flowplayer'); ?></td>
142
+ <?php endif; ?>
143
+ <td><?php _e('Export', 'fv-wordpress-flowplayer'); ?></td>
144
+ <td><?php _e('Options', 'fv-wordpress-flowplayer'); ?></td>
145
+ <td><?php _e('Status', 'fv-wordpress-flowplayer'); ?></td>
146
+ <td></td>
147
+ </tr>
148
+ </thead>
149
+ <tbody>
150
+ <?php
151
+
152
+ foreach ($aListData AS $key => $aList) {
153
+ $mailchimpOptions = '';
154
+
155
+ foreach($aMailchimpLists['result'] as $mailchimpId => $list){
156
+ if(!$list)
157
+ continue;
158
+ $use = true;
159
+ foreach($list['fields'] as $field){
160
+
161
+ if( $field['required'] && ($field['tag'] === "FNAME" && ( empty($aList['first_name']) || !$aList['first_name'] ) || $field['tag'] === "LNAME" && ( empty($aList['last_name']) || !$aList['last_name'] ) ) ){
162
+ $use = false;
163
+ break;
164
+ }
165
+
166
+ }
167
+ if($use){
168
+ $mailchimpOptions .= '<option value="mailchimp-' . $list['id'] . '" ' . ( isset($aList['integration']) && 'mailchimp-' . $list['id'] === $aList['integration']?"selected":"" ) . '>' . $list['name'] . '</option>';
169
+ }
170
+ }
171
+
172
+ if( $aMailchimpLists && $mailchimpOptions ) {
173
+ $mailchimp_no_option = 'None';
174
+ } else if( $aMailchimpLists && !$mailchimpOptions ) {
175
+ $mailchimp_no_option = 'No matching list found';
176
+ }
177
+
178
+ ?>
179
+ <tr class='data' id="fv-player-list-item-<?php echo $key; ?>"<?php echo $key === '#fv_list_dummy_key#' ? 'style="display:none"' : ''; ?>>
180
+ <td class='id'><?php echo $key ; ?></td>
181
+ <td>
182
+ <table>
183
+ <tr>
184
+ <td style="width:16%"><label>Header</label></td>
185
+ <td><input type='text' name='email_lists[<?php echo $key; ?>][title]' value='<?php echo isset($aList['title']) ? esc_attr($aList['title']) : ''; ?>' /></td>
186
+ </tr>
187
+ <tr>
188
+ <td><label>Message</label></td>
189
+ <td><input type='text' name='email_lists[<?php echo $key; ?>][description]' value='<?php echo isset($aList['description']) ? esc_attr($aList['description']) : ''; ?>' /></td>
190
+ </tr>
191
+ </table>
192
+ </td>
193
+ <?php if( !empty($aMailchimpLists['result']) ) : ?>
194
+ <td>
195
+ <select name="email_lists[<?php echo $key; ?>][integration]" title="E-mail list">
196
+ <option value=""><?php echo $mailchimp_no_option; ?></option>
197
+ <?php echo $mailchimpOptions ;?>
198
+ </select>
199
+ <br />&nbsp;
200
+ </td>
201
+ <?php endif; ?>
202
+ <td>
203
+ <a class='fv-player-list-export' href='<?php echo admin_url('options-general.php?page=fvplayer&fv-email-export='.$key ); ?>' target="_blank" ><?php _e('Download CSV', 'fv-wordpress-flowplayer'); ?></a>
204
+ <br />
205
+ <a class='fv-player-list-export' href='<?php echo admin_url('options-general.php?page=fvplayer&fv-email-export-screen='.$key); ?>' target="_blank" ><?php _e('View list', 'fv-wordpress-flowplayer'); ?></a>
206
+ </td>
207
+ <td>
208
+ <input type='hidden' name='email_lists[<?php echo $key; ?>][first_name]' value='0' />
209
+ <input id='list-first-name-<?php echo $key; ?>' title="first name" type='checkbox' name='email_lists[<?php echo $key; ?>][first_name]' value='1' <?php echo (isset($aList['first_name']) && $aList['first_name'] ? 'checked="checked"' : ''); ?> />
210
+ <label for='list-first-name-<?php echo $key; ?>'>First Name</label>
211
+ <br />
212
+ <input type='hidden' name='email_lists[<?php echo $key; ?>][last_name]' value='0' />
213
+ <input id='list-last-name-<?php echo $key; ?>' title="last name" type='checkbox' name='email_lists[<?php echo $key; ?>][last_name]' value='1' <?php echo (isset($aList['last_name']) && $aList['last_name'] ? 'checked="checked"' : ''); ?> />
214
+ <label for='list-last-name-<?php echo $key; ?>'>Last Name</label>
215
+ </td>
216
+ <td>
217
+ <input type='hidden' name='email_lists[<?php echo $key; ?>][disabled]' value='0' />
218
+ <input id='ListAdDisabled-<?php echo $key; ?>' type='checkbox' title="disable" name='email_lists[<?php echo $key; ?>][disabled]' value='1' <?php echo (isset($aList['disabled']) && $aList['disabled'] ? 'checked="checked"' : ''); ?> />
219
+ <label for='ListAdDisabled-<?php echo $key; ?>'>Disable</label>
220
+ <br />
221
+ <a class='fv-player-list-remove' href=''><?php _e('Remove', 'fv-wordpress-flowplayer'); ?></a>
222
+ </td>
223
+ <td>
224
+ <input type="button" style="visibility: hidden" class="fv_player_email_list_save button" value="Save & Preview" />
225
+ </td>
226
+ </tr>
227
+ <?php
228
+ }
229
+ ?>
230
+ </tbody>
231
+ </table>
232
+ </td>
233
+ </tr>
234
+ <tr>
235
+ <td>
236
+ <input type="button" value="<?php _e('Add More Lists', 'fv-wordpress-flowplayer'); ?>" class="button" id="fv-player-email_lists-add" />
237
+ </td>
238
+ </tr>
239
+ </table>
240
+
241
+ <script>
242
+ jQuery('#fv-player-email_lists-add').click( function() {
243
+ var fv_player_list_index = (parseInt( jQuery('#fv-player-email_lists-settings tr.data:last .id').html() ) || 0 ) + 1;
244
+ jQuery('#fv-player-email_lists-settings').append(jQuery('#fv-player-email_lists-settings tr.data:first').prop('outerHTML').replace(/#fv_list_dummy_key#/gi,fv_player_list_index + ""));
245
+ jQuery('#fv-player-list-item-' + fv_player_list_index).show();
246
+ return false;
247
+ } );
248
+
249
+ jQuery(document).on('click','.fv-player-list-remove', false, function() {
250
+ if( confirm('Are you sure you want to remove the list?') ){
251
+ jQuery(this).parents('.data').remove();
252
+ if(jQuery('#fv-player-email_lists-settings .data').length === 1) {
253
+ jQuery('#fv-player-email_lists-add').trigger('click');
254
+ }
255
+ }
256
+ return false;
257
+ } );
258
+
259
+ jQuery(document).on('keydown change', '#fv-player-email_lists-settings', function(e) {
260
+ var row = jQuery(e.target).parents('[id^="fv-player-list-item-"]');
261
+ row.find('.fv_player_email_list_save').css('visibility','visible');
262
+ });
263
+ jQuery(document).on('click', '#fv-player-email_lists-settings input[type=checkbox]', function(e) {
264
+ var row = jQuery(e.target).parents('[id^="fv-player-list-item-"]');
265
+ row.find('.fv_player_email_list_save').css('visibility','visible');
266
+ });
267
+
268
+ jQuery(document).on('click', '.fv_player_email_list_save', function() {
269
+ var button = jQuery(this);
270
+ var row = button.parents('[id^="fv-player-list-item-"]');
271
+ var aInputs = row.find('input, select');
272
+ var key = row.attr('id').replace(/fv-player-list-item-/,'');
273
+
274
+ fv_player_open_preview_window(null,<?php echo $fv_fp->_get_option('width') ?>,<?php echo $fv_fp->_get_option('height') ?>+100);
275
+
276
+ button.prop('disabled',true);
277
+ jQuery.ajax( {
278
+ type: "POST",
279
+ url: ajaxurl,
280
+ data: aInputs.serialize()+'&key='+key+'&action=fv_player_email_subscription_save&_wpnonce=<?php echo wp_create_nonce('fv_player_email_subscription_save'); ?>',
281
+ success: function(response) {
282
+ button.css('visibility','hidden');
283
+ button.prop('disabled', false);
284
+
285
+ row.replaceWith( jQuery('#'+row.attr('id'),response) );
286
+
287
+ var shortcode = '<?php echo '[fvplayer src="https://player.vimeo.com/external/196881410.hd.mp4?s=24645ecff21ff60079fc5b7715a97c00f90c6a18&profile_id=174&oauth2_token_id=3501005" splash="https://i.vimeocdn.com/video/609485450_1280.jpg" preroll="no" postroll="no" subtitles="'.plugins_url('images/test-subtitles.vtt',dirname(__FILE__)).'" end_popup_preview="true" popup="email-#key#" caption="'.__("This is how the popup will appear at the end of a video",'fv-wordpress-flowplayer').'"]'; ?>';
288
+ shortcode = shortcode.replace(/#key#/,key);
289
+
290
+ var url = '<?php echo home_url(); ?>?fv_player_embed=1&fv_player_preview=' + b64EncodeUnicode(shortcode);
291
+ fv_player_open_preview_window(url);
292
+ },
293
+ error: function() {
294
+ button.val('Error saving!');
295
+ }
296
+ } );
297
+ });
298
+ </script>
299
+ <?php
300
+ }
301
+
302
+ /*
303
+ * GENEREATE HTML
304
+ */
305
+ public function popup_html($popup) {
306
+ if ($popup === 'email-no'){
307
+ return '';
308
+ }
309
+
310
+ if(strpos($popup,'email-') !== 0)
311
+ {
312
+ return $popup ;
313
+ }
314
+
315
+ $id = array_reverse(explode('-',$popup));
316
+ $id = $id[0];
317
+ $aLists = get_option('fv_player_email_lists',array());
318
+ $list = isset($aLists[$id]) ? $aLists[$id] : array('disabled' => '1');
319
+
320
+ if( empty($list['title']) || $list['disabled'] === '1'){
321
+ return '';
322
+ }
323
+ $popupItems = '';
324
+ $count = 1;
325
+ foreach($list as $key => $field){
326
+ if(($key === 'first_name' || $key === 'last_name') && $field == "1"){
327
+ $count++;
328
+ $aName = explode('_',$key);
329
+ foreach($aName as $nameKey => $val){
330
+ $aName[$nameKey] = ucfirst($aName[$nameKey]);
331
+ }
332
+
333
+ $sName = implode(' ',$aName);
334
+ $popupItems .= '<input type="text" placeholder="' . $sName . '" name="' . $key . '" required/>';
335
+ }
336
+
337
+ }
338
+ $popup = '';
339
+ if( !empty($list['title']) ) $popup .= '<h3>'.$list['title'].'</h3>';
340
+ if( !empty($list['description']) ) $popup .= '<p>'.$list['description'].'</p>';
341
+ $popup .= '<form class="mailchimp-form mailchimp-form-' . $count . '">'
342
+ . '<input type="hidden" name="list" value="' . $id . '" />'
343
+ . '<input type="email" placeholder="' . __('Email Address', 'fv-wordpress-flowplayer') . '" name="email"/>'
344
+ . $popupItems . '<input type="submit" value="' . __('Subscribe', 'fv-wordpress-flowplayer') . '"/></form>';
345
+ return $popup;
346
+ }
347
+
348
+ /*
349
+ * API CALL
350
+ */
351
+ private function get_mailchimp_lists() {
352
+ if(version_compare(phpversion(),'5.3.0','<')){
353
+ return array('error' => 'PHP 5.3 or above required.', 'result' => false);
354
+ }
355
+
356
+ global $fv_fp;
357
+ $aLists = array();
358
+
359
+ if (!$fv_fp->_get_option('mailchimp_api')) {
360
+ update_option('fv_player_mailchimp_lists', $aLists);
361
+ return array('error' => 'No API key found. ', 'result' => $aLists);
362
+ }
363
+
364
+ $aLists = get_option('fv_player_mailchimp_lists', array());
365
+ $sTimeout = !$aLists || count($aLists) == 0 ? 60 : 3600;
366
+
367
+ if( get_option('fv_player_mailchimp_time', 0 ) + $sTimeout > time() && !isset($_GET['fv_refresh_mailchimp']) ) return array('error' => false, 'result' => $aLists);
368
+
369
+ require_once dirname(__FILE__) . '/../includes/mailchimp-api/src/MailChimp.php';
370
+ require_once dirname(__FILE__) . '/email-subscription-mailchimp.php';
371
+
372
+ $result = fv_player_mailchimp_result();
373
+ $error = fv_player_mailchimp_last_error();
374
+ if ($error || !$result) {
375
+ update_option('fv_player_mailchimp_time', time() - 50 * 60);
376
+ update_option('fv_player_mailchimp_lists', $aLists);
377
+ return array('error' => $error, 'result' => $aLists);
378
+ }
379
+ $aLists = array();
380
+ foreach ($result['lists'] as $list) {
381
+ $item = array(
382
+ 'id' => $list['id'],
383
+ 'name' => $list['name'],
384
+ 'fields' => array()
385
+ );
386
+
387
+
388
+ foreach ($list['_links'] as $link) {
389
+ if ($link['rel'] === 'merge-fields') {
390
+ $mergeFields = fv_player_mailchimp_get($list['id']);
391
+ foreach ($mergeFields['merge_fields'] as $field) {
392
+ $item['fields'][] = array(
393
+ 'tag' => $field['tag'],
394
+ 'name' => $field['name'],
395
+ 'required' => $field['required'],
396
+ );
397
+ }
398
+ break;
399
+ }
400
+ }
401
+ $aLists[$list['id']] = $item;
402
+ }
403
+
404
+ update_option('fv_player_mailchimp_time', time() );
405
+ update_option('fv_player_mailchimp_lists', $aLists);
406
+ return array('error' => false, 'result' => $aLists);
407
+ }
408
+
409
+ private function mailchimp_signup($list_id, $data){
410
+ global $fv_fp;
411
+ require_once dirname(__FILE__) . '/../includes/mailchimp-api/src/MailChimp.php';
412
+ require_once dirname(__FILE__) . '/email-subscription-mailchimp.php';
413
+
414
+ $merge_fields = array();
415
+
416
+ if(isset($data['first_name'])){
417
+ $merge_fields['FNAME'] = $data['first_name'];
418
+ }
419
+
420
+ if(isset($data['last_name'])){
421
+ $merge_fields['LNAME'] = $data['last_name'];
422
+ }
423
+
424
+ $result_data = fv_player_mailchimp_post($list_id, $data['email'], $merge_fields);
425
+
426
+ $result = array(
427
+ 'status' => 'OK',
428
+ 'text' => __('Thank You for subscribing.', 'fv-wordpress-flowplayer'),
429
+ 'error_log' => false,
430
+ );
431
+
432
+
433
+ if ($result_data['status'] === 400) {
434
+ if ($result_data['title'] === 'Member Exists') {
435
+ $result = array(
436
+ 'status' => 'ERROR',
437
+ 'text' => __('Email Address already subscribed.', 'fv-wordpress-flowplayer'),
438
+ 'error_log' => $result_data,
439
+ );
440
+ } elseif ($result_data['title'] === 'Invalid Resource') {
441
+ $result = array(
442
+ 'status' => 'ERROR',
443
+ 'text' => __('Email Address not valid', 'fv-wordpress-flowplayer'),
444
+ 'error_log' => $result_data
445
+ );
446
+ } else {
447
+ $result = array(
448
+ 'status' => 'ERROR',
449
+ 'text' => 'Unknown Error 1. ',
450
+ 'error_log'=> $result_data,
451
+ );
452
+ }
453
+ }elseif($result_data['status'] !== 'subscribed'){
454
+ $result = array(
455
+ 'status' => 'ERROR',
456
+ 'text' => 'Unknown Error 2.',
457
+ 'error_log'=> $result_data,
458
+ );
459
+ }
460
+ return $result;
461
+ }
462
+
463
+ public function email_signup() {
464
+ $data = $_POST;
465
+ $list_id = isset($data['list']) ? $data['list'] : 0;
466
+ unset($data['list']);
467
+ $aLists = get_option('fv_player_email_lists');
468
+
469
+ $list = isset($aLists[$list_id]) ? $aLists[$list_id] : array();
470
+
471
+ global $wpdb;
472
+ $table_name = $wpdb->prefix . 'fv_player_emails';
473
+ if ($wpdb->get_var("SHOW TABLES LIKE '$table_name'") !== $table_name) {
474
+ $sql = "CREATE TABLE `$table_name` (
475
+ `id` INT(11) NOT NULL AUTO_INCREMENT,
476
+ `email` TEXT NULL,
477
+ `first_name` TEXT NULL,
478
+ `last_name` TEXT NULL,
479
+ `id_list` INT(11) NOT NULL,
480
+ `date` DATETIME NULL DEFAULT NULL,
481
+ `data` TEXT NULL,
482
+ `integration` TEXT NULL,
483
+ `integration_nice` TEXT NULL,
484
+ `status` TEXT NULL,
485
+ `error` TEXT NULL,
486
+ PRIMARY KEY (`id`)
487
+ )" . $wpdb->get_charset_collate() . ";";
488
+ require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
489
+ dbDelta($sql);
490
+ }
491
+
492
+ $result = array(
493
+ 'status' => 'OK',
494
+ 'text' => __('Thank You for subscribing.', 'fv-wordpress-flowplayer'));
495
+
496
+ $integration_nice = '';
497
+
498
+ if(!empty($list['integration'])){
499
+ $aLists = get_option('fv_player_mailchimp_lists', array());
500
+ $integration_nice = $aLists[str_replace('mailchimp-','',$list['integration'])]['name'];
501
+ $result = $this->mailchimp_signup(str_replace('mailchimp-','',$list['integration']),$data);
502
+ }
503
+ if(empty($data['email']) || filter_var(trim($data['email']), FILTER_VALIDATE_EMAIL)===false){
504
+ $result['status'] = 'ERROR';
505
+ $result['text'] = __('Malformed Email Address.', 'fv-wordpress-flowplayer');
506
+ };
507
+
508
+ $count = $wpdb->get_var('SELECT COUNT(*) FROM ' . $wpdb->prefix . 'fv_player_emails WHERE email="' . addslashes($data['email']) . '" AND id_list = "'. addslashes($list_id) .'"' );
509
+
510
+
511
+ if(intval($count) === 0){
512
+ $wpdb->insert($table_name, array(
513
+ 'email' => $data['email'],
514
+ 'data' => serialize($data),
515
+ 'id_list'=>$list_id,
516
+ 'date'=>date("Y-m-d H:i:s"),
517
+ 'first_name' => isset($data['first_name']) ? $data['first_name'] : '',
518
+ 'last_name' => isset($data['last_name']) ? $data['last_name'] : '',
519
+ 'integration' => $list['integration'],
520
+ 'integration_nice' => $integration_nice,
521
+ 'status' => $result['status'],
522
+ 'error' => $result['status'] === 'ERROR' ? serialize( $result['error_log'] ) : '',
523
+ ));
524
+
525
+ }elseif($result['status'] === 'OK'){
526
+ $result = array(
527
+ 'status' => 'ERROR',
528
+ 'text' => __('Email Address already subscribed.', 'fv-wordpress-flowplayer'),
529
+ );
530
+
531
+ }else{
532
+ $wpdb->insert($table_name, array(
533
+ 'email' => $data['email'],
534
+ 'data' => serialize($data),
535
+ 'id_list'=>$list_id,
536
+ 'date'=>date("Y-m-d H:i:s"),
537
+ 'first_name' => isset($data['first_name']) ? $data['first_name'] : '',
538
+ 'last_name' => isset($data['last_name']) ? $data['last_name'] : '',
539
+ 'integration' => $list['integration'],
540
+ 'integration_nice' => $integration_nice,
541
+ 'status' => $result['status'],
542
+ 'error' => $result['status'] === 'ERROR' ? serialize( $result['error_log'] ) : '',
543
+ ));
544
+ }
545
+
546
+ unset($result['error_log']);
547
+ die(json_encode($result));
548
+ }
549
+
550
+ function csv_export(){
551
+ $list_id = $_GET['fv-email-export'];
552
+ $aLists = get_option('fv_player_email_lists');
553
+ $list = $aLists[$list_id];
554
+ $filename = 'export-lists-' . (empty($list->title) ? $list_id : $list->title) . '-' . date('Y-m-d') . '.csv';
555
+
556
+ header("Content-type: text/csv");
557
+ header("Content-Disposition: attachment; filename=$filename");
558
+ header("Pragma: no-cache");
559
+ header("Expires: 0");
560
+
561
+ global $wpdb;
562
+ $results = $wpdb->get_results('SELECT `email`, `first_name`, `last_name`, `date`, `integration`, `integration_nice`, `status`, `error` FROM `' . $wpdb->prefix . 'fv_player_emails` WHERE `id_list` = "' . esc_sql($list_id) . '"');
563
+
564
+ echo 'email,first_name,last_name,date,integration,status,error'."\n";
565
+ if( $results ) {
566
+ foreach ($results as $row){
567
+ if(!empty($row->integration)){
568
+ $row->integration .= ': '.$row->integration_nice;
569
+ }
570
+ unset($row->integration_nice);
571
+
572
+ if(!empty($row->error)){
573
+ $tmp = unserialize($row->error);
574
+ $row->error = $tmp['title'];
575
+ }
576
+
577
+
578
+ echo '"' . implode('","',str_replace('"','',(array)$row)) . "\"\n";
579
+ }
580
+ }
581
+ die;
582
+ }
583
+
584
+
585
+ public function admin_export_screen(){
586
+
587
+ $list_id = $_GET['fv-email-export-screen'];
588
+
589
+ global $wpdb;
590
+ $results = $wpdb->get_results('SELECT `email`, `first_name`, `last_name`, `date`, `integration`, `integration_nice`, `status`, `error` FROM `' . $wpdb->prefix . 'fv_player_emails` WHERE `id_list` = "' . esc_sql($list_id) . '" LIMIT 10');
591
+
592
+ ?>
593
+ <style>
594
+ #adminmenumain { display: none }
595
+ #wpcontent { margin-left: 0 }
596
+ </style>
597
+
598
+ <table class="wp-list-table widefat fixed striped posts">
599
+ <thead>
600
+ <tr>
601
+ <th scope="col" class="manage-column">E-mail</th>
602
+ <th scope="col" class="manage-column">First Name</th>
603
+ <th scope="col" class="manage-column">Last Name</th>
604
+ <th scope="col" class="manage-column">Date</th>
605
+ <th scope="col" class="manage-column">Integration</th>
606
+ <th scope="col" class="manage-column">Status</th>
607
+ <th scope="col" class="manage-column">Error</th>
608
+ </tr>
609
+ </thead>
610
+ <tbody>
611
+ <?php
612
+ foreach ($results as $row){
613
+ echo '<tr>';
614
+ foreach ($row as $key => $item) {
615
+ if($key === 'integration' && !empty($item)){
616
+ $item .= ': ' . $row->integration_nice;
617
+ }elseif($key === 'integration_nice'){
618
+ continue;
619
+ }elseif($key === 'error'){
620
+ $item = '';
621
+ if( !empty($item) ) {
622
+ $tmp = unserialize($item);
623
+ $item = $tmp['title'];
624
+ }
625
+ }
626
+ echo '<td>' . $item . '</td>';
627
+ }
628
+ echo '</tr>';
629
+ }
630
+ ?>
631
+ </tbody>
632
+ </table>
633
+ <p>
634
+ <a class='fv-player-list-export button' href='<?php echo admin_url('options-general.php?page=fvplayer&fv-email-export='.$list_id);?>' target="_blank" ><?php _e('Download CSV', 'fv-wordpress-flowplayer'); ?></a>
635
+ </p>
636
+
637
+ <?php
638
+
639
+ die();
640
+ }
641
+
642
+
643
+ public function save_settings() {
644
+ check_ajax_referer('fv_player_email_subscription_save');
645
+
646
+ $aLists = get_option('fv_player_email_lists',array());
647
+ $key = intval($_POST['key']);
648
+
649
+ if( !isset($_POST['email_lists'][$key]) ) {
650
+ header('HTTP/1.0 403 Forbidden');
651
+ die();
652
+ }
653
+
654
+ $aLists[$key] = $_POST['email_lists'][$key];
655
+ update_option('fv_player_email_lists',$aLists);
656
+
657
+ fv_player_admin_page();
658
+ }
659
+
660
+
661
+ public function popup_preview( $aAttributes ) {
662
+ global $fv_fp;
663
+ $aArgs = func_get_args();
664
+ if( isset($aArgs[2]->aCurArgs['end_popup_preview']) && $aArgs[2]->aCurArgs['end_popup_preview'] ) {
665
+ $aAttributes['data-end_popup_preview'] = true;
666
+ }
667
+ return $aAttributes;
668
+ }
669
+
670
+ }
671
+
672
+ $FV_Player_Email_Subscription = new FV_Player_Email_Subscription();
models/flowplayer-frontend.php CHANGED
@@ -22,11 +22,11 @@
22
  class flowplayer_frontend extends flowplayer
23
  {
24
 
25
- var $ajax_count = 0;
26
-
27
- var $autobuffer_count = 0;
28
-
29
- var $expire_time = 0;
30
 
31
  var $aAds = array();
32
 
@@ -43,44 +43,44 @@ class flowplayer_frontend extends flowplayer
43
  var $count_tabs = 0;
44
 
45
 
46
- /**
47
- * Builds the HTML and JS code of single flowplayer instance on a page/post.
48
- * @param string $media URL or filename (in case it is in the /videos/ directory) of video file to be played.
49
- * @param array $args Array of arguments (name => value).
50
- * @return Returns array with 2 elements - 'html' => html code displayed anywhere on page/post, 'script' => javascript code displayed before </body> tag
51
- */
52
- function build_min_player($media,$args = array()) {
53
 
54
- $this->hash = md5($media.$this->_salt()); // unique player id
55
  $this->aCurArgs = apply_filters( 'fv_flowplayer_args_pre', $args );
56
  $this->sHTMLAfter = false;
57
- $player_type = 'video';
58
- $rtmp = false;
59
- $youtube = false;
60
- $vimeo = false;
61
  $scripts_after = '';
62
 
63
  $attributes = array();
64
 
65
- // returned array with new player's html and javascript content
66
  if( !isset($GLOBALS['fv_fp_scripts']) ) {
67
  $GLOBALS['fv_fp_scripts'] = array();
68
  }
69
- $this->ret = array('html' => '', 'script' => $GLOBALS['fv_fp_scripts'] ); // note: we need the white space here, it fails to add into the string on some hosts without it (???)
70
-
71
 
72
 
73
- /*
74
  * Set common variables
75
  */
76
- $width = $this->_get_option('width');
77
- $height = $this->_get_option('height');
78
- if (isset($this->aCurArgs['width'])&&!empty($this->aCurArgs['width'])) $width = trim($this->aCurArgs['width']);
79
- if (isset($this->aCurArgs['height'])&&!empty($this->aCurArgs['height'])) $height = trim($this->aCurArgs['height']);
80
-
81
- $src1 = ( isset($this->aCurArgs['src1']) && !empty($this->aCurArgs['src1']) ) ? trim($this->aCurArgs['src1']) : false;
82
- $src2 = ( isset($this->aCurArgs['src2']) && !empty($this->aCurArgs['src2']) ) ? trim($this->aCurArgs['src2']) : false;
83
-
84
  $splash_img = $this->get_splash();
85
 
86
  foreach( array( $media, $src1, $src2 ) AS $media_item ) {
@@ -95,50 +95,50 @@ class flowplayer_frontend extends flowplayer
95
 
96
  list( $media, $src1, $src2 ) = apply_filters( 'fv_flowplayer_media_pre', array( $media, $src1, $src2 ), $this );
97
 
98
-
99
  /*
100
  * Which player should be used
101
  */
102
- foreach( array( $media, $src1, $src2 ) AS $media_item ) {
103
  if( !$this->_get_option('audio') ) {
104
  if( preg_match( '~\.(mp3|wav|ogg)([?#].*?)?$~', $media_item ) ) {
105
  $player_type = 'audio';
106
  break;
107
  }
108
  }
109
-
110
- global $post;
111
  if( $post ) {
112
  $fv_flowplayer_meta = get_post_meta( $post->ID, '_fv_flowplayer', true );
113
  if( $fv_flowplayer_meta && isset($fv_flowplayer_meta[sanitize_title($media_item)]['time']) ) {
114
  $this->expire_time = $fv_flowplayer_meta[sanitize_title($media_item)]['time'];
115
  }
116
  }
117
- }
118
 
119
  if( preg_match( "~(youtu\.be/|youtube\.com/(watch\?(.*&)?v=|(embed|v)/))([^\?&\"'>]+)~i", $media, $aYoutube ) ) {
120
- if( isset($aYoutube[5]) ) {
121
- $youtube = $aYoutube[5];
122
- $player_type = 'youtube';
123
- }
124
- } else if( preg_match( "~^[a-zA-Z0-9-_]{11}$~", $media, $aYoutube ) ) {
125
- if( isset($aYoutube[0]) ) {
126
- $youtube = $aYoutube[0];
127
- $player_type = 'youtube';
128
- }
129
- }
130
 
131
- if( preg_match( "~vimeo.com/(?:video/|moogaloop\.swf\?clip_id=)?(\d+)~i", $media, $aVimeo ) ) {
132
- if( isset($aVimeo[1]) ) {
133
- $vimeo = $aVimeo[1];
134
- $player_type = 'vimeo';
135
- }
136
- } else if( preg_match( "~^[0-9]{8}$~", $media, $aVimeo ) ) {
137
- if( isset($aVimeo[0]) ) {
138
- $vimeo = $aVimeo[0];
139
- $player_type = 'vimeo';
140
- }
141
- }
142
 
143
 
144
  if( !isset($this->aCurArgs['liststyle']) || empty($this->aCurArgs['liststyle']) ){
@@ -198,21 +198,21 @@ class flowplayer_frontend extends flowplayer
198
  /*
199
  * Video player
200
  */
201
- if( $player_type == 'video' ) {
202
 
203
- if (!empty($media)) {
204
- $media = $this->get_video_url($media);
205
- }
206
- if (!empty($src1)) {
207
- $src1 = $this->get_video_url($src1);
208
- }
209
- if (!empty($src2)) {
210
- $src2 = $this->get_video_url($src2);
211
- }
212
  $mobile = ( isset($this->aCurArgs['mobile']) && !empty($this->aCurArgs['mobile']) ) ? trim($this->aCurArgs['mobile']) : false;
213
- if (!empty($mobile)) {
214
- $mobile = $this->get_video_url($mobile);
215
- }
216
 
217
  if( is_feed() ) {
218
  $this->ret['html'] = '<p class="fv-flowplayer-feed"><a href="'.get_permalink().'" title="'.__('Click to watch the video').'">'.apply_filters( 'fv_flowplayer_rss_intro_splash', __('[This post contains video, click to play]') );
@@ -233,8 +233,7 @@ class flowplayer_frontend extends flowplayer
233
  }
234
  }
235
 
236
-
237
- if( !$bHTTPs && function_exists('is_amp_endpoint') && is_amp_endpoint() || count($aPlaylistItems) && function_exists('is_amp_endpoint') && is_amp_endpoint() ) {
238
  $this->ret['html'] = '<p class="fv-flowplayer-feed"><a href="'.get_permalink().'" title="'.__('Click to watch the video').'">'.apply_filters( 'fv_flowplayer_rss_intro_splash', __('[This post contains advanced video player, click to open the original website]') );
239
  if( $splash_img ) {
240
  $this->ret['html'] .= '<br /><img src="'.$splash_img.'" width="400" />';
@@ -246,72 +245,77 @@ class flowplayer_frontend extends flowplayer
246
  return $this->ret;
247
 
248
  } else if( function_exists('is_amp_endpoint') && is_amp_endpoint() ) {
249
- $this->ret['html'] .= "\t".'<video controls';
250
- if (isset($splash_img) && !empty($splash_img)) {
251
- $this->ret['html'] .= ' poster="'.flowplayer::get_encoded_url($splash_img).'"';
252
- }
253
- if( $autoplay == true ) {
254
- $this->ret['html'] .= ' autoplay';
255
- }
256
- $this->ret['html'] .= ">\n";
257
-
258
- if (!empty($mobile)) {
259
- $this->ret['html'] .= $this->get_video_src($mobile, array( 'id' => 'wpfp_'.$this->hash.'_mobile', 'mobileUserAgent' => true ) );
260
- } else {
 
 
 
 
 
 
 
 
261
  foreach( apply_filters( 'fv_player_media', array($media, $src1, $src2), $this ) AS $media_item ) {
262
- $this->ret['html'] .= $this->get_video_src($media_item, array( 'mobileUserAgent' => true ) );
263
  }
264
  }
265
-
266
- $this->ret['html'] .= "\t".'</video>';
267
 
268
  $this->ret['html'] = apply_filters( 'fv_flowplayer_amp', $this->ret['html'], $this );
269
 
270
  return $this->ret;
271
  }
272
-
273
- foreach( array( $media, $src1, $src2 ) AS $media_item ) {
274
- //if( ( strpos($media_item, 'amazonaws.com') !== false && stripos( $media_item, 'http://s3.amazonaws.com/' ) !== 0 && stripos( $media_item, 'https://s3.amazonaws.com/' ) !== 0 ) || stripos( $media_item, 'rtmp://' ) === 0 ) { // we are also checking amazonaws.com due to compatibility with older shortcodes
275
-
276
- if( !$this->_get_option('engine') && stripos( $media_item, '.m4v' ) !== false ) {
277
- $this->ret['script']['fv_flowplayer_browser_ff_m4v'][$this->hash] = true;
278
- }
279
-
280
- }
281
-
282
- $popup = '';
283
-
284
- //check user agents
285
- $aUserAgents = array('iphone', 'ipod', 'iPad', 'aspen', 'incognito', 'webmate', 'android', 'android', 'dream', 'cupcake', 'froyo', 'blackberry9500', 'blackberry9520', 'blackberry9530', 'blackberry9550', 'blackberry9800', 'Palm', 'webos', 's8000', 'bada', 'Opera Mini', 'Opera Mobi', 'htc_touch_pro');
286
- $mobileUserAgent = false;
287
- foreach($aUserAgents as $userAgent){
288
- if(stripos($_SERVER['HTTP_USER_AGENT'],$userAgent))
289
- $mobileUserAgent = true;
290
- }
291
 
 
292
 
293
  $aSubtitles = $this->get_subtitles();
294
-
295
- $show_splashend = false;
296
- if (isset($this->aCurArgs['splashend']) && $this->aCurArgs['splashend'] == 'show' && isset($this->aCurArgs['splash']) && !empty($this->aCurArgs['splash'])) {
297
- $show_splashend = true;
298
- $splashend_contents = '<div id="wpfp_'.$this->hash.'_custom_background" class="wpfp_custom_background" style="position: absolute; background: url(\''.$splash_img.'\') no-repeat center center; background-size: contain; width: 100%; height: 100%; z-index: 1;"></div>';
299
- }
300
-
301
-
302
-
303
-
304
-
305
- $attributes['class'] = 'flowplayer no-brand is-splash';
306
 
307
  if( $autoplay ) {
308
  $attributes['data-fvautoplay'] = 'true';
309
  }
310
 
311
  if( isset($this->aCurArgs['playlist_hide']) && strcmp($this->aCurArgs['playlist_hide'],'true') == 0 ) {
312
- $attributes['class'] .= ' playlist-hidden';
313
- }
314
-
 
 
 
 
 
 
315
  // Fixed control bar
316
  $bFixedControlbar = $this->_get_option('ui_fixed_controlbar');
317
  if( isset($this->aCurArgs['controlbar']) ) {
@@ -337,23 +341,23 @@ class flowplayer_frontend extends flowplayer
337
  if( $bPlayButton ) {
338
  $attributes['class'] .= ' fvp-play-button';
339
  }
340
-
341
  // Align
342
- if( isset($this->aCurArgs['align']) ) {
343
- if( $this->aCurArgs['align'] == 'left' ) {
344
- $attributes['class'] .= ' alignleft';
345
- } else if( $this->aCurArgs['align'] == 'right' ) {
346
- $attributes['class'] .= ' alignright';
347
- } else if( $this->aCurArgs['align'] == 'center' ) {
348
- $attributes['class'] .= ' aligncenter';
349
- }
350
- }
351
  $attributes['class'] .= $this->get_align();
352
-
353
- if( $this->_get_option('engine') || $this->aCurArgs['engine'] == 'flash' ) {
354
- $attributes['data-engine'] = 'flash';
355
- }
356
-
357
  if( $this->_get_option( array( 'integrations', 'embed_iframe' ) ) ) {
358
  if( $this->aCurArgs['embed'] == 'false' || ( $this->_get_option('disableembedding') && $this->aCurArgs['embed'] != 'true' ) ) {
359
 
@@ -367,51 +371,67 @@ class flowplayer_frontend extends flowplayer
367
  }
368
 
369
  if( isset($this->aCurArgs['logo']) && $this->aCurArgs['logo'] ) {
370
- $attributes['data-logo'] = ( strcmp($this->aCurArgs['logo'],'none') == 0 ) ? '' : $this->aCurArgs['logo'];
371
- }
372
-
373
- if( $this->_get_option('fixed_size') ) {
374
- $attributes['style'] = 'width: ' . $width . 'px; height: ' . $height . 'px; ';
375
- } else {
376
- $attributes['style'] = 'max-width: ' . $width . 'px; max-height: ' . $height . 'px; ';
377
- }
378
-
 
 
 
 
 
 
 
379
  global $fv_wp_flowplayer_ver;
380
- //$attributes['data-swf'] = FV_FP_RELATIVE_PATH.'/flowplayer/flowplayer.swf?ver='.$fv_wp_flowplayer_ver; // it's better to have this in flowplayer.conf
381
- //$attributes['data-flashfit'] = "true";
382
-
383
- if( $this->_get_option('googleanalytics') ) {
384
- $attributes['data-analytics'] = $this->_get_option('googleanalytics');
385
- }
386
 
387
  list( $rtmp_server, $rtmp ) = $this->get_rtmp_server($rtmp);
388
  if( /*count($aPlaylistItems) == 0 &&*/ $rtmp_server) {
389
  $attributes['data-rtmp'] = $rtmp_server;
390
  }
391
-
392
- $this->get_video_checker_media($attributes, $media, $src1, $src2, $rtmp);
 
 
393
 
394
 
395
- if( !$this->_get_option('allowfullscreen') ) {
396
- $attributes['data-fullscreen'] = 'false';
397
- }
398
-
399
- $ratio = round($height / $width, 4);
400
- $this->fRatio = $ratio;
401
 
402
- $attributes['data-ratio'] = str_replace(',','.',$ratio);
 
 
 
 
 
403
 
404
- if( $this->_get_option('scaling') && $this->_get_option('fixed_size') ) {
405
- $attributes['data-flashfit'] = 'true';
406
- }
407
 
408
  if( isset($this->aCurArgs['live']) && $this->aCurArgs['live'] == 'true' ) {
409
- $attributes['data-live'] = 'true';
410
- }
411
 
412
- $playlist = '';
413
- $is_preroll = false;
414
- if( isset($playlist_items_external_html) ) {
 
 
 
 
 
415
  if( $args['liststyle'] == 'prevnext' || ( isset($this->aCurArgs['playlist_hide']) && $this->aCurArgs['playlist_hide']== 'true' ) ) {
416
  $playlist_items_external_html = str_replace( 'class="fp-playlist-external', 'style="display: none" class="fp-playlist-external', $playlist_items_external_html );
417
  }
@@ -430,11 +450,11 @@ class flowplayer_frontend extends flowplayer
430
  $attributes['style'] .= "background-image: url({$splash_img});";
431
  }
432
 
433
- } else if( !empty($this->aCurArgs['caption']) ) {
434
  $attributes['class'] .= ' has-caption';
435
  $this->sHTMLAfter = apply_filters( 'fv_player_caption', "<p class='fp-caption'>".$this->aCurArgs['caption']."</p>", $this );
436
 
437
- }
438
 
439
  if( !empty($this->aCurArgs['redirect']) ) {
440
  $attributes['data-fv_redirect'] = trim($this->aCurArgs['redirect']);
@@ -460,30 +480,32 @@ class flowplayer_frontend extends flowplayer
460
  }
461
  }
462
  }
463
-
464
- $attributes_html = '';
465
- $attributes = apply_filters( 'fv_flowplayer_attributes', $attributes, $media, $this );
466
- foreach( $attributes AS $attr_key => $attr_value ) {
467
  if( $attr_key == 'data-item' ) {
468
  $attributes_html .= ' '.$attr_key.'=\''.$attr_value.'\'';
469
  } else {
470
  $attributes_html .= ' '.$attr_key.'="'.esc_attr( $attr_value ).'"';
471
  }
472
- }
473
-
474
- $this->ret['html'] .= '<div id="wpfp_' . $this->hash . '"'.$attributes_html.'>'."\n";
475
 
476
- $this->ret['html'] .= "\t".'<div class="fp-ratio" style="padding-top: '.str_replace(',','.',$this->fRatio * 100).'%"></div>'."\n";
 
 
477
 
478
- if( count($aPlaylistItems) == 0 ) { // todo: this stops subtitles, mobile video, preload etc.
479
- $this->ret['html'] .= "\t".'<video class="fp-engine" preload="none"';
480
- if (isset($splash_img) && !empty($splash_img)) {
481
- $this->ret['html'] .= ' poster="'.flowplayer::get_encoded_url($splash_img).'"';
482
- }
483
 
484
- $this->ret['html'] .= ">\n";
485
 
486
- if( isset($rtmp) && !empty($rtmp) ) {
487
 
488
  foreach( apply_filters( 'fv_player_media_rtmp', array($rtmp),$this ) AS $rtmp_item ) {
489
  $rtmp_item = apply_filters( 'fv_flowplayer_video_src', $rtmp_item, $this );
@@ -512,17 +534,17 @@ class flowplayer_frontend extends flowplayer
512
 
513
  $this->ret['html'] .= "\t"."\t".'<source src="'.$extension.trim($rtmp_file, " \t\n\r\0\x0B/").'" type="video/flash" />'."\n";
514
  }
515
- }
516
-
517
  foreach( apply_filters( 'fv_player_media', array($media, $src1, $src2), $this ) AS $media_item ) {
518
- $this->ret['html'] .= $this->get_video_src($media_item, array( 'mobileUserAgent' => $mobileUserAgent, 'rtmp' => $rtmp ) );
519
  }
520
- if (!empty($mobile)) {
521
- $this->ret['script']['fv_flowplayer_mobile_switch'][$this->hash] = true;
522
- $this->ret['html'] .= $this->get_video_src($mobile, array( 'id' => 'wpfp_'.$this->hash.'_mobile', 'mobileUserAgent' => $mobileUserAgent, 'rtmp' => $rtmp ) );
523
- }
524
-
525
- if (isset($aSubtitles) && !empty($aSubtitles)) {
526
  $aLangs = self::get_languages();
527
  $countSubtitles = 0;
528
  foreach( $aSubtitles AS $key => $subtitles ) {
@@ -559,32 +581,34 @@ class flowplayer_frontend extends flowplayer
559
  $countSubtitles++;
560
  $this->ret['html'] .= "\t"."\t".'<track '.$sExtra.'src="'.esc_attr($subtitles).'" />'."\n";
561
  }
562
- }
563
-
564
- $this->ret['html'] .= "\t".'</video>';//."\n";
565
- }
566
-
567
  $this->ret['html'] .= $this->get_buttons();
568
-
569
- if( isset($splashend_contents) ) {
570
- $this->ret['html'] .= $splashend_contents;
571
- }
572
- if( $popup_contents = $this->get_popup_code() ) {
573
  $this->aPopups["wpfp_{$this->hash}"] = $popup_contents;
574
- }
575
- if( $ad_contents = $this->get_ad_code() ) {
576
- $this->aAds["wpfp_{$this->hash}"] = $ad_contents;
577
- }
578
 
579
  if( flowplayer::is_special_editor() ) {
580
  $this->ret['html'] .= '<div class="fp-ui"></div>';
581
  } else if( current_user_can('manage_options') && !isset($playlist_items_external_html) ) {
582
- $this->ret['html'] .= '<div id="wpfp_'.$this->hash.'_admin_error" class="fvfp_admin_error"><div class="fvfp_admin_error_content"><h4>Admin JavaScript warning:</h4><p>I\'m sorry, your JavaScript appears to be broken. Please use "Check template" in plugin settings, read our <a href="https://foliovision.com/player/installation#fixing-broken-javascript" target="_blank">troubleshooting guide</a>, <a href="https://foliovision.com/troubleshooting-javascript-errors" target="_blank">troubleshooting guide for programmers</a> or <a href="http://foliovision.com/wordpress/pro-install" target="_blank">order our pro support</a> and we will get it fixed for you.</p></div></div>';
583
  }
584
 
585
  $this->ret['html'] .= apply_filters( 'fv_flowplayer_inner_html', null, $this );
586
-
587
- $this->ret['html'] .= $this->get_sharing_html()."\n";
 
 
588
 
589
  if( current_user_can('manage_options') && !$this->_get_option('disable_videochecker') ) {
590
  $this->ret['html'] .= $this->get_video_checker_html()."\n";
@@ -594,74 +618,74 @@ class flowplayer_frontend extends flowplayer
594
  $this->ret['html'].='<a class="fp-prev" title="prev">&lt;</a><a class="fp-next" title="next">&gt;</a>';
595
  }
596
 
597
- $this->ret['html'] .= '</div>'."\n";
598
 
599
- $this->ret['html'] .= $this->sHTMLAfter.$scripts_after;
600
 
601
  if( get_query_var('fv_player_embed') ) { // this is needed for iframe embedding only
602
  $this->ret['html'] .= "<!--fv player end-->";
603
  }
604
 
605
- // change engine for IE9 and 10
606
- if( $this->aCurArgs['engine'] == 'false' ) {
607
- $this->ret['script']['fv_flowplayer_browser_ie'][$this->hash] = true;
608
- }
609
 
610
- } // end Video player
611
 
612
 
613
  /*
614
  * Youtube player
615
  */
616
  else if( $player_type == 'youtube' ) {
617
-
618
- $sAutoplay = ($autoplay) ? 'autoplay=1&amp;' : '';
619
- $this->ret['html'] .= "<iframe id='fv_ytplayer_{$this->hash}' type='text/html' width='{$width}' height='{$height}'
620
- src='//www.youtube.com/embed/$youtube?{$sAutoplay}origin=".urlencode(get_permalink())."' frameborder='0' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>\n";
621
-
622
- }
623
 
624
 
625
  /*
626
  * Vimeo player
627
  */
628
  else if( $player_type == 'vimeo' ) {
629
-
630
- $sAutoplay = ($autoplay) ? " autoplay='1'" : "";
631
- $this->ret['html'] .= "<iframe id='fv_vimeo_{$this->hash}' src='//player.vimeo.com/video/{$vimeo}' width='{$width}' height='{$height}' frameborder='0' webkitallowfullscreen mozallowfullscreen allowfullscreen{$sAutoplay}></iframe>\n";
632
-
633
- }
634
 
635
 
636
  /*
637
  * Audio player
638
  */
639
- else { // $player_type == 'video' ends
640
- $this->build_audio_player( $media, $width, $autoplay );
641
- }
642
 
643
- if( isset($this->aCurArgs['liststyle']) && $this->aCurArgs['liststyle'] == 'vertical' && count($aPlaylistItems) ){
644
  $this->ret['html'] = '<div class="fp-playlist-vertical-wrapper">'.$this->ret['html'].'</div>';
645
  }
646
  $this->ret['html'] = apply_filters( 'fv_flowplayer_html', $this->ret['html'], $this );
647
 
648
 
649
 
650
- $this->ret['script'] = apply_filters( 'fv_flowplayer_scripts_array', $this->ret['script'], 'wpfp_' . $this->hash, $media );
651
 
652
  return $this->ret;
653
- }
654
 
655
 
656
- function build_audio_player( $media, $width, $autoplay ) {
657
- $this->load_mediaelement = true;
658
-
659
- $preload = ($autoplay == true) ? '' : ' preload="none"';
660
-
661
- $this->ret['script']['mediaelementplayer'][$this->hash] = true;
662
- $this->ret['html'] .= '<div id="wpfp_' . $this->hash . '" class="fvplayer fv-mediaelement">'."\n";
663
  $this->ret['html'] .= "\t".'<audio src="'.$this->get_video_src( $media, array( 'url_only' => true ) ).'" type="audio/'.$this->get_mime_type($media, false, true).'" controls="controls" '.$preload.' style="width:100%;height:100%"></audio>'."\n";
664
- $this->ret['html'] .= '</div>'."\n";
665
  }
666
 
667
 
@@ -670,7 +694,7 @@ class flowplayer_frontend extends flowplayer
670
 
671
  if(
672
  ( trim($this->_get_option('ad')) || ( isset($this->aCurArgs['ad']) && !empty($this->aCurArgs['ad']) ) )
673
- && !strlen($this->aCurArgs['ad_skip'])
674
  ) {
675
  if (isset($this->aCurArgs['ad']) && !empty($this->aCurArgs['ad'])) {
676
  $ad = trim($this->aCurArgs['ad']);
@@ -681,12 +705,12 @@ class flowplayer_frontend extends flowplayer
681
  $ad = html_entity_decode( str_replace('&#039;',"'",$ad ) );
682
  }
683
 
684
- $ad_width = ( isset($this->aCurArgs['ad_width']) && intval($this->aCurArgs['ad_width']) > 0 ) ? intval($this->aCurArgs['ad_width']).'px' : '100%';
685
- $ad_height = ( isset($this->aCurArgs['ad_height']) && intval($this->aCurArgs['ad_height']) > 0 ) ? intval($this->aCurArgs['ad_height']).'px' : '';
686
  }
687
  else {
688
- $ad = trim( $this->_get_option('ad') );
689
- $ad_width = ( $this->_get_option('ad_width') ) ? $this->_get_option('ad_width').'px' : '100%';
690
  $ad_height = ( $this->_get_option('ad_height') ) ? $this->_get_option('ad_height').'px' : '';
691
  }
692
 
@@ -700,7 +724,7 @@ class flowplayer_frontend extends flowplayer
700
 
701
 
702
  $ad = apply_filters( 'fv_flowplayer_ad_html', $ad);
703
- if( strlen(trim($ad)) > 0 ) {
704
  $ad_contents = array(
705
  'html' => "<div class='wpfp_custom_ad_content' style='width: $ad_width; height: $ad_height; display:$ad_display;'>\n\t\t<div class='fv_fp_close'><a href='#' onclick='jQuery(\"#wpfp_".$this->hash."_ad\").fadeOut(); return false'></a></div>\n\t\t\t".$ad."\n\t\t</div>",
706
  'width' => $ad_width,
@@ -768,8 +792,8 @@ class flowplayer_frontend extends flowplayer
768
  }
769
 
770
 
771
- function get_popup_code() {
772
- if ( !empty($this->aCurArgs['popup'])) {
773
  $popup = trim($this->aCurArgs['popup']);
774
  } else {
775
  $popup = $this->_get_option('popups_default');
@@ -780,33 +804,33 @@ class flowplayer_frontend extends flowplayer
780
  } else {
781
  $popup = html_entity_decode(str_replace('&#039;', "'", $popup));
782
  }
783
-
784
  if ($popup === 'no') {
785
  return false;
786
- }
787
-
788
  $iPopupIndex = 1;
789
- if($popup === 'random' || is_numeric($popup) ){
790
- $aPopupData = get_option('fv_player_popups');
791
  if ($popup === 'random') {
792
- $iPopupIndex = rand(1,count($aPopupData) );
793
  } elseif (is_numeric($popup)) {
794
  $iPopupIndex = intval($popup);
795
  }
796
-
797
- if(isset($aPopupData[$iPopupIndex])){
798
- $popup = $aPopupData[$iPopupIndex]['html'];
799
- }else{
800
  return false;
801
  }
802
  }
803
-
804
- $sClass = ' fv_player_popup-'.$iPopupIndex;
805
-
806
  $popup = apply_filters('fv_flowplayer_popup_html', $popup);
807
  if (strlen(trim($popup)) > 0) {
808
  $popup_contents = array(
809
- 'html' => '<div class="fv_player_popup'.$sClass.' wpfp_custom_popup_content">' . $popup . '</div>'
810
  );
811
  return $popup_contents;
812
  }
@@ -883,7 +907,7 @@ class flowplayer_frontend extends flowplayer
883
  }
884
  else {
885
  $splash_img = trim($this->aCurArgs['splash']);
886
- }
887
  } else if( $this->_get_option('splash') ) {
888
  $splash_img = $this->_get_option('splash');
889
  }
@@ -980,19 +1004,22 @@ class flowplayer_frontend extends flowplayer
980
  if( current_user_can('manage_options') && $this->ajax_count < 100 && !$this->_get_option('disable_videochecker') && ( $this->_get_option('video_checker_agreement') || $this->_get_option('key_automatic') ) ) {
981
  $this->ajax_count++;
982
 
983
- $rtmp_test = false;
984
- if( isset($attributes['data-rtmp']) && $rtmp ) {
985
- $rtmp_test = parse_url($rtmp);
986
- $rtmp_test = trailingslashit($attributes['data-rtmp']).ltrim($rtmp_test['path'],'/');
987
  }
988
 
989
  $aTest_media = array();
990
- foreach( array( $media, $src1, $src2, $rtmp_test ) AS $media_item ) {
991
  if( $media_item ) {
992
  $aTest_media[] = $this->get_video_src( $media_item, array( 'flash' => false, 'url_only' => true, 'dynamic' => true ) );
993
  //break;
994
  }
995
- }
 
 
 
 
996
 
997
  if( isset($aTest_media) && count($aTest_media) > 0 ) {
998
  $this->ret['script']['fv_flowplayer_admin_test_media'][$this->hash] = $aTest_media;
@@ -1022,7 +1049,7 @@ class flowplayer_frontend extends flowplayer
1022
  $bVideoLink = false;
1023
  }
1024
  }
1025
-
1026
  $sLink = get_permalink();
1027
  if( !isset($sPermalink) || empty($sPermalink) ) {
1028
  $sPermalink = urlencode(get_permalink());
@@ -1030,7 +1057,7 @@ class flowplayer_frontend extends flowplayer
1030
  $sTitle = urlencode( html_entity_decode( is_singular() ? get_the_title().' ' : get_bloginfo() ).' ');
1031
  }
1032
 
1033
-
1034
  $sHTMLSharing = '<ul class="fvp-sharing">
1035
  <li><a class="sharing-facebook" href="https://www.facebook.com/sharer/sharer.php?u=' . $sPermalink . '" target="_blank">Facebook</a></li>
1036
  <li><a class="sharing-twitter" href="https://twitter.com/home?status=' . $sTitle . $sPermalink . '" target="_blank">Twitter</a></li>
22
  class flowplayer_frontend extends flowplayer
23
  {
24
 
25
+ var $ajax_count = 0;
26
+
27
+ var $autobuffer_count = 0;
28
+
29
+ var $expire_time = 0;
30
 
31
  var $aAds = array();
32
 
43
  var $count_tabs = 0;
44
 
45
 
46
+ /**
47
+ * Builds the HTML and JS code of single flowplayer instance on a page/post.
48
+ * @param string $media URL or filename (in case it is in the /videos/ directory) of video file to be played.
49
+ * @param array $args Array of arguments (name => value).
50
+ * @return Returns array with 2 elements - 'html' => html code displayed anywhere on page/post, 'script' => javascript code displayed before </body> tag
51
+ */
52
+ function build_min_player($media,$args = array()) {
53
 
54
+ $this->hash = md5($media.$this->_salt()); // unique player id
55
  $this->aCurArgs = apply_filters( 'fv_flowplayer_args_pre', $args );
56
  $this->sHTMLAfter = false;
57
+ $player_type = 'video';
58
+ $rtmp = false;
59
+ $youtube = false;
60
+ $vimeo = false;
61
  $scripts_after = '';
62
 
63
  $attributes = array();
64
 
65
+ // returned array with new player's html and javascript content
66
  if( !isset($GLOBALS['fv_fp_scripts']) ) {
67
  $GLOBALS['fv_fp_scripts'] = array();
68
  }
69
+ $this->ret = array('html' => '', 'script' => $GLOBALS['fv_fp_scripts'] ); // note: we need the white space here, it fails to add into the string on some hosts without it (???)
70
+
71
 
72
 
73
+ /*
74
  * Set common variables
75
  */
76
+ $width = $this->_get_option('width');
77
+ $height = $this->_get_option('height');
78
+ if (isset($this->aCurArgs['width'])&&!empty($this->aCurArgs['width'])) $width = trim($this->aCurArgs['width']);
79
+ if (isset($this->aCurArgs['height'])&&!empty($this->aCurArgs['height'])) $height = trim($this->aCurArgs['height']);
80
+
81
+ $src1 = ( isset($this->aCurArgs['src1']) && !empty($this->aCurArgs['src1']) ) ? trim($this->aCurArgs['src1']) : false;
82
+ $src2 = ( isset($this->aCurArgs['src2']) && !empty($this->aCurArgs['src2']) ) ? trim($this->aCurArgs['src2']) : false;
83
+
84
  $splash_img = $this->get_splash();
85
 
86
  foreach( array( $media, $src1, $src2 ) AS $media_item ) {
95
 
96
  list( $media, $src1, $src2 ) = apply_filters( 'fv_flowplayer_media_pre', array( $media, $src1, $src2 ), $this );
97
 
98
+
99
  /*
100
  * Which player should be used
101
  */
102
+ foreach( array( $media, $src1, $src2 ) AS $media_item ) {
103
  if( !$this->_get_option('audio') ) {
104
  if( preg_match( '~\.(mp3|wav|ogg)([?#].*?)?$~', $media_item ) ) {
105
  $player_type = 'audio';
106
  break;
107
  }
108
  }
109
+
110
+ global $post;
111
  if( $post ) {
112
  $fv_flowplayer_meta = get_post_meta( $post->ID, '_fv_flowplayer', true );
113
  if( $fv_flowplayer_meta && isset($fv_flowplayer_meta[sanitize_title($media_item)]['time']) ) {
114
  $this->expire_time = $fv_flowplayer_meta[sanitize_title($media_item)]['time'];
115
  }
116
  }
117
+ }
118
 
119
  if( preg_match( "~(youtu\.be/|youtube\.com/(watch\?(.*&)?v=|(embed|v)/))([^\?&\"'>]+)~i", $media, $aYoutube ) ) {
120
+ if( isset($aYoutube[5]) ) {
121
+ $youtube = $aYoutube[5];
122
+ $player_type = 'youtube';
123
+ }
124
+ } else if( preg_match( "~^[a-zA-Z0-9-_]{11}$~", $media, $aYoutube ) ) {
125
+ if( isset($aYoutube[0]) ) {
126
+ $youtube = $aYoutube[0];
127
+ $player_type = 'youtube';
128
+ }
129
+ }
130
 
131
+ if( preg_match( "~vimeo.com/(?:video/|moogaloop\.swf\?clip_id=)?(\d+)~i", $media, $aVimeo ) ) {
132
+ if( isset($aVimeo[1]) ) {
133
+ $vimeo = $aVimeo[1];
134
+ $player_type = 'vimeo';
135
+ }
136
+ } else if( preg_match( "~^[0-9]{8}$~", $media, $aVimeo ) ) {
137
+ if( isset($aVimeo[0]) ) {
138
+ $vimeo = $aVimeo[0];
139
+ $player_type = 'vimeo';
140
+ }
141
+ }
142
 
143
 
144
  if( !isset($this->aCurArgs['liststyle']) || empty($this->aCurArgs['liststyle']) ){
198
  /*
199
  * Video player
200
  */
201
+ if( $player_type == 'video' ) {
202
 
203
+ if (!empty($media)) {
204
+ $media = $this->get_video_url($media);
205
+ }
206
+ if (!empty($src1)) {
207
+ $src1 = $this->get_video_url($src1);
208
+ }
209
+ if (!empty($src2)) {
210
+ $src2 = $this->get_video_url($src2);
211
+ }
212
  $mobile = ( isset($this->aCurArgs['mobile']) && !empty($this->aCurArgs['mobile']) ) ? trim($this->aCurArgs['mobile']) : false;
213
+ if (!empty($mobile)) {
214
+ $mobile = $this->get_video_url($mobile);
215
+ }
216
 
217
  if( is_feed() ) {
218
  $this->ret['html'] = '<p class="fv-flowplayer-feed"><a href="'.get_permalink().'" title="'.__('Click to watch the video').'">'.apply_filters( 'fv_flowplayer_rss_intro_splash', __('[This post contains video, click to play]') );
233
  }
234
  }
235
 
236
+ if( !$bHTTPs && function_exists('is_amp_endpoint') && is_amp_endpoint() || count($aPlaylistItems) > 1 && function_exists('is_amp_endpoint') && is_amp_endpoint() ) {
 
237
  $this->ret['html'] = '<p class="fv-flowplayer-feed"><a href="'.get_permalink().'" title="'.__('Click to watch the video').'">'.apply_filters( 'fv_flowplayer_rss_intro_splash', __('[This post contains advanced video player, click to open the original website]') );
238
  if( $splash_img ) {
239
  $this->ret['html'] .= '<br /><img src="'.$splash_img.'" width="400" />';
245
  return $this->ret;
246
 
247
  } else if( function_exists('is_amp_endpoint') && is_amp_endpoint() ) {
248
+ $this->ret['html'] .= "\t".'<video controls';
249
+ if (isset($splash_img) && !empty($splash_img)) {
250
+ $this->ret['html'] .= ' poster="'.flowplayer::get_encoded_url($splash_img).'"';
251
+ }
252
+ if( $autoplay == true ) {
253
+ $this->ret['html'] .= ' autoplay';
254
+ }
255
+
256
+ if( is_int($width) && intval($width) > 0 ) {
257
+ $this->ret['html'] .= ' width="'.$width.'"';
258
+ }
259
+ if( is_int($height) && intval($height) > 0 ) {
260
+ $this->ret['html'] .= ' height="'.$height.'"';
261
+ }
262
+
263
+ $this->ret['html'] .= ">\n";
264
+
265
+ if (!empty($mobile)) {
266
+ $this->ret['html'] .= $this->get_video_src($mobile, array( 'id' => 'wpfp_'.$this->hash.'_mobile' ) );
267
+ } else {
268
  foreach( apply_filters( 'fv_player_media', array($media, $src1, $src2), $this ) AS $media_item ) {
269
+ $this->ret['html'] .= $this->get_video_src($media_item);
270
  }
271
  }
272
+
273
+ $this->ret['html'] .= "\t".'</video>';
274
 
275
  $this->ret['html'] = apply_filters( 'fv_flowplayer_amp', $this->ret['html'], $this );
276
 
277
  return $this->ret;
278
  }
279
+
280
+ foreach( array( $media, $src1, $src2 ) AS $media_item ) {
281
+ //if( ( strpos($media_item, 'amazonaws.com') !== false && stripos( $media_item, 'http://s3.amazonaws.com/' ) !== 0 && stripos( $media_item, 'https://s3.amazonaws.com/' ) !== 0 ) || stripos( $media_item, 'rtmp://' ) === 0 ) { // we are also checking amazonaws.com due to compatibility with older shortcodes
282
+
283
+ if( !$this->_get_option('engine') && stripos( $media_item, '.m4v' ) !== false ) {
284
+ $this->ret['script']['fv_flowplayer_browser_ff_m4v'][$this->hash] = true;
285
+ }
286
+
287
+ }
 
 
 
 
 
 
 
 
 
 
288
 
289
+ $popup = '';
290
 
291
  $aSubtitles = $this->get_subtitles();
292
+
293
+ $show_splashend = false;
294
+ if (isset($this->aCurArgs['splashend']) && $this->aCurArgs['splashend'] == 'show' && isset($this->aCurArgs['splash']) && !empty($this->aCurArgs['splash'])) {
295
+ $show_splashend = true;
296
+ $splashend_contents = '<div id="wpfp_'.$this->hash.'_custom_background" class="wpfp_custom_background" style="position: absolute; background: url(\''.$splash_img.'\') no-repeat center center; background-size: contain; width: 100%; height: 100%; z-index: 1;"></div>';
297
+ }
298
+
299
+
300
+
301
+
302
+
303
+ $attributes['class'] = 'flowplayer no-brand is-splash';
304
 
305
  if( $autoplay ) {
306
  $attributes['data-fvautoplay'] = 'true';
307
  }
308
 
309
  if( isset($this->aCurArgs['playlist_hide']) && strcmp($this->aCurArgs['playlist_hide'],'true') == 0 ) {
310
+ $attributes['class'] .= ' playlist-hidden';
311
+ }
312
+
313
+ $bIsAudio = false;
314
+ if( ( empty($splash_img) || $splash_img == $this->_get_option('splash') ) && preg_match( '~\.(mp3|wav|ogg)([?#].*?)?$~', $media ) ) {
315
+ $bIsAudio = true;
316
+ $attributes['class'] .= ' is-audio fixed-controls is-mouseover';
317
+ }
318
+
319
  // Fixed control bar
320
  $bFixedControlbar = $this->_get_option('ui_fixed_controlbar');
321
  if( isset($this->aCurArgs['controlbar']) ) {
341
  if( $bPlayButton ) {
342
  $attributes['class'] .= ' fvp-play-button';
343
  }
344
+
345
  // Align
346
+ if( isset($this->aCurArgs['align']) ) {
347
+ if( $this->aCurArgs['align'] == 'left' ) {
348
+ $attributes['class'] .= ' alignleft';
349
+ } else if( $this->aCurArgs['align'] == 'right' ) {
350
+ $attributes['class'] .= ' alignright';
351
+ } else if( $this->aCurArgs['align'] == 'center' ) {
352
+ $attributes['class'] .= ' aligncenter';
353
+ }
354
+ }
355
  $attributes['class'] .= $this->get_align();
356
+
357
+ if( $this->_get_option('engine') || $this->aCurArgs['engine'] == 'flash' ) {
358
+ $attributes['data-engine'] = 'flash';
359
+ }
360
+
361
  if( $this->_get_option( array( 'integrations', 'embed_iframe' ) ) ) {
362
  if( $this->aCurArgs['embed'] == 'false' || ( $this->_get_option('disableembedding') && $this->aCurArgs['embed'] != 'true' ) ) {
363
 
371
  }
372
 
373
  if( isset($this->aCurArgs['logo']) && $this->aCurArgs['logo'] ) {
374
+ $attributes['data-logo'] = ( strcmp($this->aCurArgs['logo'],'none') == 0 ) ? '' : $this->aCurArgs['logo'];
375
+ }
376
+
377
+ $attributes['style'] = '';
378
+ if( !$bIsAudio ) {
379
+ if( intval($width) == 0 ) $width = '100%';
380
+ if( intval($height) == 0 ) $height = '100%';
381
+ $cssWidth = stripos($width,'%') !== false ? $width : $width . 'px';
382
+ $cssHeight = stripos($height,'%') !== false ? $height : $height. 'px';
383
+ if( $this->_get_option('fixed_size') ) {
384
+ $attributes['style'] .= 'width: ' . $cssWidth . '; height: ' . $cssHeight . '; ';
385
+ } else {
386
+ $attributes['style'] .= 'max-width: ' . $cssWidth . '; max-height: ' . $cssHeight . '; ';
387
+ }
388
+ }
389
+
390
  global $fv_wp_flowplayer_ver;
391
+ //$attributes['data-swf'] = FV_FP_RELATIVE_PATH.'/flowplayer/flowplayer.swf?ver='.$fv_wp_flowplayer_ver; // it's better to have this in flowplayer.conf
392
+ //$attributes['data-flashfit'] = "true";
393
+
394
+ if( $this->_get_option('googleanalytics') ) {
395
+ $attributes['data-analytics'] = $this->_get_option('googleanalytics');
396
+ }
397
 
398
  list( $rtmp_server, $rtmp ) = $this->get_rtmp_server($rtmp);
399
  if( /*count($aPlaylistItems) == 0 &&*/ $rtmp_server) {
400
  $attributes['data-rtmp'] = $rtmp_server;
401
  }
402
+
403
+ if( !$bIsAudio ) {
404
+ $this->get_video_checker_media($attributes, $media, $src1, $src2, $rtmp);
405
+ }
406
 
407
 
408
+ if( !$this->_get_option('allowfullscreen') ) {
409
+ $attributes['data-fullscreen'] = 'false';
410
+ }
 
 
 
411
 
412
+ if( !$bIsAudio && is_int($width) && intval($width) > 0 && is_int($height) && intval($height) > 0 ) {
413
+ $ratio = round($height / $width, 4);
414
+ $this->fRatio = $ratio;
415
+
416
+ $attributes['data-ratio'] = str_replace(',','.',$ratio);
417
+ }
418
 
419
+ if( $this->_get_option('scaling') && $this->_get_option('fixed_size') ) {
420
+ $attributes['data-flashfit'] = 'true';
421
+ }
422
 
423
  if( isset($this->aCurArgs['live']) && $this->aCurArgs['live'] == 'true' ) {
424
+ $attributes['data-live'] = 'true';
425
+ }
426
 
427
+ $playlist = '';
428
+ $is_preroll = false;
429
+ if( isset($playlist_items_external_html) ) {
430
+
431
+ if( $bIsAudio ) {
432
+ $playlist_items_external_html = str_replace( 'class="fp-playlist-external', 'class="fp-playlist-external is-audio', $playlist_items_external_html );
433
+ }
434
+
435
  if( $args['liststyle'] == 'prevnext' || ( isset($this->aCurArgs['playlist_hide']) && $this->aCurArgs['playlist_hide']== 'true' ) ) {
436
  $playlist_items_external_html = str_replace( 'class="fp-playlist-external', 'style="display: none" class="fp-playlist-external', $playlist_items_external_html );
437
  }
450
  $attributes['style'] .= "background-image: url({$splash_img});";
451
  }
452
 
453
+ } else if( !empty($this->aCurArgs['caption']) ) {
454
  $attributes['class'] .= ' has-caption';
455
  $this->sHTMLAfter = apply_filters( 'fv_player_caption', "<p class='fp-caption'>".$this->aCurArgs['caption']."</p>", $this );
456
 
457
+ }
458
 
459
  if( !empty($this->aCurArgs['redirect']) ) {
460
  $attributes['data-fv_redirect'] = trim($this->aCurArgs['redirect']);
480
  }
481
  }
482
  }
483
+
484
+ $attributes_html = '';
485
+ $attributes = apply_filters( 'fv_flowplayer_attributes', $attributes, $media, $this );
486
+ foreach( $attributes AS $attr_key => $attr_value ) {
487
  if( $attr_key == 'data-item' ) {
488
  $attributes_html .= ' '.$attr_key.'=\''.$attr_value.'\'';
489
  } else {
490
  $attributes_html .= ' '.$attr_key.'="'.esc_attr( $attr_value ).'"';
491
  }
492
+ }
493
+
494
+ $this->ret['html'] .= '<div id="wpfp_' . $this->hash . '"'.$attributes_html.'>'."\n";
495
 
496
+ if( !$bIsAudio && isset($this->fRatio) ) {
497
+ $this->ret['html'] .= "\t".'<div class="fp-ratio" style="padding-top: '.str_replace(',','.',$this->fRatio * 100).'%"></div>'."\n";
498
+ }
499
 
500
+ if( count($aPlaylistItems) == 0 ) { // todo: this stops subtitles, mobile video, preload etc.
501
+ $this->ret['html'] .= "\t".'<video class="fp-engine" preload="none"';
502
+ if (isset($splash_img) && !empty($splash_img)) {
503
+ $this->ret['html'] .= ' poster="'.flowplayer::get_encoded_url($splash_img).'"';
504
+ }
505
 
506
+ $this->ret['html'] .= ">\n";
507
 
508
+ if( isset($rtmp) && !empty($rtmp) ) {
509
 
510
  foreach( apply_filters( 'fv_player_media_rtmp', array($rtmp),$this ) AS $rtmp_item ) {
511
  $rtmp_item = apply_filters( 'fv_flowplayer_video_src', $rtmp_item, $this );
534
 
535
  $this->ret['html'] .= "\t"."\t".'<source src="'.$extension.trim($rtmp_file, " \t\n\r\0\x0B/").'" type="video/flash" />'."\n";
536
  }
537
+ }
538
+
539
  foreach( apply_filters( 'fv_player_media', array($media, $src1, $src2), $this ) AS $media_item ) {
540
+ $this->ret['html'] .= $this->get_video_src($media_item, array( 'rtmp' => $rtmp ) );
541
  }
542
+ if (!empty($mobile)) {
543
+ $this->ret['script']['fv_flowplayer_mobile_switch'][$this->hash] = true;
544
+ $this->ret['html'] .= $this->get_video_src($mobile, array( 'id' => 'wpfp_'.$this->hash.'_mobile', 'rtmp' => $rtmp ) );
545
+ }
546
+
547
+ if (isset($aSubtitles) && !empty($aSubtitles)) {
548
  $aLangs = self::get_languages();
549
  $countSubtitles = 0;
550
  foreach( $aSubtitles AS $key => $subtitles ) {
581
  $countSubtitles++;
582
  $this->ret['html'] .= "\t"."\t".'<track '.$sExtra.'src="'.esc_attr($subtitles).'" />'."\n";
583
  }
584
+ }
585
+
586
+ $this->ret['html'] .= "\t".'</video>';//."\n";
587
+ }
588
+
589
  $this->ret['html'] .= $this->get_buttons();
590
+
591
+ if( isset($splashend_contents) ) {
592
+ $this->ret['html'] .= $splashend_contents;
593
+ }
594
+ if( $popup_contents = $this->get_popup_code() ) {
595
  $this->aPopups["wpfp_{$this->hash}"] = $popup_contents;
596
+ }
597
+ if( $ad_contents = $this->get_ad_code() ) {
598
+ $this->aAds["wpfp_{$this->hash}"] = $ad_contents;
599
+ }
600
 
601
  if( flowplayer::is_special_editor() ) {
602
  $this->ret['html'] .= '<div class="fp-ui"></div>';
603
  } else if( current_user_can('manage_options') && !isset($playlist_items_external_html) ) {
604
+ $this->ret['html'] .= '<div id="wpfp_'.$this->hash.'_admin_error" class="fvfp_admin_error"><div class="fvfp_admin_error_content"><h4>Admin JavaScript warning:</h4><p>I\'m sorry, your JavaScript appears to be broken. Please use "Check template" in plugin settings, read our <a href="https://foliovision.com/player/installation#fixing-broken-javascript" target="_blank">troubleshooting guide</a>, <a href="https://foliovision.com/troubleshooting-javascript-errors" target="_blank">troubleshooting guide for programmers</a> or <a href="http://foliovision.com/wordpress/pro-install" target="_blank">order our pro support</a> and we will get it fixed for you.</p></div></div>';
605
  }
606
 
607
  $this->ret['html'] .= apply_filters( 'fv_flowplayer_inner_html', null, $this );
608
+
609
+ if( !$bIsAudio ) {
610
+ $this->ret['html'] .= $this->get_sharing_html()."\n";
611
+ }
612
 
613
  if( current_user_can('manage_options') && !$this->_get_option('disable_videochecker') ) {
614
  $this->ret['html'] .= $this->get_video_checker_html()."\n";
618
  $this->ret['html'].='<a class="fp-prev" title="prev">&lt;</a><a class="fp-next" title="next">&gt;</a>';
619
  }
620
 
621
+ $this->ret['html'] .= '</div>'."\n";
622
 
623
+ $this->ret['html'] .= $this->sHTMLAfter.$scripts_after;
624
 
625
  if( get_query_var('fv_player_embed') ) { // this is needed for iframe embedding only
626
  $this->ret['html'] .= "<!--fv player end-->";
627
  }
628
 
629
+ // change engine for IE9 and 10
630
+ if( $this->aCurArgs['engine'] == 'false' ) {
631
+ $this->ret['script']['fv_flowplayer_browser_ie'][$this->hash] = true;
632
+ }
633
 
634
+ } // end Video player
635
 
636
 
637
  /*
638
  * Youtube player
639
  */
640
  else if( $player_type == 'youtube' ) {
641
+
642
+ $sAutoplay = ($autoplay) ? 'autoplay=1&amp;' : '';
643
+ $this->ret['html'] .= "<iframe id='fv_ytplayer_{$this->hash}' type='text/html' width='{$width}' height='{$height}'
644
+ src='//www.youtube.com/embed/$youtube?{$sAutoplay}origin=".urlencode(get_permalink())."' frameborder='0' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>\n";
645
+
646
+ }
647
 
648
 
649
  /*
650
  * Vimeo player
651
  */
652
  else if( $player_type == 'vimeo' ) {
653
+
654
+ $sAutoplay = ($autoplay) ? " autoplay='1'" : "";
655
+ $this->ret['html'] .= "<iframe id='fv_vimeo_{$this->hash}' src='//player.vimeo.com/video/{$vimeo}' width='{$width}' height='{$height}' frameborder='0' webkitallowfullscreen mozallowfullscreen allowfullscreen{$sAutoplay}></iframe>\n";
656
+
657
+ }
658
 
659
 
660
  /*
661
  * Audio player
662
  */
663
+ else { // $player_type == 'video' ends
664
+ $this->build_audio_player( $media, $width, $autoplay );
665
+ }
666
 
667
+ if( isset($this->aCurArgs['liststyle']) && $this->aCurArgs['liststyle'] == 'vertical' && count($aPlaylistItems) > 1 ){
668
  $this->ret['html'] = '<div class="fp-playlist-vertical-wrapper">'.$this->ret['html'].'</div>';
669
  }
670
  $this->ret['html'] = apply_filters( 'fv_flowplayer_html', $this->ret['html'], $this );
671
 
672
 
673
 
674
+ $this->ret['script'] = apply_filters( 'fv_flowplayer_scripts_array', $this->ret['script'], 'wpfp_' . $this->hash, $media );
675
 
676
  return $this->ret;
677
+ }
678
 
679
 
680
+ function build_audio_player( $media, $width, $autoplay ) {
681
+ $this->load_mediaelement = true;
682
+
683
+ $preload = ($autoplay == true) ? '' : ' preload="none"';
684
+
685
+ $this->ret['script']['mediaelementplayer'][$this->hash] = true;
686
+ $this->ret['html'] .= '<div id="wpfp_' . $this->hash . '" class="fvplayer fv-mediaelement">'."\n";
687
  $this->ret['html'] .= "\t".'<audio src="'.$this->get_video_src( $media, array( 'url_only' => true ) ).'" type="audio/'.$this->get_mime_type($media, false, true).'" controls="controls" '.$preload.' style="width:100%;height:100%"></audio>'."\n";
688
+ $this->ret['html'] .= '</div>'."\n";
689
  }
690
 
691
 
694
 
695
  if(
696
  ( trim($this->_get_option('ad')) || ( isset($this->aCurArgs['ad']) && !empty($this->aCurArgs['ad']) ) )
697
+ && !strlen($this->aCurArgs['ad_skip'])
698
  ) {
699
  if (isset($this->aCurArgs['ad']) && !empty($this->aCurArgs['ad'])) {
700
  $ad = trim($this->aCurArgs['ad']);
705
  $ad = html_entity_decode( str_replace('&#039;',"'",$ad ) );
706
  }
707
 
708
+ $ad_width = ( isset($this->aCurArgs['ad_width']) && intval($this->aCurArgs['ad_width']) > 0 ) ? intval($this->aCurArgs['ad_width']).'px' : '100%';
709
+ $ad_height = ( isset($this->aCurArgs['ad_height']) && intval($this->aCurArgs['ad_height']) > 0 ) ? intval($this->aCurArgs['ad_height']).'px' : '';
710
  }
711
  else {
712
+ $ad = trim( $this->_get_option('ad') );
713
+ $ad_width = ( $this->_get_option('ad_width') ) ? $this->_get_option('ad_width').'px' : '100%';
714
  $ad_height = ( $this->_get_option('ad_height') ) ? $this->_get_option('ad_height').'px' : '';
715
  }
716
 
724
 
725
 
726
  $ad = apply_filters( 'fv_flowplayer_ad_html', $ad);
727
+ if( strlen(trim($ad)) > 0 ) {
728
  $ad_contents = array(
729
  'html' => "<div class='wpfp_custom_ad_content' style='width: $ad_width; height: $ad_height; display:$ad_display;'>\n\t\t<div class='fv_fp_close'><a href='#' onclick='jQuery(\"#wpfp_".$this->hash."_ad\").fadeOut(); return false'></a></div>\n\t\t\t".$ad."\n\t\t</div>",
730
  'width' => $ad_width,
792
  }
793
 
794
 
795
+ function get_popup_code() {
796
+ if (!empty($this->aCurArgs['popup'])) {
797
  $popup = trim($this->aCurArgs['popup']);
798
  } else {
799
  $popup = $this->_get_option('popups_default');
804
  } else {
805
  $popup = html_entity_decode(str_replace('&#039;', "'", $popup));
806
  }
807
+
808
  if ($popup === 'no') {
809
  return false;
810
+ }
811
+
812
  $iPopupIndex = 1;
813
+ if ($popup === 'random' || is_numeric($popup)) {
814
+ $aPopupData = get_option('fv_player_popups');
815
  if ($popup === 'random') {
816
+ $iPopupIndex = rand(1, count($aPopupData));
817
  } elseif (is_numeric($popup)) {
818
  $iPopupIndex = intval($popup);
819
  }
820
+
821
+ if (isset($aPopupData[$iPopupIndex])) {
822
+ $popup = $aPopupData[$iPopupIndex]['html'];
823
+ } else {
824
  return false;
825
  }
826
  }
827
+
828
+ $sClass = ' fv_player_popup-' . $iPopupIndex;
829
+
830
  $popup = apply_filters('fv_flowplayer_popup_html', $popup);
831
  if (strlen(trim($popup)) > 0) {
832
  $popup_contents = array(
833
+ 'html' => '<div class="fv_player_popup' . $sClass . ' wpfp_custom_popup_content">' . $popup . '</div>'
834
  );
835
  return $popup_contents;
836
  }
907
  }
908
  else {
909
  $splash_img = trim($this->aCurArgs['splash']);
910
+ }
911
  } else if( $this->_get_option('splash') ) {
912
  $splash_img = $this->_get_option('splash');
913
  }
1004
  if( current_user_can('manage_options') && $this->ajax_count < 100 && !$this->_get_option('disable_videochecker') && ( $this->_get_option('video_checker_agreement') || $this->_get_option('key_automatic') ) ) {
1005
  $this->ajax_count++;
1006
 
1007
+ if( stripos($rtmp,'rtmp://') === false && $rtmp ) {
1008
+ list( $rtmp_server, $rtmp ) = $this->get_rtmp_server($rtmp);
1009
+ $rtmp = trailingslashit($rtmp_server).$rtmp;
 
1010
  }
1011
 
1012
  $aTest_media = array();
1013
+ foreach( array( $media, $src1, $src2, $rtmp ) AS $media_item ) {
1014
  if( $media_item ) {
1015
  $aTest_media[] = $this->get_video_src( $media_item, array( 'flash' => false, 'url_only' => true, 'dynamic' => true ) );
1016
  //break;
1017
  }
1018
+ }
1019
+
1020
+ if( !empty($this->aCurArgs['mobile']) ) {
1021
+ $aTest_media[] = $this->get_video_src($this->aCurArgs['mobile'], array( 'flash' => false, 'url_only' => true, 'dynamic' => true ) );
1022
+ }
1023
 
1024
  if( isset($aTest_media) && count($aTest_media) > 0 ) {
1025
  $this->ret['script']['fv_flowplayer_admin_test_media'][$this->hash] = $aTest_media;
1049
  $bVideoLink = false;
1050
  }
1051
  }
1052
+
1053
  $sLink = get_permalink();
1054
  if( !isset($sPermalink) || empty($sPermalink) ) {
1055
  $sPermalink = urlencode(get_permalink());
1057
  $sTitle = urlencode( html_entity_decode( is_singular() ? get_the_title().' ' : get_bloginfo() ).' ');
1058
  }
1059
 
1060
+
1061
  $sHTMLSharing = '<ul class="fvp-sharing">
1062
  <li><a class="sharing-facebook" href="https://www.facebook.com/sharer/sharer.php?u=' . $sPermalink . '" target="_blank">Facebook</a></li>
1063
  <li><a class="sharing-twitter" href="https://twitter.com/home?status=' . $sTitle . $sPermalink . '" target="_blank">Twitter</a></li>
models/flowplayer.php CHANGED
@@ -201,7 +201,7 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
201
  if( !isset( $conf['ad_css'] ) ) $conf['ad_css'] = $this->ad_css_default;
202
  if( !isset( $conf['ad_show_after'] ) ) $conf['ad_show_after'] = 0;
203
  if( !isset( $conf['disable_videochecker'] ) ) $conf['disable_videochecker'] = 'false';
204
- if( isset( $conf['videochecker'] ) && $conf['videochecker'] == 'off' ) { $conf['disable_videochecker'] = 'true'; unset($conf['videochecker']); }
205
  if( !isset( $conf['interface'] ) ) $conf['interface'] = array( 'playlist' => false, 'redirect' => false, 'autoplay' => false, 'loop' => false, 'splashend' => false, 'embed' => false, 'subtitles' => false, 'ads' => false, 'mobile' => false, 'align' => false );
206
  if( !isset( $conf['interface']['popup'] ) ) $conf['interface']['popup'] = 'true';
207
  if( !isset( $conf['amazon_bucket'] ) || !is_array($conf['amazon_bucket']) ) $conf['amazon_bucket'] = array('');
@@ -211,7 +211,7 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
211
  if( !isset( $conf['amazon_expire'] ) ) $conf['amazon_expire'] = '5';
212
  if( !isset( $conf['amazon_expire_force'] ) ) $conf['amazon_expire_force'] = 'false';
213
  if( !isset( $conf['fixed_size'] ) ) $conf['fixed_size'] = 'false';
214
- if( isset( $conf['responsive'] ) && $conf['responsive'] == 'fixed' ) { $conf['fixed_size'] = true; unset($conf['responsive']); } // some legacy setting
215
  if( !isset( $conf['js-everywhere'] ) ) $conf['js-everywhere'] = 'false';
216
  if( !isset( $conf['marginBottom'] ) ) $conf['marginBottom'] = '28';
217
  if( !isset( $conf['ui_play_button'] ) ) $conf['ui_play_button'] = 'true';
@@ -224,11 +224,10 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
224
  if( !isset( $conf['liststyle'] ) ) $conf['liststyle'] = 'horizontal';
225
  if( !isset( $conf['ui_speed_increment'] ) ) $conf['ui_speed_increment'] = 0.25;
226
  if( !isset( $conf['popups_default'] ) ) $conf['popups_default'] = 'no';
227
-
228
 
229
  $conf = apply_filters('fv_player_conf_defaults', $conf);
230
 
231
-
232
  update_option( 'fvwpflowplayer', $conf );
233
  $this->conf = $conf;
234
  return true;
@@ -281,7 +280,9 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
281
  foreach( $aNewOptions AS $key => $value ) {
282
  if( is_array($value) ) {
283
  $aNewOptions[$key] = $value;
284
- } else if( !in_array( $key, array('amazon_region', 'amazon_bucket', 'amazon_key', 'amazon_secret', 'font-face', 'ad', 'ad_css', 'subtitleFontFace','sharing_email_text') ) ) {
 
 
285
  $aNewOptions[$key] = trim( preg_replace('/[^A-Za-z0-9.:\-_\/]/', '', $value) );
286
  } else {
287
  $aNewOptions[$key] = stripslashes(trim($value));
@@ -349,11 +350,11 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
349
 
350
  $aPlayer = apply_filters( 'fv_player_item', $aPlayer, $index, $aArgs );
351
 
352
- $sHTML = "\t\t<a href='#' onclick='return false'";
353
  $sHTML .= !$this->_get_option('old_code') ? " data-item='".json_encode($aPlayer)."'" : "";
354
  $sHTML .= ">";
355
- $sHTML .= $sSplashImage ? "<span style='background-image: url(\"" . $sSplashImage . "\")'></span>" : "<span></span>";
356
- $sHTML .= $sItemCaption."</a>\n";
357
 
358
  $sHTML = apply_filters( 'fv_player_item_html', $sHTML, $aArgs, $sSplashImage, $sItemCaption, $aPlayer, $index );
359
 
@@ -386,13 +387,26 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
386
  $aItem = array();
387
  $flash_media = array();
388
 
389
- if( $rtmp ) {
390
  $rtmp = 'rtmp:'.$rtmp;
391
  }
392
 
393
  foreach( apply_filters( 'fv_player_media', array($media, $src1, $src2, $rtmp), $this ) AS $key => $media_item ) {
394
  if( !$media_item ) continue;
395
- $media_url = $this->get_video_src( preg_replace( '~^rtmp:~', '', $media_item ), array( 'url_only' => true, 'suppress_filters' => $suppress_filters ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
396
  if( is_array($media_url) ) {
397
  $actual_media_url = $media_url['media'];
398
  if( $this->get_mime_type($actual_media_url) == 'video/mp4' ) {
@@ -402,8 +416,9 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
402
  $actual_media_url = $media_url;
403
  }
404
  if( stripos( $media_item, 'rtmp:' ) === 0 ) {
405
- if( !preg_match( '~^[a-z0-9]+:~', $actual_media_url ) ) {
406
- $aItem[] = array( 'src' => $this->get_mime_type($actual_media_url,'mp4',true).':'.str_replace( '+', ' ', $actual_media_url ), 'type' => 'video/flash' );
 
407
  } else {
408
  $aItem[] = array( 'src' => str_replace( '+', ' ', $actual_media_url ), 'type' => 'video/flash' );
409
  }
@@ -434,6 +449,11 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
434
 
435
  list( $rtmp_server, $rtmp ) = $this->get_rtmp_server($rtmp);
436
 
 
 
 
 
 
437
  $aPlayer = array( 'sources' => $aItem );
438
  if( $rtmp_server ) $aPlayer['rtmp'] = array( 'url' => $rtmp_server );
439
 
@@ -491,11 +511,12 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
491
  $actual_media_url = $media_url;
492
  }
493
  if( stripos( $aPlaylist_item_i, 'rtmp:' ) === 0 ) {
494
- if( !preg_match( '~^[a-z0-9]+:~', $actual_media_url ) ) {
495
- $aItem[] = array( 'src' => $this->get_mime_type($actual_media_url,'mp4',true).':'.str_replace( '+', ' ', $actual_media_url ), 'type' => 'video/flash' );
 
496
  } else {
497
  $aItem[] = array( 'src' => str_replace( '+', ' ', $actual_media_url ), 'type' => 'video/flash' );
498
- }
499
  } else {
500
  $aItem[] = array( 'src' => $actual_media_url, 'type' => $this->get_mime_type($aPlaylist_item_i) );
501
  }
@@ -525,6 +546,10 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
525
  $sItemCaption = apply_filters( 'fv_flowplayer_caption', $sItemCaption, $aItem, $aArgs );
526
 
527
 
 
 
 
 
528
  $sHTML[] = $this->build_playlist_html( $aArgs, $sSplashImage, $sItemCaption, $aPlayer, $iKey + 1 );
529
  if( $sSplashImage ) {
530
  $aSplashScreens[] = $sSplashImage;
@@ -537,7 +562,9 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
537
 
538
  $sPlaylistClass = '' ;
539
 
540
- if( isset($aArgs['liststyle']) && $aArgs['liststyle'] == 'vertical' ){
 
 
541
  $sPlaylistClass .= ' fp-playlist-vertical';
542
  }
543
  //var_dump($aCaptions);
@@ -614,6 +641,7 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
614
 
615
  .wpfp_custom_background { display: none; }
616
  .wpfp_custom_popup { position: absolute; top: 10%; z-index: 20; text-align: center; width: 100%; color: #fff; }
 
617
  .is-finished .wpfp_custom_background { display: block; }
618
  .fv_player_popup { background: <?php echo $fv_fp->_get_option('backgroundColor') ?>; padding: 1% 5%; width: 65%; margin: 0 auto; }
619
 
@@ -629,10 +657,15 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
629
  .fvfp_admin_error_content { background: <?php echo $fv_fp->_get_option('backgroundColor'); ?>; opacity:0.75;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=75); }
630
 
631
  .fp-playlist-external > a > span { background-color:<?php echo $fv_fp->_get_option('playlistBgColor');?>; }
632
- <?php if ( $fv_fp->_get_option('playlistFontColor') && $fv_fp->_get_option('playlistFontColor') !=='#') : ?>.fp-playlist-external > a { color:<?php echo $fv_fp->_get_option('playlistFontColor');?>; }<?php endif; ?>
633
  .fp-playlist-external > a.is-active > span { border-color:<?php echo $fv_fp->_get_option('playlistSelectedColor');?>; }
634
- .fp-playlist-external a.is-active { color:<?php echo $fv_fp->_get_option('playlistSelectedColor');?>; }
635
- <?php if ( $fv_fp->_get_option('splash') ):?>.fp-playlist-external a span { background-image:url(<?php echo $fv_fp->_get_option('splash'); ?>); }<?php endif; ?>
 
 
 
 
 
636
  <?php if( $fv_fp->_get_option('subtitleSize') ) : ?>.flowplayer .fp-subtitle span.fp-subtitle-line { font-size: <?php echo intval($fv_fp->_get_option('subtitleSize')); ?>px; }<?php endif; ?>
637
  <?php if( $fv_fp->_get_option('subtitleFontFace') ) : ?>.flowplayer .fp-subtitle span.fp-subtitle-line { font-family: <?php echo $fv_fp->_get_option('subtitleFontFace'); ?>; }<?php endif; ?>
638
  <?php if( $fv_fp->_get_option('logoPosition') ) :
@@ -1283,8 +1316,7 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
1283
  $aArgs = wp_parse_args( $aArgs, array(
1284
  'dynamic' => false,
1285
  'flash' => true,
1286
- 'id' => false,
1287
- 'mobileUserAgent' => false,
1288
  'rtmp' => false,
1289
  'suppress_filters' => false,
1290
  'url_only' => false
@@ -1332,6 +1364,8 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
1332
 
1333
 
1334
  function get_video_url($media) {
 
 
1335
  if( strpos($media,'rtmp://') !== false ) {
1336
  return null;
1337
  }
@@ -1493,7 +1527,7 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
1493
  <body class="fv-player-preview">
1494
  <?php if( isset($_GET['fv_player_preview']) && !empty($_GET['fv_player_preview']) ) :
1495
 
1496
- if( !is_user_logged_in() ){
1497
  ?><script>window.parent.jQuery(window.parent.document).trigger('fvp-preview-complete');</script><?php
1498
  wp_die('Please log in.');
1499
  }
201
  if( !isset( $conf['ad_css'] ) ) $conf['ad_css'] = $this->ad_css_default;
202
  if( !isset( $conf['ad_show_after'] ) ) $conf['ad_show_after'] = 0;
203
  if( !isset( $conf['disable_videochecker'] ) ) $conf['disable_videochecker'] = 'false';
204
+ if( isset( $conf['videochecker'] ) && $conf['videochecker'] == 'off' ) { $conf['disable_videochecker'] = 'true'; unset($conf['videochecker']); }
205
  if( !isset( $conf['interface'] ) ) $conf['interface'] = array( 'playlist' => false, 'redirect' => false, 'autoplay' => false, 'loop' => false, 'splashend' => false, 'embed' => false, 'subtitles' => false, 'ads' => false, 'mobile' => false, 'align' => false );
206
  if( !isset( $conf['interface']['popup'] ) ) $conf['interface']['popup'] = 'true';
207
  if( !isset( $conf['amazon_bucket'] ) || !is_array($conf['amazon_bucket']) ) $conf['amazon_bucket'] = array('');
211
  if( !isset( $conf['amazon_expire'] ) ) $conf['amazon_expire'] = '5';
212
  if( !isset( $conf['amazon_expire_force'] ) ) $conf['amazon_expire_force'] = 'false';
213
  if( !isset( $conf['fixed_size'] ) ) $conf['fixed_size'] = 'false';
214
+ if( isset( $conf['responsive'] ) && $conf['responsive'] == 'fixed' ) { $conf['fixed_size'] = true; unset($conf['responsive']); } // some legacy setting
215
  if( !isset( $conf['js-everywhere'] ) ) $conf['js-everywhere'] = 'false';
216
  if( !isset( $conf['marginBottom'] ) ) $conf['marginBottom'] = '28';
217
  if( !isset( $conf['ui_play_button'] ) ) $conf['ui_play_button'] = 'true';
224
  if( !isset( $conf['liststyle'] ) ) $conf['liststyle'] = 'horizontal';
225
  if( !isset( $conf['ui_speed_increment'] ) ) $conf['ui_speed_increment'] = 0.25;
226
  if( !isset( $conf['popups_default'] ) ) $conf['popups_default'] = 'no';
227
+ if( !isset( $conf['email_lists'] ) ) $conf['email_lists'] = array();
228
 
229
  $conf = apply_filters('fv_player_conf_defaults', $conf);
230
 
 
231
  update_option( 'fvwpflowplayer', $conf );
232
  $this->conf = $conf;
233
  return true;
280
  foreach( $aNewOptions AS $key => $value ) {
281
  if( is_array($value) ) {
282
  $aNewOptions[$key] = $value;
283
+ } else if( in_array( $key, array('width', 'height') ) ) {
284
+ $aNewOptions[$key] = trim( preg_replace('/[^0-9%]/', '', $value) );
285
+ } else if( !in_array( $key, array('amazon_region', 'amazon_bucket', 'amazon_key', 'amazon_secret', 'font-face', 'ad', 'ad_css', 'subtitleFontFace','sharing_email_text','mailchimp_label','email_lists') ) ) {
286
  $aNewOptions[$key] = trim( preg_replace('/[^A-Za-z0-9.:\-_\/]/', '', $value) );
287
  } else {
288
  $aNewOptions[$key] = stripslashes(trim($value));
350
 
351
  $aPlayer = apply_filters( 'fv_player_item', $aPlayer, $index, $aArgs );
352
 
353
+ $sHTML = "\t\t<a href='#' class='fvp-video-thumb' onclick='return false'";
354
  $sHTML .= !$this->_get_option('old_code') ? " data-item='".json_encode($aPlayer)."'" : "";
355
  $sHTML .= ">";
356
+ $sHTML .= $sSplashImage ? "<div style='background-image: url(\"".$sSplashImage."\")'></div>" : "<div></div>";
357
+ $sHTML .= "<h4><span>".$sItemCaption."</span></h4></a>\n";
358
 
359
  $sHTML = apply_filters( 'fv_player_item_html', $sHTML, $aArgs, $sSplashImage, $sItemCaption, $aPlayer, $index );
360
 
387
  $aItem = array();
388
  $flash_media = array();
389
 
390
+ if( $rtmp && stripos($rtmp,'rtmp://') === false ) {
391
  $rtmp = 'rtmp:'.$rtmp;
392
  }
393
 
394
  foreach( apply_filters( 'fv_player_media', array($media, $src1, $src2, $rtmp), $this ) AS $key => $media_item ) {
395
  if( !$media_item ) continue;
396
+
397
+ if( stripos($media_item,'rtmp:') === 0 && stripos($media_item,'rtmp://') === false ) {
398
+ $media_item_tmp = preg_replace( '~^rtmp:~', '', $media_item );
399
+ } else {
400
+ $media_item_tmp = $media_item;
401
+ }
402
+
403
+ $media_url = $this->get_video_src( $media_item_tmp, array( 'url_only' => true, 'suppress_filters' => $suppress_filters ) );
404
+
405
+ // add domain for relative video URLs if it's not RTMP
406
+ if( stripos($media_item,'rtmp://') === false && $key != 3 ) {
407
+ $media_url = $this->get_video_url($media_url);
408
+ }
409
+
410
  if( is_array($media_url) ) {
411
  $actual_media_url = $media_url['media'];
412
  if( $this->get_mime_type($actual_media_url) == 'video/mp4' ) {
416
  $actual_media_url = $media_url;
417
  }
418
  if( stripos( $media_item, 'rtmp:' ) === 0 ) {
419
+ if( !preg_match( '~^[a-z0-9]+:~', $actual_media_url ) ) { // no RTMP extension provided
420
+ $ext = $this->get_mime_type($actual_media_url,false,true) ? $this->get_mime_type($actual_media_url,false,true).':' : false;
421
+ $aItem[] = array( 'src' => $ext.str_replace( '+', ' ', $actual_media_url ), 'type' => 'video/flash' );
422
  } else {
423
  $aItem[] = array( 'src' => str_replace( '+', ' ', $actual_media_url ), 'type' => 'video/flash' );
424
  }
449
 
450
  list( $rtmp_server, $rtmp ) = $this->get_rtmp_server($rtmp);
451
 
452
+ if( !empty($aArgs['mobile']) ) {
453
+ $mobile = $this->get_video_url($aArgs['mobile']);
454
+ $aItem[] = array( 'src' => $mobile, 'type' => $this->get_mime_type($mobile), 'mobile' => true );
455
+ }
456
+
457
  $aPlayer = array( 'sources' => $aItem );
458
  if( $rtmp_server ) $aPlayer['rtmp'] = array( 'url' => $rtmp_server );
459
 
511
  $actual_media_url = $media_url;
512
  }
513
  if( stripos( $aPlaylist_item_i, 'rtmp:' ) === 0 ) {
514
+ if( !preg_match( '~^[a-z0-9]+:~', $actual_media_url ) ) { // no RTMP extension provided
515
+ $ext = $this->get_mime_type($actual_media_url,false,true) ? $this->get_mime_type($actual_media_url,false,true).':' : false;
516
+ $aItem[] = array( 'src' => $ext.str_replace( '+', ' ', $actual_media_url ), 'type' => 'video/flash' );
517
  } else {
518
  $aItem[] = array( 'src' => str_replace( '+', ' ', $actual_media_url ), 'type' => 'video/flash' );
519
+ }
520
  } else {
521
  $aItem[] = array( 'src' => $actual_media_url, 'type' => $this->get_mime_type($aPlaylist_item_i) );
522
  }
546
  $sItemCaption = apply_filters( 'fv_flowplayer_caption', $sItemCaption, $aItem, $aArgs );
547
 
548
 
549
+ if( !$sSplashImage && $this->_get_option('splash') ) {
550
+ $sSplashImage = $this->_get_option('splash');
551
+ }
552
+
553
  $sHTML[] = $this->build_playlist_html( $aArgs, $sSplashImage, $sItemCaption, $aPlayer, $iKey + 1 );
554
  if( $sSplashImage ) {
555
  $aSplashScreens[] = $sSplashImage;
562
 
563
  $sPlaylistClass = '' ;
564
 
565
+ if( isset($aArgs['liststyle']) && $aArgs['liststyle'] == 'horizontal' ){
566
+ $sPlaylistClass .= ' fp-playlist-horizontal';
567
+ } else if( isset($aArgs['liststyle']) && $aArgs['liststyle'] == 'vertical' ){
568
  $sPlaylistClass .= ' fp-playlist-vertical';
569
  }
570
  //var_dump($aCaptions);
641
 
642
  .wpfp_custom_background { display: none; }
643
  .wpfp_custom_popup { position: absolute; top: 10%; z-index: 20; text-align: center; width: 100%; color: #fff; }
644
+ .wpfp_custom_popup h1, .wpfp_custom_popup h2, .wpfp_custom_popup h3, .wpfp_custom_popup h4 { color: #fff; }
645
  .is-finished .wpfp_custom_background { display: block; }
646
  .fv_player_popup { background: <?php echo $fv_fp->_get_option('backgroundColor') ?>; padding: 1% 5%; width: 65%; margin: 0 auto; }
647
 
657
  .fvfp_admin_error_content { background: <?php echo $fv_fp->_get_option('backgroundColor'); ?>; opacity:0.75;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=75); }
658
 
659
  .fp-playlist-external > a > span { background-color:<?php echo $fv_fp->_get_option('playlistBgColor');?>; }
660
+ <?php if ( $fv_fp->_get_option('playlistFontColor') && $fv_fp->_get_option('playlistFontColor') !=='#') : ?>.fp-playlist-external > a,.fp-playlist-vertical a h4 { color:<?php echo $fv_fp->_get_option('playlistFontColor');?>; }<?php endif; ?>
661
  .fp-playlist-external > a.is-active > span { border-color:<?php echo $fv_fp->_get_option('playlistSelectedColor');?>; }
662
+ .fp-playlist-external a.is-active,.fp-playlist-external a.is-active h4 { color:<?php echo $fv_fp->_get_option('playlistSelectedColor');?>; }
663
+ .fp-playlist-external a.is-active div:after { background-color:<?php echo $fv_fp->_get_option('playlistSelectedColor');?> !important; }
664
+ <?php if ( $fv_fp->_get_option('playlistBgColor') !=='#') : ?>.fp-playlist-vertical { background-color:<?php echo $fv_fp->_get_option('playlistBgColor');?>; }<?php endif; ?>
665
+ <?php if ( $fv_fp->_get_option('splash') ):?>.fp-playlist-external a.is-active div:after {background-color:<?php echo $fv_fp->_get_option('playlistFontColor');?>}<?php endif; ?>
666
+
667
+ .fp-playlist-external a.is-active div:after {position:absolute;content:"";top:0;bottom:0;left:0;right:0;width:100%;height:100%;background-color:#00a7c8;opacity:0.6}
668
+
669
  <?php if( $fv_fp->_get_option('subtitleSize') ) : ?>.flowplayer .fp-subtitle span.fp-subtitle-line { font-size: <?php echo intval($fv_fp->_get_option('subtitleSize')); ?>px; }<?php endif; ?>
670
  <?php if( $fv_fp->_get_option('subtitleFontFace') ) : ?>.flowplayer .fp-subtitle span.fp-subtitle-line { font-family: <?php echo $fv_fp->_get_option('subtitleFontFace'); ?>; }<?php endif; ?>
671
  <?php if( $fv_fp->_get_option('logoPosition') ) :
1316
  $aArgs = wp_parse_args( $aArgs, array(
1317
  'dynamic' => false,
1318
  'flash' => true,
1319
+ 'id' => false,
 
1320
  'rtmp' => false,
1321
  'suppress_filters' => false,
1322
  'url_only' => false
1364
 
1365
 
1366
  function get_video_url($media) {
1367
+ if( !is_string($media) ) return $media;
1368
+
1369
  if( strpos($media,'rtmp://') !== false ) {
1370
  return null;
1371
  }
1527
  <body class="fv-player-preview">
1528
  <?php if( isset($_GET['fv_player_preview']) && !empty($_GET['fv_player_preview']) ) :
1529
 
1530
+ if( !is_user_logged_in() || !current_user_can('manage_options') ){
1531
  ?><script>window.parent.jQuery(window.parent.document).trigger('fvp-preview-complete');</script><?php
1532
  wp_die('Please log in.');
1533
  }
models/lightbox.php CHANGED
@@ -403,7 +403,7 @@ class FV_Player_lightbox {
403
  <p class="description">
404
  <input type="hidden" value="false" name="lightbox_improve_galleries" />
405
  <input type="checkbox" value="true" name="lightbox_improve_galleries" id="lightbox_improve_galleries" <?php if ($fv_fp->_get_option('lightbox_improve_galleries')) echo 'checked="checked"'; ?> />
406
- <?php _e('Your gallery litems will link to image files directly to allow this.', 'fv-wordpress-flowplayer'); ?>
407
  </p>
408
  </td>
409
  </tr>
403
  <p class="description">
404
  <input type="hidden" value="false" name="lightbox_improve_galleries" />
405
  <input type="checkbox" value="true" name="lightbox_improve_galleries" id="lightbox_improve_galleries" <?php if ($fv_fp->_get_option('lightbox_improve_galleries')) echo 'checked="checked"'; ?> />
406
+ <?php _e('Your gallery items will link to image files directly to allow this.', 'fv-wordpress-flowplayer'); ?>
407
  </p>
408
  </td>
409
  </tr>
models/widget.php CHANGED
@@ -110,7 +110,11 @@ class FV_Player_Widget extends WP_Widget {
110
  }
111
 
112
  function formFooter() {
113
-
 
 
 
 
114
  include dirname(__FILE__) . '/../view/wizard.php';
115
  ?>
116
  <script src="<?php echo FV_FP_RELATIVE_PATH; ?>/js/shortcode-editor.js"></script>
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>
readme.txt CHANGED
@@ -343,12 +343,64 @@ Thank you for being part of the HMTL 5 mobile video revolution!
343
 
344
  == Changelog ==
345
 
346
- = 6.1.6 - 2016/07/?? =
347
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
348
  * CSS - optimizing the player graphics
 
 
349
  * Fixing shortcode editor JS glitch with playlist subtitles
350
 
351
- = 6.1.5 - 2016/06/29 =
352
 
353
  * Compatibility - bugfix for FV Player widget as it was breaking Featured Image insertion when also using DesignThemes Core Features Plugin
354
  * Iframe embedding - using width and height attributes like YouTube or Vimeo to ensure FV Player Iframe embeds are responsive at least in themes with iframe responsiveness code
@@ -356,7 +408,7 @@ Thank you for being part of the HMTL 5 mobile video revolution!
356
  * Reverting - Ajax loading - fix for repeated autoplay if your theme loads FV Player using Ajax and uses autoplay for the loaded content. You have to set fv_player_did_autoplay = false in your JavaScript instead.
357
  * Bugfix - "audio" errors showing instead of "video" errors
358
 
359
- = 6.1.4 - 2016/06/22 =
360
 
361
  * Ads - close icon size increased and retina version provided
362
  * Ajax loading - fix for repeated autoplay if your theme loads FV Player using Ajax and uses autoplay for the loaded content
@@ -371,7 +423,7 @@ Thank you for being part of the HMTL 5 mobile video revolution!
371
 
372
  * MPEG-DASH - making sure the automated quality switching respects the player size
373
  * Mobile - added "Mobile Settings" box with "Use native fullscreen on mobile" and "Force fullscreen on mobile" (beta) settings
374
- * Subtitles - you can not select a single subtitle item for each video in playlist
375
 
376
  = 6.1.1 - 2017/06/05 =
377
 
343
 
344
  == Changelog ==
345
 
346
+ = 6.2.11 - 2017/09/?? =
347
 
348
+ * CSS - Player width setting - now you can enter 100% for player width
349
+
350
+ = 6.2.10 - 2017/09/04 =
351
+
352
+ * Google Analytics - fix for HLS streams turning up as "index" only - adding last directory name into it as well, so you will get my-video/index now.
353
+
354
+ = 6.2.9 - 2017/08/28 =
355
+
356
+ * Fix for error message not appearing on old browser using Flash
357
+
358
+ = 6.2.8 - 2017/08/25 =
359
+
360
+ * Fix for fullscreen mode on Chrome 60 on Android - was using native fullscreen
361
+
362
+ = 6.2.7 - 2017/08/25 =
363
+
364
+ * Fix for Download button appearing in Chrome 60 on Android when using native fullscreen
365
+ * CSS - making the timeline wider if there are subtitles but no volume control (mobile)
366
+ * Lightbox - parsing link rel attribute to allow you to create lightboxes which are not grouped into galleries. Very useful for lightboxes which show inline HTML or iframe.
367
+
368
+ = 6.2.6 - 2017/07/26 =
369
+
370
+ * Android - fix for duplicate warning about obsolete stock browsers on Android 4
371
+ * Core Flowplayer - Chrome 59-60 not showing video error messages, applying bugfix https://github.com/flowplayer/flowplayer/issues/1221
372
+ * JW Player - conversion tool added - takes care of [jwplayer] shortcodes with file, image and playlistid parameters.
373
+
374
+ = 6.2.5 - 2017/07/21 =
375
+
376
+ * RTMP - more parsing fixes for streams without extension or full RTMP URL
377
+
378
+ = 6.2.4 - 2017/07/20 =
379
+
380
+ * RTMP - parsing fixes for streams without extension and full RTMP URL like rtmp://{server}/path/{extension}:{stream_name}
381
+ * Bugfix - relative video paths
382
+
383
+ = 6.2.3 - 2017/07/14 =
384
+
385
+ * Playlist - bringing back the captions for mobile, on desktop they show up on hower
386
+ * Improved handling for default splash screen (will be used for playlist as well, but won't show up for audio player)
387
+ * Bugfix for loading of mobile video
388
+
389
+ = 6.2.2 - 2017/07/13 =
390
+
391
+ * Fix for PHP versions below 5.4
392
+
393
+ = 6.2 - 2017/07/12 =
394
+
395
+ * New feature - Email subscription forms with Mailchimp support, check Actions -> Email Popups
396
+ * Audio support - new audio player styling, try enabling Integration/Compatibility -> Enable audio playback (beta)
397
+ * Playlist - new styling
398
  * CSS - optimizing the player graphics
399
+ * HLS.js - fix for Flash fallback - if it failed on the page once, it was forcing any further HLS playback to use Flash
400
+ * Mobile - "Force fullscreen on mobile" fix for iPhone with iOS 10
401
  * Fixing shortcode editor JS glitch with playlist subtitles
402
 
403
+ = 6.1.5 - 2017/06/29 =
404
 
405
  * Compatibility - bugfix for FV Player widget as it was breaking Featured Image insertion when also using DesignThemes Core Features Plugin
406
  * Iframe embedding - using width and height attributes like YouTube or Vimeo to ensure FV Player Iframe embeds are responsive at least in themes with iframe responsiveness code
408
  * Reverting - Ajax loading - fix for repeated autoplay if your theme loads FV Player using Ajax and uses autoplay for the loaded content. You have to set fv_player_did_autoplay = false in your JavaScript instead.
409
  * Bugfix - "audio" errors showing instead of "video" errors
410
 
411
+ = 6.1.4 - 2017/06/22 =
412
 
413
  * Ads - close icon size increased and retina version provided
414
  * Ajax loading - fix for repeated autoplay if your theme loads FV Player using Ajax and uses autoplay for the loaded content
423
 
424
  * MPEG-DASH - making sure the automated quality switching respects the player size
425
  * Mobile - added "Mobile Settings" box with "Use native fullscreen on mobile" and "Force fullscreen on mobile" (beta) settings
426
+ * Subtitles - playlist support!
427
 
428
  = 6.1.1 - 2017/06/05 =
429
 
view/admin.php CHANGED
@@ -199,9 +199,9 @@ function fv_flowplayer_admin_default_options() {
199
  <td><label for="width"><?php _e('Default Video Size', 'fv-wordpress-flowplayer'); ?>:</label></td>
200
  <td>
201
  <p class="description">
202
- <label for="width"><?php _e('Width', 'fv-wordpress-flowplayer'); ?>:</label>&nbsp;<input type="text" class="small" name="width" id="width" value="<?php echo intval( $fv_fp->_get_option('width') ); ?>" />
203
- <label for="height"><?php _e('Height', 'fv-wordpress-flowplayer'); ?>:</label>&nbsp;<input type="text" class="small" name="height" id="height" value="<?php echo intval( $fv_fp->_get_option('height') ); ?>" />
204
- <?php _e('Enter values in pixels.', 'fv-wordpress-flowplayer'); ?>
205
  </p>
206
  </td>
207
  </tr>
@@ -492,7 +492,7 @@ function fv_flowplayer_admin_description_actions() {
492
  <tr>
493
  <td colspan="4">
494
  <p>
495
- <?php _e('Here you can configure ads and banners that will be showed in the video.', 'fv-wordpress-flowplayer'); ?>
496
  </p>
497
  </td>
498
  </tr>
@@ -650,9 +650,8 @@ function fv_flowplayer_admin_mobile() {
650
 
651
 
652
  function fv_flowplayer_admin_select_popups($aArgs){
653
- global $fv_fp;
654
 
655
- $aPopupData = get_option('fv_player_popups');
656
 
657
 
658
  $sId = (isset($aArgs['id'])?$aArgs['id']:'popups_default');
@@ -669,6 +668,7 @@ function fv_flowplayer_admin_select_popups($aArgs){
669
  foreach( $aPopupData AS $key => $aPopupAd ) {
670
  ?><option <?php if( $aArgs['item_id'] == $key ) echo 'selected'; ?> value="<?php echo $key; ?>"><?php
671
  echo $key;
 
672
  if( !empty($aPopupAd['name']) ) echo ' - '.$aPopupAd['name'];
673
  if( $aPopupAd['disabled'] == 1 ) echo ' (currently disabled)';
674
  ?></option><?php
@@ -679,20 +679,32 @@ function fv_flowplayer_admin_select_popups($aArgs){
679
  }
680
 
681
 
682
- function fv_flowplayer_admin_popups(){
683
  global $fv_fp;
684
  ?>
685
  <table class="form-table2" style="margin: 5px; ">
686
  <tr>
687
  <td style="width:150px;vertical-align:top;line-height:2.4em;"><label for="popups_default"><?php _e('Default Popup', 'fv-wordpress-flowplayer'); ?>:</label></td>
688
  <td>
689
- <?php $cva_id = $fv_fp->_get_option('popups_default'); ?>
690
- <?php fv_flowplayer_admin_select_popups( array('item_id'=>$cva_id,'id'=>'popups_default') ); ?>
691
- <p class="description"><?php _e('You can set a default popup here and then skip it for individual videos.', 'fv-wordpress-flowplayer'); ?></p>
692
  </td>
693
  </tr>
694
- </table>
695
- <table class="form-table2" style="margin: 5px; ">
 
 
 
 
 
 
 
 
 
 
 
 
 
696
  <tr>
697
  <td>
698
  <table id="fv-player-popups-settings">
@@ -1306,7 +1318,8 @@ add_meta_box( 'fv_flowplayer_amazon_options', __('Amazon S3 Protected Content',
1306
 
1307
  /* Actions Tab */
1308
  add_meta_box( 'fv_flowplayer_description', ' ', 'fv_flowplayer_admin_description_actions', 'fv_flowplayer_settings_actions', 'normal', 'high' );
1309
- add_meta_box( 'fv_flowplayer_popups', __('Popups', 'fv-wordpress-flowplayer'), 'fv_flowplayer_admin_popups' , 'fv_flowplayer_settings_actions', 'normal' );
 
1310
  add_meta_box( 'fv_flowplayer_ads', __('Ads', 'fv-wordpress-flowplayer'), 'fv_flowplayer_admin_ads', 'fv_flowplayer_settings_actions', 'normal' );
1311
 
1312
  /* Video Ads Tab */
@@ -1372,14 +1385,6 @@ add_meta_box( 'fv_flowplayer_usage', __('Usage', 'fv-wordpress-flowplayer'), 'fv
1372
  </p>
1373
  <div id="fv_flowplayer_admin_notices">
1374
  </div>
1375
- <div id="fv_flowplayer_admin_tabs">
1376
- <h2 class="fv-nav-tab-wrapper nav-tab-wrapper">
1377
- <?php foreach($fv_player_aSettingsTabs as $key => $val):?>
1378
- <a href="#postbox-container-<?php echo $val['hash'];?>" class="nav-tab<?php if( $key == 0 ) : ?> nav-tab-active<?php endif; ?>" style="outline: 0px;"><?php _e($val['name'],'fv-wordpress-flowplayer');?></a>
1379
- <?php endforeach;?>
1380
- <div id="fv_player_js_warning" style=" margin: 8px 40px; display: inline-block; color: darkgrey;" >There Is a Problem with JavaScript.</div>
1381
- </h2>
1382
- </div>
1383
 
1384
  <?php if( preg_match( '!^\$\d+!', $fv_fp->_get_option('key') ) || apply_filters('fv_player_skip_ads',false) ) : ?>
1385
  <?php else : ?>
@@ -1399,7 +1404,16 @@ add_meta_box( 'fv_flowplayer_usage', __('Usage', 'fv-wordpress-flowplayer'), 'fv
1399
  <img width="297" height="239" border="0" src="<?php echo flowplayer::get_plugin_url().'/images/fv-wp-flowplayer-led-monitor.png' ?>"> </a>
1400
  </div>
1401
  </div>
1402
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
1403
 
1404
  <div id="dashboard-widgets" class="metabox-holder fv-metabox-holder columns-1">
1405
  <?php foreach($fv_player_aSettingsTabs as $key => $val):?>
@@ -1488,11 +1502,10 @@ add_meta_box( 'fv_flowplayer_usage', __('Usage', 'fv-wordpress-flowplayer'), 'fv
1488
 
1489
  jQuery('.fv_wp_flowplayer_activate_extension').click( function() { // todo: block multiple clicks
1490
  var button = jQuery(this);
1491
- jQuery(button).siblings('img').eq(0).show();
1492
 
1493
- var button = this;
1494
  jQuery.post( ajaxurl, { action: 'fv_wp_flowplayer_activate_extension', nonce: '<?php echo wp_create_nonce( 'fv_wp_flowplayer_activate_extension' ); ?>', plugin: jQuery(this).attr("data-plugin") }, function( response ) {
1495
- jQuery(button).siblings('img').eq(0).hide();
1496
 
1497
  var obj;
1498
  try {
@@ -1500,8 +1513,8 @@ add_meta_box( 'fv_flowplayer_usage', __('Usage', 'fv-wordpress-flowplayer'), 'fv
1500
  response = response.replace( /<\/FVFLOWPLAYER>[\s\S]*/, '' );
1501
  obj = jQuery.parseJSON( response );
1502
 
1503
- jQuery(button).removeClass('fv_wp_flowplayer_activate_extension');
1504
- jQuery(button).attr('value',obj.message);
1505
 
1506
  if( typeof(obj.error) == "undefined" ) {
1507
  //window.location.hash = '#'+jQuery(button).attr("data-plugin");
@@ -1509,13 +1522,13 @@ add_meta_box( 'fv_flowplayer_usage', __('Usage', 'fv-wordpress-flowplayer'), 'fv
1509
  window.location.href = window.location.href;
1510
  }
1511
  } catch(e) { // todo: what if there is "<p>Plugin install failed.</p>"
1512
- jQuery(button).after('<p>Error parsing JSON</p>');
1513
  return;
1514
  }
1515
 
1516
  } ).error(function() {
1517
- jQuery(button).siblings('img').eq(0).hide();
1518
- jQuery(button).after('<p>Error!</p>');
1519
  });
1520
  } );
1521
 
199
  <td><label for="width"><?php _e('Default Video Size', 'fv-wordpress-flowplayer'); ?>:</label></td>
200
  <td>
201
  <p class="description">
202
+ <label for="width"><?php _e('Width', 'fv-wordpress-flowplayer'); ?>:</label>&nbsp;<input type="text" class="small" name="width" id="width" value="<?php echo $fv_fp->_get_option('width'); ?>" />
203
+ <label for="height"><?php _e('Height', 'fv-wordpress-flowplayer'); ?>:</label>&nbsp;<input type="text" class="small" name="height" id="height" value="<?php echo $fv_fp->_get_option('height'); ?>" />
204
+ <?php _e('Enter values in pixels or 100%.', 'fv-wordpress-flowplayer'); ?>
205
  </p>
206
  </td>
207
  </tr>
492
  <tr>
493
  <td colspan="4">
494
  <p>
495
+ <?php _e('Here you can configure ads and banners that will be shown in the video.', 'fv-wordpress-flowplayer'); ?>
496
  </p>
497
  </td>
498
  </tr>
650
 
651
 
652
  function fv_flowplayer_admin_select_popups($aArgs){
 
653
 
654
+ $aPopupData = apply_filters('fv_player_admin_popups_defaults', get_option('fv_player_popups'));
655
 
656
 
657
  $sId = (isset($aArgs['id'])?$aArgs['id']:'popups_default');
668
  foreach( $aPopupData AS $key => $aPopupAd ) {
669
  ?><option <?php if( $aArgs['item_id'] == $key ) echo 'selected'; ?> value="<?php echo $key; ?>"><?php
670
  echo $key;
671
+ if( !empty($aPopupAd['title']) ) echo ' - '.$aPopupAd['title'];
672
  if( !empty($aPopupAd['name']) ) echo ' - '.$aPopupAd['name'];
673
  if( $aPopupAd['disabled'] == 1 ) echo ' (currently disabled)';
674
  ?></option><?php
679
  }
680
 
681
 
682
+ function fv_flowplayer_admin_end_of_video(){
683
  global $fv_fp;
684
  ?>
685
  <table class="form-table2" style="margin: 5px; ">
686
  <tr>
687
  <td style="width:150px;vertical-align:top;line-height:2.4em;"><label for="popups_default"><?php _e('Default Popup', 'fv-wordpress-flowplayer'); ?>:</label></td>
688
  <td>
689
+ <?php $cva_id = $fv_fp->_get_option('popups_default'); ?>
690
+ <p class="description"><?php fv_flowplayer_admin_select_popups( array('item_id'=>$cva_id,'id'=>'popups_default') ); ?> <?php _e('You can set a default popup here and then skip it for individual videos.', 'fv-wordpress-flowplayer'); ?></p>
 
691
  </td>
692
  </tr>
693
+ <tr>
694
+ <td colspan="4">
695
+ <input type="submit" name="fv-wp-flowplayer-submit" class="button-primary" value="<?php _e('Save All Changes', 'fv-wordpress-flowplayer'); ?>" />
696
+ </td>
697
+ </tr>
698
+ </table>
699
+ <?php
700
+ }
701
+
702
+
703
+ function fv_flowplayer_admin_popups(){
704
+ global $fv_fp;
705
+ ?>
706
+ <p><?php _e('Add any popups here which you would like to use with multiple videos.', 'fv-wordpress-flowplayer'); ?></p>
707
+ <table class="form-table2" style="margin: 5px; ">
708
  <tr>
709
  <td>
710
  <table id="fv-player-popups-settings">
1318
 
1319
  /* Actions Tab */
1320
  add_meta_box( 'fv_flowplayer_description', ' ', 'fv_flowplayer_admin_description_actions', 'fv_flowplayer_settings_actions', 'normal', 'high' );
1321
+ add_meta_box( 'fv_flowplayer_end_of_video', __('End of Video', 'fv-wordpress-flowplayer'), 'fv_flowplayer_admin_end_of_video' , 'fv_flowplayer_settings_actions', 'normal', 'high' );
1322
+ add_meta_box( 'fv_flowplayer_popups', __('Custom Popups', 'fv-wordpress-flowplayer'), 'fv_flowplayer_admin_popups' , 'fv_flowplayer_settings_actions', 'normal', 'high' );
1323
  add_meta_box( 'fv_flowplayer_ads', __('Ads', 'fv-wordpress-flowplayer'), 'fv_flowplayer_admin_ads', 'fv_flowplayer_settings_actions', 'normal' );
1324
 
1325
  /* Video Ads Tab */
1385
  </p>
1386
  <div id="fv_flowplayer_admin_notices">
1387
  </div>
 
 
 
 
 
 
 
 
1388
 
1389
  <?php if( preg_match( '!^\$\d+!', $fv_fp->_get_option('key') ) || apply_filters('fv_player_skip_ads',false) ) : ?>
1390
  <?php else : ?>
1404
  <img width="297" height="239" border="0" src="<?php echo flowplayer::get_plugin_url().'/images/fv-wp-flowplayer-led-monitor.png' ?>"> </a>
1405
  </div>
1406
  </div>
1407
+ <?php endif; ?>
1408
+
1409
+ <div id="fv_flowplayer_admin_tabs">
1410
+ <h2 class="fv-nav-tab-wrapper nav-tab-wrapper">
1411
+ <?php foreach($fv_player_aSettingsTabs as $key => $val):?>
1412
+ <a href="#postbox-container-<?php echo $val['hash'];?>" class="nav-tab<?php if( $key == 0 ) : ?> nav-tab-active<?php endif; ?>" style="outline: 0px;"><?php _e($val['name'],'fv-wordpress-flowplayer');?></a>
1413
+ <?php endforeach;?>
1414
+ <div id="fv_player_js_warning" style=" margin: 8px 40px; display: inline-block; color: darkgrey;" >There Is a Problem with JavaScript.</div>
1415
+ </h2>
1416
+ </div>
1417
 
1418
  <div id="dashboard-widgets" class="metabox-holder fv-metabox-holder columns-1">
1419
  <?php foreach($fv_player_aSettingsTabs as $key => $val):?>
1502
 
1503
  jQuery('.fv_wp_flowplayer_activate_extension').click( function() { // todo: block multiple clicks
1504
  var button = jQuery(this);
1505
+ button.siblings('img').eq(0).show();
1506
 
 
1507
  jQuery.post( ajaxurl, { action: 'fv_wp_flowplayer_activate_extension', nonce: '<?php echo wp_create_nonce( 'fv_wp_flowplayer_activate_extension' ); ?>', plugin: jQuery(this).attr("data-plugin") }, function( response ) {
1508
+ button.siblings('img').eq(0).hide();
1509
 
1510
  var obj;
1511
  try {
1513
  response = response.replace( /<\/FVFLOWPLAYER>[\s\S]*/, '' );
1514
  obj = jQuery.parseJSON( response );
1515
 
1516
+ button.removeClass('fv_wp_flowplayer_activate_extension');
1517
+ button.attr('value',obj.message);
1518
 
1519
  if( typeof(obj.error) == "undefined" ) {
1520
  //window.location.hash = '#'+jQuery(button).attr("data-plugin");
1522
  window.location.href = window.location.href;
1523
  }
1524
  } catch(e) { // todo: what if there is "<p>Plugin install failed.</p>"
1525
+ button.after('<p>Error parsing JSON</p>');
1526
  return;
1527
  }
1528
 
1529
  } ).error(function() {
1530
+ button.siblings('img').eq(0).hide();
1531
+ button.after('<p>Error!</p>');
1532
  });
1533
  } );
1534
 
view/wizard.old.php CHANGED
@@ -33,7 +33,6 @@
33
  global $fv_fp;
34
 
35
  $aPopupData = get_option('fv_player_popups');
36
-
37
 
38
  $sId = (isset($aArgs['id'])?$aArgs['id']:'popups_default');
39
  $aArgs = wp_parse_args( $aArgs, array( 'id'=>$sId, 'item_id'=>'', 'show_default' => false ) );
33
  global $fv_fp;
34
 
35
  $aPopupData = get_option('fv_player_popups');
 
36
 
37
  $sId = (isset($aArgs['id'])?$aArgs['id']:'popups_default');
38
  $aArgs = wp_parse_args( $aArgs, array( 'id'=>$sId, 'item_id'=>'', 'show_default' => false ) );
view/wizard.php CHANGED
@@ -31,10 +31,9 @@
31
  }
32
 
33
  function fv_flowplayer_admin_select_popups($aArgs) {
34
- global $fv_fp;
35
-
36
  $aPopupData = get_option('fv_player_popups');
37
-
38
 
39
  $sId = (isset($aArgs['id'])?$aArgs['id']:'popups_default');
40
  $aArgs = wp_parse_args( $aArgs, array( 'id'=>$sId, 'item_id'=>'', 'show_default' => false ) );
@@ -401,20 +400,23 @@ var fv_flowplayer_set_post_thumbnail_nonce = '<?php echo wp_create_nonce( "set_p
401
  <?php fv_player_shortcode_row( array('label' => 'End of video',
402
  'playlist_label' => 'End of playlist',
403
  'name' => 'end_actions',
404
- 'dropdown' => array( array('', 'Nothing'), array('redirect', 'Redirect'), array('loop', 'Loop'), array('popup','Show popup'), array('splashend','Show splash screen') ),
 
 
 
 
 
 
405
  'live' => false ) ); ?>
406
-
407
  <tr class="fv_player_actions_end-toggle">
408
  <th scope="row" class="label"><label for="fv_wp_flowplayer_field_redirect" class="alignright"><?php _e('Redirect to', 'fv_flowplayer'); ?></label></th>
409
  <td class="field"><input type="text" id="fv_wp_flowplayer_field_redirect" name="fv_wp_flowplayer_field_redirect" style="width: 93%" /></td>
410
  </tr>
411
-
412
  <tr class="fv_player_actions_end-toggle">
413
  <th scope="row" class="label"><label for="fv_wp_flowplayer_field_popup_id" class="alignright"><?php _e('End popup', 'fv_flowplayer'); ?></label></th>
414
  <td>
415
- <!-- legacy -->
416
-
417
- <!-- end legacy -->
418
  <?php fv_flowplayer_admin_select_popups(array('id' => 'fv_wp_flowplayer_field_popup_id', 'show_default' => true)) ?>
419
  <div style="display: none">
420
  <p><span class="dashicons dashicons-warning"></span> <?php _e('You are using the legacy popup functionality. Move the popup code', 'fv-wordpress-flowplayer'); ?> <a href="<?php echo site_url(); ?>/wp-admin/options-general.php?page=fvplayer#tab_popups" target="_target"><?php _e('here', 'fv-wordpress-flowplayer'); ?></a><?php _e(', then use the drop down menu above.', 'fv-wordpress-flowplayer'); ?></p>
@@ -422,7 +424,25 @@ var fv_flowplayer_set_post_thumbnail_nonce = '<?php echo wp_create_nonce( "set_p
422
  </div>
423
  </td>
424
  </tr>
425
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
426
  <tr <?php if( !isset($fv_flowplayer_conf["interface"]["ads"]) || $fv_flowplayer_conf["interface"]["ads"] !== 'true' ) echo ' class="fv_player_interface_hide"'; ?>>
427
  <th scope="row" class="label"><label for="fv_wp_flowplayer_field_ad" class="alignright"><?php _e('Ad code', 'fv_flowplayer'); ?></label></th>
428
  <td>
31
  }
32
 
33
  function fv_flowplayer_admin_select_popups($aArgs) {
34
+
 
35
  $aPopupData = get_option('fv_player_popups');
36
+
37
 
38
  $sId = (isset($aArgs['id'])?$aArgs['id']:'popups_default');
39
  $aArgs = wp_parse_args( $aArgs, array( 'id'=>$sId, 'item_id'=>'', 'show_default' => false ) );
400
  <?php fv_player_shortcode_row( array('label' => 'End of video',
401
  'playlist_label' => 'End of playlist',
402
  'name' => 'end_actions',
403
+ 'dropdown' => array(
404
+ array('', 'Nothing'),
405
+ array('redirect', 'Redirect'),
406
+ array('loop', 'Loop'),
407
+ array('popup', 'Show popup'),
408
+ array('splashend', 'Show splash screen'),
409
+ array('email_list', 'Collect Emails')),
410
  'live' => false ) ); ?>
411
+
412
  <tr class="fv_player_actions_end-toggle">
413
  <th scope="row" class="label"><label for="fv_wp_flowplayer_field_redirect" class="alignright"><?php _e('Redirect to', 'fv_flowplayer'); ?></label></th>
414
  <td class="field"><input type="text" id="fv_wp_flowplayer_field_redirect" name="fv_wp_flowplayer_field_redirect" style="width: 93%" /></td>
415
  </tr>
416
+
417
  <tr class="fv_player_actions_end-toggle">
418
  <th scope="row" class="label"><label for="fv_wp_flowplayer_field_popup_id" class="alignright"><?php _e('End popup', 'fv_flowplayer'); ?></label></th>
419
  <td>
 
 
 
420
  <?php fv_flowplayer_admin_select_popups(array('id' => 'fv_wp_flowplayer_field_popup_id', 'show_default' => true)) ?>
421
  <div style="display: none">
422
  <p><span class="dashicons dashicons-warning"></span> <?php _e('You are using the legacy popup functionality. Move the popup code', 'fv-wordpress-flowplayer'); ?> <a href="<?php echo site_url(); ?>/wp-admin/options-general.php?page=fvplayer#tab_popups" target="_target"><?php _e('here', 'fv-wordpress-flowplayer'); ?></a><?php _e(', then use the drop down menu above.', 'fv-wordpress-flowplayer'); ?></p>
424
  </div>
425
  </td>
426
  </tr>
427
+
428
+ <?php
429
+
430
+ $rawLists = get_option('fv_player_email_lists');
431
+ $aLists = array();
432
+ foreach($rawLists as $key => $val){
433
+ if(!is_numeric($key))
434
+ continue;
435
+ $aLists[] = array($key,(empty($val->name) ? "List " . $key : "$val->name" ));
436
+ }
437
+ if(count($aLists)){
438
+ fv_player_shortcode_row( array(
439
+ 'label' => 'E-mail list',
440
+ 'name' => 'email_list',
441
+ 'class' => 'fv_player_actions_end-toggle',
442
+ 'dropdown' =>$aLists,
443
+ 'live' => false ) );
444
+ }
445
+ ?>
446
  <tr <?php if( !isset($fv_flowplayer_conf["interface"]["ads"]) || $fv_flowplayer_conf["interface"]["ads"] !== 'true' ) echo ' class="fv_player_interface_hide"'; ?>>
447
  <th scope="row" class="label"><label for="fv_wp_flowplayer_field_ad" class="alignright"><?php _e('Ad code', 'fv_flowplayer'); ?></label></th>
448
  <td>