FV Flowplayer Video Player - Version 2.3.12

Version Description

  • 2015/02/13 =

  • Feature - player position setting - lets you change the default centering to left align with no text wrapping

  • Feature - RSS - improving player appearance

  • Bugfix - FV Flowplayer preview in admin screen conflict with WP Media Library fixed

Download this release

Release Info

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

Code changes from version 2.2.9 to 2.3.12

controller/backend.php CHANGED
@@ -17,36 +17,23 @@
17
  along with this program. If not, see <http://www.gnu.org/licenses/>.
18
  */
19
 
20
- include_once(dirname( __FILE__ ) . '/../models/flowplayer.php');
21
- include_once(dirname( __FILE__ ) . '/../models/flowplayer-backend.php');
22
-
23
- /**
24
- * Create the flowplayer_backend object
25
- */
26
- $fv_fp = new flowplayer_backend();
27
-
28
- /**
29
- * WP Hooks
30
- */
31
  add_action('wp_ajax_fv_wp_flowplayer_support_mail', 'fv_wp_flowplayer_support_mail');
32
  add_action('wp_ajax_fv_wp_flowplayer_activate_extension', 'fv_wp_flowplayer_activate_extension');
33
  add_action('wp_ajax_fv_wp_flowplayer_check_template', 'fv_wp_flowplayer_check_template');
34
  add_action('wp_ajax_fv_wp_flowplayer_check_files', 'fv_wp_flowplayer_check_files');
35
 
36
- add_action('admin_head', 'flowplayer_head');
 
 
 
37
  add_action('admin_menu', 'flowplayer_admin');
38
  add_action('media_buttons', 'flowplayer_add_media_button', 30);
 
39
 
40
 
41
  add_action('admin_init', 'fv_wp_flowplayer_admin_init');
42
  add_action( 'wp_ajax_fv_foliopress_ajax_pointers', 'fv_wp_flowplayer_pointers_ajax' );
43
- add_action('media_upload_fvplayer_video', 'fv_wp_flowplayer_media_upload');
44
- add_action('media_upload_fvplayer_video_1', 'fv_wp_flowplayer_media_upload');
45
- add_action('media_upload_fvplayer_video_2', 'fv_wp_flowplayer_media_upload');
46
- add_action('media_upload_fvplayer_mobile', 'fv_wp_flowplayer_media_upload');
47
- add_action('media_upload_fvplayer_splash', 'fv_wp_flowplayer_media_upload');
48
- add_action('media_upload_fvplayer_logo', 'fv_wp_flowplayer_media_upload');
49
- add_action('media_upload_fvplayer_subtitles', 'fv_wp_flowplayer_media_upload');
50
 
51
 
52
  add_action( 'admin_enqueue_scripts', 'fv_wp_flowplayer_admin_enqueue_scripts' );
@@ -54,51 +41,17 @@ add_action( 'edit_form_after_editor', 'fv_wp_flowplayer_edit_form_after_editor'
54
 
55
  add_action( 'after_plugin_row', 'fv_wp_flowplayer_after_plugin_row', 10, 3 );
56
 
57
- add_action( 'save_post', 'fv_wp_flowplayer_save_post', 9999 );
58
 
59
  add_filter( 'get_user_option_closedpostboxes_fv_flowplayer_settings', 'fv_wp_flowplayer_closed_meta_boxes' );
60
 
61
 
62
- //loading a video and splash image
63
- if(
64
- isset($_REQUEST['_wp_http_referer']) &&
65
- (
66
- strpos($_REQUEST['_wp_http_referer'],'type=fvplayer_video') ||
67
- strpos($_REQUEST['_wp_http_referer'],'type=fvplayer_video_1') ||
68
- strpos($_REQUEST['_wp_http_referer'],'type=fvplayer_video_2') ||
69
- strpos($_REQUEST['_wp_http_referer'],'type=fvplayer_mobile') ||
70
- strpos($_REQUEST['_wp_http_referer'],'type=fvplayer_splash') ||
71
- strpos($_REQUEST['_wp_http_referer'],'type=fvplayer_subtitles')
72
- )
73
- ) {
74
- add_filter('media_send_to_editor','fv_wp_flowplayer_media_send_to_editor', 10, 3);
75
- //disable inserting the image to the editor
76
- add_filter('image_send_to_editor', 'fv_wp_flowplayer_image_send_to_editor', 10);
77
- }
78
- else {
79
- //loading a logo
80
- if(isset($_POST['_wp_http_referer']) && (strpos($_POST['_wp_http_referer'],'type=fvplayer_logo'))) {
81
- add_filter('media_send_to_editor','fp_media_send_to_settings', 10, 3);
82
- }
83
- }
84
-
85
- if(
86
- !empty($_GET['post_id']) &&
87
- (
88
- $_GET['type'] == 'fvplayer_video' ||
89
- $_GET['type'] == 'fvplayer_video_1' ||
90
- $_GET['type'] == 'fvplayer_video_2' ||
91
- $_GET['type'] == 'fvplayer_mobile' ||
92
- $_GET['type'] == 'fvplayer_splash' ||
93
- $_GET['type'] == 'fvplayer_subtitles'
94
- )
95
- ) {
96
- add_action( 'post-html-upload-ui', 'fv_wp_flowplayer_image_media_upload_html_bypass', 100 );
97
- }
98
-
99
  add_action('the_content', 'flowplayer_content_remove_commas');
 
100
  add_filter('admin_print_scripts', 'flowplayer_print_scripts');
101
  add_action('admin_print_styles', 'flowplayer_print_styles');
 
 
102
  //conversion script via AJAX
103
  add_action('wp_ajax_flowplayer_conversion_script', 'flowplayer_conversion_script');
104
  add_action('admin_notices', 'fv_wp_flowplayer_admin_notice');
@@ -114,216 +67,56 @@ function flowplayer_deactivate() {
114
  delete_transient( 'fv_flowplayer_license' );
115
  }
116
  delete_option( 'fv_flowplayer_extension_install' );
 
117
  }
118
 
119
 
120
- function flowplayer_content_remove_commas($content) {
121
- preg_match('/.*popup=\'(.*?)\'.*/', $content, $matches);
122
- $content_new = preg_replace('/\,/', '',$content);
123
- if (isset($matches[1]))
124
- $content_new = preg_replace('/popup=\'(.*?)\'/', 'popup=\''.$matches[1].'\'',$content_new);
125
- return $content_new;
126
- }
127
-
128
-
129
- /**
130
- * END WP Hooks
131
- */
132
-
133
-
134
- function fv_wp_flowplayer_media_send_to_editor($html, $attachment_id, $attachment) {
135
-
136
- $video_types = array('flv','mov','avi','mpeg','mpg','asf','qt','wmv','mp4','m4v','mp3','webm','ogv');
137
- $splash_types = array('jpg','jpeg','gif','png', 'bmp','jpe');
138
- $subtitles_types = array('txt','vtt');
139
-
140
- if (isset($attachment_id)) {
141
- $attachment_url = wp_get_attachment_url($attachment_id);
142
- $path_parts = pathinfo($attachment_url);
143
- if (strpos($_POST['_wp_http_referer'],'type=fvplayer_splash')) {
144
- setcookie("selected_image",$attachment_url);
145
- $selected_attachment = array('url'=>$attachment_url,'id'=>$attachment_id);
146
- }
147
- else
148
- if (strpos($_POST['_wp_http_referer'],'type=fvplayer_video_1')) {
149
- setcookie("selected_video1",$attachment_url);
150
- $selected_attachment = array('id'=>'src1', 'url'=>$attachment_url);
151
- }
152
- else
153
- if (strpos($_POST['_wp_http_referer'],'type=fvplayer_video_2')) {
154
- setcookie("selected_video2",$attachment_url);
155
- $selected_attachment = array('id'=>'src2', 'url'=>$attachment_url);
156
- }
157
- else
158
- if (strpos($_POST['_wp_http_referer'],'type=fvplayer_mobile')) {
159
- setcookie("selected_mobile",$attachment_url);
160
- $selected_attachment = array('id'=>'mobile', 'url'=>$attachment_url);
161
- }
162
- else
163
- if (strpos($_POST['_wp_http_referer'],'type=fvplayer_subtitles')) {
164
- setcookie("selected_subtitles",$attachment_url);
165
- $selected_attachment = array('id'=>'subtitles', 'url'=>$attachment_url);
166
- }
167
- else {
168
- setcookie("selected_video",$attachment_url);
169
- $selected_attachment = array('id'=>'src', 'url'=>$attachment_url);
170
- }
171
- }
172
-
173
- if (isset($selected_attachment['url'])) {
174
- $path_parts = pathinfo($selected_attachment['url']);
175
- if (in_array($path_parts['extension'], $video_types)) {
176
- if ($selected_attachment['id'] == 'src1') {
177
- $uploaded_video1 = $selected_attachment['url'];
178
- }
179
- else
180
- if ($selected_attachment['id'] == 'src2') {
181
- $uploaded_video2 = $selected_attachment['url'];
182
- }
183
- else
184
- if ($selected_attachment['id'] == 'mobile') {
185
- $uploaded_mobile = $selected_attachment['url'];
186
- }
187
- else {
188
- $uploaded_video = $selected_attachment['url'];
189
- }
190
- }
191
- if( in_array($path_parts['extension'], $splash_types) ) {
192
- $uploaded_image = $selected_attachment['url'];
193
- }
194
- else if( in_array($path_parts['extension'], $subtitles_types) ) {
195
- $uploaded_subtitles = $selected_attachment['url'];
196
- }
197
- }
198
-
199
- $document_root = ( isset($_SERVER['SUBDOMAIN_DOCUMENT_ROOT']) && strlen(trim($_SERVER['SUBDOMAIN_DOCUMENT_ROOT'])) > 0 ) ? $_SERVER['SUBDOMAIN_DOCUMENT_ROOT'] : $_SERVER['DOCUMENT_ROOT'];
200
-
201
- if (isset($uploaded_video)) {
202
- $serv = $_SERVER['SERVER_NAME'];
203
- $pattern = '/'.$serv.'(.*)/';
204
- preg_match($pattern, $uploaded_video, $matches);
205
-
206
- // Initialize getID3 engine
207
- if ( ! class_exists( 'getID3' ) ) {
208
- require( ABSPATH . WPINC . '/ID3/getid3.php' );
209
- }
210
- $getID3 = new getID3;
211
- if (empty($matches)) {
212
- $ThisFileInfo = $getID3->analyze(realpath($document_root . $uploaded_video));
213
- }
214
- else {
215
- $ThisFileInfo = $getID3->analyze(realpath($document_root . $matches[1]));
216
- }
217
- if (isset($ThisFileInfo['error'])) $file_error = "Could not read video details, please fill the width and height manually.";
218
- //getid3_lib::CopyTagsToComments($ThisFileInfo);
219
- $file_time = $ThisFileInfo['playtime_string']; // playtime in minutes:seconds, formatted string
220
- $file_width = $ThisFileInfo['video']['resolution_x'];
221
- $file_height = $ThisFileInfo['video']['resolution_y'];
222
- $file_size = $ThisFileInfo['filesize'];
223
- $file_size = round($file_size/(1024*1024),2);
224
- }
225
- if (!empty($uploaded_video)) {
226
- ?>
227
- <script type='text/javascript'>
228
- window.parent.document.getElementById('fv_wp_flowplayer_field_src').value = "<?php echo esc_attr($uploaded_video) ?>";
229
- <?php if (!empty($uploaded_video) && !isset($ThisFileInfo['error'])) { ?>
230
- window.parent.document.getElementById('fv_wp_flowplayer_field_width').value = "<?php echo esc_attr(ceil($file_width)) ?>";
231
- window.parent.document.getElementById('fv_wp_flowplayer_field_height').value = "<?php echo esc_attr(ceil($file_height)) ?>";
232
- window.parent.document.getElementById('fv_wp_flowplayer_file_info').style.display = "table-row";
233
- window.parent.document.getElementById('fv_wp_flowplayer_file_duration').innerHTML = "<?php echo esc_attr($file_time) ?>";
234
- window.parent.document.getElementById('fv_wp_flowplayer_file_size').innerHTML = "<?php echo esc_attr($file_size) ?>";
235
- <?php } ?>
236
- window.parent.tb_remove();
237
- </script>
238
- <?php
239
- }
240
- else
241
- if (!empty($uploaded_image)) {
242
- ?>
243
- <script type='text/javascript'>
244
- window.parent.document.getElementById('fv_wp_flowplayer_field_splash').value = "<?php echo esc_attr($uploaded_image) ?>";
245
- </script>
246
- <?php
247
- $conf = get_option( 'fvwpflowplayer' );
248
- $post_thumbnail = false;
249
 
250
- if( isset($conf["postthumbnail"]) ) {
251
- $post_thumbnail = $conf["postthumbnail"];
252
- }
253
- if ( $post_thumbnail == 'true' && current_theme_supports( 'post-thumbnails') && isset($selected_attachment['id']) ) {
254
- $post_id = (int)$_GET['post_id'];
255
- update_post_meta( $post_id, '_thumbnail_id', $selected_attachment['id'] );
256
- }
257
- }
258
- else
259
- if (!empty($uploaded_video1)) {
260
- ?>
261
- <script type='text/javascript'>
262
- window.parent.document.getElementById('fv_wp_flowplayer_field_src_1').value = "<?php echo esc_attr($uploaded_video1) ?>";
263
- </script>
264
- <?php
265
- }
266
- else
267
- if (!empty($uploaded_video2)) {
268
- ?>
269
- <script type='text/javascript'>
270
- window.parent.document.getElementById('fv_wp_flowplayer_field_src_2').value = "<?php echo esc_attr($uploaded_video2) ?>";
271
- </script>
272
- <?php
273
- }
274
- else
275
- if (!empty($uploaded_mobile)) {
276
- ?>
277
- <script type='text/javascript'>
278
- window.parent.document.getElementById('fv_wp_flowplayer_field_mobile').value = "<?php echo esc_attr($uploaded_mobile) ?>";
279
- </script>
280
- <?php
281
  }
282
- else
283
- if( !empty($uploaded_subtitles) ) {
284
- ?>
285
- <script type='text/javascript'>
286
- window.parent.document.getElementById('fv_wp_flowplayer_field_subtitles').value = "<?php echo esc_attr($uploaded_subtitles) ?>";
287
- </script>
288
- <?php
289
- }
290
- }
291
-
292
 
293
- function fv_wp_flowplayer_image_send_to_editor() {
294
- return '';
 
 
 
 
 
 
 
 
 
295
  }
296
 
297
 
298
- function fv_wp_flowplayer_image_media_upload_html_bypass() {
299
- ?>
300
- <p class="upload-html-bypass hide-if-no-js">
301
- <?php _e('<strong>FV Wordpress Flowplayer Warning:</strong> Plese use <a href="#">the multi-file uploader</a>. Otherwise you will have to select the file in the Media Library.'); ?>
302
- </p>
303
- <?php
304
  }
305
 
306
 
307
- function fp_media_send_to_settings($html, $attachment_id, $attachment) {
308
- if(isset($_POST['_wp_http_referer']) && (strpos($_POST['_wp_http_referer'],'type=fvplayer_logo'))) {
309
- $logo_types = array('jpg','jpeg','gif','png', 'bmp','jpe');
310
-
311
- if (isset($attachment_id)) {
312
- $attachment_url = wp_get_attachment_url($attachment_id);
313
- $path_parts = pathinfo($attachment_url);
314
- if (in_array($path_parts['extension'], $logo_types)) {
315
- $selected_attachment = $attachment_url;
316
- }
317
- }
318
  ?>
319
- <script type="text/javascript">
320
- window.parent.document.getElementById("logo").value = '<?php echo $selected_attachment ?>';
321
- window.parent.tb_remove();
 
322
  </script>
323
  <?php
324
- }
325
  }
326
 
 
 
327
 
328
  /**
329
  * Administrator environment function.
@@ -339,6 +132,7 @@ function flowplayer_admin () {
339
  'flowplayer_page'
340
  );
341
  }
 
342
  }
343
 
344
 
@@ -472,10 +266,13 @@ function fv_wp_flowplayer_admin_enqueue_scripts( $page ) {
472
  if( $page !== 'post.php' && $page !== 'post-new.php' ) {
473
  return;
474
  }
475
- wp_register_script('fvwpflowplayer-domwindow', flowplayer::get_plugin_url().'/js/jquery.colorbox-min.js',array('jquery') );
476
- wp_enqueue_script('fvwpflowplayer-domwindow');
477
 
478
- wp_register_script('fvwpflowplayer-shortcode-editor', flowplayer::get_plugin_url().'/js/shortcode-editor.js',array('jquery') );
 
 
 
 
 
479
  wp_enqueue_script('fvwpflowplayer-shortcode-editor');
480
 
481
  wp_register_style('fvwpflowplayer-domwindow-css', flowplayer::get_plugin_url().'/css/colorbox.css','','1.0','screen');
@@ -627,7 +424,7 @@ function fv_wp_flowplayer_license_check( $aArgs ) {
627
  );
628
  $resp = wp_remote_post( 'http://foliovision.com/?fv_remote=true', $args );
629
 
630
- if( isset($resp['body']) && $resp['body'] && $data = json_decode( preg_replace( '~[\s\S]*?<FVFLOWPLAYER>(.*?)</FVFLOWPLAYER>[\s\S]*?~', '$1', $resp['body'] ) ) ) {
631
  return $data;
632
  } else {
633
  return false;
@@ -649,6 +446,10 @@ function fv_wp_flowplayer_media_upload() {
649
 
650
 
651
  function fv_wp_flowplayer_after_plugin_row( $arg) {
 
 
 
 
652
  $args = func_get_args();
653
 
654
  if( $args[1]['Name'] == 'FV Wordpress Flowplayer' ) {
@@ -658,7 +459,7 @@ function fv_wp_flowplayer_after_plugin_row( $arg) {
658
  <tr class="plugin-update-tr fv-wordpress-flowplayer-tr">
659
  <td class="plugin-update colspanchange" colspan="3">
660
  <div class="update-message">
661
- <a href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/download">All Licenses 20% Off</a> - Easter sale!
662
  </div>
663
  </td>
664
  </tr>
@@ -666,272 +467,7 @@ function fv_wp_flowplayer_after_plugin_row( $arg) {
666
  endif;
667
  }
668
  }
669
-
670
-
671
- function fv_wp_flowplayer_check_headers( $headers, $remotefilename, $random, $args = false ) {
672
- global $fv_fp;
673
-
674
- $args = wp_parse_args( $args, array( 'talk_bad_mime' => 'Video served with a bad mime type' , 'wrap'=>'p' ) );
675
-
676
- $sOutput = '';
677
-
678
- $bFatal = false;
679
- if( $headers && $headers['response']['code'] == '404' ) {
680
- $video_errors[] = 'File not found (HTTP 404)!';
681
- $bFatal = true;
682
- } else if( $headers && $headers['response']['code'] == '403' ) {
683
- $video_errors[] = 'Access to video forbidden (HTTP 403)!';
684
- $bFatal = true;
685
- } else if( $headers && $headers['response']['code'] != '200' && $headers['response']['code'] != '206' ) {
686
- $video_errors[] = 'Can\'t check the video (HTTP '.$headers['response']['code'].')!';
687
- $bFatal = true;
688
- } else {
689
-
690
- if(
691
- ( !isset($headers['headers']['accept-ranges']) || $headers['headers']['accept-ranges'] != 'bytes' ) &&
692
- !isset($headers['headers']['content-range'])
693
- ) {
694
- $video_errors[] = 'Server does not support HTTP range requests! Please check <a href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/faq#getting-error-about-range-requests">our FAQ</a>.';
695
- }
696
-
697
- if(
698
- ( stripos( $remotefilename, '.mp4' ) !== FALSE && $headers['headers']['content-type'] != 'video/mp4' ) ||
699
- ( stripos( $remotefilename, '.m4v' ) !== FALSE && $headers['headers']['content-type'] != 'video/x-m4v' ) ||
700
- ( stripos( $remotefilename, '.webm' ) !== FALSE && $headers['headers']['content-type'] != 'video/webm' ) ||
701
- ( stripos( $remotefilename, '.mov' ) !== FALSE && $headers['headers']['content-type'] != 'video/mp4' )
702
- ) {
703
- if( stripos( $remotefilename, '.mov' ) !== FALSE ) {
704
- $meta_note_addition = ' Firefox on Windows does not like MOV files with video/quicktime mime type.';
705
- } else if( stripos( $remotefilename, '.webm' ) !== FALSE ) {
706
- $meta_note_addition = ' Older Firefox versions don\'t like WEBM files with mime type other than video/webm.';
707
- } else {
708
- $meta_note_addition = ' Some web browsers may experience playback issues in HTML5 mode (Internet Explorer 9 - 10).';
709
- /*if( $fv_fp->conf['engine'] == 'default' ) {
710
- $meta_note_addition .= ' Currently you are using the "Default (mixed)" <a href="'.site_url().'/wp-admin/options-general.php?page=fvplayer">Preferred Flowplayer engine</a> setting, so IE will always use Flash and will play fine.';
711
- }*/
712
- }
713
-
714
- $fix = '<div class="fix-meta-'.$random.'" style="display: none; ">
715
- <p>If the video is hosted on Amazon S3:</p>
716
- <blockquote>Using your Amazon AWS Management Console, you can go though your videos and find file content type under the "Metadata" tab in an object\'s "Properties" pane and fix it to "video/mp4" for MP4, "video/x-m4v" for M4V files, "video/mp4" for MOV files and "video/webm" for WEBM files.</blockquote>
717
- <p>If the video is hosted on your server, put this into your .htaccess:</p>
718
- <pre>AddType video/mp4 .mp4
719
- AddType video/webm .webm
720
- AddType video/ogg .ogv
721
- AddType application/x-mpegurl .m3u8
722
- AddType video/x-m4v .m4v
723
- AddType video/mp4 .mov
724
- # hls transport stream segments:
725
- AddType video/mp2t .ts</pre>
726
- <p>If you are using Microsoft IIS, you need to use the IIS manager. Check our <a href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/faq#video-doesnt-play-internet-explorer" target="_blank">FAQ</a> for more info.</p>
727
- </div>';
728
-
729
- $sOutput = ( $args['wrap'] ) ? '<'.$args['wrap'].'>' : '';
730
- $sOutput .= '<strong>Bad mime type</strong>: '.$args['talk_bad_mime'].' <tt>'.$headers['headers']['content-type'].'</tt>!'.$meta_note_addition.' (<a href="#" onclick="jQuery(\'.fix-meta-'.$random.'\').toggle(); return false">show fix</a>)';
731
- $sOutput .= ( $args['wrap'] ) ? '</'.$args['wrap'].'>' : '';
732
- $sOutput .= $fix;
733
- $video_errors[] = $sOutput;
734
- }
735
- }
736
-
737
- return array( $video_errors, (isset($headers['headers']['content-type'])) ? $headers['headers']['content-type'] : '', $bFatal );
738
- }
739
-
740
-
741
- // don't include body in our wp_remote_head requests. We have to use GET instead of HEAD because of Amazon
742
- function fv_wp_flowplayer_http_api_curl( $handle ) {
743
- curl_setopt( $handle, CURLOPT_NOBODY, true );
744
- }
745
-
746
-
747
- function fv_wp_flowplayer_http( $sURL, $args ) {
748
- global $fv_wp_flowplayer_ver;
749
-
750
- $args = wp_parse_args( $args, array( 'file' => false, 'size' => 2097152, 'quick_check' => false ) );
751
- extract($args);
752
-
753
- $iTimeout = ($quick_check) ? 10 : 20;
754
-
755
- $ch = curl_init();
756
- curl_setopt( $ch, CURLOPT_URL, $sURL );
757
- curl_setopt( $ch, CURLOPT_RANGE, '0-'.$size );
758
- curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
759
- if( !@ini_get('open_basedir') ) {
760
- @curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
761
- }
762
- curl_setopt( $ch, CURLOPT_HEADER, true );
763
- curl_setopt( $ch, CURLOPT_VERBOSE, 1 );
764
- curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, $iTimeout );
765
- curl_setopt( $ch, CURLOPT_TIMEOUT, $iTimeout );
766
- curl_setopt( $ch, CURLOPT_USERAGENT, 'FV Flowplayer video checker/'.$fv_wp_flowplayer_ver);
767
-
768
- $data = curl_exec($ch);
769
-
770
- $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
771
- $header = substr($data, 0, $header_size);
772
- $body = substr($data, $header_size);
773
-
774
- if( $file ) {
775
- file_put_contents( $file, $body);
776
- }
777
- $sError = ($ch == false) ? 'CURL Error: '.curl_error ( $ch) : false;
778
- if( curl_errno($ch) == 28 ) {
779
- $sError .= "Connection timeout, can't check the video.";
780
- } else if(!curl_errno($ch) ) {
781
- $aInfo = curl_getinfo($ch);
782
- if( $aInfo['total_time'] > $iTimeout*0.9 ) {
783
- $sError .= "Connection timeout, can't check the video.";
784
- }
785
- }
786
- curl_close($ch);
787
-
788
- return array( $header, $sError );
789
- }
790
-
791
 
792
- function fv_wp_flowplayer_check_mimetype( $URLs = false, $meta = false ) {
793
- add_action( 'http_api_curl', 'fv_wp_flowplayer_http_api_curl' );
794
-
795
- global $fv_wp_flowplayer_ver, $fv_fp;
796
-
797
- if( !empty($meta) ) {
798
- extract( $meta, EXTR_SKIP );
799
- }
800
-
801
- if( defined('DOING_AJAX') && DOING_AJAX && isset( $_POST['media'] ) && stripos( $_SERVER['HTTP_REFERER'], home_url() ) === 0 ) {
802
- $URLs = json_decode( stripslashes( trim($_POST['media']) ));
803
- }
804
-
805
- if( isset($URLs) ) {
806
- $all_sources = $URLs;
807
-
808
- foreach( $all_sources AS $source ) {
809
- if( preg_match( '!^rtmp://!', $source, $match ) ) {
810
- $found_rtmp = true;
811
- } else if( !isset($media) && !preg_match( '!\.(m3u8|m3u|avi)$!', $source) ) {
812
- $media = $source;
813
- }
814
- }
815
-
816
- //$random = rand( 0, 10000 );
817
- $random = (isset($_POST['hash'])) ? trim($_POST['hash']) : false;
818
-
819
- if( isset($media) ) {
820
- $remotefilename = $media;
821
- $remotefilename_encoded = flowplayer::get_encoded_url($remotefilename);
822
-
823
- if( $fv_fp->is_secure_amazon_s3($remotefilename_encoded) || 1>0 ) { // skip headers check for Amazon S3, as it's slow
824
- $headers = false;
825
- } else {
826
- $headers = wp_remote_head( trim( str_replace(' ', '%20', $remotefilename_encoded ) ), array( 'method' => 'GET', 'redirection' => 3 ) );
827
- }
828
-
829
- $bValidFile = true;
830
- if( is_wp_error($headers) ) {
831
- $video_errors[] = 'Error checking '.$media.'!<br />'.print_r($headers,true);
832
- } else {
833
- if( $headers ) {
834
- list( $aVideoErrors, $sContentType, $bFatal ) = fv_wp_flowplayer_check_headers( $headers, $remotefilename, $random );
835
- if( $bFatal ) {
836
- $bValidFile = false;
837
- }
838
- if( $aVideoErrors ) {
839
- $video_errors = array_merge( $video_errors, $aVideoErrors );
840
- }
841
- }
842
-
843
- if( function_exists('is_utf8') && is_utf8($remotefilename) ) {
844
- $video_errors[] = '<p><strong>UTF-8 error</strong>: Your file name is using non-latin characters, the file might not play in browsers using Flash for the video!</p>';
845
- }
846
-
847
- if( @ini_get('safe_mode') ) {
848
- $video_warnings[] = 'Detailed video check is not available with PHP Safe Mode On. Please contact your webhost support.';
849
- } else {
850
-
851
- if ( ! class_exists( 'getID3' ) ) {
852
- require( ABSPATH . WPINC . '/ID3/getid3.php' );
853
- }
854
- $getID3 = new getID3;
855
-
856
- if( !function_exists('curl_init') ) {
857
- $video_errors[] = 'cURL for PHP not found, please contact your server administrator.';
858
- } else {
859
- $message = '<p>Analysis of <a class="bluelink" target="_blank" href="'.esc_attr($remotefilename_encoded).'">'.$remotefilename_encoded.'</a></p>';
860
-
861
- // taken from: http://www.getid3.org/phpBB3/viewtopic.php?f=3&t=1141
862
- $upload_dir = wp_upload_dir();
863
- $localtempfilename = trailingslashit( $upload_dir['basedir'] ).'fv_flowlayer_tmp_'.md5(rand(1,999)).'_'.basename( substr($remotefilename_encoded,0,32) );
864
-
865
- $out = fopen( $localtempfilename,'wb' );
866
- if( $out ) {
867
- list( $header, $sHTTPError ) = fv_wp_flowplayer_http( $remotefilename_encoded, array( 'file' => $localtempfilename ) );
868
-
869
-
870
- if( $sHTTPError ) {
871
- $video_errors[] = $sHTTPError;
872
- $bValidFile = false;
873
- }
874
- fclose($out);
875
-
876
- if( !$headers ) {
877
- $headers = WP_Http::processHeaders( $header );
878
-
879
- list( $aVideoErrors, $sContentType, $bFatal ) = fv_wp_flowplayer_check_headers( $headers, $remotefilename, $random );
880
- if( $bFatal ) {
881
- $bValidFile = false;
882
- }
883
-
884
- if( $aVideoErrors ) {
885
- $video_errors = array_merge( $video_errors, $aVideoErrors );
886
- }
887
-
888
- if( isset($hearders['headers']['server']) && $hearders['headers']['server'] == 'AmazonS3' && $headers['response']['code'] == '403' ) {
889
- $error = new SimpleXMLElement($body);
890
-
891
- if( stripos( $error->Message, 'Request has expired' ) !== false ) {
892
- $video_errors[] = '<p><strong>Amazon S3</strong>: Your secure link is expired, there might be problem with your Amazon S3 plugin. Please test if the above URL opens in your browser.</p>';
893
- } else {
894
- $video_errors[] = '<p><strong>Amazon S3</strong>: '.$error->Message.'</p>';
895
- }
896
-
897
- }
898
- }
899
-
900
- if( $bValidFile ) {
901
- $ThisFileInfo = $getID3->analyze( $localtempfilename );
902
- }
903
- if( !@unlink($localtempfilename) ) {
904
- $video_errors[] = 'Can\'t remove temporary file for video analysis in <tt>'.$localtempfilename.'</tt>!';
905
- }
906
- } else {
907
- $video_errors[] = 'Can\'t create temporary file for video analysis in <tt>'.$localtempfilename.'</tt>!';
908
- }
909
- }
910
-
911
-
912
- /*
913
- Only check file length
914
- */
915
- if( isset($meta_action) && $meta_action == 'check_time' ) {
916
-
917
- if( isset($ThisFileInfo['playtime_seconds']) ) {
918
- $time = $ThisFileInfo['playtime_seconds'];
919
- }
920
- global $post;
921
- $fv_flowplayer_meta = get_post_meta( $post->ID, '_fv_flowplayer', true );
922
- $fv_flowplayer_meta = ($fv_flowplayer_meta) ? $fv_flowplayer_meta : array();
923
- $fv_flowplayer_meta[sanitize_title($meta_original)] = array('time' => $time);
924
- update_post_meta( $post->ID, '_fv_flowplayer', $fv_flowplayer_meta );
925
- return;
926
- }
927
-
928
- }
929
- } // end is_wp_error check
930
-
931
- } // end isset($media)
932
- }
933
- }
934
-
935
 
936
  // enter script URL, return false if it's not version 5
937
  function fv_wp_flowplayer_check_script_version( $url ) {
@@ -1039,12 +575,14 @@ function fv_wp_flowplayer_check_files() {
1039
  if( stripos( $videos[0]['src'], '.mp4' ) === FALSE /*&& stripos( $videos[0]['src'], '.m4v' ) === FALSE*/ ) {
1040
  continue;
1041
  }
 
 
1042
 
1043
  if( stripos( trim($videos[0]['src']), 'rtmp://' ) === false ) {
1044
- list( $header, $message_out ) = fv_wp_flowplayer_http( trim($videos[0]['src']), array( 'quick_check' => 'true', 'size' => 65536 ) );
1045
  if( $header ) {
1046
  $headers = WP_Http::processHeaders( $header );
1047
- list( $new_errors, $mime_type, $fatal ) = fv_wp_flowplayer_check_headers( $headers, trim($videos[0]['src']), rand(0,999), array( 'talk_bad_mime' => 'Server <code>'.$server.'</code> uses incorrect mime type for MP4 ', 'wrap' => false ) );
1048
  if( $fatal ) {
1049
  continue;
1050
  }
@@ -1053,7 +591,7 @@ function fv_wp_flowplayer_check_files() {
1053
  foreach( $videos AS $video ) {
1054
  $sPostsLinks .= '<a href="'.home_url().'?p='.$video['post_id'].'">'.$video['post_id'].'</a> ';
1055
  }
1056
- $errors[] = $new_errors.'(<a href="#" onclick="jQuery(\'#fv-flowplayer-warning-'.$count.'\').toggle(); return false">click to see a list of posts</a>) <div id="fv-flowplayer-warning-'.$count.'" style="display: none; ">'.$sPostsLinks.'</div>';
1057
  $count++;
1058
  continue;
1059
  } else {
@@ -1105,7 +643,7 @@ function fv_wp_flowplayer_check_template() {
1105
  }
1106
 
1107
  if( stripos( $response['body'], '/html5.js') === FALSE && stripos( $response['body'], '/html5shiv.js') === FALSE ) {
1108
- $errors[] = 'html5.js not found in your template! Videos might not play in old browsers, like Internet Explorer 6-8. Get it <a href="https://code.google.com/p/html5shim/">here</a> and put it into your template.';
1109
  }
1110
 
1111
  $ok[] = 'Template checker has changed. Just open any of your videos on your site and see if you get a red warning message about JavaScript not working.';
@@ -1246,48 +784,6 @@ function fv_wp_flowplayer_support_mail_phpmailer_init( $phpmailer ) {
1246
  }
1247
 
1248
 
1249
- function fv_wp_flowplayer_save_post( $id ) {
1250
- if( wp_is_post_revision($id) ) {
1251
- return true;
1252
- }
1253
-
1254
- global $fv_fp;
1255
- if( !isset($fv_fp->conf['amazon_bucket']) ) {
1256
- return;
1257
- }
1258
-
1259
- $videos = array();
1260
- $saved_post = get_post($id);
1261
- preg_match_all( '~\[(?:flowplayer|fvplayer).*?\]~', $saved_post->post_content, $matches );
1262
- if( isset($matches[0]) && count($matches[0]) ) {
1263
- foreach( $matches[0] AS $shortcode ) {
1264
- $process = false;
1265
- foreach( $fv_fp->conf['amazon_bucket'] AS $bucket ) {
1266
- if( strlen(trim($bucket)) > 0 && preg_match( '~[\'"](\S+?'.$bucket.'\S+?)[\'"]~', $shortcode, $process) ) {
1267
- $videos[] = $process[1];
1268
- break;
1269
- }
1270
- }
1271
- }
1272
- }
1273
-
1274
- if( count($videos) > 0 ) {
1275
- $videos = array_unique($videos);
1276
- foreach( $videos AS $video ) {
1277
- global $post;
1278
- if( $fv_flowplayer_meta = get_post_meta( $post->ID, '_fv_flowplayer', true ) ) {
1279
- if( isset($fv_flowplayer_meta[sanitize_title($video)]) ) {
1280
- continue;
1281
- }
1282
- }
1283
-
1284
- $video_secured = $fv_fp->get_amazon_secure($video, $fv_fp);
1285
- fv_wp_flowplayer_check_mimetype( array($video_secured), array( 'meta_action' => 'check_time', 'meta_original' => $video ) );
1286
- }
1287
- }
1288
- }
1289
-
1290
-
1291
  function fv_wp_flowplayer_closed_meta_boxes( $closed ) {
1292
  if ( false === $closed )
1293
  $closed = array( 'fv_flowplayer_amazon_options', 'fv_flowplayer_interface_options', 'fv_flowplayer_default_options', 'fv_flowplayer_ads', 'fv_flowplayer_skin' );
@@ -1446,4 +942,23 @@ function fv_wp_flowplayer_activate_extension() {
1446
 
1447
  echo "<FVFLOWPLAYER>".json_encode( array( 'message' => 'Success!', 'plugin' => $_POST['plugin'] ) )."</FVFLOWPLAYER>";
1448
  die();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1449
  }
17
  along with this program. If not, see <http://www.gnu.org/licenses/>.
18
  */
19
 
 
 
 
 
 
 
 
 
 
 
 
20
  add_action('wp_ajax_fv_wp_flowplayer_support_mail', 'fv_wp_flowplayer_support_mail');
21
  add_action('wp_ajax_fv_wp_flowplayer_activate_extension', 'fv_wp_flowplayer_activate_extension');
22
  add_action('wp_ajax_fv_wp_flowplayer_check_template', 'fv_wp_flowplayer_check_template');
23
  add_action('wp_ajax_fv_wp_flowplayer_check_files', 'fv_wp_flowplayer_check_files');
24
 
25
+ add_action('admin_head', 'flowplayer_admin_head');
26
+ add_action('admin_footer', 'flowplayer_admin_footer');
27
+ add_action('admin_print_footer_scripts', 'flowplayer_admin_footer_wp_js_restore', 999999 );
28
+
29
  add_action('admin_menu', 'flowplayer_admin');
30
  add_action('media_buttons', 'flowplayer_add_media_button', 30);
31
+ add_action('media_upload_fvplayer_video', '__return_false'); // keep for compatibility!
32
 
33
 
34
  add_action('admin_init', 'fv_wp_flowplayer_admin_init');
35
  add_action( 'wp_ajax_fv_foliopress_ajax_pointers', 'fv_wp_flowplayer_pointers_ajax' );
36
+
 
 
 
 
 
 
37
 
38
 
39
  add_action( 'admin_enqueue_scripts', 'fv_wp_flowplayer_admin_enqueue_scripts' );
41
 
42
  add_action( 'after_plugin_row', 'fv_wp_flowplayer_after_plugin_row', 10, 3 );
43
 
44
+ add_action( 'save_post', 'fv_wp_flowplayer_save_post'/*, 9999*/ );
45
 
46
  add_filter( 'get_user_option_closedpostboxes_fv_flowplayer_settings', 'fv_wp_flowplayer_closed_meta_boxes' );
47
 
48
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  add_action('the_content', 'flowplayer_content_remove_commas');
50
+
51
  add_filter('admin_print_scripts', 'flowplayer_print_scripts');
52
  add_action('admin_print_styles', 'flowplayer_print_styles');
53
+ add_action('admin_enqueue_scripts', 'fv_flowplayer_admin_scripts');
54
+
55
  //conversion script via AJAX
56
  add_action('wp_ajax_flowplayer_conversion_script', 'flowplayer_conversion_script');
57
  add_action('admin_notices', 'fv_wp_flowplayer_admin_notice');
67
  delete_transient( 'fv_flowplayer_license' );
68
  }
69
  delete_option( 'fv_flowplayer_extension_install' );
70
+ wp_clear_scheduled_hook('fv_flowplayer_checker_event');
71
  }
72
 
73
 
74
+ function flowplayer_admin_head() {
75
+ include dirname( __FILE__ ) . '/../view/frontend-head.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
 
77
+ if( !isset($_GET['page']) || $_GET['page'] != 'fvplayer' ) {
78
+ return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  }
 
 
 
 
 
 
 
 
 
 
80
 
81
+ global $fv_wp_flowplayer_ver;
82
+ ?>
83
+ <script type="text/javascript" src="<?php echo FV_FP_RELATIVE_PATH; ?>/js/jscolor/jscolor.js"></script>
84
+ <link rel="stylesheet" type="text/css" href="<?php echo flowplayer::get_plugin_url().'/css/license.css'; ?>?ver=<?php echo $fv_wp_flowplayer_ver; ?>" />
85
+
86
+ <script>
87
+ jQuery(window).on('unload', function(){
88
+ window.fv_flowplayer_wp = window.wp;
89
+ });
90
+ </script>
91
+ <?php
92
  }
93
 
94
 
95
+ function flowplayer_admin_footer() {
96
+ if( !isset($_GET['page']) || $_GET['page'] != 'fvplayer' ) {
97
+ return;
98
+ }
99
+
100
+ flowplayer_prepare_scripts();
101
  }
102
 
103
 
104
+ function flowplayer_admin_footer_wp_js_restore() {
105
+ if( !isset($_GET['page']) || $_GET['page'] != 'fvplayer' ) {
106
+ return;
107
+ }
108
+
 
 
 
 
 
 
109
  ?>
110
+ <script>
111
+ jQuery(window).on('unload', function(){
112
+ window.wp = window.fv_flowplayer_wp;
113
+ });
114
  </script>
115
  <?php
 
116
  }
117
 
118
+
119
+
120
 
121
  /**
122
  * Administrator environment function.
132
  'flowplayer_page'
133
  );
134
  }
135
+
136
  }
137
 
138
 
266
  if( $page !== 'post.php' && $page !== 'post-new.php' ) {
267
  return;
268
  }
 
 
269
 
270
+ global $fv_wp_flowplayer_ver;
271
+
272
+ wp_register_script('fvwpflowplayer-domwindow', flowplayer::get_plugin_url().'/js/jquery.colorbox-min.js',array('jquery'), $fv_wp_flowplayer_ver );
273
+ wp_enqueue_script('fvwpflowplayer-domwindow');
274
+
275
+ wp_register_script('fvwpflowplayer-shortcode-editor', flowplayer::get_plugin_url().'/js/shortcode-editor.js',array('jquery'), $fv_wp_flowplayer_ver );
276
  wp_enqueue_script('fvwpflowplayer-shortcode-editor');
277
 
278
  wp_register_style('fvwpflowplayer-domwindow-css', flowplayer::get_plugin_url().'/css/colorbox.css','','1.0','screen');
424
  );
425
  $resp = wp_remote_post( 'http://foliovision.com/?fv_remote=true', $args );
426
 
427
+ if( isset($resp['body']) && $resp['body'] && $data = json_decode( preg_replace( '~[\s\S]*?<FVFLOWPLAYER>(.*?)</FVFLOWPLAYER>[\s\S]*?~', '$1', $resp['body'] ) ) ) {
428
  return $data;
429
  } else {
430
  return false;
446
 
447
 
448
  function fv_wp_flowplayer_after_plugin_row( $arg) {
449
+ if( apply_filters('fv_player_skip_ads',false) ) {
450
+ return;
451
+ }
452
+
453
  $args = func_get_args();
454
 
455
  if( $args[1]['Name'] == 'FV Wordpress Flowplayer' ) {
459
  <tr class="plugin-update-tr fv-wordpress-flowplayer-tr">
460
  <td class="plugin-update colspanchange" colspan="3">
461
  <div class="update-message">
462
+ <a href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/download">All Licenses 20% Off</a> - Christmas sale!
463
  </div>
464
  </td>
465
  </tr>
467
  endif;
468
  }
469
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
470
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
471
 
472
  // enter script URL, return false if it's not version 5
473
  function fv_wp_flowplayer_check_script_version( $url ) {
575
  if( stripos( $videos[0]['src'], '.mp4' ) === FALSE /*&& stripos( $videos[0]['src'], '.m4v' ) === FALSE*/ ) {
576
  continue;
577
  }
578
+
579
+ global $FV_Player_Checker;
580
 
581
  if( stripos( trim($videos[0]['src']), 'rtmp://' ) === false ) {
582
+ list( $header, $message_out ) = $FV_Player_Checker->http_request( trim($videos[0]['src']), array( 'quick_check' => 10, 'size' => 65536 ) );
583
  if( $header ) {
584
  $headers = WP_Http::processHeaders( $header );
585
+ list( $new_errors, $mime_type, $fatal ) = $FV_Player_Checker->check_headers( $headers, trim($videos[0]['src']), rand(0,999), array( 'talk_bad_mime' => 'Server <code>'.$server.'</code> uses incorrect mime type for MP4 ', 'wrap' => false ) );
586
  if( $fatal ) {
587
  continue;
588
  }
591
  foreach( $videos AS $video ) {
592
  $sPostsLinks .= '<a href="'.home_url().'?p='.$video['post_id'].'">'.$video['post_id'].'</a> ';
593
  }
594
+ $errors[] = implode( " ",$new_errors ).'(<a href="#" onclick="jQuery(\'#fv-flowplayer-warning-'.$count.'\').toggle(); return false">click to see a list of posts</a>) <div id="fv-flowplayer-warning-'.$count.'" style="display: none; ">'.$sPostsLinks.'</div>';
595
  $count++;
596
  continue;
597
  } else {
643
  }
644
 
645
  if( stripos( $response['body'], '/html5.js') === FALSE && stripos( $response['body'], '/html5shiv.js') === FALSE ) {
646
+ $errors[] = 'html5.js not found in your template! Videos might not play in old browsers, like Internet Explorer 6-8. Read our instrutions <a href="https://foliovision.com/player/installation#html5js">here</a>.';
647
  }
648
 
649
  $ok[] = 'Template checker has changed. Just open any of your videos on your site and see if you get a red warning message about JavaScript not working.';
784
  }
785
 
786
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
787
  function fv_wp_flowplayer_closed_meta_boxes( $closed ) {
788
  if ( false === $closed )
789
  $closed = array( 'fv_flowplayer_amazon_options', 'fv_flowplayer_interface_options', 'fv_flowplayer_default_options', 'fv_flowplayer_ads', 'fv_flowplayer_skin' );
942
 
943
  echo "<FVFLOWPLAYER>".json_encode( array( 'message' => 'Success!', 'plugin' => $_POST['plugin'] ) )."</FVFLOWPLAYER>";
944
  die();
945
+ }
946
+
947
+ add_filter('plugin_action_links', 'fv_wp_flowplayer_plugin_action_links', 10, 2);
948
+
949
+ function fv_wp_flowplayer_plugin_action_links($links, $file) {
950
+ if( $file == 'fv-wordpress-flowplayer/flowplayer.php') {
951
+ $settings_link = '<a href="https://foliovision.com/pro-support" target="_blank">Premium Support</a>';
952
+ array_unshift($links, $settings_link);
953
+ $settings_link = '<a href="options-general.php?page=fvplayer">Settings</a>';
954
+ array_unshift($links, $settings_link);
955
+ }
956
+ return $links;
957
+ }
958
+
959
+
960
+ function fv_flowplayer_admin_scripts() {
961
+ if (isset($_GET['page']) && $_GET['page'] == 'fvplayer') {
962
+ wp_enqueue_media();
963
+ }
964
  }
controller/frontend.php CHANGED
@@ -16,24 +16,26 @@
16
  along with this program. If not, see <http://www.gnu.org/licenses/>.
17
  */
18
 
19
- include_once(dirname( __FILE__ ) . '/../models/flowplayer.php');
20
- include_once(dirname( __FILE__ ) . '/../models/flowplayer-frontend.php');
21
-
22
- $fv_fp = new flowplayer_frontend();
23
-
24
  //add_action('the_content', 'flowplayer_content_remove_commas');
25
  add_action('wp_head', 'flowplayer_head');
26
  add_action('wp_footer','flowplayer_prepare_scripts',9);
27
  add_action('wp_footer','flowplayer_display_scripts',100);
28
- add_action('widget_text','flowplayer_content');
29
  add_action('wp_enqueue_scripts', 'flowplayer_jquery');
30
 
 
 
31
 
32
  function fv_flowplayer_remove_bad_scripts() {
33
- wp_deregister_script( 'flowplayer' );
 
 
 
34
  }
35
  add_action( 'wp_print_scripts', 'fv_flowplayer_remove_bad_scripts', 100 );
36
 
 
 
37
 
38
 
39
  function flowplayer_content_remove_commas($content) {
@@ -266,23 +268,37 @@ function flowplayer_prepare_scripts() {
266
  if( $fv_fp->load_mediaelement && !wp_script_is('wp-mediaelement') ) {
267
  wp_enqueue_script( 'flowplayer-mediaelement', flowplayer::get_plugin_url().'/mediaelement/mediaelement-and-player.min.js', array('jquery'), $fv_wp_flowplayer_ver, true );
268
  }
269
- wp_localize_script( 'flowplayer', 'fv_flowplayer_playlists', $fv_fp->aPlaylists );
270
- wp_localize_script( 'flowplayer', 'fv_fp_ajaxurl', site_url().'/wp-admin/admin-ajax.php' );
271
 
272
  $aConf = array('embed' => array( 'library' => $sPluginUrl.'/flowplayer/fv-flowplayer.min.js', 'script' => $sPluginUrl.'/flowplayer/embed.min.js', 'skin' => $sPluginUrl.'/css/flowplayer.css', 'swf' => $sPluginUrl.'/flowplayer/flowplayer.swf?ver='.$fv_wp_flowplayer_ver ) );
273
  if( $sCommercialKey ) $aConf['key'] = $sCommercialKey;
274
- if( !isset($fv_fp->conf['fixed_size']) || strcmp($fv_fp->conf['fixed_size'],'true') != 0 ) {
275
  $aConf['safety_resize'] = true;
276
  }
 
 
 
277
  if( current_user_can('manage_options') && $fv_fp->conf['disable_videochecker'] != 'true' ) {
278
  $aConf['video_checker_site'] = home_url();
279
  }
280
  if( $sLogo ) $aConf['logo'] = $sLogo;
 
 
 
 
281
  wp_localize_script( 'flowplayer', 'fv_flowplayer_conf', $aConf );
282
  if( current_user_can('manage_options') ) {
283
  wp_localize_script( 'flowplayer', 'fv_flowplayer_admin_input', array(true) );
284
  wp_localize_script( 'flowplayer', 'fv_flowplayer_admin_js_test', array(true) );
285
  }
 
 
 
 
 
 
 
 
 
286
 
287
  if( count($GLOBALS['fv_fp_scripts']) > 0 ) {
288
  foreach( $GLOBALS['fv_fp_scripts'] AS $sKey => $aScripts ) {
@@ -312,15 +328,28 @@ function flowplayer($shortcode) {
312
 
313
 
314
  /*
315
- Make sure our div won't be wrapped in any P tag.
316
  */
317
  function fv_flowplayer_the_content( $c ) {
318
- $c = preg_replace( '!<p[^>]*?>(\[(?:fvplayer|flowplayer).*?\])</p>!', "\n".'$1'."\n", $c );
 
319
  return $c;
320
  }
321
  add_filter( 'the_content', 'fv_flowplayer_the_content', 0 );
322
 
323
 
 
 
 
 
 
 
 
 
 
 
 
 
324
  /*
325
  Handle attachment pages which contain videos
326
  */
@@ -333,13 +362,37 @@ function fv_flowplayer_attachment_page_video( $c ) {
333
  if( !$src = wp_get_attachment_url($post->ID) ) {
334
  return $c;
335
  }
336
-
337
  $meta = get_post_meta( $post->ID, '_wp_attachment_metadata', true );
338
  $size = (isset($meta['width']) && isset($meta['height']) && intval($meta['width'])>0 && intval($meta['height'])>0 ) ? ' width="'.intval($meta['width']).'" height="'.intval($meta['height']).'"' : false;
339
 
340
  $shortcode = '[fvplayer src="'.$src.'"'.$size.']';
341
 
342
  $c = preg_replace( '~<p class=.attachment.[\s\S]*?</p>~', $shortcode, $c );
 
 
343
  return $c;
344
  }
345
  add_filter( 'prepend_attachment', 'fv_flowplayer_attachment_page_video' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  along with this program. If not, see <http://www.gnu.org/licenses/>.
17
  */
18
 
 
 
 
 
 
19
  //add_action('the_content', 'flowplayer_content_remove_commas');
20
  add_action('wp_head', 'flowplayer_head');
21
  add_action('wp_footer','flowplayer_prepare_scripts',9);
22
  add_action('wp_footer','flowplayer_display_scripts',100);
23
+ add_action('widget_text','do_shortcode');
24
  add_action('wp_enqueue_scripts', 'flowplayer_jquery');
25
 
26
+ add_filter( 'run_ngg_resource_manager', '__return_false' );
27
+
28
 
29
  function fv_flowplayer_remove_bad_scripts() {
30
+ global $wp_scripts;
31
+ if( isset($wp_scripts->registered['flowplayer']) && isset($wp_scripts->registered['flowplayer']->src) && stripos($wp_scripts->registered['flowplayer']->src, 'fv-wordpress-flowplayer') === false ) {
32
+ wp_deregister_script( 'flowplayer' );
33
+ }
34
  }
35
  add_action( 'wp_print_scripts', 'fv_flowplayer_remove_bad_scripts', 100 );
36
 
37
+ add_filter( 'run_ngg_resource_manager', '__return_false' ); // Nextgen Gallery compatibility fix
38
+
39
 
40
 
41
  function flowplayer_content_remove_commas($content) {
268
  if( $fv_fp->load_mediaelement && !wp_script_is('wp-mediaelement') ) {
269
  wp_enqueue_script( 'flowplayer-mediaelement', flowplayer::get_plugin_url().'/mediaelement/mediaelement-and-player.min.js', array('jquery'), $fv_wp_flowplayer_ver, true );
270
  }
 
 
271
 
272
  $aConf = array('embed' => array( 'library' => $sPluginUrl.'/flowplayer/fv-flowplayer.min.js', 'script' => $sPluginUrl.'/flowplayer/embed.min.js', 'skin' => $sPluginUrl.'/css/flowplayer.css', 'swf' => $sPluginUrl.'/flowplayer/flowplayer.swf?ver='.$fv_wp_flowplayer_ver ) );
273
  if( $sCommercialKey ) $aConf['key'] = $sCommercialKey;
274
+ if( apply_filters( 'fv_flowplayer_safety_resize', true) && !isset($fv_fp->conf['fixed_size']) || strcmp($fv_fp->conf['fixed_size'],'true') != 0 ) {
275
  $aConf['safety_resize'] = true;
276
  }
277
+ if( isset($fv_fp->conf['cbox_compatibility']) && strcmp($fv_fp->conf['cbox_compatibility'],'true') == 0 ) {
278
+ $aConf['cbox_compatibility'] = true;
279
+ }
280
  if( current_user_can('manage_options') && $fv_fp->conf['disable_videochecker'] != 'true' ) {
281
  $aConf['video_checker_site'] = home_url();
282
  }
283
  if( $sLogo ) $aConf['logo'] = $sLogo;
284
+ $aConf['volume'] = floatval($fv_fp->conf['volume']);
285
+ if( $aConf['volume'] > 1 ) {
286
+ $aConf['volume'] = 1;
287
+ }
288
  wp_localize_script( 'flowplayer', 'fv_flowplayer_conf', $aConf );
289
  if( current_user_can('manage_options') ) {
290
  wp_localize_script( 'flowplayer', 'fv_flowplayer_admin_input', array(true) );
291
  wp_localize_script( 'flowplayer', 'fv_flowplayer_admin_js_test', array(true) );
292
  }
293
+
294
+ wp_localize_script( 'flowplayer', 'fv_fp_ajaxurl', site_url().'/wp-admin/admin-ajax.php' );
295
+ wp_localize_script( 'flowplayer', 'fv_flowplayer_playlists', $fv_fp->aPlaylists );
296
+ if( count($fv_fp->aAds) > 0 ) {
297
+ wp_localize_script( 'flowplayer', 'fv_flowplayer_ad', $fv_fp->aAds );
298
+ }
299
+ if( count($fv_fp->aPopups) > 0 ) {
300
+ wp_localize_script( 'flowplayer', 'fv_flowplayer_popup', $fv_fp->aPopups );
301
+ }
302
 
303
  if( count($GLOBALS['fv_fp_scripts']) > 0 ) {
304
  foreach( $GLOBALS['fv_fp_scripts'] AS $sKey => $aScripts ) {
328
 
329
 
330
  /*
331
+ Make sure our div won't be wrapped in any P tag and that html attributes don't break the shortcode
332
  */
333
  function fv_flowplayer_the_content( $c ) {
334
+ $c = preg_replace( '!<p[^>]*?>(\[(?:fvplayer|flowplayer).*?[^\\\]\])</p>!', "\n".'$1'."\n", $c );
335
+ $c = preg_replace_callback( '!\[(?:fvplayer|flowplayer).*?[^\\\]\]!', 'fv_flowplayer_shortfcode_fix_attrs', $c );
336
  return $c;
337
  }
338
  add_filter( 'the_content', 'fv_flowplayer_the_content', 0 );
339
 
340
 
341
+ function fv_flowplayer_shortfcode_fix_attrs( $aMatch ) {
342
+ $aMatch[0] = preg_replace_callback( '!(?:ad|popup)="(.*?[^\\\])"!', 'fv_flowplayer_shortfcode_fix_attr', $aMatch[0] );
343
+ return $aMatch[0];
344
+ }
345
+
346
+
347
+ function fv_flowplayer_shortfcode_fix_attr( $aMatch ) {
348
+ $aMatch[0] = str_replace( $aMatch[1], '<!--fv_flowplayer_base64_encoded-->'.base64_encode($aMatch[1]), $aMatch[0] );
349
+ return $aMatch[0];
350
+ }
351
+
352
+
353
  /*
354
  Handle attachment pages which contain videos
355
  */
362
  if( !$src = wp_get_attachment_url($post->ID) ) {
363
  return $c;
364
  }
365
+
366
  $meta = get_post_meta( $post->ID, '_wp_attachment_metadata', true );
367
  $size = (isset($meta['width']) && isset($meta['height']) && intval($meta['width'])>0 && intval($meta['height'])>0 ) ? ' width="'.intval($meta['width']).'" height="'.intval($meta['height']).'"' : false;
368
 
369
  $shortcode = '[fvplayer src="'.$src.'"'.$size.']';
370
 
371
  $c = preg_replace( '~<p class=.attachment.[\s\S]*?</p>~', $shortcode, $c );
372
+ $c = preg_replace( '~<div[^>]*?class="[^"]*?wp-video[^"]*?"[^>]*?>[\s\S]*?<video.*?</video></div>~', $shortcode, $c );
373
+
374
  return $c;
375
  }
376
  add_filter( 'prepend_attachment', 'fv_flowplayer_attachment_page_video' );
377
+
378
+
379
+ function fv_player_caption( $caption ) {
380
+ global $post, $authordata;
381
+ $caption = str_replace(
382
+ array(
383
+ '%post_title%',
384
+ '%post_date%',
385
+ '%post_author%',
386
+ '%post_author_name%'
387
+ ),
388
+ array(
389
+ get_the_title(),
390
+ get_the_date(),
391
+ sprintf( '<a href="%1$s" title="%2$s" rel="author">%3$s</a>', esc_url( get_author_posts_url( $authordata->ID, $authordata->user_nicename ) ), esc_attr( sprintf( __( 'Posts by %s' ), get_the_author() ) ), get_the_author() ),
392
+ get_the_author()
393
+ ),
394
+ $caption );
395
+ return $caption;
396
+ }
397
+ add_filter( 'fv_player_caption', 'fv_player_caption' );
398
+
controller/shortcodes.php CHANGED
@@ -24,6 +24,8 @@ add_shortcode('flowplayer','flowplayer_content_handle');
24
 
25
  add_shortcode('fvplayer','flowplayer_content_handle');
26
 
 
 
27
  function flowplayer_content_handle( $atts, $content = null, $tag ) {
28
  global $fv_fp;
29
 
@@ -100,6 +102,7 @@ function flowplayer_content_handle( $atts, $content = null, $tag ) {
100
  'splashend' => '',
101
  'popup' => '',
102
  'controlbar' => '',
 
103
  'redirect' => '',
104
  'loop' => '',
105
  'engine' => '',
@@ -113,10 +116,13 @@ function flowplayer_content_handle( $atts, $content = null, $tag ) {
113
  'rtmp' => '',
114
  'rtmp_path' => '',
115
  'playlist' => '',
 
116
  'admin_warning' => '',
117
  'live' => '',
118
  'caption' => '',
119
- 'logo' => ''
 
 
120
  ), $atts ) );
121
 
122
  if( $fv_fp->conf['parse_commas'] == 'true' && strcmp($tag,'flowplayer') == 0 ) {
@@ -130,6 +136,7 @@ function flowplayer_content_handle( $atts, $content = null, $tag ) {
130
  $arguments['splashend'] = preg_replace('/\,/', '', $splashend);
131
  $arguments['popup'] = $popup;
132
  $arguments['controlbar'] = preg_replace('/\,/', '', $controlbar);
 
133
  $arguments['redirect'] = preg_replace('/\,/', '', $redirect);
134
  $arguments['loop'] = preg_replace('/\,/', '', $loop);
135
  $arguments['engine'] = preg_replace('/\,/', '', $engine);
@@ -143,12 +150,15 @@ function flowplayer_content_handle( $atts, $content = null, $tag ) {
143
  $arguments['rtmp'] = preg_replace('/\,/', '', $rtmp);
144
  $arguments['rtmp_path'] = preg_replace('/\,/', '', $rtmp_path);
145
  $arguments['playlist'] = $playlist;
 
146
  $arguments['admin_warning'] = $admin_warning;
147
  $arguments['live'] = $live;
148
  $arguments['caption'] = $caption;
149
- $arguments['logo'] = $logo;
150
- $src = trim( preg_replace('/\,/', '', $src) );
151
- $arguments['src'] = $src;
 
 
152
  } else {
153
  $arguments = shortcode_atts( array(
154
  'src' => '',
@@ -162,6 +172,7 @@ function flowplayer_content_handle( $atts, $content = null, $tag ) {
162
  'splashend' => '',
163
  'popup' => '',
164
  'controlbar' => '',
 
165
  'redirect' => '',
166
  'loop' => '',
167
  'engine' => '',
@@ -175,18 +186,55 @@ function flowplayer_content_handle( $atts, $content = null, $tag ) {
175
  'rtmp' => '',
176
  'rtmp_path' => '',
177
  'playlist' => '',
 
178
  'admin_warning' => '',
179
  'live' => '',
180
  'caption' => '',
181
- 'logo' => ''
 
 
182
  ), $atts );
183
  }
184
 
 
 
 
 
 
185
  $arguments = apply_filters( 'fv_flowplayer_shortcode', $arguments, $fv_fp, $atts );
186
 
187
- if( $src != '' || ( ( ( strlen($fv_fp->conf['rtmp']) && $fv_fp->conf['rtmp'] != 'false' ) || strlen($arguments['rtmp'])) && strlen($arguments['rtmp_path']) ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
  // build new player
189
- $new_player = $fv_fp->build_min_player($src,$arguments);
190
  if (!empty($new_player['script'])) {
191
  $GLOBALS['fv_fp_scripts'] = $new_player['script'];
192
  }
@@ -285,4 +333,13 @@ function fv_flowplayer_optimizepress_bridge( $input ) {
285
  return $shortcode;
286
  }
287
 
288
- ?>
 
 
 
 
 
 
 
 
 
24
 
25
  add_shortcode('fvplayer','flowplayer_content_handle');
26
 
27
+ add_shortcode('fv_time','fv_player_time');
28
+
29
  function flowplayer_content_handle( $atts, $content = null, $tag ) {
30
  global $fv_fp;
31
 
102
  'splashend' => '',
103
  'popup' => '',
104
  'controlbar' => '',
105
+ 'play_button' => '',
106
  'redirect' => '',
107
  'loop' => '',
108
  'engine' => '',
116
  'rtmp' => '',
117
  'rtmp_path' => '',
118
  'playlist' => '',
119
+ 'playlist_hide' => '',
120
  'admin_warning' => '',
121
  'live' => '',
122
  'caption' => '',
123
+ 'logo' => '',
124
+ 'share' => '',
125
+ 'post' => '',
126
  ), $atts ) );
127
 
128
  if( $fv_fp->conf['parse_commas'] == 'true' && strcmp($tag,'flowplayer') == 0 ) {
136
  $arguments['splashend'] = preg_replace('/\,/', '', $splashend);
137
  $arguments['popup'] = $popup;
138
  $arguments['controlbar'] = preg_replace('/\,/', '', $controlbar);
139
+ $arguments['play_button'] = preg_replace('/\,/', '', $play_button);
140
  $arguments['redirect'] = preg_replace('/\,/', '', $redirect);
141
  $arguments['loop'] = preg_replace('/\,/', '', $loop);
142
  $arguments['engine'] = preg_replace('/\,/', '', $engine);
150
  $arguments['rtmp'] = preg_replace('/\,/', '', $rtmp);
151
  $arguments['rtmp_path'] = preg_replace('/\,/', '', $rtmp_path);
152
  $arguments['playlist'] = $playlist;
153
+ $arguments['playlist_hide'] = $playlist_hide;
154
  $arguments['admin_warning'] = $admin_warning;
155
  $arguments['live'] = $live;
156
  $arguments['caption'] = $caption;
157
+ $arguments['logo'] = $logo;
158
+ $arguments['share'] = $share;
159
+ $arguments['post'] = $post;
160
+ $arguments['src'] = trim( preg_replace('/\,/', '', $src) );
161
+
162
  } else {
163
  $arguments = shortcode_atts( array(
164
  'src' => '',
172
  'splashend' => '',
173
  'popup' => '',
174
  'controlbar' => '',
175
+ 'play_button' => '',
176
  'redirect' => '',
177
  'loop' => '',
178
  'engine' => '',
186
  'rtmp' => '',
187
  'rtmp_path' => '',
188
  'playlist' => '',
189
+ 'playlist_hide' => '',
190
  'admin_warning' => '',
191
  'live' => '',
192
  'caption' => '',
193
+ 'logo' => '',
194
+ 'share' => '',
195
+ 'post' => ''
196
  ), $atts );
197
  }
198
 
199
+ if( ( !isset($arguments['src']) || strlen(trim($arguments['src'])) == 0 ) && isset($arguments['mobile']) && strlen(trim($arguments['mobile'])) ) {
200
+ $arguments['src'] = $arguments['mobile'];
201
+ unset($arguments['mobile']);
202
+ }
203
+
204
  $arguments = apply_filters( 'fv_flowplayer_shortcode', $arguments, $fv_fp, $atts );
205
 
206
+ if( $post == 'this' ) {
207
+ $post = get_the_ID();
208
+ }
209
+
210
+ if( intval($post) > 0 ) {
211
+ $objVideoQuery = new WP_Query( array( 'post_type' => 'attachment', 'post_status' => 'inherit', 'post_parent' => intval($post), 'post_mime_type' => 'video' ) );
212
+ if( $objVideoQuery->have_posts() ) {
213
+ $sHTML = '';
214
+ while( $objVideoQuery->have_posts() ) {
215
+ $objVideoQuery->the_post();
216
+ $aArgs = $arguments;
217
+ $aArgs['src'] = wp_get_attachment_url(get_the_ID());
218
+ if( $aSplash = wp_get_attachment_image_src( get_post_thumbnail_id(get_the_ID()), 'large' ) ) {
219
+ $aArgs['splash'] = $aSplash[0];
220
+ }
221
+ if( strlen($aArgs['lightbox']) ) {
222
+ $aArgs['lightbox'] .= ';'.html_entity_decode(get_the_title());
223
+ }
224
+ if( strlen($aArgs['caption']) ) {
225
+ $aArgs['caption'] = apply_filters( 'fv_player_caption', $aArgs['caption'], false );
226
+ }
227
+
228
+ $new_player = $fv_fp->build_min_player( $aArgs['src'],$aArgs );
229
+ $sHTML .= $new_player['html'];
230
+ }
231
+
232
+ return $sHTML;
233
+ }
234
+
235
+ } else if( $arguments['src'] != '' || ( ( ( strlen($fv_fp->conf['rtmp']) && $fv_fp->conf['rtmp'] != 'false' ) || strlen($arguments['rtmp'])) && strlen($arguments['rtmp_path']) ) ) {
236
  // build new player
237
+ $new_player = $fv_fp->build_min_player($arguments['src'],$arguments);
238
  if (!empty($new_player['script'])) {
239
  $GLOBALS['fv_fp_scripts'] = $new_player['script'];
240
  }
333
  return $shortcode;
334
  }
335
 
336
+
337
+ function fv_player_time() {
338
+ global $post, $fv_fp;
339
+
340
+ if( $post->ID > 0 && isset($fv_fp->aCurArgs['src']) ) {
341
+ return flowplayer::get_duration( $post->ID, $fv_fp->aCurArgs['src'] );
342
+ } else {
343
+ return flowplayer::get_duration_post();
344
+ }
345
+ }
css/admin.css CHANGED
@@ -1,4 +1,4 @@
1
- #content .fv-wp-flowplayer-notice-small, .fv-wp-flowplayer-notice-small { color: <?php echo trim($this->conf['timeColor']); ?>; position: absolute; top: 1%; left: 1%; z-index: 2; }
2
  #content .flowplayer.is-mouseout .fv-wp-flowplayer-notice-small, .flowplayer.is-mouseout .fv-wp-flowplayer-notice-small { top: 1%; -webkit-transition:top .15s .3s;-moz-transition:top .15s .3s;transition:top .15s .3s }
3
  #content .flowplayer.is-mouseover.is-ready .fv-wp-flowplayer-notice-small, .flowplayer.is-mouseover.is-ready .fv-wp-flowplayer-notice-small { top: 32px }
4
  #content .fv-wp-flowplayer-notice, .fv-wp-flowplayer-notice { color: black !important; background-color: #FFFFE0; border-color: #E6DB55; margin: -1%; padding: 0 0.6em; border-radius: 3px 3px 3px 3px; border-style: solid; border-width: 1px; line-height: 15px; z-index: 100; width: 97%; font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif }
@@ -8,10 +8,12 @@
8
  .fv-wp-flowplayer-notice p tt { color: #000; }
9
  .fv-wp-flowplayer-notice p tt.bluelink { color: #4189A7; }
10
 
 
 
11
  #content .fv-wp-flowplayer-notice blockquote, #content .fv-wp-flowplayer-notice pre, .fv-wp-flowplayer-notice blockquote, .fv-wp-flowplayer-notice pre { padding: 5px; margin: 0; }
12
  .fv-wp-flowplayer-notice textarea.wpfp_message_field { border: 1px solid #dedede; color: #8f8f8f; font-size: 12px; padding: 1%; }
13
  .fv-wp-flowplayer-notice input[type="button"] { border: 1px solid #960c0c; color: #fff; border-radius: 4px; padding: 5px 8px; box-shadow: inset 0 0 1px #de3232; background: #ad1010; font-size: 12px; line-height: 18px; float: right; margin-bottom: 8px; }
14
- #content .fv-wp-flowplayer-notice a.techinfo, .fv-wp-flowplayer-notice a.techinfo { background-image:url(img/techinfo.png); color: gray; background-repeat: no-repeat; background-position: left center; display: inline-block; min-height: 18px; padding-left: 24px; margin-top: 5px; }
15
  #content .fv-wp-flowplayer-notice.fv-wp-flowplayer-error, .fv-wp-flowplayer-notice.fv-wp-flowplayer-error { background-color: #FFEBE8; border-color: #CC0000; }
16
  #content .fv-wp-flowplayer-notice.fv-wp-flowplayer-notice, .fv-wp-flowplayer-notice.fv-wp-flowplayer-notice { background-color: #EDEDED; border-color: #c0c0c0; box-shadow: 0 0 4px #ccc; }
17
  .fv-wp-flowplayer-notice-small .fv_wp_flowplayer_notice_head { display: none; }
@@ -42,5 +44,5 @@
42
 
43
 
44
 
45
- .flowplayer-wrapper { min-width: 50%; display: inline-block; float: right;}
46
  @media only screen and (max-width: 940px) {.flowplayer-wrapper { width: 100%; float: none;} .form-table2.flowplayer-settings {width: 100% !important;}}
1
+ #content .fv-wp-flowplayer-notice-small, .fv-wp-flowplayer-notice-small { position: absolute; top: 1%; left: 1%; z-index: 2; }
2
  #content .flowplayer.is-mouseout .fv-wp-flowplayer-notice-small, .flowplayer.is-mouseout .fv-wp-flowplayer-notice-small { top: 1%; -webkit-transition:top .15s .3s;-moz-transition:top .15s .3s;transition:top .15s .3s }
3
  #content .flowplayer.is-mouseover.is-ready .fv-wp-flowplayer-notice-small, .flowplayer.is-mouseover.is-ready .fv-wp-flowplayer-notice-small { top: 32px }
4
  #content .fv-wp-flowplayer-notice, .fv-wp-flowplayer-notice { color: black !important; background-color: #FFFFE0; border-color: #E6DB55; margin: -1%; padding: 0 0.6em; border-radius: 3px 3px 3px 3px; border-style: solid; border-width: 1px; line-height: 15px; z-index: 100; width: 97%; font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif }
8
  .fv-wp-flowplayer-notice p tt { color: #000; }
9
  .fv-wp-flowplayer-notice p tt.bluelink { color: #4189A7; }
10
 
11
+ #content .fv-wp-flowplayer-notice a { color: #800 !important; }
12
+
13
  #content .fv-wp-flowplayer-notice blockquote, #content .fv-wp-flowplayer-notice pre, .fv-wp-flowplayer-notice blockquote, .fv-wp-flowplayer-notice pre { padding: 5px; margin: 0; }
14
  .fv-wp-flowplayer-notice textarea.wpfp_message_field { border: 1px solid #dedede; color: #8f8f8f; font-size: 12px; padding: 1%; }
15
  .fv-wp-flowplayer-notice input[type="button"] { border: 1px solid #960c0c; color: #fff; border-radius: 4px; padding: 5px 8px; box-shadow: inset 0 0 1px #de3232; background: #ad1010; font-size: 12px; line-height: 18px; float: right; margin-bottom: 8px; }
16
+ #content .fv-wp-flowplayer-notice a.techinfo, .fv-wp-flowplayer-notice a.techinfo { background-image:url(img/techinfo.png); color: gray !important; background-repeat: no-repeat; background-position: left center; display: inline-block; min-height: 18px; padding-left: 24px; margin-top: 5px; }
17
  #content .fv-wp-flowplayer-notice.fv-wp-flowplayer-error, .fv-wp-flowplayer-notice.fv-wp-flowplayer-error { background-color: #FFEBE8; border-color: #CC0000; }
18
  #content .fv-wp-flowplayer-notice.fv-wp-flowplayer-notice, .fv-wp-flowplayer-notice.fv-wp-flowplayer-notice { background-color: #EDEDED; border-color: #c0c0c0; box-shadow: 0 0 4px #ccc; }
19
  .fv-wp-flowplayer-notice-small .fv_wp_flowplayer_notice_head { display: none; }
44
 
45
 
46
 
47
+ .flowplayer-wrapper { width: 54%; display: inline-block; float: right;}
48
  @media only screen and (max-width: 940px) {.flowplayer-wrapper { width: 100%; float: none;} .form-table2.flowplayer-settings {width: 100% !important;}}
css/colorbox.css CHANGED
@@ -5,8 +5,8 @@ ColorBox Core Style
5
  The following rules are the styles that are consistant between themes.
6
  Avoid changing this area to maintain compatability with future versions of ColorBox.
7
  */
8
- #colorbox, #cboxOverlay, #cboxWrapper, #colorbox.fv-flowplayer-shortcode-editor, #cboxOverlay.fv-flowplayer-shortcode-editor, #cboxWrapper.fv-flowplayer-shortcode-editor{position:absolute; top:0; left:0; z-index:100; overflow:hidden;}
9
- #cboxOverlay, #cboxOverlay.fv-flowplayer-shortcode-editor{position:fixed; width:100%; height:100%; z-index: 100}
10
  #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
11
  #cboxContent{position:relative; overflow:hidden;}
12
  #cboxLoadedContent{overflow:auto;}
5
  The following rules are the styles that are consistant between themes.
6
  Avoid changing this area to maintain compatability with future versions of ColorBox.
7
  */
8
+ #colorbox, #cboxOverlay, #cboxWrapper, #colorbox.fv-flowplayer-shortcode-editor, #cboxOverlay.fv-flowplayer-shortcode-editor, #cboxWrapper.fv-flowplayer-shortcode-editor{position:absolute; top:0; left:0; z-index:1001; overflow:hidden;}
9
+ #cboxOverlay, #cboxOverlay.fv-flowplayer-shortcode-editor{position:fixed; width:100%; height:100%; z-index: 1000}
10
  #cboxMiddleLeft, #cboxBottomLeft{clear:left;}
11
  #cboxContent{position:relative; overflow:hidden;}
12
  #cboxLoadedContent{overflow:auto;}
css/flowplayer.css CHANGED
@@ -1,11 +1,11 @@
1
  .flowplayer{position:relative;width:100%;background-size:contain;background-repeat:no-repeat;background-position:center center;display:inline-block; -webkit-backface-visibility: hidden }
2
  .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}
3
  .flowplayer a:focus{outline:0}
4
- .flowplayer video{width:100%}
5
  .flowplayer.is-ipad video{-webkit-transform:translateX(-2048px);}
6
  .is-ready.flowplayer.is-ipad video{-webkit-transform:translateX(0)}
7
  .flowplayer .fp-engine,.flowplayer .fp-ui,.flowplayer .fp-message{position:absolute;top:0;left:0;width:100%;height:100%;cursor:pointer;z-index:1}
8
- .flowplayer .fp-message{display:none;text-align:center;cursor:default;}
9
  .flowplayer .fp-message h2{font-size:120%;margin-bottom:1em}
10
  .flowplayer .fp-message p{color:#666;font-size:95%}
11
  .flowplayer .fp-controls{position:absolute;bottom:0;width:100%;}
@@ -14,7 +14,7 @@
14
  .is-mouseover.flowplayer .fp-controls{bottom:0}
15
  .flowplayer .fp-waiting{/*display:none;*/margin:19% auto;text-align:center; height: 0; }
16
  .flowplayer .fp-waiting *{-webkit-box-shadow:0 0 5px #333;-moz-box-shadow:0 0 5px #333;box-shadow:0 0 5px #333}
17
- .flowplayer .fp-waiting em{width:0em;height:0em;-webkit-border-radius:1em;-moz-border-radius:1em;border-radius:1em;background-color:rgba(255,255,255,0.8);display:inline-block; -webkit-animation:pulse .6s infinite;-moz-animation:pulse .6s infinite;animation:pulse .6s infinite;margin:.3em;opacity:0;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=0);}
18
  .flowplayer .fp-waiting em:nth-child(1){-webkit-animation-delay:.3s;-moz-animation-delay:.3s;animation-delay:.3s}
19
  .flowplayer .fp-waiting em:nth-child(2){-webkit-animation-delay:.45s;-moz-animation-delay:.45s;animation-delay:.45s}
20
  .flowplayer .fp-waiting em:nth-child(3){-webkit-animation-delay:.6s;-moz-animation-delay:.6s;animation-delay:.6s}
@@ -39,24 +39,25 @@
39
  .is-rtl.flowplayer .fp-fullscreen,.is-rtl.flowplayer .fp-unload,.is-rtl.flowplayer .fp-mute,.is-rtl.flowplayer .fp-embed,.is-rtl.flowplayer .fp-close,.is-rtl.flowplayer .fp-play{background-image:url(img/white_rtl.png)}
40
  .color-light.flowplayer .fp-fullscreen,.color-light.flowplayer .fp-unload,.color-light.flowplayer .fp-mute,.color-light.flowplayer .fp-embed,.color-light.flowplayer .fp-close,.color-light.flowplayer .fp-play{background-image:url(img/black.png);}
41
  .is-rtl.color-light.flowplayer .fp-fullscreen,.is-rtl.color-light.flowplayer .fp-unload,.is-rtl.color-light.flowplayer .fp-mute,.is-rtl.color-light.flowplayer .fp-embed,.is-rtl.color-light.flowplayer .fp-close,.is-rtl.color-light.flowplayer .fp-play{background-image:url(img/black_rtl.png)}
42
- @media (-webkit-min-device-pixel-ratio: 2){.color-light.flowplayer .fp-fullscreen,.color-light.flowplayer .fp-unload,.color-light.flowplayer .fp-mute,.color-light.flowplayer .fp-embed,.color-light.flowplayer .fp-close,.color-light.flowplayer .fp-play{background-image:url(img/black@x2.png)}
43
- .is-rtl.color-light.flowplayer .fp-fullscreen,.is-rtl.color-light.flowplayer .fp-unload,.is-rtl.color-light.flowplayer .fp-mute,.is-rtl.color-light.flowplayer .fp-embed,.is-rtl.color-light.flowplayer .fp-close,.is-rtl.color-light.flowplayer .fp-play{background-image:url(img/black_rtl@x2.png)}
44
- }@media (-webkit-min-device-pixel-ratio: 2){.flowplayer .fp-fullscreen,.flowplayer .fp-unload,.flowplayer .fp-mute,.flowplayer .fp-embed,.flowplayer .fp-close,.flowplayer .fp-play{background-image:url(img/white@x2.png)}
45
- .is-rtl.flowplayer .fp-fullscreen,.is-rtl.flowplayer .fp-unload,.is-rtl.flowplayer .fp-mute,.is-rtl.flowplayer .fp-embed,.is-rtl.flowplayer .fp-close,.is-rtl.flowplayer .fp-play{background-image:url(img/white_rtl@x2.png)}
46
- }.is-splash.flowplayer .fp-ui,.is-paused.flowplayer .fp-ui{background:url(img/play_white.png) center no-repeat;background-size:12%;}
 
47
  .is-error.flowplayer .fp-ui{background:url(img/no_play_white.png) center no-repeat;background-size:12%;}
48
  .is-rtl.is-splash.flowplayer .fp-ui,.is-rtl.is-paused.flowplayer .fp-ui{background:url(img/play_white_rtl.png) center no-repeat;background-size:12%}
49
- @media (-webkit-min-device-pixel-ratio: 2){.is-splash.flowplayer .fp-ui,.is-paused.flowplayer .fp-ui{background:url(img/play_white@x2.png) center no-repeat;background-size:12%}
50
- .is-error.flowplayer .fp-ui {background:url(img/no_play_white@x2.png) center no-repeat;background-size:12%}
51
- .is-rtl.is-splash.flowplayer .fp-ui,.is-rtl.is-paused.flowplayer .fp-ui{background:url(img/play_white_rtl@x2.png) center no-repeat;background-size:12%}
52
  }.color-light.is-splash.flowplayer .fp-ui,.color-light.is-paused.flowplayer .fp-ui{background-image:url(img/play_black.png);}
53
  .is-rtl.color-light.is-splash.flowplayer .fp-ui,.is-rtl.color-light.is-paused.flowplayer .fp-ui{background-image:url(img/play_black_rtl.png)}
54
- @media (-webkit-min-device-pixel-ratio: 2){.color-light.is-splash.flowplayer .fp-ui,.color-light.is-paused.flowplayer .fp-ui{background-image:url(img/play_black@x2.png);}
55
- .is-rtl.color-light.is-splash.flowplayer .fp-ui,.is-rtl.color-light.is-paused.flowplayer .fp-ui{background-image:url(img/play_black_rtl@x2.png)}
56
  }.is-fullscreen.flowplayer .fp-ui{background-size:auto}
57
  .is-seeking.flowplayer .fp-ui,.is-loading.flowplayer .fp-ui{background-image:none}
58
  .flowplayer .fp-logo{position:absolute;top:auto;left:15px;bottom:30px;cursor:pointer;display:none;z-index:100;}
59
- .flowplayer .fp-logo img{width:100%; border-radius: 0; box-shadow: none;}
60
  .is-embedded.flowplayer .fp-logo{display:block}
61
  .fixed-controls.flowplayer .fp-logo{bottom:15px}
62
  .flowplayer .fp-fullscreen,.flowplayer .fp-unload,.flowplayer .fp-close{position:absolute;top:5px;left:auto;right:5px;display:block;width:30px;height:21px;background-position:12px -197px;cursor:pointer;}
@@ -101,6 +102,7 @@
101
  .is-rtl.play-button.no-time.flowplayer .fp-timeline,.is-rtl.play-button.aside-time.flowplayer .fp-timeline{margin-right:27px}
102
  .flowplayer .fp-buffer,.flowplayer .fp-progress{position:absolute;top:0;left:auto;height:100%;cursor:col-resize}
103
  .flowplayer .fp-buffer{-webkit-transition:width .25s linear;-moz-transition:width .25s linear;transition:width .25s linear}
 
104
  .flowplayer.is-touch .fp-timeline{overflow:visible}
105
  .flowplayer.is-touch .fp-progress{-webkit-transition:width .2s linear;-moz-transition:width .2s linear;transition:width .2s linear}
106
  .flowplayer.is-touch .fp-timeline.is-dragging .fp-progress{-webkit-transition:right .1s linear,border .1s linear,top .1s linear,left .1s linear;-moz-transition:right .1s linear,border .1s linear,top .1s linear,left .1s linear;transition:right .1s linear,border .1s linear,top .1s linear,left .1s linear}
@@ -149,18 +151,20 @@
149
  .flowplayer.is-splash,.flowplayer.is-poster{cursor:pointer;}
150
  .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{display:none !important}
151
  .flowplayer.is-poster .fp-engine{top:-9999em}
152
- .flowplayer.is-loading video.fp-engine{position:absolute;top:-9999em}
153
  .flowplayer.is-loading .fp-waiting {height: 1em;}
154
  .flowplayer.is-loading .fp-waiting em {width:1em;height:1em;}
155
  .flowplayer.is-loading .fp-controls,.flowplayer.is-loading .fp-time{display:none}
156
  .flowplayer.is-loading .fp-ui{background-position:-9999em}
 
157
  .flowplayer.is-seeking .fp-waiting {height: 1em;}
158
  .flowplayer.is-seeking .fp-waiting em {width:1em;height:1em;}
 
 
159
  .flowplayer.is-fullscreen{position:fixed !important;top:0 !important;left:0 !important;border:0 !important;margin:0 !important;width:100% !important;height:100% !important;max-width:100% !important;max-height:100% !important;z-index:99999 !important;-webkit-box-shadow:0 !important;-moz-box-shadow:0 !important;box-shadow:0 !important;background-image:none !important;background-color:#000 !important;}
160
  .is-rtl.flowplayer.is-fullscreen{left:auto !important;right:0 !important}
161
- .flowplayer.is-error {border:1px solid #909090;}
162
  .flowplayer.is-error h2{font-weight:bold;font-size:large;margin-top:10%}
163
- .flowplayer.is-error .fp-message{display:block; background: rgba(255, 255, 255, 0.75) !important;}
164
  .flowplayer.is-error object,.flowplayer.is-error video,.flowplayer.is-error .fp-controls,.flowplayer.is-error .fp-time,.flowplayer.is-error .fp-subtitle{display:none}
165
  .flowplayer.is-ready.is-muted .fp-mute{opacity:.5;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=50)}
166
  .flowplayer.is-mouseout .fp-controls{height:0;-webkit-transition:height .15s .3s;-moz-transition:height .15s .3s;transition:height .15s .3s}
@@ -175,6 +179,9 @@
175
  .flowplayer.fixed-controls .fp-time em{bottom:-15px;opacity:1;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100);}
176
  .is-fullscreen.flowplayer.fixed-controls .fp-time em{bottom:5px}
177
  .flowplayer.is-disabled .fp-progress{background-color:#999}
 
 
 
178
  .flowplayer .fp-embed{position:absolute;top:5px;left:5px;display:block;width:25px;height:20px;background-position:3px -237px;}
179
  .is-rtl.flowplayer .fp-embed{background-position:22px -237px;left:auto;right:5px}
180
 
@@ -226,23 +233,56 @@
226
  .is-rtl.flowplayer .fvp-share-bar{left:auto;}
227
  .flowplayer .fvp-share-bar textarea{width:400px;min-height:130px;font-family: "Lucida Console", Monaco, monospace; color:#777; white-space:nowrap; resize:none;overflow:hidden;border:0;outline:0;background-color:transparent;color:#ccc; border: 1px solid #888;}
228
  .flowplayer.is-embedding .fp-embed,.flowplayer.is-embedding .fvp-share-bar{display:block;opacity:1;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100)}
229
- .fvp-share-bar .fvp-sharing, #content .fvp-share-bar .fvp-sharing {
 
 
 
 
 
 
 
230
  /*clear: both;
231
  width: 102px;*/
232
  min-height: 24px;
233
- margin: 7px auto;
234
- float:left;
235
- font-family:"Lucida Console", Monaco, monospace
 
 
 
 
236
  }
237
  .fvp-share-bar label {
238
- text-align: center;
 
 
 
 
 
 
 
239
  }
240
-
241
  .fvp-share-bar .fvp-sharing li {
242
  float: left;
243
  display: inline-block;
244
- margin: 0 5px;
245
- padding: 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
246
  }
247
 
248
  .fvp-share-bar .fvp-sharing a {
@@ -278,7 +318,7 @@
278
  #content .flowplayer .fvp-share-bar textarea, .flowplayer .fvp-share-bar textarea { padding: 3px; line-height: 1.4; white-space: pre-wrap; color: black !important; height: auto; min-height: 130px; width: 99%; font-size: 10px; background-color:rgba(255, 255, 255, 1); box-shadow: none; border-radius: 0; cursor: text; }
279
  #content .flowplayer.is-ready .fvp-share-bar.visible .embed-code, .flowplayer.is-ready .fvp-share-bar.visible .embed-code { display: block; }
280
  /*#content .flowplayer.is-ready .fp-embed-code.visible textarea, .flowplayer.is-ready .fp-embed-code.visible textarea { height: 140px; }*/
281
- a.embed-code-toggle { font-weight: bold; color: white; }
282
 
283
  .flowplayer .fp-prev, .flowplayer .fp-next{/* next and prev buttons */position:absolute;top:44%;cursor:pointer;-webkit-transition:opacity .5s;-moz-transition:opacity .5s;transition:opacity .5s;background:url("img/playlist-buttons.png");opacity:0;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=0);height:20px;width:12px;}
284
  .is-mouseover.is-ready.flowplayer .fp-prev,.is-mouseover.is-ready.flowplayer .fp-next{opacity:1;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100)}
@@ -348,8 +388,13 @@ a #add-format, a #add-rtmp {
348
 
349
  .wpfp_custom_ad_content h1, .wpfp_custom_ad_content h2, .wpfp_custom_ad_content h3, .wpfp_custom_ad_content h4, .wpfp_custom_ad_content h5, .wpfp_custom_ad_content p { padding: 0 5px 2px 5px; margin: 0 5px 2px 5px; }
350
 
351
- .flowplayer.alignleft { margin-right: 10px; margin-bottom: 10px; }
352
- .flowplayer.alignright { margin-left: 10px; margin-bottom: 10px; }
 
 
 
 
 
353
 
354
  /*
355
  MediaElement.js
@@ -360,7 +405,28 @@ MediaElement.js
360
  .mejs-controls .mejs-button button{cursor:pointer;display:block;font-size:0;line-height:0;text-decoration:none;margin:7px 5px;padding:0;position:absolute;height:16px;width:16px;border:0;background:transparent url(controls.svg) no-repeat;}.no-svg .mejs-controls .mejs-button button{background-image:url(controls.png);}.mejs-controls .mejs-button button:focus{outline:solid 1px yellow;}.mejs-container .mejs-controls .mejs-time{color:#fff;display:block;height:17px;width:auto;padding:8px 3px 0 3px;overflow:hidden;text-align:center;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;}.mejs-container .mejs-controls .mejs-time span{color:#fff;font-size:11px;line-height:12px;display:block;float:left;margin:1px 2px 0 0;width:auto;}.mejs-controls .mejs-play button{background-position:0 0;}.mejs-controls .mejs-pause button{background-position:0 -16px;}.mejs-controls .mejs-stop button{background-position:-112px 0;}.mejs-controls div.mejs-time-rail{width:200px;padding-top:5px;}.mejs-controls .mejs-time-rail span{display:block;position:absolute;width:180px;height:10px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;cursor:pointer;}.mejs-controls .mejs-time-rail .mejs-time-total{margin:5px;background:#333;background:rgba(50,50,50,0.8);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(30,30,30,0.8)),to(rgba(60,60,60,0.8)));background:-webkit-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-moz-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-o-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-ms-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:linear-gradient(rgba(30,30,30,0.8),rgba(60,60,60,0.8));}.mejs-controls .mejs-time-rail .mejs-time-buffering{width:100%;background-image:-o-linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-ms-linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);-webkit-background-size:15px 15px;-moz-background-size:15px 15px;-o-background-size:15px 15px;background-size:15px 15px;-webkit-animation:buffering-stripes 2s linear infinite;-moz-animation:buffering-stripes 2s linear infinite;-ms-animation:buffering-stripes 2s linear infinite;-o-animation:buffering-stripes 2s linear infinite;animation:buffering-stripes 2s linear infinite;}@-webkit-keyframes buffering-stripes{from{background-position:0 0;}to{background-position:30px 0;}}@-moz-keyframes buffering-stripes{from{background-position:0 0;}to{background-position:30px 0;}}@-ms-keyframes buffering-stripes{from{background-position:0 0;}to{background-position:30px 0;}}@-o-keyframes buffering-stripes{from{background-position:0 0;}to{background-position:30px 0;}}@keyframes buffering-stripes{from{background-position:0 0;}to{background-position:30px 0;}}.mejs-controls .mejs-time-rail .mejs-time-loaded{background:#3caac8;background:rgba(60,170,200,0.8);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(44,124,145,0.8)),to(rgba(78,183,212,0.8)));background:-webkit-linear-gradient(top,rgba(44,124,145,0.8),rgba(78,183,212,0.8));background:-moz-linear-gradient(top,rgba(44,124,145,0.8),rgba(78,183,212,0.8));background:-o-linear-gradient(top,rgba(44,124,145,0.8),rgba(78,183,212,0.8));background:-ms-linear-gradient(top,rgba(44,124,145,0.8),rgba(78,183,212,0.8));background:linear-gradient(rgba(44,124,145,0.8),rgba(78,183,212,0.8));width:0;}.mejs-controls .mejs-time-rail .mejs-time-current{background:#fff;background:rgba(255,255,255,0.8);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(255,255,255,0.9)),to(rgba(200,200,200,0.8)));background:-webkit-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-moz-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-o-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-ms-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:linear-gradient(rgba(255,255,255,0.9),rgba(200,200,200,0.8));width:0;}.mejs-controls .mejs-time-rail .mejs-time-handle{display:none;position:absolute;margin:0;width:10px;background:#fff;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;cursor:pointer;border:solid 2px #333;top:-2px;text-align:center;}.mejs-controls .mejs-time-rail .mejs-time-float{position:absolute;display:none;background:#eee;width:36px;height:17px;border:solid 1px #333;top:-26px;margin-left:-18px;text-align:center;color:#111;}.mejs-controls .mejs-time-rail .mejs-time-float-current{margin:2px;width:30px;display:block;text-align:center;left:0;}.mejs-controls .mejs-time-rail .mejs-time-float-corner{position:absolute;display:block;width:0;height:0;line-height:0;border:solid 5px #eee;border-color:#eee transparent transparent transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;top:15px;left:13px;}.mejs-long-video .mejs-controls .mejs-time-rail .mejs-time-float{width:48px;}.mejs-long-video .mejs-controls .mejs-time-rail .mejs-time-float-current{width:44px;}.mejs-long-video .mejs-controls .mejs-time-rail .mejs-time-float-corner{left:18px;}.mejs-controls .mejs-fullscreen-button button{background-position:-32px 0;}.mejs-controls .mejs-unfullscreen button{background-position:-32px -16px;}.mejs-controls .mejs-mute button{background-position:-16px -16px;}.mejs-controls .mejs-unmute button{background-position:-16px 0;}.mejs-controls .mejs-volume-button{position:relative;}.mejs-controls .mejs-volume-button .mejs-volume-slider{display:none;height:115px;width:25px;background:url(background.png);background:rgba(50,50,50,0.7);-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;top:-115px;left:0;z-index:1;position:absolute;margin:0;}.mejs-controls .mejs-volume-button:hover{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-total{position:absolute;left:11px;top:8px;width:2px;height:100px;background:#ddd;background:rgba(255,255,255,0.5);margin:0;}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-current{position:absolute;left:11px;top:8px;width:2px;height:100px;background:#ddd;background:rgba(255,255,255,0.9);margin:0;}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-handle{position:absolute;left:4px;top:-3px;width:16px;height:6px;background:#ddd;background:rgba(255,255,255,0.9);cursor:N-resize;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;margin:0;}.mejs-controls div.mejs-horizontal-volume-slider{height:26px;width:60px;position:relative;}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total{position:absolute;left:0;top:11px;width:50px;height:8px;margin:0;padding:0;font-size:1px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;background:#333;background:rgba(50,50,50,0.8);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(30,30,30,0.8)),to(rgba(60,60,60,0.8)));background:-webkit-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-moz-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-o-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-ms-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:linear-gradient(rgba(30,30,30,0.8),rgba(60,60,60,0.8));}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current{position:absolute;left:0;top:11px;width:50px;height:8px;margin:0;padding:0;font-size:1px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;background:#fff;background:rgba(255,255,255,0.8);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(255,255,255,0.9)),to(rgba(200,200,200,0.8)));background:-webkit-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-moz-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-o-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-ms-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:linear-gradient(rgba(255,255,255,0.9),rgba(200,200,200,0.8));}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-handle{display:none;}.mejs-controls .mejs-captions-button{position:relative;}.mejs-controls .mejs-captions-button button{background-position:-48px 0;}.mejs-controls .mejs-captions-button .mejs-captions-selector{visibility:hidden;position:absolute;bottom:26px;right:-10px;width:130px;height:100px;background:url(background.png);background:rgba(50,50,50,0.7);border:solid 1px transparent;padding:10px;overflow:hidden;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul{margin:0;padding:0;display:block;list-style-type:none!important;overflow:hidden;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li{margin:0 0 6px 0;padding:0;list-style-type:none!important;display:block;color:#fff;overflow:hidden;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li input{clear:both;float:left;margin:3px 3px 0 5px;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li label{width:100px;float:left;padding:4px 0 0 0;line-height:15px;font-family:helvetica,arial;font-size:10px;}.mejs-controls .mejs-captions-button .mejs-captions-translations{font-size:10px;margin:0 0 5px 0;}.mejs-chapters{position:absolute;top:0;left:0;-xborder-right:solid 1px #fff;width:10000px;z-index:1;}.mejs-chapters .mejs-chapter{position:absolute;float:left;background:#222;background:rgba(0,0,0,0.7);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(50,50,50,0.7)),to(rgba(0,0,0,0.7)));background:-webkit-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-moz-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-o-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-ms-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:linear-gradient(rgba(50,50,50,0.7),rgba(0,0,0,0.7));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,startColorstr=#323232,endColorstr=#000000);overflow:hidden;border:0;}.mejs-chapters .mejs-chapter .mejs-chapter-block{font-size:11px;color:#fff;padding:5px;display:block;border-right:solid 1px #333;border-bottom:solid 1px #333;cursor:pointer;}.mejs-chapters .mejs-chapter .mejs-chapter-block-last{border-right:none;}.mejs-chapters .mejs-chapter .mejs-chapter-block:hover{background:#666;background:rgba(102,102,102,0.7);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(102,102,102,0.7)),to(rgba(50,50,50,0.6)));background:-webkit-linear-gradient(top,rgba(102,102,102,0.7),rgba(50,50,50,0.6));background:-moz-linear-gradient(top,rgba(102,102,102,0.7),rgba(50,50,50,0.6));background:-o-linear-gradient(top,rgba(102,102,102,0.7),rgba(50,50,50,0.6));background:-ms-linear-gradient(top,rgba(102,102,102,0.7),rgba(50,50,50,0.6));background:linear-gradient(rgba(102,102,102,0.7),rgba(50,50,50,0.6));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,startColorstr=#666666,endColorstr=#323232);}.mejs-chapters .mejs-chapter .mejs-chapter-block .ch-title{font-size:12px;font-weight:bold;display:block;white-space:nowrap;text-overflow:ellipsis;margin:0 0 3px 0;line-height:12px;}.mejs-chapters .mejs-chapter .mejs-chapter-block .ch-timespan{font-size:12px;line-height:12px;margin:3px 0 4px 0;display:block;white-space:nowrap;text-overflow:ellipsis;}.mejs-captions-layer{position:absolute;bottom:0;left:0;text-align:center;line-height:22px;font-size:12px;color:#fff;}.mejs-captions-layer a{color:#fff;text-decoration:underline;}.mejs-captions-layer[lang=ar]{font-size:20px;font-weight:normal;}.mejs-captions-position{position:absolute;width:100%;bottom:15px;left:0;}.mejs-captions-position-hover{bottom:45px;}.mejs-captions-text{padding:3px 5px;background:url(background.png);background:rgba(20,20,20,0.8);}.me-cannotplay a{color:#fff;font-weight:bold;}.me-cannotplay span{padding:15px;display:block;}.mejs-controls .mejs-loop-off button{background-position:-64px -16px;}.mejs-controls .mejs-loop-on button{background-position:-64px 0;}.mejs-controls .mejs-backlight-off button{background-position:-80px -16px;}.mejs-controls .mejs-backlight-on button{background-position:-80px 0;}.mejs-controls .mejs-picturecontrols-button{background-position:-96px 0;}.mejs-contextmenu{position:absolute;width:150px;padding:10px;border-radius:4px;top:0;left:0;background:#fff;border:solid 1px #999;z-index:1001;}.mejs-contextmenu .mejs-contextmenu-separator{height:1px;font-size:0;margin:5px 6px;background:#333;}.mejs-contextmenu .mejs-contextmenu-item{font-family:Helvetica,Arial;font-size:12px;padding:4px 6px;cursor:pointer;color:#333;}.mejs-contextmenu .mejs-contextmenu-item:hover{background:#2C7C91;color:#fff;}.mejs-controls .mejs-sourcechooser-button{position:relative;}.mejs-controls .mejs-sourcechooser-button button{background-position:-128px 0;}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector{visibility:hidden;position:absolute;bottom:26px;right:-10px;width:130px;height:100px;background:url(background.png);background:rgba(50,50,50,0.7);border:solid 1px transparent;padding:10px;overflow:hidden;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul{margin:0;padding:0;display:block;list-style-type:none!important;overflow:hidden;}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul li{margin:0 0 6px 0;padding:0;list-style-type:none!important;display:block;color:#fff;overflow:hidden;}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul li input{clear:both;float:left;margin:3px 3px 0 5px;}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul li label{width:100px;float:left;padding:4px 0 0 0;line-height:15px;font-family:helvetica,arial;font-size:10px;}.mejs-postroll-layer{position:absolute;bottom:0;left:0;width:100%;height:100%;background:url(background.png);background:rgba(50,50,50,0.7);z-index:1000;overflow:hidden;}.mejs-postroll-layer-content{width:100%;height:100%;}.mejs-postroll-close{position:absolute;right:0;top:0;background:url(background.png);background:rgba(50,50,50,0.7);color:#fff;padding:4px;z-index:100;cursor:pointer;}
361
 
362
  .fvfp_admin_error { position: absolute; top: 10%; z-index: 2; text-align: center; width: 100%; /*color: #fff;*/ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
363
  .fvfp_admin_error a { /*color: #fff;*/ text-decoration: underline; }
364
  #content .fvfp_admin_error a { /*color: #fff;*/ text-decoration: underline; }
365
  .fvfp_admin_error_content { /*background: #dd0000;*/ padding: 1% 5%; width: 65%; margin: 0 auto; -webkit-box-shadow: 3px 3px 30px 0px rgba(50, 50, 50, 0.96); -moz-box-shadow: 3px 3px 30px 0px rgba(50, 50, 50, 0.96); box-shadow: 3px 3px 30px 0px rgba(50, 50, 50, 0.96);}
366
-
 
 
 
 
 
1
  .flowplayer{position:relative;width:100%;background-size:contain;background-repeat:no-repeat;background-position:center center;display:inline-block; -webkit-backface-visibility: hidden }
2
  .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}
3
  .flowplayer a:focus{outline:0}
4
+ .flowplayer video{width:100%; background: black;}
5
  .flowplayer.is-ipad video{-webkit-transform:translateX(-2048px);}
6
  .is-ready.flowplayer.is-ipad video{-webkit-transform:translateX(0)}
7
  .flowplayer .fp-engine,.flowplayer .fp-ui,.flowplayer .fp-message{position:absolute;top:0;left:0;width:100%;height:100%;cursor:pointer;z-index:1}
8
+ .flowplayer .fp-message{display:none;text-align:center;padding-top:5%;cursor:default;}
9
  .flowplayer .fp-message h2{font-size:120%;margin-bottom:1em}
10
  .flowplayer .fp-message p{color:#666;font-size:95%}
11
  .flowplayer .fp-controls{position:absolute;bottom:0;width:100%;}
14
  .is-mouseover.flowplayer .fp-controls{bottom:0}
15
  .flowplayer .fp-waiting{/*display:none;*/margin:19% auto;text-align:center; height: 0; }
16
  .flowplayer .fp-waiting *{-webkit-box-shadow:0 0 5px #333;-moz-box-shadow:0 0 5px #333;box-shadow:0 0 5px #333}
17
+ .flowplayer .fp-waiting em{width:0em;height:0em;-webkit-border-radius:1em;-moz-border-radius:1em;border-radius:1em;background-color:rgba(255,255,255,0.8);display:inline-block;-webkit-animation:pulse .6s infinite;-moz-animation:pulse .6s infinite;animation:pulse .6s infinite;margin:.3em;opacity:0;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=0);}
18
  .flowplayer .fp-waiting em:nth-child(1){-webkit-animation-delay:.3s;-moz-animation-delay:.3s;animation-delay:.3s}
19
  .flowplayer .fp-waiting em:nth-child(2){-webkit-animation-delay:.45s;-moz-animation-delay:.45s;animation-delay:.45s}
20
  .flowplayer .fp-waiting em:nth-child(3){-webkit-animation-delay:.6s;-moz-animation-delay:.6s;animation-delay:.6s}
39
  .is-rtl.flowplayer .fp-fullscreen,.is-rtl.flowplayer .fp-unload,.is-rtl.flowplayer .fp-mute,.is-rtl.flowplayer .fp-embed,.is-rtl.flowplayer .fp-close,.is-rtl.flowplayer .fp-play{background-image:url(img/white_rtl.png)}
40
  .color-light.flowplayer .fp-fullscreen,.color-light.flowplayer .fp-unload,.color-light.flowplayer .fp-mute,.color-light.flowplayer .fp-embed,.color-light.flowplayer .fp-close,.color-light.flowplayer .fp-play{background-image:url(img/black.png);}
41
  .is-rtl.color-light.flowplayer .fp-fullscreen,.is-rtl.color-light.flowplayer .fp-unload,.is-rtl.color-light.flowplayer .fp-mute,.is-rtl.color-light.flowplayer .fp-embed,.is-rtl.color-light.flowplayer .fp-close,.is-rtl.color-light.flowplayer .fp-play{background-image:url(img/black_rtl.png)}
42
+ @media (-webkit-min-device-pixel-ratio: 2){.color-light.flowplayer .fp-fullscreen,.color-light.flowplayer .fp-unload,.color-light.flowplayer .fp-mute,.color-light.flowplayer .fp-embed,.color-light.flowplayer .fp-close,.color-light.flowplayer .fp-play{background-image:url(img/black-x2.png)}
43
+ .is-rtl.color-light.flowplayer .fp-fullscreen,.is-rtl.color-light.flowplayer .fp-unload,.is-rtl.color-light.flowplayer .fp-mute,.is-rtl.color-light.flowplayer .fp-embed,.is-rtl.color-light.flowplayer .fp-close,.is-rtl.color-light.flowplayer .fp-play{background-image:url(img/black_rtl-x2.png)}
44
+ }@media (-webkit-min-device-pixel-ratio: 2){.flowplayer .fp-fullscreen,.flowplayer .fp-unload,.flowplayer .fp-mute,.flowplayer .fp-embed,.flowplayer .fp-close,.flowplayer .fp-play{background-image:url(img/white-x2.png)}
45
+ .is-rtl.flowplayer .fp-fullscreen,.is-rtl.flowplayer .fp-unload,.is-rtl.flowplayer .fp-mute,.is-rtl.flowplayer .fp-embed,.is-rtl.flowplayer .fp-close,.is-rtl.flowplayer .fp-play{background-image:url(img/white_rtl-x2.png)}
46
+ }.flowplayer .fp-flash-disabled{background:#333;width:390px;margin:0 auto;position:absolute;bottom:0;color:#fff}
47
+ .is-splash.flowplayer .fp-ui,.is-paused.flowplayer .fp-ui{background:url(img/play_white.png) center no-repeat;background-size:12%;}
48
  .is-error.flowplayer .fp-ui{background:url(img/no_play_white.png) center no-repeat;background-size:12%;}
49
  .is-rtl.is-splash.flowplayer .fp-ui,.is-rtl.is-paused.flowplayer .fp-ui{background:url(img/play_white_rtl.png) center no-repeat;background-size:12%}
50
+ @media (-webkit-min-device-pixel-ratio: 2){.is-splash.flowplayer .fp-ui,.is-paused.flowplayer .fp-ui{background:url(img/play_white-x2.png) center no-repeat;background-size:12%}
51
+ .is-error.flowplayer .fp-ui {background:url(img/no_play_white-x2.png) center no-repeat;background-size:12%}
52
+ .is-rtl.is-splash.flowplayer .fp-ui,.is-rtl.is-paused.flowplayer .fp-ui{background:url(img/play_white_rtl-x2.png) center no-repeat;background-size:12%}
53
  }.color-light.is-splash.flowplayer .fp-ui,.color-light.is-paused.flowplayer .fp-ui{background-image:url(img/play_black.png);}
54
  .is-rtl.color-light.is-splash.flowplayer .fp-ui,.is-rtl.color-light.is-paused.flowplayer .fp-ui{background-image:url(img/play_black_rtl.png)}
55
+ @media (-webkit-min-device-pixel-ratio: 2){.color-light.is-splash.flowplayer .fp-ui,.color-light.is-paused.flowplayer .fp-ui{background-image:url(img/play_black-x2.png);}
56
+ .is-rtl.color-light.is-splash.flowplayer .fp-ui,.is-rtl.color-light.is-paused.flowplayer .fp-ui{background-image:url(img/play_black_rtl-x2.png)}
57
  }.is-fullscreen.flowplayer .fp-ui{background-size:auto}
58
  .is-seeking.flowplayer .fp-ui,.is-loading.flowplayer .fp-ui{background-image:none}
59
  .flowplayer .fp-logo{position:absolute;top:auto;left:15px;bottom:30px;cursor:pointer;display:none;z-index:100;}
60
+ .flowplayer .fp-logo img{width:100%; border-radius: 0; box-shadow: none; border: 0; background: transparent; }
61
  .is-embedded.flowplayer .fp-logo{display:block}
62
  .fixed-controls.flowplayer .fp-logo{bottom:15px}
63
  .flowplayer .fp-fullscreen,.flowplayer .fp-unload,.flowplayer .fp-close{position:absolute;top:5px;left:auto;right:5px;display:block;width:30px;height:21px;background-position:12px -197px;cursor:pointer;}
102
  .is-rtl.play-button.no-time.flowplayer .fp-timeline,.is-rtl.play-button.aside-time.flowplayer .fp-timeline{margin-right:27px}
103
  .flowplayer .fp-buffer,.flowplayer .fp-progress{position:absolute;top:0;left:auto;height:100%;cursor:col-resize}
104
  .flowplayer .fp-buffer{-webkit-transition:width .25s linear;-moz-transition:width .25s linear;transition:width .25s linear}
105
+ .flowplayer .fp-timeline.no-animation .fp-buffer{-webkit-transition:none;-moz-transition:none;transition:none}
106
  .flowplayer.is-touch .fp-timeline{overflow:visible}
107
  .flowplayer.is-touch .fp-progress{-webkit-transition:width .2s linear;-moz-transition:width .2s linear;transition:width .2s linear}
108
  .flowplayer.is-touch .fp-timeline.is-dragging .fp-progress{-webkit-transition:right .1s linear,border .1s linear,top .1s linear,left .1s linear;-moz-transition:right .1s linear,border .1s linear,top .1s linear,left .1s linear;transition:right .1s linear,border .1s linear,top .1s linear,left .1s linear}
151
  .flowplayer.is-splash,.flowplayer.is-poster{cursor:pointer;}
152
  .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{display:none !important}
153
  .flowplayer.is-poster .fp-engine{top:-9999em}
 
154
  .flowplayer.is-loading .fp-waiting {height: 1em;}
155
  .flowplayer.is-loading .fp-waiting em {width:1em;height:1em;}
156
  .flowplayer.is-loading .fp-controls,.flowplayer.is-loading .fp-time{display:none}
157
  .flowplayer.is-loading .fp-ui{background-position:-9999em}
158
+ .flowplayer.is-loading video.fp-engine{position:absolute;top:-9999em}
159
  .flowplayer.is-seeking .fp-waiting {height: 1em;}
160
  .flowplayer.is-seeking .fp-waiting em {width:1em;height:1em;}
161
+ .flowplayer.is-playing{background-image:none !important;background-color:#333;}
162
+ .flowplayer.is-playing.hls-fix.is-finished .fp-engine{position:absolute;top:-9999em}
163
  .flowplayer.is-fullscreen{position:fixed !important;top:0 !important;left:0 !important;border:0 !important;margin:0 !important;width:100% !important;height:100% !important;max-width:100% !important;max-height:100% !important;z-index:99999 !important;-webkit-box-shadow:0 !important;-moz-box-shadow:0 !important;box-shadow:0 !important;background-image:none !important;background-color:#000 !important;}
164
  .is-rtl.flowplayer.is-fullscreen{left:auto !important;right:0 !important}
165
+ .flowplayer.is-error{border:1px solid #909090;background:#fdfdfd !important;}
166
  .flowplayer.is-error h2{font-weight:bold;font-size:large;margin-top:10%}
167
+ .flowplayer.is-error .fp-message{display:block}
168
  .flowplayer.is-error object,.flowplayer.is-error video,.flowplayer.is-error .fp-controls,.flowplayer.is-error .fp-time,.flowplayer.is-error .fp-subtitle{display:none}
169
  .flowplayer.is-ready.is-muted .fp-mute{opacity:.5;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=50)}
170
  .flowplayer.is-mouseout .fp-controls{height:0;-webkit-transition:height .15s .3s;-moz-transition:height .15s .3s;transition:height .15s .3s}
179
  .flowplayer.fixed-controls .fp-time em{bottom:-15px;opacity:1;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100);}
180
  .is-fullscreen.flowplayer.fixed-controls .fp-time em{bottom:5px}
181
  .flowplayer.is-disabled .fp-progress{background-color:#999}
182
+ .flowplayer.is-flash-disabled{background-color:#333;}
183
+ .flowplayer.is-flash-disabled object.fp-engine{z-index:100}
184
+ .flowplayer.is-flash-disabled .fp-flash-disabled{display:block;z-index:101}
185
  .flowplayer .fp-embed{position:absolute;top:5px;left:5px;display:block;width:25px;height:20px;background-position:3px -237px;}
186
  .is-rtl.flowplayer .fp-embed{background-position:22px -237px;left:auto;right:5px}
187
 
233
  .is-rtl.flowplayer .fvp-share-bar{left:auto;}
234
  .flowplayer .fvp-share-bar textarea{width:400px;min-height:130px;font-family: "Lucida Console", Monaco, monospace; color:#777; white-space:nowrap; resize:none;overflow:hidden;border:0;outline:0;background-color:transparent;color:#ccc; border: 1px solid #888;}
235
  .flowplayer.is-embedding .fp-embed,.flowplayer.is-embedding .fvp-share-bar{display:block;opacity:1;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100)}
236
+
237
+ /* style reset first */
238
+ .flowplayer .fvp-sharing ul {
239
+ list-style: none !important;
240
+ }
241
+ .fvp-share-bar ul,
242
+ .fvp-share-bar .fvp-sharing,
243
+ #content .fvp-share-bar .fvp-sharing {
244
  /*clear: both;
245
  width: 102px;*/
246
  min-height: 24px;
247
+ margin: 7px auto !important;
248
+ padding: 0 !important;
249
+ float: left;
250
+ font-family: "Lucida Console", Monaco, monospace;
251
+ }
252
+ .fvp-share-bar {
253
+ line-height: 24px !important;
254
  }
255
  .fvp-share-bar label {
256
+ text-align: center !important;
257
+ }
258
+ .fvp-share-bar .fvp-sharing li a:before,
259
+ .fvp-share-bar .fvp-sharing li a:after,
260
+ .fvp-share-bar .fvp-sharing li:before,
261
+ .fvp-share-bar .fvp-sharing li:after {
262
+ content: "" !important;
263
+ display: none !important;
264
  }
 
265
  .fvp-share-bar .fvp-sharing li {
266
  float: left;
267
  display: inline-block;
268
+ margin: 0 5px !important;
269
+ padding: 0 !important;
270
+ border: none !important;
271
+ background: none !important;
272
+ }
273
+ #content .flowplayer a,
274
+ .flowplayer a,
275
+ .flowplayer a:hover,
276
+ .fvp-share-bar .fvp-sharing a {
277
+ color: #fff !important;
278
+ text-shadow: none !important;
279
+ -webkit-transition: none !important;
280
+ -moz-transition: none !important;
281
+ transition: none !important;
282
+ }
283
+
284
+ .flowplayer em {
285
+ font-style: normal !important;
286
  }
287
 
288
  .fvp-share-bar .fvp-sharing a {
318
  #content .flowplayer .fvp-share-bar textarea, .flowplayer .fvp-share-bar textarea { padding: 3px; line-height: 1.4; white-space: pre-wrap; color: black !important; height: auto; min-height: 130px; width: 99%; font-size: 10px; background-color:rgba(255, 255, 255, 1); box-shadow: none; border-radius: 0; cursor: text; }
319
  #content .flowplayer.is-ready .fvp-share-bar.visible .embed-code, .flowplayer.is-ready .fvp-share-bar.visible .embed-code { display: block; }
320
  /*#content .flowplayer.is-ready .fp-embed-code.visible textarea, .flowplayer.is-ready .fp-embed-code.visible textarea { height: 140px; }*/
321
+ .fvp-share-bar a.embed-code-toggle { font-weight: bold; color: white; }
322
 
323
  .flowplayer .fp-prev, .flowplayer .fp-next{/* next and prev buttons */position:absolute;top:44%;cursor:pointer;-webkit-transition:opacity .5s;-moz-transition:opacity .5s;transition:opacity .5s;background:url("img/playlist-buttons.png");opacity:0;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=0);height:20px;width:12px;}
324
  .is-mouseover.is-ready.flowplayer .fp-prev,.is-mouseover.is-ready.flowplayer .fp-next{opacity:1;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100)}
388
 
389
  .wpfp_custom_ad_content h1, .wpfp_custom_ad_content h2, .wpfp_custom_ad_content h3, .wpfp_custom_ad_content h4, .wpfp_custom_ad_content h5, .wpfp_custom_ad_content p { padding: 0 5px 2px 5px; margin: 0 5px 2px 5px; }
390
 
391
+ .flowplayer.alignleft { margin-left: 10px; margin-bottom: 10px; }
392
+ .flowplayer.alignright { margin-right: 10px; margin-bottom: 10px; }
393
+
394
+ .flowplayer.no-controlbar .fp-controls{display:none}
395
+ .flowplayer.no-controlbar .fp-time{display:none}
396
+
397
+ p.fp-caption { text-align: center; }
398
 
399
  /*
400
  MediaElement.js
405
  .mejs-controls .mejs-button button{cursor:pointer;display:block;font-size:0;line-height:0;text-decoration:none;margin:7px 5px;padding:0;position:absolute;height:16px;width:16px;border:0;background:transparent url(controls.svg) no-repeat;}.no-svg .mejs-controls .mejs-button button{background-image:url(controls.png);}.mejs-controls .mejs-button button:focus{outline:solid 1px yellow;}.mejs-container .mejs-controls .mejs-time{color:#fff;display:block;height:17px;width:auto;padding:8px 3px 0 3px;overflow:hidden;text-align:center;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;}.mejs-container .mejs-controls .mejs-time span{color:#fff;font-size:11px;line-height:12px;display:block;float:left;margin:1px 2px 0 0;width:auto;}.mejs-controls .mejs-play button{background-position:0 0;}.mejs-controls .mejs-pause button{background-position:0 -16px;}.mejs-controls .mejs-stop button{background-position:-112px 0;}.mejs-controls div.mejs-time-rail{width:200px;padding-top:5px;}.mejs-controls .mejs-time-rail span{display:block;position:absolute;width:180px;height:10px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;cursor:pointer;}.mejs-controls .mejs-time-rail .mejs-time-total{margin:5px;background:#333;background:rgba(50,50,50,0.8);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(30,30,30,0.8)),to(rgba(60,60,60,0.8)));background:-webkit-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-moz-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-o-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-ms-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:linear-gradient(rgba(30,30,30,0.8),rgba(60,60,60,0.8));}.mejs-controls .mejs-time-rail .mejs-time-buffering{width:100%;background-image:-o-linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-ms-linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);-webkit-background-size:15px 15px;-moz-background-size:15px 15px;-o-background-size:15px 15px;background-size:15px 15px;-webkit-animation:buffering-stripes 2s linear infinite;-moz-animation:buffering-stripes 2s linear infinite;-ms-animation:buffering-stripes 2s linear infinite;-o-animation:buffering-stripes 2s linear infinite;animation:buffering-stripes 2s linear infinite;}@-webkit-keyframes buffering-stripes{from{background-position:0 0;}to{background-position:30px 0;}}@-moz-keyframes buffering-stripes{from{background-position:0 0;}to{background-position:30px 0;}}@-ms-keyframes buffering-stripes{from{background-position:0 0;}to{background-position:30px 0;}}@-o-keyframes buffering-stripes{from{background-position:0 0;}to{background-position:30px 0;}}@keyframes buffering-stripes{from{background-position:0 0;}to{background-position:30px 0;}}.mejs-controls .mejs-time-rail .mejs-time-loaded{background:#3caac8;background:rgba(60,170,200,0.8);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(44,124,145,0.8)),to(rgba(78,183,212,0.8)));background:-webkit-linear-gradient(top,rgba(44,124,145,0.8),rgba(78,183,212,0.8));background:-moz-linear-gradient(top,rgba(44,124,145,0.8),rgba(78,183,212,0.8));background:-o-linear-gradient(top,rgba(44,124,145,0.8),rgba(78,183,212,0.8));background:-ms-linear-gradient(top,rgba(44,124,145,0.8),rgba(78,183,212,0.8));background:linear-gradient(rgba(44,124,145,0.8),rgba(78,183,212,0.8));width:0;}.mejs-controls .mejs-time-rail .mejs-time-current{background:#fff;background:rgba(255,255,255,0.8);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(255,255,255,0.9)),to(rgba(200,200,200,0.8)));background:-webkit-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-moz-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-o-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-ms-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:linear-gradient(rgba(255,255,255,0.9),rgba(200,200,200,0.8));width:0;}.mejs-controls .mejs-time-rail .mejs-time-handle{display:none;position:absolute;margin:0;width:10px;background:#fff;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;cursor:pointer;border:solid 2px #333;top:-2px;text-align:center;}.mejs-controls .mejs-time-rail .mejs-time-float{position:absolute;display:none;background:#eee;width:36px;height:17px;border:solid 1px #333;top:-26px;margin-left:-18px;text-align:center;color:#111;}.mejs-controls .mejs-time-rail .mejs-time-float-current{margin:2px;width:30px;display:block;text-align:center;left:0;}.mejs-controls .mejs-time-rail .mejs-time-float-corner{position:absolute;display:block;width:0;height:0;line-height:0;border:solid 5px #eee;border-color:#eee transparent transparent transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;top:15px;left:13px;}.mejs-long-video .mejs-controls .mejs-time-rail .mejs-time-float{width:48px;}.mejs-long-video .mejs-controls .mejs-time-rail .mejs-time-float-current{width:44px;}.mejs-long-video .mejs-controls .mejs-time-rail .mejs-time-float-corner{left:18px;}.mejs-controls .mejs-fullscreen-button button{background-position:-32px 0;}.mejs-controls .mejs-unfullscreen button{background-position:-32px -16px;}.mejs-controls .mejs-mute button{background-position:-16px -16px;}.mejs-controls .mejs-unmute button{background-position:-16px 0;}.mejs-controls .mejs-volume-button{position:relative;}.mejs-controls .mejs-volume-button .mejs-volume-slider{display:none;height:115px;width:25px;background:url(background.png);background:rgba(50,50,50,0.7);-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;top:-115px;left:0;z-index:1;position:absolute;margin:0;}.mejs-controls .mejs-volume-button:hover{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-total{position:absolute;left:11px;top:8px;width:2px;height:100px;background:#ddd;background:rgba(255,255,255,0.5);margin:0;}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-current{position:absolute;left:11px;top:8px;width:2px;height:100px;background:#ddd;background:rgba(255,255,255,0.9);margin:0;}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-handle{position:absolute;left:4px;top:-3px;width:16px;height:6px;background:#ddd;background:rgba(255,255,255,0.9);cursor:N-resize;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;margin:0;}.mejs-controls div.mejs-horizontal-volume-slider{height:26px;width:60px;position:relative;}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total{position:absolute;left:0;top:11px;width:50px;height:8px;margin:0;padding:0;font-size:1px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;background:#333;background:rgba(50,50,50,0.8);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(30,30,30,0.8)),to(rgba(60,60,60,0.8)));background:-webkit-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-moz-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-o-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-ms-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:linear-gradient(rgba(30,30,30,0.8),rgba(60,60,60,0.8));}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current{position:absolute;left:0;top:11px;width:50px;height:8px;margin:0;padding:0;font-size:1px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;background:#fff;background:rgba(255,255,255,0.8);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(255,255,255,0.9)),to(rgba(200,200,200,0.8)));background:-webkit-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-moz-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-o-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-ms-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:linear-gradient(rgba(255,255,255,0.9),rgba(200,200,200,0.8));}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-handle{display:none;}.mejs-controls .mejs-captions-button{position:relative;}.mejs-controls .mejs-captions-button button{background-position:-48px 0;}.mejs-controls .mejs-captions-button .mejs-captions-selector{visibility:hidden;position:absolute;bottom:26px;right:-10px;width:130px;height:100px;background:url(background.png);background:rgba(50,50,50,0.7);border:solid 1px transparent;padding:10px;overflow:hidden;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul{margin:0;padding:0;display:block;list-style-type:none!important;overflow:hidden;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li{margin:0 0 6px 0;padding:0;list-style-type:none!important;display:block;color:#fff;overflow:hidden;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li input{clear:both;float:left;margin:3px 3px 0 5px;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li label{width:100px;float:left;padding:4px 0 0 0;line-height:15px;font-family:helvetica,arial;font-size:10px;}.mejs-controls .mejs-captions-button .mejs-captions-translations{font-size:10px;margin:0 0 5px 0;}.mejs-chapters{position:absolute;top:0;left:0;-xborder-right:solid 1px #fff;width:10000px;z-index:1;}.mejs-chapters .mejs-chapter{position:absolute;float:left;background:#222;background:rgba(0,0,0,0.7);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(50,50,50,0.7)),to(rgba(0,0,0,0.7)));background:-webkit-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-moz-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-o-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-ms-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:linear-gradient(rgba(50,50,50,0.7),rgba(0,0,0,0.7));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,startColorstr=#323232,endColorstr=#000000);overflow:hidden;border:0;}.mejs-chapters .mejs-chapter .mejs-chapter-block{font-size:11px;color:#fff;padding:5px;display:block;border-right:solid 1px #333;border-bottom:solid 1px #333;cursor:pointer;}.mejs-chapters .mejs-chapter .mejs-chapter-block-last{border-right:none;}.mejs-chapters .mejs-chapter .mejs-chapter-block:hover{background:#666;background:rgba(102,102,102,0.7);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(102,102,102,0.7)),to(rgba(50,50,50,0.6)));background:-webkit-linear-gradient(top,rgba(102,102,102,0.7),rgba(50,50,50,0.6));background:-moz-linear-gradient(top,rgba(102,102,102,0.7),rgba(50,50,50,0.6));background:-o-linear-gradient(top,rgba(102,102,102,0.7),rgba(50,50,50,0.6));background:-ms-linear-gradient(top,rgba(102,102,102,0.7),rgba(50,50,50,0.6));background:linear-gradient(rgba(102,102,102,0.7),rgba(50,50,50,0.6));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,startColorstr=#666666,endColorstr=#323232);}.mejs-chapters .mejs-chapter .mejs-chapter-block .ch-title{font-size:12px;font-weight:bold;display:block;white-space:nowrap;text-overflow:ellipsis;margin:0 0 3px 0;line-height:12px;}.mejs-chapters .mejs-chapter .mejs-chapter-block .ch-timespan{font-size:12px;line-height:12px;margin:3px 0 4px 0;display:block;white-space:nowrap;text-overflow:ellipsis;}.mejs-captions-layer{position:absolute;bottom:0;left:0;text-align:center;line-height:22px;font-size:12px;color:#fff;}.mejs-captions-layer a{color:#fff;text-decoration:underline;}.mejs-captions-layer[lang=ar]{font-size:20px;font-weight:normal;}.mejs-captions-position{position:absolute;width:100%;bottom:15px;left:0;}.mejs-captions-position-hover{bottom:45px;}.mejs-captions-text{padding:3px 5px;background:url(background.png);background:rgba(20,20,20,0.8);}.me-cannotplay a{color:#fff;font-weight:bold;}.me-cannotplay span{padding:15px;display:block;}.mejs-controls .mejs-loop-off button{background-position:-64px -16px;}.mejs-controls .mejs-loop-on button{background-position:-64px 0;}.mejs-controls .mejs-backlight-off button{background-position:-80px -16px;}.mejs-controls .mejs-backlight-on button{background-position:-80px 0;}.mejs-controls .mejs-picturecontrols-button{background-position:-96px 0;}.mejs-contextmenu{position:absolute;width:150px;padding:10px;border-radius:4px;top:0;left:0;background:#fff;border:solid 1px #999;z-index:1001;}.mejs-contextmenu .mejs-contextmenu-separator{height:1px;font-size:0;margin:5px 6px;background:#333;}.mejs-contextmenu .mejs-contextmenu-item{font-family:Helvetica,Arial;font-size:12px;padding:4px 6px;cursor:pointer;color:#333;}.mejs-contextmenu .mejs-contextmenu-item:hover{background:#2C7C91;color:#fff;}.mejs-controls .mejs-sourcechooser-button{position:relative;}.mejs-controls .mejs-sourcechooser-button button{background-position:-128px 0;}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector{visibility:hidden;position:absolute;bottom:26px;right:-10px;width:130px;height:100px;background:url(background.png);background:rgba(50,50,50,0.7);border:solid 1px transparent;padding:10px;overflow:hidden;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul{margin:0;padding:0;display:block;list-style-type:none!important;overflow:hidden;}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul li{margin:0 0 6px 0;padding:0;list-style-type:none!important;display:block;color:#fff;overflow:hidden;}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul li input{clear:both;float:left;margin:3px 3px 0 5px;}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul li label{width:100px;float:left;padding:4px 0 0 0;line-height:15px;font-family:helvetica,arial;font-size:10px;}.mejs-postroll-layer{position:absolute;bottom:0;left:0;width:100%;height:100%;background:url(background.png);background:rgba(50,50,50,0.7);z-index:1000;overflow:hidden;}.mejs-postroll-layer-content{width:100%;height:100%;}.mejs-postroll-close{position:absolute;right:0;top:0;background:url(background.png);background:rgba(50,50,50,0.7);color:#fff;padding:4px;z-index:100;cursor:pointer;}
406
 
407
  .fvfp_admin_error { position: absolute; top: 10%; z-index: 2; text-align: center; width: 100%; /*color: #fff;*/ }
408
+
409
+ @-moz-keyframes fade-in {
410
+ from { transform: opacity 0.5s ease; opacity: 0; filter: alpha(opacity=0); }
411
+ to { opacity: 1; filter: alpha(opacity=100); }
412
+ }
413
+ @-webkit-keyframes fade-in {
414
+ from { transform: opacity 0.5s ease; opacity: 0; filter: alpha(opacity=0); }
415
+ to { opacity: 1; filter: alpha(opacity=100); }
416
+ }
417
+ @keyframes fade-in {
418
+ from { transform: opacity 0.5s ease; opacity: 0; filter: alpha(opacity=0); }
419
+ to { opacity: 1; filter: alpha(opacity=100); }
420
+ }
421
+ .fvfp_admin_error { -webkit-animation-name: fade-in; -moz-animation-name: fade-in; -o-animation-name: fade-in; animation-name: fade-in; -webkit-animation-duration: 1s; -moz-animation-duration: 1s; -o-animation-duration: 1s; animation-duration: 1s; -webkit-animation-delay: 5s; -moz-animation-delay: 5s;-o-animation-delay: 5s; animation-delay: 5s; -webkit-animation-fill-mode:both; -moz-animation-fill-mode:both; -o-animation-fill-mode:both; animation-fill-mode:both; }
422
+
423
+ article .entry-content .fvfp_admin_error p { line-height: 18px; }
424
  .fvfp_admin_error a { /*color: #fff;*/ text-decoration: underline; }
425
  #content .fvfp_admin_error a { /*color: #fff;*/ text-decoration: underline; }
426
  .fvfp_admin_error_content { /*background: #dd0000;*/ padding: 1% 5%; width: 65%; margin: 0 auto; -webkit-box-shadow: 3px 3px 30px 0px rgba(50, 50, 50, 0.96); -moz-box-shadow: 3px 3px 30px 0px rgba(50, 50, 50, 0.96); box-shadow: 3px 3px 30px 0px rgba(50, 50, 50, 0.96);}
427
+ .flowplayer:hover .fvfp_admin_error { display: block }
428
+
429
+ .fvfp_duration { position: absolute; bottom: 0px; right: 1%; z-index: 2; text-align: center; color: #fff; display: none; }
430
+ .is-ready .fvfp_duration, .is-loading .fvfp_duration { display: none; }
431
+ .fp-playlist-external .dur { margin-left: 10px; display: none; }
432
+
css/img/black-x2.png ADDED
Binary file
css/img/black_rtl-x2.png ADDED
Binary file
css/img/flowplayer-2x.png ADDED
Binary file
css/img/flowplayer@2x.png ADDED
Binary file
css/img/no_play_white-x2.png ADDED
Binary file
css/img/play_black-x2.png ADDED
Binary file
css/img/play_black_rtl-x2.png ADDED
Binary file
css/img/play_white-x2.png ADDED
Binary file
css/img/play_white_rtl-x2.png ADDED
Binary file
css/img/playful_black-x2.png ADDED
Binary file
css/img/playful_black_rtl-x2.png ADDED
Binary file
css/img/playful_white-x2.png ADDED
Binary file
css/img/playful_white_rtl-x2.png ADDED
Binary file
css/img/white-x2.png ADDED
Binary file
css/img/white_rtl-x2.png ADDED
Binary file
css/license.css CHANGED
@@ -68,3 +68,28 @@ a.red-button {
68
  padding-left: 30px; */
69
  margin-bottom: 2px;
70
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  padding-left: 30px; */
69
  margin-bottom: 2px;
70
  }
71
+
72
+
73
+
74
+ #wpbody-content #wpfp_options #postbox-container-1 { width: 100% }
75
+ #wpfp_options .postbox h3 { cursor: default; }
76
+
77
+ #wpfp_options table { width: 100% }
78
+ #wpfp_options table td.first { width: 250px }
79
+ #wpfp_options #fv_flowplayer_integrations table td.first { width: 350px }
80
+ #wpfp_options table.flowplayer-settings { width: 46%; }
81
+
82
+ div.clear { clear: both }
83
+ div.column { float: left; width: 49% }
84
+ div.green { background-color: #e0ffe0; border-color: #88AA88; }
85
+ .amazon-s3-first .fv_fp_amazon_remove { display: none; }
86
+ .form-table2 td p { line-height: 20px; }
87
+ input[type=text] { width: 100%; }
88
+ #wpfp_options input.button-primary, #wpfp_options input.button { margin-top: 16px }
89
+ #wpfp_options input.button.no-margin { margin-top: 0px }
90
+ input.small { width: 80px }
91
+ td.second-column { margin-left: 20px }
92
+
93
+ span.new { color: #e00; font-weight: bold }
94
+
95
+ #fv_flowplayer_amazon_options label { float: right }
flowplayer.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: FV Wordpress Flowplayer
4
  Plugin URI: http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer
5
  Description: Embed videos (MP4, WEBM, OGV, FLV) into posts or pages. Uses Flowplayer 5.
6
- Version: 2.2.9
7
  Author URI: http://foliovision.com/
8
  License: GPL-3.0
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.txt
@@ -24,27 +24,30 @@ License URI: http://www.gnu.org/licenses/gpl-3.0.txt
24
 
25
  You should have received a copy of the GNU General Public License
26
  along with this program. If not, see <http://www.gnu.org/licenses/>.
27
- */
28
 
29
- include( dirname( __FILE__ ) . '/includes/extra-functions.php' );
 
30
 
31
- if( is_admin() ) {
32
- /**
33
- * If administrator is logged, loads the controller for backend.
34
- */
 
 
 
35
 
 
 
 
 
 
36
  include( dirname( __FILE__ ) . '/controller/backend.php' );
37
 
38
  register_deactivation_hook( __FILE__, 'flowplayer_deactivate' );
39
 
40
- } else {
41
- /**
42
- * If administrator is not logged, loads the controller for frontend.
43
- */
44
- include( dirname( __FILE__ ) . '/controller/frontend.php' );
45
- require_once( dirname( __FILE__ ) . '/controller/shortcodes.php');
46
- }
47
-
48
 
49
- $fv_wp_flowplayer_ver = '2.2.9';
50
- $fv_wp_flowplayer_core_ver = '5.4.6';
3
  Plugin Name: FV Wordpress Flowplayer
4
  Plugin URI: http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer
5
  Description: Embed videos (MP4, WEBM, OGV, FLV) into posts or pages. Uses Flowplayer 5.
6
+ Version: 2.3.12
7
  Author URI: http://foliovision.com/
8
  License: GPL-3.0
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.txt
24
 
25
  You should have received a copy of the GNU General Public License
26
  along with this program. If not, see <http://www.gnu.org/licenses/>.
27
+ */
28
 
29
+ $fv_wp_flowplayer_ver = '2.3.12';
30
+ $fv_wp_flowplayer_core_ver = '5.5.2';
31
 
32
+ include( dirname( __FILE__ ) . '/includes/extra-functions.php' );
33
+ if( file_exists( dirname( __FILE__ ) . '/includes/module.php' ) ) {
34
+ include( dirname( __FILE__ ) . '/includes/module.php' );
35
+ }
36
+
37
+ include( dirname( __FILE__ ) . '/models/checker.php' );
38
+ $FV_Player_Checker = new FV_Player_Checker();
39
 
40
+ include_once(dirname( __FILE__ ) . '/models/flowplayer.php');
41
+ include_once(dirname( __FILE__ ) . '/models/flowplayer-frontend.php');
42
+ $fv_fp = new flowplayer_frontend();
43
+
44
+ if( is_admin() ) {
45
  include( dirname( __FILE__ ) . '/controller/backend.php' );
46
 
47
  register_deactivation_hook( __FILE__, 'flowplayer_deactivate' );
48
 
49
+ }
50
+
51
+ include( dirname( __FILE__ ) . '/controller/frontend.php' );
52
+ require_once( dirname( __FILE__ ) . '/controller/shortcodes.php');
 
 
 
 
53
 
 
 
flowplayer/embed.min.js CHANGED
@@ -1,3 +1,3 @@
1
  /*
2
- Flowplayer Embed 5.4.6 | flowplayer.org
3
- */!function(){function c(e,t,n){if(e)return n(e);if(window.fp5ecc[t])return window.fp5ecc[t].push(n);window.fp5ecc[t]=[n];var r=document.createElement("script");r.onload=r.onreadystatechange=function(){var e=r.readyState;if(e===undefined||/complete|loaded/.test(e)){var n=window.fp5ecc[t];for(var i=0;i<n.length;i++)n[i]()}},r.async=!0,r.src=t,i.insertBefore(r,i.firstChild)}function h(e){if(window.fp5ecssc[e])return;window.fp5ecssc[e]=!0;var t=document.createElement("link");t.rel="stylesheet",t.type="text/css",t.href=e,i.insertBefore(t,i.firstChild)}var e,t=document.getElementsByTagName("script"),n=document.createElement("div");for(var r=0;r<t.length;r++)if(t[r].innerHTML.indexOf("<video")!==-1){e=t[r],e.parentNode.insertBefore(n,e),e.parentNode.removeChild(e);break}var i=document.getElementsByTagName("head")[0],s="//foliovision.com/flowplayer/5.4.6",o=e.getAttribute("data-library")||s+"/flowplayer.min.js",u=e.getAttribute("data-swf")||s+"/flowplayer.swf",a=e.getAttribute("data-skin")||s+"/flowplayer.css",f="//www.google-analytics.com/ga.js",l="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";window.fp5ecc=window.fp5ecc||{},window.fp5ecssc=window.fp5ecssc||{};var p=typeof jQuery!="undefined"?jQuery().jquery:"",d=p.split("."),v=typeof $!="undefined"&&jQuery!=$;c(Number(d[0])>=1&&Number(d[1])>=7,l,function(t){var r;!t&&v&&(r=jQuery.noConflict());var i=!t&&p!=="";c(typeof _gat!="undefined",f,function(){c(typeof flowplayer!="undefined",o,function(t){t||h(a),r=r||jQuery;var s=r(e),f=s.attr("src"),l=r(s.html().replace(/^[ \t\n\r]+/gm,"").replace(/[ \n\t\r]+$/gm,""));r(n).replaceWith(l),l.find(":not(video, source)").remove(),l.flowplayer({swf:u,e:1}),l.data("flowplayer").conf.embed={library:o,swf:u,script:f},i&&r.noConflict(!0)})})})}();
1
  /*
2
+ Flowplayer Embed 5.5.2 | flowplayer.org
3
+ */!function(){function c(e,t,n){if(e)return n(e);if(window.fp5ecc[t])return window.fp5ecc[t].push(n);window.fp5ecc[t]=[n];var r=document.createElement("script");r.onload=r.onreadystatechange=function(){var e=r.readyState;if(e===undefined||/complete|loaded/.test(e)){var n=window.fp5ecc[t];for(var i=0;i<n.length;i++)n[i]()}},r.async=!0,r.src=t,i.insertBefore(r,i.firstChild)}function h(e){if(window.fp5ecssc[e])return;window.fp5ecssc[e]=!0;var t=document.createElement("link");t.rel="stylesheet",t.type="text/css",t.href=e,i.insertBefore(t,i.firstChild)}var e,t=document.getElementsByTagName("script"),n=document.createElement("div");for(var r=0;r<t.length;r++)if(t[r].innerHTML.indexOf("<video")!==-1){e=t[r],e.parentNode.insertBefore(n,e),e.parentNode.removeChild(e);break}var i=document.getElementsByTagName("head")[0],s="//foliovision.com/5.5.2/commercial",o=e.getAttribute("data-library")||s+"/flowplayer.min.js",u=e.getAttribute("data-swf")||s+"/flowplayer.swf",a=e.getAttribute("data-skin")||s+"/flowplayer.css",f="//www.google-analytics.com/ga.js",l="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";window.fp5ecc=window.fp5ecc||{},window.fp5ecssc=window.fp5ecssc||{};var p=typeof jQuery!="undefined"?jQuery().jquery:"",d=p.split("."),v=typeof $!="undefined"&&jQuery!=$;c(Number(d[0])>=1&&Number(d[1])>=7,l,function(t){var r;!t&&v&&(r=jQuery.noConflict());var i=!t&&p!=="";c(typeof _gat!="undefined",f,function(){c(typeof flowplayer!="undefined",o,function(t){t||h(a),r=r||jQuery;var s=r(e),f=s.attr("src"),l=r(s.html().replace(/^[ \t\n\r]+/gm,"").replace(/[ \n\t\r]+$/gm,""));r(n).replaceWith(l),l.find(":not(video, source)").remove(),l.flowplayer({swf:u,e:1}),l.data("flowplayer").conf.embed={library:o,swf:u,script:f},i&&r.noConflict(!0)})})})}();
flowplayer/flowplayer.swf CHANGED
Binary file
flowplayer/fv-flowplayer.min.js CHANGED
@@ -1,15 +1,19 @@
1
  /*!
2
 
3
- Flowplayer Unlimited v5.4.6 (2013-12-17) | flowplayer.org/license
 
 
 
4
 
5
- */!function(e){function u(t,n){var r="obj"+(""+Math.random()).slice(2,15),i='<object class="fp-engine" id="'+r+'" name="'+r+'" ';i+=e.browser.msie?'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">':' data="'+t+'" type="application/x-shockwave-flash">';var s={width:"100%",height:"100%",allowscriptaccess:"always",wmode:"transparent",quality:"high",flashvars:"",movie:t+(e.browser.msie?"?"+r:""),name:r};return e.each(n,function(e,t){s.flashvars+=e+"="+t+"&"}),e.each(s,function(e,t){i+='<param name="'+e+'" value="'+t+'"/>'}),i+="</object>",e(i)}function l(e,t){return t=t||100,Math.round(e*t)/t}function c(e){return/mpegurl/i.test(e)?"application/x-mpegurl":"video/"+e}function h(e){return/^(video|application)/.test(e)||(e=c(e)),!!a.canPlayType(e).replace("no","")}function p(t,n){var r=e.grep(t,function(e){return e.type===n});return r.length?r[0]:null}function g(e){var t=e.attr("src"),n=e.attr("type")||"",r=t.split(m)[1];return n=/mpegurl/.test(n)?"mpegurl":n.replace("video/",""),{src:t,suffix:r||n,type:n||r}}function y(t){var n=this,r=[];e("source",t).each(function(){r.push(g(e(this)))}),r.length||r.push(g(t)),n.initialSources=r,n.resolve=function(t){return t?(e.isArray(t)?t={sources:e.map(t,function(t){var n,r=e.extend({},t);return e.each(t,function(e,t){n=e}),r.type=n,r.src=t[n],delete r[n],r})}:typeof t=="string"&&(t={src:t,sources:[]},e.each(r,function(e,n){n.type!="flash"&&t.sources.push({type:n.type,src:t.src.replace(m,"."+n.suffix+"$2")})})),t):{sources:r}}}function b(e){return e=parseInt(e,10),e>=10?e:"0"+e}function w(e){e=e||0;var t=Math.floor(e/3600),n=Math.floor(e/60);return e-=n*60,t>=1?(n-=t*60,t+":"+b(n)+":"+b(e)):b(n)+":"+b(e)}!function(e){if(!e.browser){var t=e.browser={},n=navigator.userAgent.toLowerCase(),r=/(chrome)[ \/]([\w.]+)/.exec(n)||/(safari)[ \/]([\w.]+)/.exec(n)||/(webkit)[ \/]([\w.]+)/.exec(n)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(n)||/(msie) ([\w.]+)/.exec(n)||n.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(n)||[];r[1]&&(t[r[1]]=!0,t.version=r[2]||"0")}}(jQuery),e(function(){typeof e.fn.flowplayer=="function"&&e("video").parent(".flowplayer").flowplayer()});var t=[],n=[],r=window.navigator.userAgent;window.flowplayer=function(r){return e.isFunction(r)?n.push(r):typeof r=="number"||r===undefined?t[r||0]:e(r).data("flowplayer")},e(window).on("beforeunload",function(){e.each(t,function(t,n){n.conf.splash?n.unload():n.bind("error",function(){e(".flowplayer.is-error .fp-message").remove()})})});var i=!1;try{typeof window.localStorage=="object"&&(window.localStorage.flowplayerTestStorage="test",i=!0)}catch(s){}e.extend(flowplayer,{version:"5.4.6",engine:{},conf:{},support:{},defaults:{debug:!1,disabled:!1,engine:"html5",fullscreen:window==window.top,keyboard:!0,ratio:9/16,adaptiveRatio:!1,flashfit:!1,rtmp:0,splash:!1,live:!1,swf:"//releases.flowplayer.org/5.4.6/commercial/flowplayer.swf",speeds:[.25,.5,1,1.5,2],tooltip:!0,volume:i?localStorage.muted=="true"?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:[]}});var o=1;e.fn.flowplayer=function(r,i){return typeof r=="string"&&(r={swf:r}),e.isFunction(r)&&(i=r,r={}),!r&&this.data("flowplayer")||this.each(function(){var s=e(this).addClass("is-loading"),u=e.extend({},flowplayer.defaults,flowplayer.conf,r,s.data()),a=e("video",s).addClass("fp-engine").removeAttr("controls"),f=a.length?new y(a):null,l={},c,h;if(u.playlist.length){var p=a.attr("preload"),d;a.length&&a.replaceWith(d=e("<p />")),a=e("<video />").addClass("fp-engine"),d?d.replaceWith(a):s.prepend(a),flowplayer.support.video&&a.attr("preload",p),typeof u.playlist[0]=="string"?a.attr("src",u.playlist[0]):e.each(u.playlist[0],function(t,n){for(var r in n)n.hasOwnProperty(r)&&a.append(e("<source />").attr({type:"video/"+r,src:n[r]}))}),f=new y(a)}var v=s.data("flowplayer");v&&v.unload(),s.data("fp-player_id",s.data("fp-player_id")||o++);try{l=window.localStorage||l}catch(m){}var g=this.currentStyle&&this.currentStyle.direction==="rtl"||window.getComputedStyle&&window.getComputedStyle(this,null).getPropertyValue("direction")==="rtl";g&&s.addClass("is-rtl");var b=v||{conf:u,currentSpeed:1,volumeLevel:typeof u.volume=="undefined"?l.volume*1:u.volume,video:{},disabled:!1,finished:!1,loading:!1,muted:l.muted=="true"||u.muted,paused:!1,playing:!1,ready:!1,splash:!1,rtl:g,load:function(t,n){if(b.error||b.loading||b.disabled)return;t=f.resolve(t),e.extend(t,h.pick(t.sources));if(t.src){var r=e.Event("load");s.trigger(r,[b,t,h]),r.isDefaultPrevented()?b.loading=!1:(h.load(t),e.isFunction(t)&&(n=t),n&&s.one("ready",n))}return b},pause:function(e){return b.ready&&!b.seeking&&!b.disabled&&!b.loading&&(h.pause(),b.one("pause",e)),b},resume:function(){return b.ready&&b.paused&&!b.disabled&&(h.resume(),b.finished&&(b.trigger("resume",[b]),b.finished=!1)),b},toggle:function(){return b.ready?b.paused?b.resume():b.pause():b.load()},seek:function(t,n){if(b.ready){if(typeof t=="boolean"){var r=b.video.duration*.1;t=b.video.time+(t?r:-r)}t=c=Math.min(Math.max(t,0),b.video.duration).toFixed(1);var i=e.Event("beforeseek");s.trigger(i,[b,t]),i.isDefaultPrevented()?(b.seeking=!1,s.toggleClass("is-seeking",b.seeking)):(h.seek(t),e.isFunction(n)&&s.one("seek",n))}return b},seekTo:function(e,t){var n=e===undefined?c:b.video.duration*.1*e;return b.seek(n,t)},mute:function(e){return e===undefined&&(e=!b.muted),l.muted=b.muted=e,l.volume=isNaN(l.volume)?u.volume:l.volume,b.volume(e?0:l.volume,!0),b.trigger("mute",e),b},volume:function(e,t){return b.ready&&(e=Math.min(Math.max(e,0),1),t||(l.volume=e),h.volume(e)),b},speed:function(t,n){return b.ready&&(typeof t=="boolean"&&(t=u.speeds[e.inArray(b.currentSpeed,u.speeds)+(t?1:-1)]||b.currentSpeed),h.speed(t),n&&s.one("speed",n)),b},stop:function(){return b.ready&&(b.pause(),b.seek(0,function(){s.trigger("stop")})),b},unload:function(){return s.hasClass("is-embedding")||(u.splash?(b.trigger("unload"),h.unload()):b.stop()),b},disable:function(e){return e===undefined&&(e=!b.disabled),e!=b.disabled&&(b.disabled=e,b.trigger("disable",e)),b}};b.conf=e.extend(b.conf,u),e.each(["bind","one","unbind"],function(e,t){b[t]=function(e,n){return s[t](e,n),b}}),b.trigger=function(e,t){return s.trigger(e,[b,t]),b},s.data("flowplayer")||s.bind("boot",function(){e.each(["autoplay","loop","preload","poster"],function(e,t){var n=a.attr(t);n!==undefined&&(u[t]=n?n:!0)});if(u.splash||s.hasClass("is-splash")||!flowplayer.support.firstframe)b.forcedSplash=!u.splash&&!s.hasClass("is-splash"),b.splash=u.splash=u.autoplay=!0,s.addClass("is-splash"),flowplayer.support.video&&a.attr("preload","none");if(u.live||s.hasClass("is-live"))b.live=u.live=!0,s.addClass("is-live");e.each(n,function(e){this(b,s)}),h=flowplayer.engine[u.engine],h&&(h=h(b,s)),h.pick(f.initialSources)?b.engine=u.engine:e.each(flowplayer.engine,function(e,t){if(e!=u.engine)return h=this(b,s),h.pick(f.initialSources)&&(b.engine=e),!1}),t.push(b);if(!b.engine)return b.trigger("error",{code:flowplayer.support.flashVideo?5:10});u.splash?b.unload():b.load(),u.disabled&&b.disable(),h.volume(b.volumeLevel),s.one("ready",i)}).bind("load",function(t,n,r){u.splash&&e(".flowplayer").filter(".is-ready, .is-loading").not(s).each(function(){var t=e(this).data("flowplayer");t.conf.splash&&t.unload()}),s.addClass("is-loading"),n.loading=!0}).bind("ready",function(e,t,n){function r(){s.removeClass("is-loading"),t.loading=!1}n.time=0,t.video=n,u.splash?s.one("progress",r):r(),t.muted?t.mute(!0):t.volume(t.volumeLevel)}).bind("unload",function(e){u.splash&&a.remove(),s.removeClass("is-loading"),b.loading=!1}).bind("ready unload",function(e){var t=e.type=="ready";s.toggleClass("is-splash",!t).toggleClass("is-ready",t),b.ready=t,b.splash=!t}).bind("progress",function(e,t,n){t.video.time=n}).bind("speed",function(e,t,n){t.currentSpeed=n}).bind("volume",function(e,t,n){t.volumeLevel=Math.round(n*100)/100,t.muted?n&&t.mute(!1):l.volume=n}).bind("beforeseek seek",function(e){b.seeking=e.type=="beforeseek",s.toggleClass("is-seeking",b.seeking)}).bind("ready pause resume unload finish stop",function(e,t,n){b.paused=/pause|finish|unload|stop/.test(e.type),e.type=="ready"&&(b.paused=u.preload=="none",n&&(b.paused=!n.duration||!u.autoplay&&u.preload!="none")),b.playing=!b.paused,s.toggleClass("is-paused",b.paused).toggleClass("is-playing",b.playing),b.load.ed||b.pause()}).bind("finish",function(e){b.finished=!0}).bind("error",function(){a.remove()}),s.trigger("boot",[b,s]).data("flowplayer",b)})},!function(){var t=function(e){var t=/Version\/(\d\.\d)/.exec(e);return t&&t.length>1?parseFloat(t[1],10):0},n=flowplayer.support,r=e.browser,i=e("<video loop autoplay preload/>")[0],s=r.msie,o=navigator.userAgent,u=/iPad|MeeGo/.test(o)&&!/CriOS/.test(o),a=/iPad/.test(o)&&/CriOS/.test(o),f=/iP(hone|od)/i.test(o)&&!/iPad/.test(o),l=/Android/.test(o)&&!/Firefox/.test(o),c=/Android/.test(o)&&/Firefox/.test(o),h=/Silk/.test(o),p=/IEMobile/.test(o),d=u?t(o):0,v=l?parseFloat(/Android\ (\d\.\d)/.exec(o)[1],10):0;e.extend(n,{subtitles:!!i.addTextTrack,fullscreen:!l&&(typeof document.webkitCancelFullScreen=="function"&&!/Mac OS X 10_5.+Version\/5\.0\.\d Safari/.test(o)||document.mozFullScreenEnabled||typeof document.exitFullscreen=="function"),inlineBlock:!(s&&r.version<8),touch:"ontouchstart"in window,dataload:!u&&!f&&!p,zeropreload:!s&&!l,volume:!u&&!l&&!f&&!h&&!a,cachedVideoTag:!u&&!f&&!a&&!p,firstframe:!f&&!u&&!l&&!h&&!a&&!p&&!c,inlineVideo:!f&&!p&&(!l||v>=3),hlsDuration:!r.safari||u||f||a,seekable:!u&&!a});try{var m=navigator.plugins["Shockwave Flash"],g=s?(new ActiveXObject("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version"):m.description;!s&&!m[0].enabledPlugin?n.flashVideo=!1:(g=g.split(/\D+/),g.length&&!g[0]&&(g=g.slice(1)),n.flashVideo=g[0]>9||g[0]==9&&g[3]>=115)}catch(y){}try{n.video=!!i.canPlayType,n.video&&i.canPlayType("video/mp4")}catch(b){n.video=!1}n.animation=function(){var t=["","Webkit","Moz","O","ms","Khtml"],n=e("<p/>")[0];for(var r=0;r<t.length;r++)if(n.style[t[r]+"AnimationName"]!=="undefined")return!0}()}(),window.attachEvent&&window.attachEvent("onbeforeunload",function(){__flash_savedUnloadHandler=__flash_unloadHandler=function(){}}),flowplayer.engine.flash=function(t,n){var r=t.conf,i=t.video,s,o,a,f={pick:function(t){if(flowplayer.support.flashVideo){var n=e.grep(t,function(e){return e.type=="flash"})[0];if(n)return n;for(var r=0,i;r<t.length;r++){i=t[r];if(/mp4|flv/.test(i.type))return i}}},load:function(i){function f(e){return e.replace(/&amp;/g,"%26").replace(/&/g,"%26").replace(/=/g,"%3D")}var l=e("video",n),c=f(i.src);is_absolute=/^https?:/.test(c);try{l.length>0&&flowplayer.support.video&&l[0].pause()}catch(h){}var p=function(){l.remove()},d=function(t){return e.grep(t,function(e){return!!l[0].canPlayType("video/"+e.type)}).length>0};flowplayer.support.video&&l.prop("autoplay")&&d(i.sources)?l.one("timeupdate",p):p(),!is_absolute&&!r.rtmp&&(c=e("<img/>").attr("src",c)[0].src);if(a)a.__play(c);else{s="fp"+(""+Math.random()).slice(3,15);var v={hostname:r.embedded?r.hostname:location.hostname,url:c,callback:"jQuery."+s};n.data("origin")&&(v.origin=n.data("origin")),is_absolute&&delete r.rtmp,e.each(["key","autoplay","preload","rtmp","loop","debug","preload","splash","bufferTime"],function(e,t){r[t]&&(v[t]=r[t])}),v.rtmp&&(v.rtmp=f(v.rtmp)),o=u(r.swf,v),o.prependTo(n),a=o[0],setTimeout(function(){try{if(!a.PercentLoaded())return n.trigger("error",[t,{code:7,url:r.swf}])}catch(e){}},5e3),setTimeout(function(){typeof a.PercentLoaded=="undefined"&&n.trigger("flashdisabled",[t])},1e3),e[s]=function(n,s){r.debug&&n!="status"&&console.log("--",n,s);var o=e.Event(n);switch(n){case"ready":s=e.extend(i,s);break;case"click":o.flash=!0;break;case"keydown":o.which=s;break;case"seek":i.time=s;break;case"status":t.trigger("progress",s.time),s.buffer<i.bytes&&!i.buffered?(i.buffer=s.buffer/i.bytes*i.duration,t.trigger("buffer",i.buffer)):i.buffered||(i.buffered=!0,t.trigger("buffered"))}n!="buffered"&&setTimeout(function(){t.trigger(o,s)},1)}}},speed:e.noop,unload:function(){a&&a.__unload&&a.__unload(),delete e[s],e("object",n).remove(),a=0}};e.each("pause,resume,seek,volume".split(","),function(e,r){f[r]=function(e){try{t.ready&&(r=="seek"&&t.video.time&&!t.paused&&t.trigger("beforeseek"),e===undefined?a["__"+r]():a["__"+r](e))}catch(i){if(typeof a["__"+r]=="undefined")return n.trigger("flashdisabled",[t]);throw i}}});var l=e(window);return t.bind("ready fullscreen fullscreen-exit",function(r){var i=n.height(),s=n.width();if(t.conf.flashfit||/full/.test(r.type)){var o=t.isFullscreen,u=o&&L,a=!flowplayer.support.inlineBlock,f=o?u?screen.width:l.width():s,c=o?u?screen.height:l.height():i,h=0,p=0,d=a?s:"",v=a?i:"",m,g;if(t.conf.flashfit||r.type==="fullscreen")m=t.video.width/t.video.height,g=t.video.height/t.video.width,v=Math.max(g*f),d=Math.max(m*c),v=v>c?d*g:v,v=Math.min(Math.round(v),c),d=d>f?v*m:d,d=Math.min(Math.round(d),f),p=Math.max(Math.round((c+p-v)/2),0),h=Math.max(Math.round((f+h-d)/2),0);e("object",n).css({width:d,height:v,marginTop:p,marginLeft:h})}}),f};var a=e("<video/>")[0],f={ended:"finish",pause:"pause",play:"resume",progress:"buffer",timeupdate:"progress",volumechange:"volume",ratechange:"speed",seeked:"seek",loadeddata:"ready",error:"error",dataunavailable:"error"},d,v=function(t){return d?d.attr({type:c(t.type),src:t.src}):d=e("<video/>",{src:t.src,type:c(t.type),"class":"fp-engine",autoplay:"autoplay",preload:"none","x-webkit-airplay":"allow"})};flowplayer.engine.html5=function(t,n){function m(r,s,u){if(r.listeners&&r.listeners.hasOwnProperty(n.data("fp-player_id")))return;(r.listeners||(r.listeners={}))[n.data("fp-player_id")]=!0,s.bind("error",function(n){try{if(n.originalEvent&&e(n.originalEvent.originalTarget).is("img"))return n.preventDefault();h(e(n.target).attr("type"))&&t.trigger("error",{code:4})}catch(r){}}),e.each(f,function(s,f){r.addEventListener(s,function(c){f=="progress"&&c.srcElement&&c.srcElement.readyState===0&&setTimeout(function(){t.video.duration||(f="error",t.trigger(f,{code:4}))},1e4),o.debug&&!/progress/.test(f)&&console.log(s,"->",f,c);if(!t.ready&&!/ready|error/.test(f)||!f||!e("video",n).length)return;var h=e.Event(f),p;switch(f){case"ready":p=e.extend(u,{duration:r.duration,width:r.videoWidth,height:r.videoHeight,url:r.currentSrc,src:r.currentSrc});try{p.seekable=r.seekable&&r.seekable.end(null)}catch(d){}a=a||setInterval(function(){try{p.buffer=r.buffered.end(null)}catch(e){}p.buffer&&(l(p.buffer,1e3)<l(p.duration,1e3)&&!p.buffered?t.trigger("buffer",c):p.buffered||(p.buffered=!0,t.trigger("buffer",c).trigger("buffered",c),clearInterval(a),a=0))},250);if(!o.live&&!p.duration&&!i.hlsDuration&&s==="loadeddata"){var v=function(){p.duration=r.duration;try{p.seekable=r.seekable&&r.seekable.end(null)}catch(e){}t.trigger(h,p),r.removeEventListener("durationchange",v)};r.addEventListener("durationchange",v);return}break;case"progress":case"seek":var m=t.video.duration;if(r.currentTime>0){p=Math.max(r.currentTime,0);break}if(f=="progress")return;case"speed":p=l(r.playbackRate);break;case"volume":p=l(r.volume);break;case"error":try{p=(c.srcElement||c.originalTarget).error}catch(g){return}}t.trigger(h,p)},!1)})}var r=e("video",n),i=flowplayer.support,s=e("track",r),o=t.conf,u,a,c;return u={pick:function(e){if(i.video){if(o.videoTypePreference){var t=p(e,o.videoTypePreference);if(t)return t}for(var n=0,r;n<e.length;n++)if(h(e[n].type))return e[n]}},load:function(u){if(o.splash&&!c)r=v(u).prependTo(n),i.inlineVideo||r.css({position:"absolute",top:"-9999em"}),s.length&&r.append(s.attr("default","")),o.loop&&r.attr("loop","loop"),c=r[0];else{c=r[0];var a=r.find("source");!c.src&&a.length&&(c.src=u.src,a.remove());if(t.video.src&&u.src!=t.video.src)r.attr("autoplay","autoplay"),c.src=u.src;else if(o.preload=="none"||!i.dataload)i.zeropreload?t.trigger("ready",u).trigger("pause").one("ready",function(){n.trigger("resume",[t])}):t.one("ready",function(){n.trigger("pause",[t])})}m(c,e("source",r).add(r),u),(o.preload!="none"||!i.zeropreload||!i.dataload)&&c.load(),o.splash&&c.load()},pause:function(){c.pause()},resume:function(){c.play()},speed:function(e){c.playbackRate=e},seek:function(e){try{var n=t.paused;c.currentTime=e,n&&c.pause()}catch(r){}},volume:function(e){c.volume=e},unload:function(){e("video.fp-engine",n).remove(),i.cachedVideoTag||(d=null),a=clearInterval(a),c=0}}};var m=/\.(\w{3,4})(\?.*)?$/i;e.throttle=function(e,t){var n;return function(){n||(e.apply(this,arguments),n=1,setTimeout(function(){n=0},t))}},e.fn.slider2=function(t){var n=/iPad/.test(navigator.userAgent)&&!/CriOS/.test(navigator.userAgent);return this.each(function(){var r=e(this),i=e(document),s=r.children(":last"),o,u,a,f,l,c,h,p,d=!1,v=function(){u=r.offset(),a=r.width(),f=r.height(),c=l?f:a,p=b(h)},m=function(e){!o&&e!=w.value&&(!h||e<h)&&(r.trigger("slide",[e]),w.value=e)},g=function(e){var n=e.pageX;!n&&e.originalEvent&&e.originalEvent.touches&&e.originalEvent.touches.length&&(n=e.originalEvent.touches[0].pageX);var r=l?e.pageY-u.top:n-u.left;r=Math.max(0,Math.min(p||c,r));var i=r/c;return l&&(i=1-i),t&&(i=1-i),y(i,0,!0)},y=function(e,t){t===undefined&&(t=0),e>1&&(e=1);var r=Math.round(e*1e3)/10+"%";if(!h||e<=h)n||s.stop(),d?s.css("width",r):s.animate(l?{height:r}:{width:r},t,"linear");return e},b=function(e){return Math.max(0,Math.min(c,l?(1-e)*f:e*a))},w={max:function(e){h=e},disable:function(e){o=e},slide:function(e,t,n){v(),n&&m(e),y(e,t)},disableAnimation:function(e){d=e!==!1}};v(),r.data("api",w).bind("mousedown.sld touchstart",function(t){t.preventDefault();if(!o){var n=e.throttle(m,100);v(),w.dragging=!0,r.addClass("is-dragging"),m(g(t)),i.bind("mousemove.sld touchmove",function(e){e.preventDefault(),n(g(e))}).one("mouseup touchend",function(){w.dragging=!1,r.removeClass("is-dragging"),i.unbind("mousemove.sld touchmove")})}})})},flowplayer(function(t,n){function o(t){return e(".fp-"+t,n)}function T(t){if(n.css("width")==="0px"||n.css("height")==="0px"||t!==flowplayer.defaults.ratio)parseInt(v,10)||h.css("paddingTop",t*100+"%");i.inlineBlock||e("object",n).height(n.height())}function N(e){n.toggleClass("is-mouseover",e).toggleClass("is-mouseout",!e)}var r=t.conf,i=flowplayer.support,s;n.find(".fp-ratio,.fp-ui").remove(),n.addClass("flowplayer").append(' <div class="ratio"/> <div class="ui"> <div class="waiting"><em/><em/><em/></div> <a class="fullscreen"/> <a class="unload"/> <p class="speed"/> <div class="controls"> <a class="play"></a> <div class="timeline"> <div class="buffer"/> <div class="progress"/> </div> <div class="volume"> <a class="mute"></a> <div class="volumeslider"> <div class="volumelevel"/> </div> </div> </div> <div class="time"> <em class="elapsed">00:00</em> <em class="remaining"/> <em class="duration">00:00</em> </div> <div class="message"><h2/><p/></div> </div>'.replace(/class="/g,'class="fp-'));var u=o("progress"),a=o("buffer"),f=o("elapsed"),l=o("remaining"),c=o("waiting"),h=o("ratio"),p=o("speed"),d=o("duration"),v=h.css("paddingTop"),m=o("timeline").slider2(t.rtl),g=m.data("api"),y=o("volume"),b=o("fullscreen"),E=o("volumeslider").slider2(t.rtl),S=E.data("api"),x=n.is(".fixed-controls, .no-toggle");g.disableAnimation(n.hasClass("is-touch")),i.animation||c.html("<p>loading &hellip;</p>"),T(r.ratio);try{r.fullscreen||b.remove()}catch(C){b.remove()}t.bind("ready",function(){var e=t.video.duration;g.disable(t.disabled||!e),r.adaptiveRatio&&T(t.video.height/t.video.width),d.add(l).html(w(e)),e>=3600&&n.addClass("is-long")||n.removeClass("is-long"),S.slide(t.volumeLevel)}).bind("unload",function(){v||h.css("paddingTop","")}).bind("buffer",function(){var e=t.video,n=e.buffer/e.duration;!e.seekable&&i.seekable&&g.max(n),n<1?a.css("width",n*100+"%"):a.css({width:"100%"})}).bind("speed",function(e,t,n){p.text(n+"x").addClass("fp-hilite"),setTimeout(function(){p.removeClass("fp-hilite")},1e3)}).bind("buffered",function(){a.css({width:"100%"}),g.max(1)}).bind("progress",function(){var e=t.video.time,n=t.video.duration;g.dragging||g.slide(e/n,t.seeking?0:250),f.html(w(e)),l.html("-"+w(n-e))}).bind("finish resume seek",function(e){n.toggleClass("is-finished",e.type=="finish")}).bind("stop",function(){f.html(w(0)),g.slide(0,100)}).bind("finish",function(){f.html(w(t.video.duration)),g.slide(1,100),n.removeClass("is-seeking")}).bind("beforeseek",function(){u.stop()}).bind("volume",function(){S.slide(t.volumeLevel)}).bind("disable",function(){var e=t.disabled;g.disable(e),S.disable(e),n.toggleClass("is-disabled",t.disabled)}).bind("mute",function(e,t,r){n.toggleClass("is-muted",r)}).bind("error",function(t,i,s){n.removeClass("is-loading").addClass("is-error");if(s){s.message=r.errors[s.code],i.error=!0;var o=e(".fp-message",n);e("h2",o).text((i.engine||"html5")+": "+s.message),e("p",o).text(s.url||i.video.url||i.video.src||r.errorUrls[s.code]),n.unbind("mouseenter click").removeClass("is-mouseover")}}).bind("mouseenter mouseleave",function(e){if(x)return;var t=e.type=="mouseenter",r;N(t),t?(n.bind("pause.x mousemove.x volume.x",function(){N(!0),r=new Date}),s=setInterval(function(){new Date-r>2e3&&(N(!1),r=new Date)},100)):(n.unbind(".x"),clearInterval(s))}).bind("mouseleave",function(){(g.dragging||S.dragging)&&n.addClass("is-mouseover").removeClass("is-mouseout")}).bind("click.player",function(n){if(e(n.target).is(".fp-ui, .fp-engine")||n.flash)return n.preventDefault(),t.toggle()}).bind("contextmenu",function(t){t.preventDefault();var r=n.offset(),i=e(window),s=t.clientX-r.left,o=t.clientY-r.top+i.scrollTop(),u=n.find(".fp-context-menu").css({left:s+"px",top:o+"px",display:"block"}).on("click",function(e){e.stopPropagation()});e("html").on("click.outsidemenu",function(t){u.hide(),e("html").off("click.outsidemenu")})}).bind("flashdisabled",function(){n.addClass("is-flash-disabled").one("ready",function(){n.removeClass("is-flash-disabled").find(".fp-flash-disabled").remove()}).append('<div class="fp-flash-disabled">Adobe Flash is disabled for this page, click player area to enable.</div>')}),r.poster&&n.css("backgroundImage","url("+r.poster+")");var k=n.css("backgroundColor"),L=n.css("backgroundImage")!="none"||k&&k!="rgba(0, 0, 0, 0)"&&k!="transparent";L&&!r.splash&&!r.autoplay&&t.bind("ready stop",function(){n.addClass("is-poster").one("progress",function(){n.removeClass("is-poster")})}),!L&&t.forcedSplash&&n.css("backgroundColor","#555"),e(".fp-toggle, .fp-play",n).click(t.toggle),e.each(["mute","fullscreen","unload"],function(e,n){o(n).click(function(){t[n]()})}),m.bind("slide",function(e,n){t.seeking=!0,t.seek(n*t.video.duration)}),E.bind("slide",function(e,n){t.volume(n)}),o("time").click(function(t){e(this).toggleClass("is-inverted")}),N(x)});var E,S,x="is-help";e(document).bind("keydown.fp",function(t){var n=E,r=t.ctrlKey||t.metaKey||t.altKey,i=t.which,s=n&&n.conf;if(!n||!s.keyboard||n.disabled)return;if(e.inArray(i,[63,187,191])!=-1)return S.toggleClass(x),!1;if(i==27&&S.hasClass(x))return S.toggleClass(x),!1;if(!r&&n.ready){t.preventDefault();if(t.shiftKey){i==39?n.speed(!0):i==37&&n.speed(!1);return}if(i<58&&i>47)return n.seekTo(i-48);switch(i){case 38:case 75:n.volume(n.volumeLevel+.15);break;case 40:case 74:n.volume(n.volumeLevel-.15);break;case 39:case 76:n.seeking=!0,n.seek(!0);break;case 37:case 72:n.seeking=!0,n.seek(!1);break;case 190:n.seekTo();break;case 32:n.toggle();break;case 70:s.fullscreen&&n.fullscreen();break;case 77:n.mute();break;case 81:n.unload()}}}),flowplayer(function(t,n){if(!t.conf.keyboard)return;n.bind("mouseenter mouseleave",function(e){E=!t.disabled&&e.type=="mouseenter"?t:0,E&&(S=n)}),n.append(' <div class="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> <p><em>shift</em> + <em>&#8592;</em><em>&#8594;</em>slower / faster <small>(latest Chrome and Safari)</small></p> </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> </div> '),t.conf.tooltip&&e(".fp-ui",n).attr("title","Hit ? for help").on("mouseout.tip",function(){e(this).removeAttr("title").off("mouseout.tip")}),e(".fp-close",n).click(function(){n.toggleClass(x)})});var T=e.browser.mozilla?"moz":"webkit",N="fullscreen",C="fullscreen-exit",k,L=flowplayer.support.fullscreen,A=typeof document.exitFullscreen=="function",O=navigator.userAgent.toLowerCase(),M=/(safari)[ \/]([\w.]+)/.exec(O)&&!/(chrome)[ \/]([\w.]+)/.exec(O);e(document).bind(A?"fullscreenchange":T+"fullscreenchange",function(t){var n=e(document.webkitCurrentFullScreenElement||document.mozFullScreenElement||document.fullscreenElement||t.target);n.length&&!k?k=n.trigger(N,[n]):(k.trigger(C,[k]),k=null)}),flowplayer(function(t,n){if(!t.conf.fullscreen)return;var r=e(window),i={index:0,pos:0,play:!1},s;t.isFullscreen=!1,t.fullscreen=function(o){if(t.disabled)return;return o===undefined&&(o=!t.isFullscreen),o&&(s=r.scrollTop()),(T=="webkit"||M)&&t.engine=="flash"&&(i.index=t.video.index,t.conf.rtmp&&e.extend(i,{pos:t.video.time,play:t.playing})),L?o?A?n[0].requestFullscreen():(n[0][T+"RequestFullScreen"](Element.ALLOW_KEYBOARD_INPUT),M&&!document.webkitCurrentFullScreenElement&&!document.mozFullScreenElement&&n[0][T+"RequestFullScreen"]()):A?document.exitFullscreen():document[T+"CancelFullScreen"]():t.trigger(o?N:C,[t]),t};var o;n.bind("mousedown.fs",function(){+(new Date)-o<150&&t.ready&&t.fullscreen(),o=+(new Date)}),t.bind(N,function(e){n.addClass("is-fullscreen"),t.isFullscreen=!0}).bind(C,function(e){var i;!L&&t.engine==="html5"&&(i=n.css("opacity")||"",n.css("opacity",0)),n.removeClass("is-fullscreen"),!L&&t.engine==="html5"&&setTimeout(function(){n.css("opacity",i)}),t.isFullscreen=!1,r.scrollTop(s)}).bind("ready",function(){if(i.index>0)t.play(i.index),i.index=0;else if(i.pos&&!isNaN(i.pos)){var n=function(){i.play||t.pause(),e.extend(i,{pos:0,play:!1})};t.conf.live?(t.resume(),n()):t.resume().seek(i.pos,n)}})}),flowplayer(function(t,n){function s(){return e(r.query,n)}function o(){return e(r.query+"."+i,n)}var r=e.extend({active:"is-active",advance:!0,query:".fp-playlist a"},t.conf),i=r.active;t.play=function(n){return n===undefined?t.resume():typeof n=="number"&&!t.conf.playlist[n]?t:(typeof n!="number"&&t.load.apply(null,arguments),t.unbind("resume.fromfirst"),t.video.index=n,t.load(typeof t.conf.playlist[n]=="string"?t.conf.playlist[n].toString():e.map(t.conf.playlist[n],function(t){return e.extend({},t)})),t)},t.next=function(e){e&&e.preventDefault();var n=t.video.index;return n!=-1&&(n=n===t.conf.playlist.length-1?0:n+1,t.play(n)),t},t.prev=function(e){e&&e.preventDefault();var n=t.video.index;return n!=-1&&(n=n===0?t.conf.playlist.length-1:n-1,t.play(n)),t},e(".fp-next",n).click(t.next),e(".fp-prev",n).click(t.prev),r.advance&&n.unbind("finish.pl").bind("finish.pl",function(e,t){var i=t.video.index+1;i<t.conf.playlist.length||r.loop?(i=i===t.conf.playlist.length?0:i,n.removeClass("is-finished"),setTimeout(function(){t.play(i)})):(n.addClass("is-playing"),t.conf.playlist.length>1&&t.one("resume.fromfirst",function(){return t.play(0),!1}))});var u=!1;if(t.conf.playlist.length){u=!0;var a=n.find(".fp-playlist");if(!a.length){a=e('<div class="fp-playlist"></div>');var f=e(".fp-next,.fp-prev",n);f.length?f.eq(0).before(a):e("video",n).after(a)}a.empty(),e.each(t.conf.playlist,function(t,n){var r;if(typeof n=="string")r=n;else for(var i in n[0])if(n[0].hasOwnProperty(i)){r=n[0][i];break}a.append(e("<a />").attr({href:r,"data-index":t}))})}if(s().length){u||(t.conf.playlist=[],s().each(function(){var n=e(this).attr("href");e(this).attr("data-index",t.conf.playlist.length),t.conf.playlist.push(n)})),n.on("click",r.query,function(n){n.preventDefault();var i=e(n.target).closest(r.query),s=Number(i.attr("data-index"));s!=-1&&t.play(s)});var l=s().filter("[data-cuepoints]").length;t.bind("load",function(r,s,u){var a=o().removeClass(i),f=a.attr("data-index"),c=u.index=t.video.index||0,h=e('a[data-index="'+c+'"]',n).addClass(i),p=c==t.conf.playlist.length-1;n.removeClass("video"+f).addClass("video"+c).toggleClass("last-video",p),u.index=s.video.index=c,u.is_last=s.video.is_last=p,l&&(t.cuepoints=h.data("cuepoints"))}).bind("unload.pl",function(){o().toggleClass(i)})}t.conf.playlist.length&&(t.conf.loop=!1)});var _=/ ?cue\d+ ?/;flowplayer(function(t,n){function i(e){n[0].className=n[0].className.replace(_," "),e>=0&&n.addClass("cue"+e)}var r=0;t.cuepoints=t.conf.cuepoints||[],t.bind("progress",function(e,s,o){if(r&&o-r<.015)return r=o;r=o;var u=t.cuepoints||[];for(var a=0,f;a<u.length;a++)f=u[a],isNaN(f)||(f={time:f}),f.time<0&&(f.time=t.video.duration+f.time),f.index=a,Math.abs(f.time-o)<.125*t.currentSpeed&&(i(a),n.trigger("cuepoint",[t,f]))}).bind("unload seek",i),t.conf.generate_cuepoints&&t.bind("load",function(){e(".fp-cuepoint",n).remove()}).bind("ready",function(){var r=t.cuepoints||[],i=t.video.duration,s=e(".fp-timeline",n).css("overflow","visible");e.each(r,function(n,r){var o=r.time||r;o<0&&(o=i+r);var u=e("<a/>").addClass("fp-cuepoint fp-cuepoint"+n).css("left",o/i*100+"%");u.appendTo(s).mousedown(function(){return t.seek(o),!1})})})}),flowplayer(function(t,n,r){function u(e){var t=e.split(":");return t.length==2&&t.unshift(0),t[0]*60*60+t[1]*60+parseFloat(t[2].replace(",","."))}var i=e("track",n),s=t.conf;if(flowplayer.support.subtitles){t.subtitles=i.length&&i[0].track;if(s.nativesubtitles&&s.engine=="html5")return}i.remove();var o=/^(([0-9]{2}:)?[0-9]{2}:[0-9]{2}[,.]{1}[0-9]{3}) --\> (([0-9]{2}:)?[0-9]{2}:[0-9]{2}[,.]{1}[0-9]{3})(.*)/;t.subtitles=[];var a=i.attr("src");if(!a)return;setTimeout(function(){e.get(a,function(n){for(var r=0,i=n.split("\n"),s=i.length,a={},f,l,c,h;r<s;r++){l=o.exec(i[r]);if(l){f=i[r-1],c="<p>"+i[++r]+"</p><br/>";while(e.trim(i[++r])&&r<i.length)c+="<p>"+i[r]+"</p><br/>";a={title:f,startTime:u(l[1]),endTime:u(l[2]||l[3]),text:c},h={time:a.startTime,subtitle:a},t.subtitles.push(a),t.cuepoints.push(h),t.cuepoints.push({time:a.endTime,subtitleEnd:f}),a.startTime===0&&t.trigger("cuepoint",h)}}}).fail(function(){return t.trigger("error",{code:8,url:a}),!1})});var f=e("<div class='fp-subtitle'/>").appendTo(n),l;t.bind("cuepoint",function(e,t,n){n.subtitle?(l=n.index,f.html(n.subtitle.text).addClass("fp-active")):n.subtitleEnd&&(f.removeClass("fp-active"),l=n.index)}).bind("seek",function(n,r,i){l&&t.cuepoints[l]&&t.cuepoints[l].time>i&&(f.removeClass("fp-active"),l=null),e.each(t.cuepoints||[],function(e,n){var r=n.subtitle;r&&l!=n.index?i>=n.time&&(!r.endTime||i<=r.endTime)&&t.trigger("cuepoint",n):n.subtitleEnd&&i>=n.time&&n.index==l+1&&t.trigger("cuepoint",n)})})}),flowplayer(function(t,n){var r=t.conf.analytics,i=0,s=0;if(r){typeof _gat=="undefined"&&e.getScript("//google-analytics.com/ga.js");function o(e){if(i&&typeof _gat!="undefined"){var s=_gat._getTracker(r),o=t.video;s._setAllowLinker(!0),s._trackEvent("Video / Seconds played",t.engine+"/"+o.type,n.attr("title")||o.src.split("/").slice(-1)[0].replace(m,""),Math.round(i/1e3)),i=0}}t.bind("load unload",o).bind("progress",function(){t.seeking||(i+=s?+(new Date)-s:0,s=+(new Date))}).bind("pause",function(){s=0}),e(window).unload(o)}});var D=/IEMobile/.test(r);(flowplayer.support.touch||D)&&flowplayer(function(t,n){var i=/Android/.test(r)&&!/Firefox/.test(r)&&!/Opera/.test(r),s=/Silk/.test(r),o=i?parseFloat(/Android\ (\d\.\d)/.exec(r)[1],10):0;if(i){t.conf.videoTypePreference="mp4";if(!/Chrome/.test(r)&&o<4){var u=t.load;t.load=function(e,n){var r=u.apply(t,arguments);return t.trigger("ready",[t,t.video]),r}}}flowplayer.support.volume||n.addClass("no-volume no-mute"),n.addClass("is-touch"),n.find(".fp-timeline").data("api").disableAnimation();var a=!1;n.bind("touchmove",function(){a=!0}).bind("touchend click",function(r){if(a){a=!1;return}if(t.playing&&!n.hasClass("is-mouseover"))
6
- return n.addClass("is-mouseover").removeClass("is-mouseout"),!1;t.paused&&n.hasClass("is-mouseout")&&!t.splash&&t.toggle(),t.paused&&D&&e("video.fp-engine",n)[0].play()}),t.conf.native_fullscreen&&typeof e("<video />")[0].webkitEnterFullScreen=="function"&&(t.fullscreen=function(){var t=e("video.fp-engine",n);t[0].webkitEnterFullScreen(),t.one("webkitendfullscreen",function(){t.prop("controls",!0).prop("controls",!1)})}),(i||s)&&t.bind("ready",function(){var r=e("video.fp-engine",n);r.one("canplay",function(){r[0].play()}),r[0].play(),t.bind("progress.dur",function(){var i=r[0].duration;i!==1&&(t.video.duration=i,e(".fp-duration",n).html(w(i)),t.unbind("progress.dur"))})})}),flowplayer(function(t,n){if(t.conf.embed===!1)return;var r=t.conf,i=e(".fp-ui",n),s=e("<a/>",{"class":"fp-embed",title:"Copy to your site"}).appendTo(i),o=e("<div/>",{"class":"fp-embed-code"}).append("<label>Copy and paste this HTML code into your webpage to embed.</label><textarea/>").appendTo(i),u=e("textarea",o);t.embedCode=function(){var i=t.video,s=i.width||n.width(),o=i.height||n.height(),u=e("<div/>",{"class":"flowplayer",css:{width:s,height:o}}),a=e("<video/>").appendTo(u);e.each(["origin","analytics","key","rtmp"],function(e,t){r[t]&&u.attr("data-"+t,r[t])}),r.logo&&u.attr("data-logo",e("<img />").attr("src",r.logo)[0].src),e.each(i.sources,function(t,n){var i=n.src;if(!/^https?:/.test(n.src)&&n.type!=="flash"||!r.rtmp)i=e("<img/>").attr("src",n.src)[0].src;a.append(e("<source/>",{type:"video/"+n.type,src:i}))});var f={src:"//foliovision.com/flowplayer/5.4.6/embed.min.js"};e.isPlainObject(r.embed)&&(f["data-swf"]=r.embed.swf,f["data-library"]=r.embed.library,f.src=r.embed.script||f.src,r.embed.skin&&(f["data-skin"]=r.embed.skin));var l=e("<foo/>",f).append(u);return e("<p/>").append(l).html().replace(/<(\/?)foo/g,"<$1script")},n.fptip(".fp-embed","is-embedding"),u.click(function(){this.select()}),s.click(function(){u.text(t.embedCode()),u[0].focus(),u[0].select()})}),e.fn.fptip=function(t,n){return this.each(function(){function i(){r.removeClass(n),e(document).unbind(".st")}var r=e(this);e(t||"a",this).click(function(t){t.preventDefault(),r.toggleClass(n),r.hasClass(n)&&e(document).bind("keydown.st",function(e){e.which==27&&i()}).bind("click.st",function(t){e(t.target).parents("."+n).length||i()})})})}}(jQuery),flowplayer(function(e,t){function n(e){var t=s("<a/>")[0];return t.href=e,t.hostname}function r(e){var t="ab.ca,ac.ac,ac.at,ac.be,ac.cn,ac.il,ac.in,ac.jp,ac.kr,ac.th,ac.uk,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.gl,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.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.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,cq.cn,de.com,de.org,ecn.br,edu.au,edu.cn,edu.hk,edu.mm,edu.my,edu.pt,edu.qa,edu.tr,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,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,k12.il,k12.tr,kr.com,lel.br,ln.cn,ltd.uk,maori.nz,mb.ca,me.uk,med.br,mi.th,mil.br,mo.cn,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,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,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.ul,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(",");e=e.toLowerCase();var n=e.split("."),r=n.length;if(r<2)return e;var i=n.slice(-2).join(".");return r>=3&&s.inArray(i,t)>=0?n.slice(-3).join("."):i}function i(e,t){t!="localhost"&&!parseInt(t.split(".").slice(-1))&&(t=r(t));var n=0;for(var i=t.length-1;i>=0;i--)n+=t.charCodeAt(i)*28939532831;n=(""+n).substring(0,7);for(i=0;i<e.length;i++)if(n===e[i].substring(1,8))return 1}var s=jQuery,o=e.conf,u=o.swf.indexOf("flowplayer.org")&&o.e&&t.data("origin"),a=u?n(u):location.hostname,f=o.key;location.protocol=="file:"&&(a="localhost"),e.load.ed=1,o.hostname=a,o.origin=u||location.href,u&&t.addClass("is-embedded"),typeof f=="string"&&(f=f.split(/,\s*/));if(f&&typeof i=="function"&&i(f,a))o.logo&&t.append(s("<a>",{"class":"fp-logo",href:u}).append(s("<img/>",{src:o.logo})));else{var l=s("<a/>").attr("onclick","").appendTo(t),c=s(".fp-controls",t),h=s('<div class="fp-context-menu"><ul><li class="copyright">&copy; 2013</li><li><a href="http://flowplayer.org">About Flowplayer</a></li><li><a href="http://flowplayer.org/license">GPL based license</a></li></ul></div>').appendTo(t);e.bind("pause resume finish unload",function(e,n){var r=-1;n.video.src&&s.each([["org","flowplayer","drive"],["org","flowplayer","my"]],function(e,t){return r=n.video.src.indexOf("://"+t.reverse().join(".")),r===-1}),/pause|resume/.test(e.type)&&n.engine!="flash"&&r!=4&&r!=5?(l.show().css({position:"absolute",left:16,bottom:36,zIndex:99999,width:120,height:27,backgroundImage:"url("+[".png","fplogo","/",".com","foliovision","//"].reverse().join("")+")"}),n.load.ed=l.is(":visible")&&s.contains(t[0],h[0]),n.load.ed||n.pause()):l.hide()})}});
7
 
8
  /*
9
  FV Flowplayer additions!
10
  */
11
  if( typeof(fv_flowplayer_conf) != "undefined" ) {
12
  flowplayer.conf = fv_flowplayer_conf
 
 
 
13
  }
14
 
15
  if( typeof(fv_flowplayer_admin_input) != "undefined" && fv_flowplayer_admin_input ) {
@@ -87,16 +91,19 @@ function fv_wp_flowplayer_admin_support_mail( hash, button ) {
87
  function fv_flowplayer_admin_message_parse_group(aInfo) {
88
  var sOutput = '';
89
  if( typeof(aInfo) != "undefined" && Object.keys(aInfo).length > 0 ) {
90
- sOutput += '<p>';
91
  for( var j in aInfo ) {
92
  if( j == parseInt(j) ){
93
  sOutput += aInfo[j]+'<br />';
 
 
94
  } else {
95
  sOutput += j+': <tt>'+aInfo[j]+'</tt><br />';
96
  }
97
  }
98
- sOutput += '</p>';
99
- }
 
 
100
  return sOutput;
101
  }
102
 
@@ -154,16 +161,20 @@ function fv_flowplayer_admin_test_media( hash, media ) {
154
  }
155
  sCheckerInfo += fv_flowplayer_admin_message_parse_group(obj[i].info);
156
 
157
- if( typeof(obj[i].warnings) != "undefined" && Object.keys(obj[i].warnings).length > 0 && sResponseClass != 'vid-issues' ) {
158
- sResponseMsg = 'Video Warnings';
159
- sResponseClass = 'vid-warning';
160
- sCheckerInfo += fv_flowplayer_admin_message_parse_group(obj[i].warnings);
 
 
 
161
  }
162
 
163
- if( typeof(obj[i].errors) != "undefined" && Object.keys(obj[i].errors).length > 0 ) {
 
164
  sResponseMsg = 'Video Issues';
165
  sResponseClass = 'vid-issues';
166
- sCheckerInfo += fv_flowplayer_admin_message_parse_group(obj[i].errors);
167
  }
168
 
169
  jQuery('#wpfp_notice_'+hash).find('.video-checker-result').addClass(sResponseClass).html(sResponseMsg);
@@ -183,15 +194,14 @@ function fv_flowplayer_admin_test_media( hash, media ) {
183
  }
184
 
185
  } ).error(function() {
186
- jQuery('#wpfp_notice_'+hash).html('<p>Admin: <abbr title="Check the PHP error log.">Check failed</abbr>.</p>');
 
 
 
 
187
  });
188
  }
189
 
190
- function fv_flowplayer_autoplay( hash ) {
191
- jQuery('#wpfp_'+hash).bind( 'ready', function() {
192
- jQuery('#wpfp_'+hash).flowplayer().play();
193
- });
194
- }
195
 
196
  function fv_flowplayer_amazon_s3( hash, time ) {
197
  jQuery('#wpfp_'+hash).bind('error', function (e,api, error) {
@@ -208,11 +218,9 @@ function fv_flowplayer_browser_chrome_fail( hash, sAttributes, sVideo, bAutobuff
208
  jQuery('#wpfp_'+hash).bind('error', function (e,api, error) {
209
  if( /chrom(e|ium)/.test(navigator.userAgent.toLowerCase()) && error != null && ( error.code == 3 || error.code == 4 || error.code == 5 ) ) {
210
  api.unload();
211
- var html = jQuery('<div />').append(jQuery('#wpfp_'+hash+' .wpfp_custom_popup').clone()).html();
212
- html += jQuery('<div />').append(jQuery('#wpfp_'+hash+' .wpfp_custom_ad').clone()).html();
213
 
214
  jQuery('#wpfp_'+hash).attr('id','bad_wpfp_'+hash);
215
- jQuery('#bad_wpfp_'+hash).after( '<div id="wpfp_'+hash+'" '+sAttributes+' data-engine="flash">'+html+'</div>' );
216
  jQuery('#wpfp_'+hash).flowplayer({ playlist: [ [ {mp4: sVideo} ] ] });
217
  // what about scripts?
218
  if( bAutobuffer ) {
@@ -231,7 +239,7 @@ function fv_flowplayer_browser_chrome_mp4( hash ) {
231
  var chrome_ver = parseInt(match[1], 10);
232
  if(
233
  ( /chrom(e|ium)/.test(navigator.userAgent.toLowerCase()) && chrome_ver < 28 && navigator.appVersion.indexOf("Win")!=-1 ) ||
234
- ( /chrom(e|ium)/.test(navigator.userAgent.toLowerCase()) && chrome_ver < 27 && navigator.appVersion.indexOf("Linux")!=-1 )
235
  ) {
236
  jQuery('#wpfp_'+hash).attr('data-engine','flash');
237
  }
@@ -245,7 +253,7 @@ function fv_flowplayer_browser_ff_m4v( hash ) {
245
  }
246
 
247
  function fv_flowplayer_browser_ie( hash ) {
248
- if( (jQuery.browser.msie && parseInt(jQuery.browser.version, 10) >= 9) || !!navigator.userAgent.match(/Trident.*rv[ :]*11\./) ) {
249
  jQuery('#wpfp_'+hash).attr('data-engine','flash');
250
  }
251
  }
@@ -269,8 +277,13 @@ jQuery(document).ready( function() {
269
  jQuery(this).find('.embed-code').hide();
270
  } );
271
  jQuery('.flowplayer .embed-code-toggle').click( function() {
272
- jQuery(this).parent().siblings('.embed-code').toggle();
273
- jQuery(this).parent().parent().toggleClass('visible');
 
 
 
 
 
274
  return false;
275
  } );
276
  } );
@@ -326,7 +339,7 @@ function fv_flowplayer_safety_resize() {
326
  var fv_flowplayer_safety_resize_init = false;
327
 
328
  jQuery('.flowplayer').each( function() {
329
- if( jQuery(this).hasClass('lightboxed') ) return;
330
 
331
  if( jQuery(this).width() < 30 || jQuery(this).height() < 20 ) {
332
  fv_flowplayer_safety_resize_init = true
@@ -344,7 +357,7 @@ function fv_flowplayer_safety_resize() {
344
  if( fv_flowplayer_safety_resize_init ) {
345
  jQuery(window).resize(function() {
346
  jQuery('.flowplayer').each( function() {
347
- if( jQuery(this).hasClass('lightboxed') ) return;
348
 
349
  if( fv_flowplayer_safety_resize_arr[jQuery(this).attr('id')] ) {
350
  jQuery(this).width( fv_flowplayer_safety_resize_arr[jQuery(this).attr('id')].width() );
@@ -384,9 +397,18 @@ jQuery(document).ready( function() {
384
  }
385
  }, 250 );
386
  } );
 
 
 
 
 
 
 
 
 
387
  } );
388
 
389
- jQuery( function() { if( typeof(flowplayer.conf) != "undefined" && typeof(flowplayer.conf.key) == "undefined" ) { jQuery('.flowplayer').unbind('contextmenu'); } } );
390
 
391
  if( typeof(fv_flowplayer_playlists) != "undefined" ) {
392
  for( var i in fv_flowplayer_playlists ) {
@@ -397,11 +419,7 @@ if( typeof(fv_flowplayer_playlists) != "undefined" ) {
397
  var fv_fp_date = new Date();
398
  var fv_fp_utime = fv_fp_date.getTime();
399
 
400
- if( typeof(fv_flowplayer_autoplay_array) != "undefined" ) {
401
- for( var i in fv_flowplayer_autoplay_array ) {
402
- fv_flowplayer_autoplay( i );
403
- }
404
- }
405
  if( typeof(fv_flowplayer_browser_ff_m4v_array) != "undefined" ) {
406
  for( var i in fv_flowplayer_browser_ff_m4v_array ) {
407
  fv_flowplayer_browser_ff_m4v( i );
@@ -453,9 +471,138 @@ if( jQuery.browser.msie && parseInt(jQuery.browser.version, 10) < 9 ) {
453
  jQuery('.flowplayer').bind("ready", function (e, api, video) {
454
  setTimeout( function () {
455
  jQuery('.fvp-share-bar',e.currentTarget).appendTo(jQuery('.fvp-share-bar',e.currentTarget).parent().find('.fp-ui'));
456
- jQuery('.fvp-share-bar',e.currentTarget).show();
457
- jQuery(e.currentTarget).find('.fp-embed').hide().click();
458
- jQuery(e.currentTarget).find('.embed-code textarea').val(jQuery(e.currentTarget).find('.fp-embed-code textarea').val());
459
  }, 100 );
460
  });
461
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  /*!
2
 
3
+ Flowplayer Unlimited v5.5.2 (2014-11-27) | flowplayer.org/license
4
+
5
+ */!function(e){function a(t,n,r){r=r||"transparent";var i="obj"+(""+Math.random()).slice(2,15),s='<object class="fp-engine" id="'+i+'" name="'+i+'" ';s+=e.browser.msie?'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">':' data="'+t+'" type="application/x-shockwave-flash">';var o={width:"100%",height:"100%",allowscriptaccess:"always",wmode:r,quality:"high",flashvars:"",movie:t+(e.browser.msie?"?"+i:""),name:i};return e.each(n,function(e,t){o.flashvars+=e+"="+t+"&"}),e.each(o,function(e,t){s+='<param name="'+e+'" value="'+t+'"/>'}),s+="</object>",e(s)}function c(e,t){return t=t||100,Math.round(e*t)/t}function h(e){return/mpegurl/i.test(e)?"application/x-mpegurl":"video/"+e}function p(e){return/^(video|application)/i.test(e)||(e=h(e)),!!f.canPlayType(e).replace("no","")}function d(t,n){var r=e.grep(t,function(e){return e.type===n});return r.length?r[0]:null}function b(e){var t=e.attr("src"),n=e.attr("type")||"",r=t.split(y)[1];return n=/mpegurl/i.test(n)?"mpegurl":n.replace("video/",""),{src:t,suffix:r||n,type:n||r}}function w(t){var n=this,r=[];e("source",t).each(function(){r.push(b(e(this)))}),r.length||r.push(b(t)),n.initialSources=r,n.resolve=function(t){return t?(e.isArray(t)?t={sources:e.map(t,function(t){var n,r=e.extend({},t);return e.each(t,function(e,t){n=e}),r.type=n,r.src=t[n],delete r[n],r})}:typeof t=="string"&&(t={src:t,sources:[]},e.each(r,function(e,n){n.type!="flash"&&t.sources.push({type:n.type,src:t.src.replace(y,"."+n.suffix+"$2")})})),t):{sources:r}}}function E(e){return e=parseInt(e,10),e>=10?e:"0"+e}function S(e){e=e||0;var t=Math.floor(e/3600),n=Math.floor(e/60);return e-=n*60,t>=1?(n-=t*60,t+":"+E(n)+":"+E(e)):E(n)+":"+E(e)}!function(e){if(!e.browser){var t=e.browser={},n=navigator.userAgent.toLowerCase(),r=/(chrome)[ \/]([\w.]+)/.exec(n)||/(safari)[ \/]([\w.]+)/.exec(n)||/(webkit)[ \/]([\w.]+)/.exec(n)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(n)||/(msie) ([\w.]+)/.exec(n)||n.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(n)||[];r[1]&&(t[r[1]]=!0,t.version=r[2]||"0")}}(jQuery),e(function(){typeof e.fn.flowplayer=="function"&&e("video").parent(".flowplayer").flowplayer()});var t=[],n=[],r=window.navigator.userAgent;window.flowplayer=function(r){return e.isFunction(r)?n.push(r):typeof r=="number"||r===undefined?t[r||0]:e(r).data("flowplayer")},e(window).on("beforeunload",function(){e.each(t,function(t,n){n.conf.splash?n.unload():n.bind("error",function(){e(".flowplayer.is-error .fp-message").remove()})})});var i=!1;try{typeof window.localStorage=="object"&&(window.localStorage.flowplayerTestStorage="test",i=!0)}catch(s){}var o=/Safari/.exec(navigator.userAgent)&&!/Chrome/.exec(navigator.userAgent);m=/(\d+\.\d+) Safari/.exec(navigator.userAgent),safariVersion=m?Number(m[1]):100,e.extend(flowplayer,{version:"5.5.2",engine:{},conf:{},support:{},defaults:{debug:!1,disabled:!1,engine:"html5",fullscreen:window==window.top,keyboard:!0,ratio:9/16,adaptiveRatio:!1,flashfit:!1,rtmp:0,splash:!1,live:!1,swf:"//releases.flowplayer.org/5.5.2/commercial/flowplayer.swf",speeds:[.25,.5,1,1.5,2],tooltip:!0,volume:i?localStorage.muted=="true"?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:o&&safariVersion<8}});var u=1;e.fn.flowplayer=function(r,s){return typeof r=="string"&&(r={swf:r}),e.isFunction(r)&&(s=r,r={}),!r&&this.data("flowplayer")||this.each(function(){var o=e(this).addClass("is-loading"),a=e.extend({},flowplayer.defaults,flowplayer.conf,r,o.data()),f=e("video",o).addClass("fp-engine").removeAttr("controls"),l=f.length?new w(f):null,c={},h,p;if(a.playlist.length){var d=a.preload||f.attr("preload"),v;f.length&&f.replaceWith(v=e("<p />")),f=e("<video />").addClass("fp-engine"),v?v.replaceWith(f):o.prepend(f),flowplayer.support.video&&f.attr("preload",d),typeof a.playlist[0]=="string"?f.attr("src",a.playlist[0]):e.each(a.playlist[0],function(t,n){for(var r in n)n.hasOwnProperty(r)&&f.append(e("<source />").attr({type:"video/"+r,src:n[r]}))}),l=new w(f)}var m=o.data("flowplayer");m&&m.unload(),o.data("fp-player_id",o.data("fp-player_id")||u++);try{c=i?window.localStorage:c}catch(g){}var y=this.currentStyle&&this.currentStyle.direction==="rtl"||window.getComputedStyle&&window.getComputedStyle(this,null).getPropertyValue("direction")==="rtl";y&&o.addClass("is-rtl");var b=m||{conf:a,currentSpeed:1,volumeLevel:typeof a.volume=="undefined"?c.volume*1:a.volume,video:{},disabled:!1,finished:!1,loading:!1,muted:c.muted=="true"||a.muted,paused:!1,playing:!1,ready:!1,splash:!1,rtl:y,load:function(t,n){if(b.error||b.loading||b.disabled)return;t=l.resolve(t),e.extend(t,p.pick(t.sources));if(t.src){var r=e.Event("load");o.trigger(r,[b,t,p]),r.isDefaultPrevented()?b.loading=!1:(p.load(t),e.isFunction(t)&&(n=t),n&&o.one("ready",n))}return b},pause:function(e){return b.ready&&!b.seeking&&!b.disabled&&!b.loading&&(p.pause(),b.one("pause",e)),b},resume:function(){return b.ready&&b.paused&&!b.disabled&&(p.resume(),b.finished&&(b.trigger("resume",[b]),b.finished=!1)),b},toggle:function(){return b.ready?b.paused?b.resume():b.pause():b.load()},seek:function(t,n){if(b.ready&&!b.live){if(typeof t=="boolean"){var r=b.video.duration*.1;t=b.video.time+(t?r:-r)}t=h=Math.min(Math.max(t,0),b.video.duration).toFixed(1);var i=e.Event("beforeseek");o.trigger(i,[b,t]),i.isDefaultPrevented()?(b.seeking=!1,o.toggleClass("is-seeking",b.seeking)):(p.seek(t),e.isFunction(n)&&o.one("seek",n))}return b},seekTo:function(e,t){var n=e===undefined?h:b.video.duration*.1*e;return b.seek(n,t)},mute:function(e){return e===undefined&&(e=!b.muted),c.muted=b.muted=e,c.volume=isNaN(c.volume)?a.volume:c.volume,b.volume(e?0:c.volume,!0),b.trigger("mute",e),b},volume:function(e,t){return b.ready&&(e=Math.min(Math.max(e,0),1),t||(c.volume=e),p.volume(e)),b},speed:function(t,n){return b.ready&&(typeof t=="boolean"&&(t=a.speeds[e.inArray(b.currentSpeed,a.speeds)+(t?1:-1)]||b.currentSpeed),p.speed(t),n&&o.one("speed",n)),b},stop:function(){return b.ready&&(b.pause(),b.seek(0,function(){o.trigger("stop")})),b},unload:function(){return o.hasClass("is-embedding")||(a.splash?(b.trigger("unload"),p.unload()):b.stop()),b},disable:function(e){return e===undefined&&(e=!b.disabled),e!=b.disabled&&(b.disabled=e,b.trigger("disable",e)),b}};b.conf=e.extend(b.conf,a),e.each(["bind","one","unbind"],function(e,t){b[t]=function(e,n){return o[t](e,n),b}}),b.trigger=function(e,t){return o.trigger(e,[b,t]),b},o.data("flowplayer")||o.bind("boot",function(){e.each(["autoplay","loop","preload","poster"],function(e,t){var n=f.attr(t);n!==undefined&&(a[t]=n?n:!0)});if(a.splash||o.hasClass("is-splash")||!flowplayer.support.firstframe)b.forcedSplash=!a.splash&&!o.hasClass("is-splash"),b.splash=a.splash=a.autoplay=!0,o.addClass("is-splash"),flowplayer.support.video&&f.attr("preload","none");if(a.live||o.hasClass("is-live"))b.live=a.live=!0,o.addClass("is-live");e.each(n,function(e){this(b,o)}),p=flowplayer.engine[a.engine],p&&(p=p(b,o)),p.pick(l.initialSources)?b.engine=a.engine:e.each(flowplayer.engine,function(e,t){if(e!=a.engine){p=this(b,o);if(p.pick(l.initialSources))return b.engine=e,!1}}),t.push(b);if(!b.engine)return b.trigger("error",{code:flowplayer.support.flashVideo?5:10});a.splash?b.unload():b.load(),a.disabled&&b.disable(),p.volume(b.volumeLevel),o.one("ready",s)}).bind("load",function(t,n,r){a.splash&&e(".flowplayer").filter(".is-ready, .is-loading").not(o).each(function(){var t=e(this).data("flowplayer");t.conf.splash&&t.unload()}),o.addClass("is-loading"),n.loading=!0}).bind("ready",function(e,t,n){function r(){o.removeClass("is-loading"),t.loading=!1}n.time=0,t.video=n,a.splash?o.one("progress",r):r(),t.muted?t.mute(!0):t.volume(t.volumeLevel);var i=t.conf.hlsFix&&/mpegurl/i.exec(n.type);o.toggleClass("hls-fix",!!i)}).bind("unload",function(e){a.splash&&f.remove(),o.removeClass("is-loading"),b.loading=!1}).bind("ready unload",function(e){var t=e.type=="ready";o.toggleClass("is-splash",!t).toggleClass("is-ready",t),b.ready=t,b.splash=!t}).bind("progress",function(e,t,n){t.video.time=n}).bind("speed",function(e,t,n){t.currentSpeed=n}).bind("volume",function(e,t,n){t.volumeLevel=Math.round(n*100)/100,t.muted?n&&t.mute(!1):c.volume=n}).bind("beforeseek seek",function(e){b.seeking=e.type=="beforeseek",o.toggleClass("is-seeking",b.seeking)}).bind("ready pause resume unload finish stop",function(e,t,n){b.paused=/pause|finish|unload|stop/.test(e.type),e.type=="ready"&&(b.paused=a.preload=="none",n&&(b.paused=!n.duration||!a.autoplay&&a.preload!="none")),b.playing=!b.paused,o.toggleClass("is-paused",b.paused).toggleClass("is-playing",b.playing),b.load.ed||b.pause()}).bind("finish",function(e){b.finished=!0}).bind("error",function(){f.remove()}),o.trigger("boot",[b,o]).data("flowplayer",b)})},!function(){var t=function(e){var t=/Version\/(\d\.\d)/.exec(e);return t&&t.length>1?parseFloat(t[1],10):0},n=flowplayer.support,r=e.browser,i=e("<video loop autoplay preload/>")[0],s=navigator.userAgent,o=r.msie||/Trident\/7/.test(s),u=/iPad|MeeGo/.test(s)&&!/CriOS/.test(s),a=/iPad/.test(s)&&/CriOS/.test(s),f=/iP(hone|od)/i.test(s)&&!/iPad/.test(s),l=/Android/.test(s)&&!/Firefox/.test(s),c=/Android/.test(s)&&/Firefox/.test(s),h=/Silk/.test(s),p=/IEMobile/.test(s),d=p?parseFloat(/Windows\ Phone\ (\d+\.\d+)/.exec(s)[1],10):0,v=p?parseFloat(/IEMobile\/(\d+\.\d+)/.exec(s)[1],10):0,m=u?t(s):0,g=l?parseFloat(/Android\ (\d\.\d)/.exec(s)[1],10):0;e.extend(n,{subtitles:!!i.addTextTrack,fullscreen:typeof document.webkitCancelFullScreen=="function"&&!/Mac OS X 10_5.+Version\/5\.0\.\d Safari/.test(s)||document.mozFullScreenEnabled||typeof document.exitFullscreen=="function"||typeof document.msExitFullscreen=="function",inlineBlock:!(o&&r.version<8),touch:"ontouchstart"in window,dataload:!u&&!f&&!p,zeropreload:!o&&!l,volume:!u&&!l&&!f&&!h&&!a,cachedVideoTag:!u&&!f&&!a&&!p,firstframe:!f&&!u&&!l&&!h&&!a&&!p&&!c,inlineVideo:!f&&(!p||d>=8.1&&v>=11)&&(!l||g>=3),hlsDuration:!l&&(!r.safari||u||f||a),seekable:!u&&!a});try{var y=navigator.plugins["Shockwave Flash"],b=o?(new ActiveXObject("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version"):y.description;!o&&!y[0].enabledPlugin?n.flashVideo=!1:(b=b.split(/\D+/),b.length&&!b[0]&&(b=b.slice(1)),n.flashVideo=b[0]>9||b[0]==9&&b[3]>=115)}catch(w){}try{n.video=!!i.canPlayType,n.video&&i.canPlayType("video/mp4")}catch(E){n.video=!1}n.animation=function(){var t=["","Webkit","Moz","O","ms","Khtml"],n=e("<p/>")[0];for(var r=0;r<t.length;r++)if(n.style[t[r]+"AnimationName"]!=="undefined")return!0}()}(),window.attachEvent&&window.attachEvent("onbeforeunload",function(){__flash_savedUnloadHandler=__flash_unloadHandler=function(){}}),flowplayer.engine.flash=function(t,n){var r=t.conf,i=t.video,s,o,u,f=e(window),l=function(){if(C=="webkit"||D){var r=e("object param[name='flashvars']",n),i=(r.attr("value")||"").split("&");e.each(i,function(e,n){n=n.split("=");if(n[0]=="url"&&n[1]!=t.video.url)return i[e]="url="+t.video.url,r.attr({value:i.join("&")}),!1})}},c=function(r){var i=n.height(),s=n.width();if(t.conf.flashfit||/full/.test(r.type)){var o=t.isFullscreen,u=o&&O,a=!flowplayer.support.inlineBlock,l=o?u?screen.width:f.width():s,c=o?u?screen.height:f.height():i,h=0,p=0,d=a?s:"",v=a?i:"",m,g;if(t.conf.flashfit||r.type==="fullscreen")m=t.video.width/t.video.height,g=t.video.height/t.video.width,v=Math.max(g*l),d=Math.max(m*c),v=v>c?d*g:v,v=Math.min(Math.round(v),c),d=d>l?v*m:d,d=Math.min(Math.round(d),l),p=Math.max(Math.round((c+p-v)/2),0),h=Math.max(Math.round((l+h-d)/2),0);e("object",n).css({width:d,height:v,marginTop:p,marginLeft:h})}},h={pick:function(t){if(flowplayer.support.flashVideo){var n=e.grep(t,function(e){return e.type=="flash"})[0];if(n)return n;for(var r=0,i;r<t.length;r++){i=t[r];if(/mp4|flv/i.test(i.type))return i}}},load:function(i){function f(e){return e.replace(/&amp;/g,"%26").replace(/&/g,"%26").replace(/=/g,"%3D")}var h=e("video",n),p=f(i.src);is_absolute=/^https?:/.test(p);var d=function(){h.remove()},v=function(t){return e.grep(t,function(e){return!!h[0].canPlayType("video/"+e.type)}).length>0};flowplayer.support.video&&h.prop("autoplay")&&v(i.sources)?h.one("timeupdate",d):d(),!is_absolute&&!r.rtmp&&(p=e("<img/>").attr("src",p)[0].src);if(u)u.__play(p);else{t.bind("ready",l).bind("ready fullscreen fullscreen-exit",c),s="fp"+(""+Math.random()).slice(3,15);var m={hostname:r.embedded?r.hostname:location.hostname,url:p,callback:"jQuery."+s};n.data("origin")&&(m.origin=n.data("origin")),is_absolute&&delete r.rtmp,e.each(["key","autoplay","preload","rtmp","subscribe","live","loop","debug","splash","poster","rtmpt"],function(e,t){r.hasOwnProperty(t)&&(m[t]=r[t])}),r.bufferTime!==undefined&&(m.bufferTime=r.bufferTime),m.rtmp&&(m.rtmp=f(m.rtmp)),m.initialVolume=t.volumeLevel,o=a(r.swf,m,r.wmode),o.prependTo(n),u=o[0],setTimeout(function(){try{if(!u.PercentLoaded())return n.trigger("error",[t,{code:7,url:r.swf}])}catch(e){}},5e3),setTimeout(function(){typeof u.PercentLoaded=="undefined"&&n.trigger("flashdisabled",[t])},1e3),u.pollInterval=setInterval(function(){if(!u)return;var e=u.__status?u.__status():null;if(!e)return;t.trigger("progress",e.time),i.buffer=e.buffer/i.bytes*i.duration,t.trigger("buffer",i.buffer),!i.buffered&&e.time>0&&(i.buffered=!0,t.trigger("buffered"))},250),e[s]=function(n,s){r.debug&&console.log("--",n,s);var o=e.Event(n);switch(n){case"ready":s=e.extend(i,s);break;case"click":o.flash=!0;break;case"keydown":o.which=s;break;case"seek":i.time=s}n!="buffered"&&setTimeout(function(){t.trigger(o,s)},1)}}},speed:e.noop,unload:function(){u&&u.__unload&&u.__unload(),delete e[s],e("object",n).remove(),u=0,t.unbind("ready",l).unbind("ready fullscreen fullscreen-exit",c),clearInterval(u.pollInterval)}};return e.each("pause,resume,seek,volume".split(","),function(e,r){h[r]=function(e){try{t.ready&&(r=="seek"&&t.video.time&&!t.paused&&t.trigger("beforeseek"),e===undefined?u["__"+r]():u["__"+r](e))}catch(i){if(typeof u["__"+r]=="undefined")return n.trigger("flashdisabled",[t]);throw i}}}),h};var f=e("<video/>")[0],l={ended:"finish",pause:"pause",play:"resume",progress:"buffer",timeupdate:"progress",volumechange:"volume",ratechange:"speed",seeked:"seek",loadeddata:"ready",error:"error",dataunavailable:"error"},v,g=function(t){return v?v.attr({type:h(t.type),src:t.src}):v=e("<video/>",{src:t.src,type:h(t.type),"class":"fp-engine",autoplay:"autoplay",preload:"none","x-webkit-airplay":"allow"})};flowplayer.engine.html5=function(t,n){function m(r,s,u){if(r.listeners&&r.listeners.hasOwnProperty(n.data("fp-player_id")))return;(r.listeners||(r.listeners={}))[n.data("fp-player_id")]=!0,s.bind("error",function(n){try{if(n.originalEvent&&e(n.originalEvent.originalTarget).is("img"))return n.preventDefault();p(e(n.target).attr("type"))&&t.trigger("error",{code:4})}catch(r){}}),e.each(l,function(s,f){r.addEventListener(s,function(l){f=="progress"&&l.srcElement&&l.srcElement.readyState===0&&setTimeout(function(){!t.video.duration&&(!t.conf.live||t.video.type==="mpegurl"&&i.hlsDuration)&&(f="error",t.trigger(f,{code:4}))},1e4),o.debug&&!/progress/.test(f)&&console.log(s,"->",f,l);if(!t.ready&&!/ready|error/.test(f)||!f||!e("video",n).length)return;var h=e.Event(f),p,d;switch(f){case"ready":p=e.extend(u,{duration:r.duration,width:r.videoWidth,height:r.videoHeight,url:r.currentSrc,src:r.currentSrc});try{p.seekable=!o.live&&/mpegurl/i.test(u?u.type||"":"")&&r.duration||r.seekable&&r.seekable.end(null)}catch(v){}a=a||setInterval(function(){try{p.buffer=r.buffered.end(null)}catch(e){}p.buffer&&(c(p.buffer,1e3)<c(p.duration,1e3)&&!p.buffered?t.trigger("buffer",l):p.buffered||(p.buffered=!0,t.trigger("buffer",l).trigger("buffered",l),clearInterval(a),a=0))},250);if(!o.live&&!p.duration&&!i.hlsDuration&&s==="loadeddata"){var m=function(){p.duration=r.duration;try{p.seekable=r.seekable&&r.seekable.end(null)}catch(e){}t.trigger(h,p),r.removeEventListener("durationchange",m)};r.addEventListener("durationchange",m);return}break;case"progress":case"seek":var g=t.video.duration;if(r.currentTime>0||t.live){p=Math.max(r.currentTime,0);break}if(f=="progress")return;case"speed":p=c(r.playbackRate);break;case"volume":p=c(r.volume);break;case"error":try{p=(l.srcElement||l.originalTarget).error}catch(y){return}}t.trigger(h,p)},!1)})}var r=e("video",n),i=flowplayer.support,s=e("track",r),o=t.conf,u,a,f,h;return u={pick:function(e){if(i.video){if(o.videoTypePreference){var t=d(e,o.videoTypePreference);if(t)return t}for(var n=0,r;n<e.length;n++)if(p(e[n].type))return e[n]}},load:function(s){if(o.splash&&!f)r=g(s).prependTo(n),i.inlineVideo||r.css({position:"absolute",top:"-9999em"}),o.loop&&r.attr("loop","loop"),f=r[0],typeof h!="undefined"&&(f.volume=h);else{f=r[0];var u=r.find("source");!f.src&&u.length&&(f.src=s.src,u.remove());if(t.video.src&&s.src!=t.video.src)r.attr("autoplay","autoplay"),f.src=s.src;else if(o.preload=="none"||!i.dataload)i.zeropreload?t.trigger("ready",s).trigger("pause").one("ready",function(){n.trigger("resume",[t])}):t.one("ready",function(){n.trigger("pause",[t])})}m(f,e("source",r).add(r),s),(o.preload!="none"&&s.type!="mpegurl"||!i.zeropreload||!i.dataload)&&f.load(),o.splash&&f.load()},pause:function(){f.pause()},resume:function(){f.play()},speed:function(e){f.playbackRate=e},seek:function(e){try{var n=t.paused;f.currentTime=e,n&&f.pause()}catch(r){}},volume:function(e){h=e,f&&(f.volume=e)},unload:function(){e("video.fp-engine",n).remove(),i.cachedVideoTag||(v=null),a=clearInterval(a),f=0}}};var y=/\.(\w{3,4})(\?.*)?$/i;e.throttle=function(e,t){var n;return function(){n||(e.apply(this,arguments),n=1,setTimeout(function(){n=0},t))}},e.fn.slider2=function(t){var n=/iPad/.test(navigator.userAgent)&&!/CriOS/.test(navigator.userAgent);return this.each(function(){var r=e(this),i=e(document),s=r.children(":last"),o,u,a,f,l,c,h,p,d=!1,v=function(){u=r.offset(),a=r.width(),f=r.height(),c=l?f:a,p=b(h)},m=function(e){!o&&e!=w.value&&(!h||e<h)&&(r.trigger("slide",[e]),w.value=e)},g=function(e){var n=e.pageX;!n&&e.originalEvent&&e.originalEvent.touches&&e.originalEvent.touches.length&&(n=e.originalEvent.touches[0].pageX);var r=l?e.pageY-u.top:n-u.left;r=Math.max(0,Math.min(p||c,r));var i=r/c;return l&&(i=1-i),t&&(i=1-i),y(i,0,!0)},y=function(e,t){t===undefined&&(t=0),e>1&&(e=1);var r=Math.round(e*1e3)/10+"%";if(!h||e<=h)!n&&!d&&s.stop(),d?s.css("width",r):s.animate(l?{height:r}:{width:r},t,"linear");return e},b=function(e){return Math.max(0,Math.min(c,l?(1-e)*f:e*a))},w={max:function(e){h=e},disable:function(e){o=e},slide:function(e,t,n){v(),n&&m(e),y(e,t)},disableAnimation:function(e,t){d=e!==!1,r.toggleClass("no-animation",!!t)}};v(),r.data("api",w).bind("mousedown.sld touchstart",function(t){t.preventDefault();if(!o){var n=e.throttle(m,100);v(),w.dragging=!0,r.addClass("is-dragging"),m(g(t)),i.bind("mousemove.sld touchmove",function(e){e.preventDefault(),n(g(e))}).one("mouseup touchend",function(){w.dragging=!1,r.removeClass("is-dragging"),i.unbind("mousemove.sld touchmove")})}})})},flowplayer(function(t,n){function o(t){return e(".fp-"+t,n)}function T(t){if(n.css("width")==="0px"||n.css("height")==="0px"||t!==flowplayer.defaults.ratio)parseInt(v,10)||h.css("paddingTop",t*100+"%");i.inlineBlock||e("object",n).height(n.height())}function N(e){n.toggleClass("is-mouseover",e).toggleClass("is-mouseout",!e)}var r=t.conf,i=flowplayer.support,s;n.find(".fp-ratio,.fp-ui").remove(),n.addClass("flowplayer").append(' <div class="ratio"/> <div class="ui"> <div class="waiting"><em/><em/><em/></div> <a class="fullscreen"/> <a class="unload"/> <p class="speed"/> <div class="controls"> <a class="play"></a> <div class="timeline"> <div class="buffer"/> <div class="progress"/> </div> <div class="volume"> <a class="mute"></a> <div class="volumeslider"> <div class="volumelevel"/> </div> </div> </div> <div class="time"> <em class="elapsed">00:00</em> <em class="remaining"/> <em class="duration">00:00</em> </div> <div class="message"><h2/><p/></div> </div>'.replace(/class="/g,'class="fp-'));var u=o("progress"),a=o("buffer"),f=o("elapsed"),l=o("remaining"),c=o("waiting"),h=o("ratio"),p=o("speed"),d=o("duration"),v=h.css("paddingTop"),m=o("timeline").slider2(t.rtl),g=m.data("api"),y=o("volume"),b=o("fullscreen"),w=o("volumeslider").slider2(t.rtl),E=w.data("api"),x=n.is(".fixed-controls, .no-toggle");g.disableAnimation(n.hasClass("is-touch")),i.animation||c.html("<p>loading &hellip;</p>"),T(r.ratio);try{r.fullscreen||b.remove()}catch(C){b.remove()}t.bind("ready",function(){var e=t.video.duration;g.disable(t.disabled||!e),r.adaptiveRatio&&T(t.video.height/t.video.width),d.add(l).html(S(e)),e>=3600&&n.addClass("is-long")||n.removeClass("is-long"),E.slide(t.volumeLevel),t.engine==="flash"&&g.disableAnimation(!0,!0)}).bind("unload",function(){v||h.css("paddingTop","")}).bind("buffer",function(){var e=t.video,n=e.buffer/e.duration;!e.seekable&&i.seekable&&g.max(n),n<1?a.css("width",n*100+"%"):a.css({width:"100%"})}).bind("speed",function(e,t,n){p.text(n+"x").addClass("fp-hilite"),setTimeout(function(){p.removeClass("fp-hilite")},1e3)}).bind("buffered",function(){a.css({width:"100%"}),g.max(1)}).bind("progress",function(){var e=t.video.time,n=t.video.duration;g.dragging||g.slide(e/n,t.seeking?0:250),f.html(S(e)),l.html("-"+S(n-e))}).bind("finish resume seek",function(e){n.toggleClass("is-finished",e.type=="finish")}).bind("stop",function(){f.html(S(0)),g.slide(0,100)}).bind("finish",function(){f.html(S(t.video.duration)),g.slide(1,100),n.removeClass("is-seeking")}).bind("beforeseek",function(){u.stop()}).bind("volume",function(){E.slide(t.volumeLevel)}).bind("disable",function(){var e=t.disabled;g.disable(e),E.disable(e),n.toggleClass("is-disabled",t.disabled)}).bind("mute",function(e,t,r){n.toggleClass("is-muted",r)}).bind("error",function(t,i,s){n.removeClass("is-loading").addClass("is-error");if(s){s.message=r.errors[s.code],i.error=!0;var o=e(".fp-message",n);e("h2",o).text((i.engine||"html5")+": "+s.message),e("p",o).text(s.url||i.video.url||i.video.src||r.errorUrls[s.code]),n.unbind("mouseenter click").removeClass("is-mouseover")}}).bind("mouseenter mouseleave",function(e){if(x)return;var t=e.type=="mouseenter",r;N(t),t?(n.bind("pause.x mousemove.x volume.x",function(){N(!0),r=new Date}),s=setInterval(function(){new Date-r>( flowplayer.support.touch ? 5e3 : 2e3 )&&(N(!1),r=new Date)},100)):(n.unbind(".x"),clearInterval(s))}).bind("mouseleave",function(){(g.dragging||E.dragging)&&n.addClass("is-mouseover").removeClass("is-mouseout")}).bind("click.player",function(n){if(e(n.target).is(".fp-ui, .fp-engine")||n.flash)return n.preventDefault(),t.toggle()}).bind("contextmenu",function(t){t.preventDefault();var r=n.offset(),i=e(window),s=t.clientX-r.left,o=t.clientY-r.top+i.scrollTop(),u=n.find(".fp-context-menu").css({left:s+"px",top:o+"px",display:"block"}).on("click",function(e){e.stopPropagation()});e("html").on("click.outsidemenu",function(t){u.hide(),e("html").off("click.outsidemenu")})}).bind("flashdisabled",function(){n.addClass("is-flash-disabled").one("ready",function(){n.removeClass("is-flash-disabled").find(".fp-flash-disabled").remove()}).append('<div class="fp-flash-disabled">Adobe Flash is disabled for this page, click player area to enable.</div>')}),r.poster&&n.css("backgroundImage","url("+r.poster+")");var k=n.css("backgroundColor"),L=n.css("backgroundImage")!="none"||k&&k!="rgba(0, 0, 0, 0)"&&k!="transparent";L&&!r.splash&&!r.autoplay&&t.bind("ready stop",function(){n.addClass("is-poster").one("progress",function(){n.removeClass("is-poster")})}),!L&&t.forcedSplash&&n.css("backgroundColor","#555"),e(".fp-toggle, .fp-play",n).click(t.toggle),e.each(["mute","fullscreen","unload"],function(e,n){o(n).click(function(){t[n]()})}),m.bind("slide",function(e,n){t.seeking=!0,t.seek(n*t.video.duration)}),w.bind("slide",function(e,n){t.volume(n)}),o("time").click(function(t){e(this).toggleClass("is-inverted")}),N(x)});var x,T,N="is-help";e(document).bind("keydown.fp",function(t){var n=x,r=t.ctrlKey||t.metaKey||t.altKey,i=t.which,s=n&&n.conf;if(!n||!s.keyboard||n.disabled)return;if(e.inArray(i,[63,187,191])!=-1)return T.toggleClass(N),!1;if(i==27&&T.hasClass(N))return T.toggleClass(N),!1;if(!r&&n.ready){t.preventDefault();if(t.shiftKey){i==39?n.speed(!0):i==37&&n.speed(!1);return}if(i<58&&i>47)return n.seekTo(i-48);switch(i){case 38:case 75:n.volume(n.volumeLevel+.15);break;case 40:case 74:n.volume(n.volumeLevel-.15);break;case 39:case 76:n.seeking=!0,n.seek(!0);break;case 37:case 72:n.seeking=!0,n.seek(!1);break;case 190:n.seekTo();break;case 32:n.toggle();break;case 70:s.fullscreen&&n.fullscreen();break;case 77:n.mute();break;case 81:n.unload()}}}),flowplayer(function(t,n){if(!t.conf.keyboard)return;n.bind("mouseenter mouseleave",function(e){x=!t.disabled&&e.type=="mouseenter"?t:0,x&&(T=n)});var r=flowplayer.support.video&&t.conf.engine!=="flash"&&!!e("<video/>")[0].playbackRate?"<p><em>shift</em> + <em>&#8592;</em><em>&#8594;</em>slower / faster</p>":"";n.append(' <div class="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>'+r+' </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> </div> '),t.conf.tooltip&&e(".fp-ui",n).attr("title","Hit ? for help").on("mouseout.tip",function(){e(this).removeAttr("title").off("mouseout.tip")}),e(".fp-close",n).click(function(){n.toggleClass(N)})});var C=e.browser.mozilla?"moz":"webkit",k="fullscreen",L="fullscreen-exit",A,O=flowplayer.support.fullscreen,M=typeof document.exitFullscreen=="function",_=navigator.userAgent.toLowerCase(),D=/(safari)[ \/]([\w.]+)/.exec(_)&&!/(chrome)[ \/]([\w.]+)/.exec(_);e(document).bind("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange",function(t){var n=e(document.webkitCurrentFullScreenElement||document.mozFullScreenElement||document.fullscreenElement||document.msFullscreenElement||t.target);n.length&&!A?A=n.trigger(k,[n]):(A.trigger(L,[A]),A=null)}),flowplayer(function(t,n){if(!t.conf.fullscreen)return;var r=e(window),i={apply:!1,pos:0,play:!1},s;t.isFullscreen=!1,t.fullscreen=function(o){if(t.disabled)return;o===undefined&&(o=!t.isFullscreen),o&&(s=r.scrollTop()),(C=="webkit"||D)&&t.engine=="flash"&&(i={apply:!0,pos:t.video.time,play:t.playing});if(O)if(o){var u=n[0];e.each(["requestFullScreen","webkitRequestFullScreen","mozRequestFullScreen","msRequestFullscreen"],function(e,t){if(typeof u[t]=="function")return u[t](Element.ALLOW_KEYBOARD_INPUT),D&&!document.webkitCurrentFullScreenElement&&!document.mozFullScreenElement&&u[t](),!1})}else e.each(["exitFullscreen","webkitCancelFullScreen","mozCancelFullScreen","msExitFullscreen"],function(e,t){if(typeof document[t]=="function")return document[t](),!1});else t.trigger(o?k:L,[t]);return t};var o;n.bind("mousedown.fs",function(){+(new Date)-o<150&&t.ready&&t.fullscreen(),o=+(new Date)}),t.bind(k,function(e){n.addClass("is-fullscreen"),t.isFullscreen=!0}).bind(L,function(e){var i;!O&&t.engine==="html5"&&(i=n.css("opacity")||"",n.css("opacity",0)),n.removeClass("is-fullscreen"),!O&&t.engine==="html5"&&setTimeout(function(){n.css("opacity",i)}),t.isFullscreen=!1,r.scrollTop(s)}).bind("ready",function(){if(i.apply){var n=function(){!i.play&&!t.conf.live?t.pause():t.resume(),e.extend(i,{pos:0,play:!1})};t.conf.live?n():t.conf.rtmp&&i.pos&&!isNaN(i.pos)?(t.resume(),t.seek(i.pos,n)):n()}})}),flowplayer(function(t,n){function s(){return e(r.query,n)}function o(){return e(r.query+"."+i,n)}var r=e.extend({active:"is-active",advance:!0,query:".fp-playlist a"},t.conf),i=r.active;t.play=function(n){return n===undefined?t.resume():typeof n=="number"&&!t.conf.playlist[n]?t:(typeof n!="number"&&t.load.apply(null,arguments),t.unbind("resume.fromfirst"),t.video.index=n,t.load(typeof t.conf.playlist[n]=="string"?t.conf.playlist[n].toString():e.map(t.conf.playlist[n],function(t){return e.extend({},t)})),t)},t.next=function(e){e&&e.preventDefault();var n=t.video.index;return n!=-1&&(n=n===t.conf.playlist.length-1?0:n+1,t.play(n)),t},t.prev=function(e){e&&e.preventDefault();var n=t.video.index;return n!=-1&&(n=n===0?t.conf.playlist.length-1:n-1,t.play(n)),t},e(".fp-next",n).click(t.next),e(".fp-prev",n).click(t.prev),r.advance&&n.unbind("finish.pl").bind("finish.pl",function(e,t){var i=t.video.index>=0?t.video.index+1:undefined;i<t.conf.playlist.length||r.loop?(i=i===t.conf.playlist.length?0:i,n.removeClass("is-finished"),setTimeout(function(){t.play(i)})):(n.addClass("is-playing"),t.conf.playlist.length>1&&t.one("resume.fromfirst",function(){return t.play(0),!1}))});var u=!1;if(t.conf.playlist.length){u=!0;var a=n.find(".fp-playlist");if(!a.length){a=e('<div class="fp-playlist"></div>');var f=e(".fp-next,.fp-prev",n);f.length?f.eq(0).before(a):e("video",n).after(a)}a.empty(),e.each(t.conf.playlist,function(t,n){var r;if(typeof n=="string")r=n;else for(var i in n[0])if(n[0].hasOwnProperty(i)){r=n[0][i];break}a.append(e("<a />").attr({href:r,"data-index":t}))})}if(s().length){u||(t.conf.playlist=[],s().each(function(){var n=e(this).attr("href");e(this).attr("data-index",t.conf.playlist.length),t.conf.playlist.push(n)})),n.on("click",r.query,function(n){n.preventDefault();var i=e(n.target).closest(r.query),s=Number(i.attr("data-index"));s!=-1&&t.play(s)});var l=s().filter("[data-cuepoints]").length;t.bind("load",function(r,s,u){var a=o().removeClass(i),f=a.attr("data-index"),c=u.index=t.video.index||0,h=e('a[data-index="'+c+'"]',n).addClass(i),p=c==t.conf.playlist.length-1;n.removeClass("video"+f).addClass("video"+c).toggleClass("last-video",p),u.index=s.video.index=c,u.is_last=s.video.is_last=p,l&&(t.cuepoints=h.data("cuepoints"))}).bind("unload.pl",function(){o().toggleClass(i)})}t.conf.playlist.length&&(t.conf.loop=!1)});var P=/ ?cue\d+ ?/;flowplayer(function(t,n){function i(e){n[0].className=n[0].className.replace(P," "),e>=0&&n.addClass("cue"+e)}var r=0;t.cuepoints=t.conf.cuepoints||[],t.bind("progress",function(e,s,o){if(r&&o-r<.015)return r=o;r=o;var u=t.cuepoints||[];for(var a=0,f;a<u.length;a++)f=u[a],isNaN(f)||(f={time:f}),f.time<0&&(f.time=t.video.duration+f.time),f.index=a,Math.abs(f.time-o)<.125*t.currentSpeed&&(i(a),n.trigger("cuepoint",[t,f]))}).bind("unload seek",i),t.conf.generate_cuepoints&&t.bind("load",function(){e(".fp-cuepoint",n).remove()}).bind("ready",function(){var r=t.cuepoints||[],i=t.video.duration,s=e(".fp-timeline",n).css("overflow","visible");e.each(r,function(n,r){var o=r.time||r;o<0&&(o=i+r);var u=e("<a/>").addClass("fp-cuepoint fp-cuepoint"+n).css("left",o/i*100+"%");u.appendTo(s).mousedown(function(){return t.seek(o),!1})})})}),flowplayer(function(t,n,r){function a(e){var t=e.split(":");return t.length==2&&t.unshift(0),t[0]*60*60+t[1]*60+parseFloat(t[2].replace(",","."))}var i=e("track",n),s=t.conf;if(flowplayer.support.subtitles){t.subtitles=i.length&&i[0].track;if(s.nativesubtitles&&s.engine=="html5"){if(!t.subtitles)return;var o=function(t){var r=e("video",n)[0].textTracks;if(!r.length)return;r[0].mode=t};o("disabled"),t.one("ready",function(){t.conf.splash&&e("video.fp-engine",n).append(e("<track />").attr({kind:"subtitles",srclang:t.subtitles.language||"en",label:t.subtitles.language||"en",src:i.attr("src"),"default":"default"})),o("disabled"),o("showing")});return}}i.remove();var u=/^(([0-9]{2}:){1,2}[0-9]{2}[,.][0-9]{3}) --\> (([0-9]{2}:){1,2}[0-9]{2}[,.][0-9]{3})(.*)/;t.subtitles=[];var f=i.attr("src");if(!f)return;setTimeout(function(){e.get(f,function(n){for(var r=0,i=n.split("\n"),s=i.length,o={},f,l,c,h;r<s;r++){l=u.exec(i[r]);if(l){f=i[r-1],c="<p>"+i[++r]+"</p><br/>";while(e.trim(i[++r])&&r<i.length)c+="<p>"+i[r]+"</p><br/>";o={title:f,startTime:a(l[1]),endTime:a(l[3]),text:c},h={time:o.startTime,subtitle:o},t.subtitles.push(o),t.cuepoints.push(h),t.cuepoints
6
+ .push({time:o.endTime,subtitleEnd:f}),o.startTime===0&&t.trigger("cuepoint",h)}}}).fail(function(){return t.trigger("error",{code:8,url:f}),!1})});var l=e("<div class='fp-subtitle'/>").appendTo(n),c;t.bind("cuepoint",function(e,t,n){n.subtitle?(c=n.index,l.html(n.subtitle.text).addClass("fp-active")):n.subtitleEnd&&(l.removeClass("fp-active"),c=n.index)}).bind("seek",function(n,r,i){c&&t.cuepoints[c]&&t.cuepoints[c].time>i&&(l.removeClass("fp-active"),c=null),e.each(t.cuepoints||[],function(e,n){var r=n.subtitle;r&&c!=n.index?i>=n.time&&(!r.endTime||i<=r.endTime)&&t.trigger("cuepoint",n):n.subtitleEnd&&i>=n.time&&n.index==c+1&&t.trigger("cuepoint",n)})})}),flowplayer(function(t,n){var r=t.conf.analytics,i=0,s=0;if(r){typeof _gat=="undefined"&&e.getScript("//google-analytics.com/ga.js");function o(e){if(i&&typeof _gat!="undefined"){var s=_gat._getTracker(r),o=t.video;if( typeof s._setAllowLinker != 'undefined' ) {s._setAllowLinker(!0),s._trackEvent("Video / Seconds played",t.engine+"/"+o.type,n.attr("title")||o.src.split("/").slice(-1)[0].replace(y,""),Math.round(i/1e3))};i=0}}t.bind("load unload",o).bind("progress",function(){t.seeking||(i+=s?+(new Date)-s:0,s=+(new Date))}).bind("pause",function(){s=0}),e(window).unload(o)}});var H=/IEMobile/.test(r);(flowplayer.support.touch||H)&&flowplayer(function(t,n){var i=/Android/.test(r)&&!/Firefox/.test(r)&&!/Opera/.test(r),s=/Silk/.test(r),o=i?parseFloat(/Android\ (\d\.\d)/.exec(r)[1],10):0;if(i){if(!/Chrome/.test(r)&&o<4){var u=t.load;t.load=function(e,n){var r=u.apply(t,arguments);return t.trigger("ready",[t,t.video]),r}}var a,f=0,l=function(e){a=setInterval(function(){e.video.time=++f,e.trigger("progress",f)},1e3)};t.bind("ready pause unload",function(){a&&(clearInterval(a),a=null)}),t.bind("ready",function(){f=0}),t.bind("resume",function(e,n){if(!n.live)return;if(f)return l(n);t.one("progress",function(e,t,n){n===0&&l(t)})})}flowplayer.support.volume||n.addClass("no-volume no-mute"),n.addClass("is-touch"),n.find(".fp-timeline").data("api").disableAnimation();if(!flowplayer.support.inlineVideo||t.conf.native_fullscreen)t.conf.nativesubtitles=!0;var c=!1;n.bind("touchmove",function(){c=!0}).bind("touchend click",function(r){if(c){c=!1;return}if(t.playing&&!n.hasClass("is-mouseover"))return n.addClass("is-mouseover").removeClass("is-mouseout"),!1;t.paused&&n.hasClass("is-mouseout")&&!t.splash&&t.toggle(),t.paused&&H&&e("video.fp-engine",n)[0].play()}),t.conf.native_fullscreen&&typeof e("<video />")[0].webkitEnterFullScreen=="function"&&(t.fullscreen=function(){var t=e("video.fp-engine",n);t[0].webkitEnterFullScreen(),t.one("webkitendfullscreen",function(){t.prop("controls",!0).prop("controls",!1)})}),(i||s)&&t.bind("ready",function(){var r=e("video.fp-engine",n);r.one("canplay",function(){r[0].play()}),r[0].play(),t.bind("progress.dur",function(){var i=r[0].duration;i!==1&&(t.video.duration=i,e(".fp-duration",n).html(S(i)),t.unbind("progress.dur"))})})}),flowplayer(function(t,n){if(t.conf.embed===!1)return;var r=t.conf,i=e(".fp-ui",n),s=e("<a/>",{"class":"fp-embed",title:"Copy to your site"}).appendTo(i),o=e("<div/>",{"class":"fp-embed-code"}).append("<label>Copy and paste this HTML code into your webpage to embed.</label><textarea/>").appendTo(i),u=e("textarea",o);t.embedCode=function(){var i=t.video,s=i.width||n.width(),o=i.height||n.height(),u=e("<div/>",{"class":"flowplayer",css:{width:s,height:o}}),a=e("<video/>").appendTo(u);e.each(["origin","analytics","key","rtmp","subscribe","bufferTime"],function(e,t){r.hasOwnProperty(t)&&u.attr("data-"+t,r[t])}),r.logo&&u.attr("data-logo",e("<img />").attr("src",r.logo)[0].src),e.each(i.sources,function(t,n){var i=n.src;if(!/^https?:/.test(n.src)&&n.type!=="flash"||!r.rtmp)i=e("<img/>").attr("src",n.src)[0].src;a.append(e("<source/>",{type:n.type!="mpegurl"?"video/"+n.type:"application/x-mpegurl",src:i}))});var f={src:"//foliovision.com/flowplayer/5.5.2/embed.min.js"};e.isPlainObject(r.embed)&&(f["data-swf"]=r.embed.swf,f["data-library"]=r.embed.library,f.src=r.embed.script||f.src,r.embed.skin&&(f["data-skin"]=r.embed.skin));var l=e("<foo/>",f).append(u);return e("<p/>").append(l).html().replace(/<(\/?)foo/g,"<$1script")},n.fptip(".fp-embed","is-embedding"),u.click(function(){this.select()}),s.click(function(){u.text(t.embedCode()),u[0].focus(),u[0].select()})}),e.fn.fptip=function(t,n){return this.each(function(){function i(){r.removeClass(n),e(document).unbind(".st")}var r=e(this);e(t||"a",this).click(function(t){t.preventDefault(),r.toggleClass(n),r.hasClass(n)&&e(document).bind("keydown.st",function(e){e.which==27&&i()}).bind("click.st",function(t){e(t.target).parents("."+n).length||i()})})})}}(jQuery),flowplayer(function(e,t){function n(e){var t=s("<a/>")[0];return t.href=e,t.hostname}function r(e){var t="ab.ca,ac.ac,ac.at,ac.be,ac.cn,ac.il,ac.in,ac.jp,ac.kr,ac.th,ac.uk,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.gl,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.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,cq.cn,de.com,de.org,ecn.br,edu.au,edu.cn,edu.hk,edu.mm,edu.my,edu.pl,edu.pt,edu.qa,edu.tr,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,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,k12.il,k12.tr,kr.com,lel.br,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(",");e=e.toLowerCase();var n=e.split("."),r=n.length;if(r<2||/^\d+$/.test(n[r-1]))return e;var i=n.slice(-2).join(".");return r>=3&&s.inArray(i,t)>=0?n.slice(-3).join("."):i}function i(e,t){t=r(t);var n=0;for(var i=t.length-1;i>=0;i--)n+=t.charCodeAt(i)*22886841204;n=(""+n).substring(0,7);for(i=0;i<e.length;i++)if(n===e[i].substring(1,8))return 1}var s=jQuery,o=e.conf,u=o.swf.indexOf("flowplayer.org")&&o.e&&t.data("origin"),a=u?n(u):location.hostname,f=o.key;location.protocol=="file:"&&(a="localhost"),e.load.ed=1,o.hostname=a,o.origin=u||location.href,u&&t.addClass("is-embedded"),typeof f=="string"&&(f=f.split(/,\s*/));if(f&&typeof i=="function"&&i(f,a))o.logo&&t.append(s("<a>",{"class":"fp-logo",href:u}).append(s("<img/>",{src:o.logo})));else{var l=s("<a/>").attr("onclick","").appendTo(t),c=s(".fp-controls",t),h=s('<div class="fp-context-menu"><ul><li class="copyright">&copy; 2014</li><li><a href="http://flowplayer.org">About Flowplayer</a></li><li><a href="http://flowplayer.org/license">GPL based license</a></li></ul></div>').appendTo(t);e.bind("pause resume finish unload",function(e,n){var r=-1;n.video.src&&s.each([["org","flowplayer","drive"],["org","flowplayer","my"]],function(e,t){return r=n.video.src.indexOf("://"+t.reverse().join(".")),r===-1}),/pause|resume/.test(e.type)&&n.engine!="flash"&&r!=4&&r!=5?(l.show().css({position:"absolute",left:16,bottom:36,zIndex:99999,width:120,height:27,backgroundImage:"url("+[".png","fplogo","/",".com","foliovision","//"].reverse().join("")+")"}),n.load.ed=l.is(":visible")&&s.contains(t[0],h[0]),n.load.ed||n.pause()):l.hide()})}});
7
 
 
 
8
 
9
  /*
10
  FV Flowplayer additions!
11
  */
12
  if( typeof(fv_flowplayer_conf) != "undefined" ) {
13
  flowplayer.conf = fv_flowplayer_conf
14
+ if( ('ontouchstart' in window) ) {
15
+ flowplayer.conf.native_fullscreen = true;
16
+ }
17
  }
18
 
19
  if( typeof(fv_flowplayer_admin_input) != "undefined" && fv_flowplayer_admin_input ) {
91
  function fv_flowplayer_admin_message_parse_group(aInfo) {
92
  var sOutput = '';
93
  if( typeof(aInfo) != "undefined" && Object.keys(aInfo).length > 0 ) {
 
94
  for( var j in aInfo ) {
95
  if( j == parseInt(j) ){
96
  sOutput += aInfo[j]+'<br />';
97
+ } else if( typeof(aInfo[j]) == "function" ) {
98
+ continue;
99
  } else {
100
  sOutput += j+': <tt>'+aInfo[j]+'</tt><br />';
101
  }
102
  }
103
+ }
104
+ if( sOutput.length > 0 ){
105
+ sOutput = '<p>'+sOutput+'</p>';
106
+ }
107
  return sOutput;
108
  }
109
 
161
  }
162
  sCheckerInfo += fv_flowplayer_admin_message_parse_group(obj[i].info);
163
 
164
+ var sWarnings = (typeof(obj[i].warnings) != "undefined" ) ? fv_flowplayer_admin_message_parse_group(obj[i].warnings) : false;
165
+ if( typeof(obj[i].warnings) != "undefined" && sWarnings ) {
166
+ if( sResponseClass != 'vid-issues' ) {
167
+ sResponseMsg = 'Video Warnings';
168
+ sResponseClass = 'vid-warning';
169
+ }
170
+ sCheckerInfo += sWarnings;
171
  }
172
 
173
+ var sErrors = ( typeof(obj[i].errors) != "undefined" ) ? fv_flowplayer_admin_message_parse_group(obj[i].errors) : false;
174
+ if( typeof(obj[i].errors) != "undefined" && sErrors ) {
175
  sResponseMsg = 'Video Issues';
176
  sResponseClass = 'vid-issues';
177
+ sCheckerInfo += sErrors;
178
  }
179
 
180
  jQuery('#wpfp_notice_'+hash).find('.video-checker-result').addClass(sResponseClass).html(sResponseMsg);
194
  }
195
 
196
  } ).error(function() {
197
+ if( /MSIE 9/i.test(navigator.userAgent) ){
198
+ jQuery('#wpfp_notice_'+hash).html('<p>Admin: Video checker doesn\'t support IE 9.</p>');
199
+ } else {
200
+ jQuery('#wpfp_notice_'+hash).html('<p>Admin: Check failed.</p>');
201
+ }
202
  });
203
  }
204
 
 
 
 
 
 
205
 
206
  function fv_flowplayer_amazon_s3( hash, time ) {
207
  jQuery('#wpfp_'+hash).bind('error', function (e,api, error) {
218
  jQuery('#wpfp_'+hash).bind('error', function (e,api, error) {
219
  if( /chrom(e|ium)/.test(navigator.userAgent.toLowerCase()) && error != null && ( error.code == 3 || error.code == 4 || error.code == 5 ) ) {
220
  api.unload();
 
 
221
 
222
  jQuery('#wpfp_'+hash).attr('id','bad_wpfp_'+hash);
223
+ jQuery('#bad_wpfp_'+hash).after( '<div id="wpfp_'+hash+'" '+sAttributes+' data-engine="flash"></div>' );
224
  jQuery('#wpfp_'+hash).flowplayer({ playlist: [ [ {mp4: sVideo} ] ] });
225
  // what about scripts?
226
  if( bAutobuffer ) {
239
  var chrome_ver = parseInt(match[1], 10);
240
  if(
241
  ( /chrom(e|ium)/.test(navigator.userAgent.toLowerCase()) && chrome_ver < 28 && navigator.appVersion.indexOf("Win")!=-1 ) ||
242
+ ( /chrom(e|ium)/.test(navigator.userAgent.toLowerCase()) && chrome_ver < 27 && navigator.appVersion.indexOf("Linux")!=-1 && navigator.userAgent.toLowerCase().indexOf("android")==-1 )
243
  ) {
244
  jQuery('#wpfp_'+hash).attr('data-engine','flash');
245
  }
253
  }
254
 
255
  function fv_flowplayer_browser_ie( hash ) {
256
+ if( (jQuery.browser.msie && parseInt(jQuery.browser.version, 10) >= 9) /*|| !!navigator.userAgent.match(/Trident.*rv[ :]*11\./)*/ ) {
257
  jQuery('#wpfp_'+hash).attr('data-engine','flash');
258
  }
259
  }
277
  jQuery(this).find('.embed-code').hide();
278
  } );
279
  jQuery('.flowplayer .embed-code-toggle').click( function() {
280
+ var player = jQuery(this).parents('.flowplayer');
281
+ var api = player.data('flowplayer');
282
+ if( typeof(api.embedCode) == 'function' && player.find('.embed-code textarea').val() == '' ) {
283
+ player.find('.embed-code textarea').val(api.embedCode());
284
+ }
285
+ jQuery(this).parents('.fvp-share-bar').find('.embed-code').toggle();
286
+ jQuery(this).parents('.fvp-share-bar').toggleClass('visible');
287
  return false;
288
  } );
289
  } );
339
  var fv_flowplayer_safety_resize_init = false;
340
 
341
  jQuery('.flowplayer').each( function() {
342
+ if( !jQuery(this).is(":visible") || jQuery(this).hasClass('lightboxed') || jQuery(this).hasClass('lightbox-starter') ) return;
343
 
344
  if( jQuery(this).width() < 30 || jQuery(this).height() < 20 ) {
345
  fv_flowplayer_safety_resize_init = true
357
  if( fv_flowplayer_safety_resize_init ) {
358
  jQuery(window).resize(function() {
359
  jQuery('.flowplayer').each( function() {
360
+ if( jQuery(this).hasClass('lightboxed') || jQuery(this).hasClass('lightbox-starter') ) return;
361
 
362
  if( fv_flowplayer_safety_resize_arr[jQuery(this).attr('id')] ) {
363
  jQuery(this).width( fv_flowplayer_safety_resize_arr[jQuery(this).attr('id')].width() );
397
  }
398
  }, 250 );
399
  } );
400
+
401
+ if( typeof(fv_flowplayer_autoplay_array) != "undefined" ) {
402
+ for( var i in fv_flowplayer_autoplay_array ) {
403
+ var api = jQuery('#wpfp_'+i).data('flowplayer');
404
+ if( typeof(api) != "undefined" ){
405
+ api.load();
406
+ }
407
+ }
408
+ }
409
  } );
410
 
411
+ jQuery( function() { jQuery('.flowplayer').unbind('contextmenu'); } );
412
 
413
  if( typeof(fv_flowplayer_playlists) != "undefined" ) {
414
  for( var i in fv_flowplayer_playlists ) {
419
  var fv_fp_date = new Date();
420
  var fv_fp_utime = fv_fp_date.getTime();
421
 
422
+
 
 
 
 
423
  if( typeof(fv_flowplayer_browser_ff_m4v_array) != "undefined" ) {
424
  for( var i in fv_flowplayer_browser_ff_m4v_array ) {
425
  fv_flowplayer_browser_ff_m4v( i );
471
  jQuery('.flowplayer').bind("ready", function (e, api, video) {
472
  setTimeout( function () {
473
  jQuery('.fvp-share-bar',e.currentTarget).appendTo(jQuery('.fvp-share-bar',e.currentTarget).parent().find('.fp-ui'));
474
+ jQuery('.fvp-share-bar',e.currentTarget).show();
 
 
475
  }, 100 );
476
  });
477
 
478
+
479
+ var isIE11 = !!navigator.userAgent.match(/Trident.*rv[ :]*11\./);
480
+ if( isIE11 ) {
481
+ jQuery(document).ready( function() {
482
+ jQuery('.fp-waiting').hide();
483
+ } );
484
+
485
+ flowplayer( function(api,root) {
486
+ api.bind("load", function (e) {
487
+ jQuery(e.currentTarget).find('.fp-waiting').show();
488
+ } ).bind("beforeseek", function (e) {
489
+ jQuery(e.currentTarget).find('.fp-waiting').show();
490
+ } ).bind("progress", function (e) {
491
+ jQuery(e.currentTarget).find('.fp-waiting').hide();
492
+ } ).bind("seek", function (e) {
493
+ jQuery(e.currentTarget).find('.fp-waiting').hide();
494
+ } ).bind("fullscreen", function (e) {
495
+ jQuery('#wpadminbar').hide();
496
+ } ).bind("fullscreen-exit", function (e) {
497
+ jQuery('#wpadminbar').show();
498
+ } );
499
+ } );
500
+ }
501
+
502
+ if( typeof(flowplayer.conf.volume) != "undefined" ) {
503
+ flowplayer(function (api) {
504
+ api.bind("ready", function (e, api) {
505
+ if ( flowplayer.conf.volume == 0 ) {
506
+ api.mute(true);
507
+ } else {
508
+ api.volume(flowplayer.conf.volume);
509
+ }
510
+ });
511
+ });
512
+ }
513
+
514
+ flowplayer(function (api) {
515
+ api.bind("ready", function (e, api) {
516
+ if( jQuery(e.currentTarget).find('#'+jQuery(e.currentTarget).attr('id')+'_ad').length == 0 && typeof(fv_flowplayer_ad) != "undefined" && typeof(fv_flowplayer_ad[jQuery(e.currentTarget).attr('id')]) != "undefined" && jQuery(e.currentTarget).width() >= parseInt(fv_flowplayer_ad[jQuery(e.currentTarget).attr('id')].width) ) {
517
+ var html = fv_flowplayer_ad[jQuery(e.currentTarget).attr('id')].html;
518
+ html = html.replace( '%random%', Math.random() );
519
+ jQuery(e.currentTarget).append( '<div id="'+jQuery(e.currentTarget).attr('id')+'_ad" class="wpfp_custom_ad">'+html+'</div>' );
520
+ }
521
+ }).bind("finish", function (e, api) {
522
+ if( typeof(fv_flowplayer_popup) != "undefined" && typeof(fv_flowplayer_popup[jQuery(e.currentTarget).attr('id')]) != "undefined" ) {
523
+ if( jQuery(e.currentTarget).find('.wpfp_custom_popup').length > 0) {
524
+ jQuery(e.currentTarget).find('.wpfp_custom_popup').show();
525
+ } else {
526
+ jQuery(e.currentTarget).append( '<div id="'+jQuery(e.currentTarget).attr('id')+'_custom_popup" class="wpfp_custom_popup">'+fv_flowplayer_popup[jQuery(e.currentTarget).attr('id')].html+'</div>' );
527
+ }
528
+ }
529
+ }).bind("resume", function (e, api) {
530
+ if( typeof(fv_flowplayer_popup) != "undefined" && typeof(fv_flowplayer_popup[jQuery(e.currentTarget).attr('id')]) != "undefined" ) {
531
+ jQuery(e.currentTarget).find('.wpfp_custom_popup').hide();
532
+ }
533
+ }).bind("load", function(e,api) {
534
+ var player = jQuery(e.currentTarget);
535
+ if( navigator.userAgent.indexOf("Safari") > -1) { // even crazier workaround to make sure the video is visible in Safari Version 7.1 (9537.85.10.17.1)
536
+ /*player.find('video').css('position','inherit');
537
+ player.find('video').delay(20).queue( function(next) {
538
+ jQuery(this).css('position','absolute');
539
+ next();
540
+ } );*/
541
+ }
542
+ });
543
+ });
544
+
545
+ if( typeof(flowplayer.conf.cbox_compatibility) != "undefined" && flowplayer.conf.cbox_compatibility ) {
546
+ jQuery(document).bind('cbox_complete', function() {
547
+ if( jQuery('.flowplayer', jQuery('#cboxLoadedContent') ).length > 0 ) {
548
+ if( jQuery('.flowplayer', jQuery('#cboxLoadedContent') ).attr('id').length == 0 ) {
549
+ return;
550
+ }
551
+
552
+ var use_this_api = false;
553
+ var recovery;
554
+ var recovery_id = Math.floor((Math.random() * 100) + 1);
555
+ jQuery('[id='+jQuery('.flowplayer', jQuery('#cboxLoadedContent') ).attr('id')+']').each( function() {
556
+ if( jQuery(this).data('flowplayer') ) {
557
+ use_this_api = jQuery(this).data('flowplayer');
558
+ recovery = jQuery(this);
559
+ jQuery(this).before('<span id="fv_flowplayer_recovery-'+recovery_id+'"></span>');
560
+ }
561
+ } );
562
+
563
+ jQuery('.flowplayer', jQuery('#cboxLoadedContent') ).replaceWith(recovery);
564
+ jQuery('.flowplayer', jQuery('#cboxLoadedContent') ).data('fv-cloned', recovery_id);
565
+ }
566
+
567
+ }).bind('cbox_cleanup', function() {
568
+ if( jQuery('.flowplayer', jQuery('#cboxLoadedContent') ).length > 0 ) {
569
+ if( jQuery('.flowplayer', jQuery('#cboxLoadedContent') ).data('fv-cloned') ){
570
+ var api = jQuery('.flowplayer', jQuery('#cboxLoadedContent') ).data('flowplayer');
571
+ api.stop().unload();
572
+ jQuery('#fv_flowplayer_recovery-'+jQuery('.flowplayer', jQuery('#cboxLoadedContent') ).data('fv-cloned') ).replaceWith( jQuery('.flowplayer', jQuery('#cboxLoadedContent')) );
573
+ }
574
+
575
+ }
576
+
577
+ });
578
+ }
579
+
580
+ flowplayer(function (api, root) {
581
+ api.bind("load", function (e,api,data) {
582
+ var player = jQuery(e.currentTarget);
583
+ if( player.data('live') ){
584
+ var live_check = setTimeout( function() {
585
+ player.find('.fp-ui').append('<div class="fp-message"><h2>Live stream load failed.</h2><h3>Please try again later, perhaps the stream is currently offline.</h3></div>');
586
+ player.addClass('is-error');
587
+ }, 10000 );
588
+ jQuery(e.currentTarget).data('live_check', live_check);
589
+ }
590
+ }).bind("ready", function (e,api,data) {
591
+ clearInterval( jQuery(e.currentTarget).data('live_check') );
592
+ }).bind("error", function (e,api,data) {
593
+ var player = jQuery(e.currentTarget);
594
+ if( player.data('live') ){
595
+ player.find('.fp-message').html('<h2>Live stream load failed.</h2><h3>Please try again later, perhaps the stream is currently offline.</h3>');
596
+ }
597
+ });
598
+ });
599
+
600
+ if( /ipad/.test(navigator.userAgent.toLowerCase()) && /os 8/.test(navigator.userAgent.toLowerCase()) ){
601
+ flowplayer(function (api, root) {
602
+ api.bind("resume", function (e,api,data) {
603
+ setTimeout( function() {
604
+ if( api.loading ) jQuery(e.currentTarget).children('video')[0].play();
605
+ }, 1000 );
606
+ });
607
+ });
608
+ }
js/shortcode-editor.js CHANGED
@@ -2,7 +2,7 @@ var FVFP_iStoreWidth = 0;
2
  var FVFP_iStoreHeight = 0;
3
  var FVFP_sStoreRTMP = 0;
4
 
5
- jQuery(document).ready(function(){
6
  if( jQuery(".fv-wordpress-flowplayer-button").length > 0 && jQuery().colorbox ) {
7
  jQuery(".fv-wordpress-flowplayer-button").colorbox( {
8
  width:"620px",
@@ -37,7 +37,88 @@ jQuery(document).ready(function(){
37
  jQuery('#fv-flowplayer-playlist table:first .fv_wp_flowplayer_field_height').val( FVFP_iStoreHeight );
38
  jQuery('#fv-flowplayer-playlist table:first .fv_wp_flowplayer_field_rtmp').val( FVFP_sStoreRTMP );
39
  }
40
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  });
42
 
43
 
@@ -123,6 +204,8 @@ function fv_flowplayer_playlist_add( sInput, sCaption ) {
123
  jQuery('[name=fv_wp_flowplayer_field_caption]',jQuery('#fv-flowplayer-playlist table:last')).val(sCaption);
124
  }
125
  }
 
 
126
  fv_wp_flowplayer_dialog_resize();
127
  return false;
128
  }
@@ -130,6 +213,9 @@ function fv_flowplayer_playlist_add( sInput, sCaption ) {
130
 
131
  function fv_wp_flowplayer_edit() {
132
 
 
 
 
133
  fv_wp_flowplayer_init();
134
 
135
  jQuery("#fv-wordpress-flowplayer-popup input").each( function() { jQuery(this).val( '' ); jQuery(this).attr( 'checked', false ) } );
@@ -137,7 +223,8 @@ function fv_wp_flowplayer_edit() {
137
  jQuery("[name=fv_wp_flowplayer_field_caption]").each( function() { jQuery(this).val( '' ) } );
138
  jQuery('#fv_wp_flowplayer_field_autoplay').prop('selectedIndex',0);
139
  jQuery('#fv_wp_flowplayer_field_embed').prop('selectedIndex',0);
140
- jQuery('#fv_wp_flowplayer_field_align').prop('selectedIndex',0);
 
141
  jQuery("#fv_wp_flowplayer_field_insert-button").attr( 'value', 'Insert' );
142
 
143
  if( fv_wp_flowplayer_hTinyMCE == undefined || tinyMCE.activeEditor.isHidden() ) {
@@ -163,87 +250,51 @@ function fv_wp_flowplayer_edit() {
163
 
164
  var shortcode = content.match( fv_wp_flowplayer_re_edit );
165
 
166
- if( shortcode != null ) {
167
  shortcode = shortcode.join('');
168
- shortcode = shortcode.replace('[', '');
169
- shortcode = shortcode.replace(']', '');
170
  shortcode = shortcode.replace( fv_wp_flowplayer_re_insert, '' );
171
 
172
  shortcode = shortcode.replace( /\\'/g,'&#039;' );
173
-
174
- var shortcode_parse_fix = shortcode.replace(/popup='[^']*?'/g, '');
175
- shortcode_parse_fix = shortcode_parse_fix.replace(/ad='[^']*?'/g, '');
176
  fv_wp_fp_shortcode_remains = shortcode_parse_fix.replace( /^\S+\s*?/, '' );
177
 
178
- var srcurl = shortcode_parse_fix.match( /src=['"]([^']*?)['"]/ );
179
- fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( /src=['"]([^']*?)['"]/, '' );
180
- if( srcurl == null ) {
181
- srcurl = shortcode_parse_fix.match( /src=([^,\]\s]*)/ );
182
- fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( /src=([^,\]\s]*)/, '' );
183
- }
 
 
 
184
 
185
- var srcrtmp = shortcode_parse_fix.match( /rtmp=['"]([^']*?)['"]/ );
186
- fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( /rtmp=['"]([^']*?)['"]/, '' );
187
- var srcrtmp_path = shortcode_parse_fix.match( /rtmp_path=['"]([^']*?)['"]/ );
188
- fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( /rtmp_path=['"]([^']*?)['"]/, '' );
 
 
 
 
 
189
 
190
- var srcurl1 = shortcode.match( /src1=['"]([^']*?)['"]/ );
191
- fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( /src1=['"]([^']*?)['"]/, '' );
192
- if( srcurl1 == null ) {
193
- srcurl1 = shortcode.match( /src1=([^,\]\s]*)/ );
194
- fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( /src1=([^,\]\s]*)/, '' );
195
- }
196
 
197
- var srcurl2 = shortcode.match( /src2=['"]([^']*?)['"]/ );
198
- fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( /src2=['"]([^']*?)['"]/, '' );
199
- if( srcurl2 == null ) {
200
- srcurl2 = shortcode.match( /src2=([^,\]\s]*)/ );
201
- fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( /src2=([^,\]\s]*)/, '' );
202
- }
203
-
204
- var iheight = shortcode_parse_fix.match( /height="?(\d*)"?/ );
205
- fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( /height="?(\d*)"?/, '' );
206
- var iwidth = shortcode_parse_fix.match( /width="?(\d*)"?/ );
207
- fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( /width="?(\d*)"?/, '' );
208
- var sautoplay = shortcode.match( /autoplay=([^\s]+)/ );
209
- fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( /autoplay=([^\s]+)/, '' );
210
- var sembed = shortcode.match( /embed=([^\s]+)/ );
211
- fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( /embed=([^\s]+)/, '' );
212
- var ssplash = shortcode.match( /splash='([^']*)'/ );
213
- fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( /splash='([^']*)'/, '' );
214
- var ssubtitles = shortcode.match( /subtitles='([^']*)'/ );
215
- fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( /subtitles='([^']*)'/, '' );
216
- var smobile = shortcode.match( /mobile='([^']*)'/ );
217
- fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( /mobile='([^']*)'/, '' );
218
- var sredirect = shortcode.match( /redirect='([^']*)'/ );
219
- fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( /redirect='([^']*)'/, '' );
220
- if( ssplash == null ) {
221
- ssplash = shortcode.match( /splash=([^,\]\s]*)/ );
222
- fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( /splash=([^,\]\s]*)/, '' );
223
- }
224
- var spopup = shortcode.match( /popup='([^']*)'/ );
225
- fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( /popup='([^']*)'/, '' );
226
- var sad = shortcode.match( /ad='([^']*)'/ );
227
- fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( /ad='([^']*)'/, '' );
228
- var iadheight = shortcode_parse_fix.match( /ad_height="?(\d*)"?/ );
229
- fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( /ad_height="?(\d*)"?/, '' );
230
- var iadwidth = shortcode_parse_fix.match( /ad_width="?(\d*)"?/ );
231
- fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( /ad_width="?(\d*)"?/, '' );
232
- var sloop = shortcode.match( /loop=([^\s]+)/ );
233
- fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( /loop=([^\s]+)/, '' );
234
- var ssplashend = shortcode.match( /splashend=([^\s]+)/ );
235
- fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( /splashend=([^\s]+)/, '' );
236
- var sad_skip = shortcode.match( /ad_skip=([^\s]+)/ );
237
- fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( /ad_skip=([^\s]+)/, '' );
238
- var salign = shortcode.match( /align="([^"]+)"/ );
239
- fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( /align="([^"]+)"/, '' );
240
 
241
- var sPlaylist = shortcode_parse_fix.match( /playlist=['"]([^']*?)['"]/ );
242
- fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( /playlist=['"]([^']*?)['"]/, '' );
 
 
 
 
 
 
243
 
244
- var sCaptions = shortcode_parse_fix.match( /caption="(.*?[^\\])"/ );
245
- fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( /caption="(.*?[^\\])"/, '' );
246
-
247
  if( srcrtmp != null && srcrtmp[1] != null ) {
248
  jQuery(".fv_wp_flowplayer_field_rtmp").val( srcrtmp[1] );
249
  jQuery(".fv_wp_flowplayer_field_rtmp_wrapper").css( 'display', 'table-row' );
@@ -314,6 +365,8 @@ function fv_wp_flowplayer_edit() {
314
  document.getElementById("fv_wp_flowplayer_field_redirect").value = sredirect[1];
315
  if( sloop != null && sloop[1] != null && sloop[1] == 'true' )
316
  document.getElementById("fv_wp_flowplayer_field_loop").checked = 1;
 
 
317
  if( ssplashend != null && ssplashend[1] != null && ssplashend[1] == 'show' )
318
  document.getElementById("fv_wp_flowplayer_field_splashend").checked = 1;
319
 
@@ -322,7 +375,14 @@ function fv_wp_flowplayer_edit() {
322
  document.getElementById("fv_wp_flowplayer_field_align").selectedIndex = 1;
323
  if (salign[1] == 'right')
324
  document.getElementById("fv_wp_flowplayer_field_align").selectedIndex = 2;
325
- }
 
 
 
 
 
 
 
326
 
327
  var aCaptions = false;
328
  if( sCaptions ) {
@@ -407,105 +467,41 @@ function fv_wp_flowplayer_submit() {
407
 
408
  fv_wp_fp_shortcode = '[' + shorttag;
409
 
410
- if ( document.getElementById("fv_wp_flowplayer_field_src").value != '' ) {
411
- fv_wp_fp_shortcode += ' src=\'' + document.getElementById("fv_wp_flowplayer_field_src").value + '\'';
412
- }
413
-
414
- if ( document.getElementById("fv_wp_flowplayer_field_src_1").value != '' ) {
415
- fv_wp_fp_shortcode += ' src1=\'' + document.getElementById("fv_wp_flowplayer_field_src_1").value + '\'';
416
- }
417
- if ( document.getElementById("fv_wp_flowplayer_field_src_2").value != '' ) {
418
- fv_wp_fp_shortcode += ' src2=\'' + document.getElementById("fv_wp_flowplayer_field_src_2").value + '\'';
419
- }
420
 
421
- if ( jQuery(".fv_wp_flowplayer_field_rtmp").val() != '' ) {
422
- fv_wp_fp_shortcode += ' rtmp="' + jQuery(".fv_wp_flowplayer_field_rtmp").val() + '"';
423
- }
424
- if ( jQuery(".fv_wp_flowplayer_field_rtmp_path").val() != '' ) {
425
- fv_wp_fp_shortcode += ' rtmp_path="' + jQuery(".fv_wp_flowplayer_field_rtmp_path").val() + '"';
426
- }
427
-
428
- if( jQuery(".fv_wp_flowplayer_field_width").val() != '' && jQuery(".fv_wp_flowplayer_field_width").val() % 1 != 0 ) {
429
- alert('Please enter a valid width.');
430
- return false;
431
- }
432
- if( jQuery(".fv_wp_flowplayer_field_width").val() != '' )
433
- fv_wp_fp_shortcode += ' width=' + jQuery(".fv_wp_flowplayer_field_width").val();
434
-
435
- if( jQuery(".fv_wp_flowplayer_field_height").val() != '' && jQuery(".fv_wp_flowplayer_field_height").val() % 1 != 0 ) {
436
- alert('Please enter a valid height.');
437
- return false;
438
- }
439
- if( jQuery(".fv_wp_flowplayer_field_height").val() != '' )
440
- fv_wp_fp_shortcode += ' height=' + jQuery(".fv_wp_flowplayer_field_height").val();
441
-
442
- if( document.getElementById("fv_wp_flowplayer_field_autoplay").selectedIndex == 1 )
443
- fv_wp_fp_shortcode += ' autoplay=true';
444
- if( document.getElementById("fv_wp_flowplayer_field_autoplay").selectedIndex == 2 )
445
- fv_wp_fp_shortcode += ' autoplay=false';
446
-
447
- if( document.getElementById("fv_wp_flowplayer_field_embed").selectedIndex == 1 )
448
- fv_wp_fp_shortcode += ' embed=true';
449
- if( document.getElementById("fv_wp_flowplayer_field_embed").selectedIndex == 2 )
450
- fv_wp_fp_shortcode += ' embed=false';
451
-
452
- if( document.getElementById("fv_wp_flowplayer_field_align").selectedIndex == 1 )
453
- fv_wp_fp_shortcode += ' align="left"';
454
- if( document.getElementById("fv_wp_flowplayer_field_align").selectedIndex == 2 )
455
- fv_wp_fp_shortcode += ' align="right"';
456
-
457
-
458
- if( document.getElementById("fv_wp_flowplayer_field_loop").checked )
459
- fv_wp_fp_shortcode += ' loop=true';
460
-
461
- if( document.getElementById("fv_wp_flowplayer_field_mobile").value != '' )
462
- fv_wp_fp_shortcode += ' mobile=\'' + document.getElementById("fv_wp_flowplayer_field_mobile").value + '\'';
463
-
464
- if( document.getElementById("fv_wp_flowplayer_field_splash").value != '' )
465
- fv_wp_fp_shortcode += ' splash=\'' + document.getElementById("fv_wp_flowplayer_field_splash").value + '\'';
466
-
467
- if( document.getElementById("fv_wp_flowplayer_field_subtitles").value != '' )
468
- fv_wp_fp_shortcode += ' subtitles=\'' + document.getElementById("fv_wp_flowplayer_field_subtitles").value + '\'';
469
-
470
- if( document.getElementById("fv_wp_flowplayer_field_splashend").checked )
471
- fv_wp_fp_shortcode += ' splashend=show';
472
-
473
- if( document.getElementById("fv_wp_flowplayer_field_redirect").value != '' )
474
- fv_wp_fp_shortcode += ' redirect=\'' + document.getElementById("fv_wp_flowplayer_field_redirect").value + '\'';
475
-
476
- if( document.getElementById("fv_wp_flowplayer_field_popup").value != '' ) {
477
- var popup = document.getElementById("fv_wp_flowplayer_field_popup").value;
478
- popup = popup.replace(/&/g,'&amp;');
479
- popup = popup.replace(/'/g,'\\\'');
480
- popup = popup.replace(/"/g,'&quot;');
481
- popup = popup.replace(/</g,'&lt;');
482
- popup = popup.replace(/>/g,'&gt;');
483
- fv_wp_fp_shortcode += ' popup=\'' + popup +'\''
484
- }
485
-
486
- if( document.getElementById("fv_wp_flowplayer_field_ad").value != '' ) {
487
- var ad = document.getElementById("fv_wp_flowplayer_field_ad").value;
488
- ad = ad.replace(/&/g,'&amp;');
489
- ad = ad.replace(/'/g,'\\\'');
490
- ad = ad.replace(/"/g,'&quot;');
491
- ad = ad.replace(/</g,'&lt;');
492
- ad = ad.replace(/>/g,'&gt;');
493
- fv_wp_fp_shortcode += ' ad=\'' + ad +'\''
494
- }
495
-
496
- if( document.getElementById("fv_wp_flowplayer_field_ad_width").value != '' )
497
- fv_wp_fp_shortcode += ' ad_width=' + document.getElementById("fv_wp_flowplayer_field_ad_width").value;
498
- if( document.getElementById("fv_wp_flowplayer_field_ad_height").value != '' )
499
- fv_wp_fp_shortcode += ' ad_height=' + document.getElementById("fv_wp_flowplayer_field_ad_height").value;
500
- if( document.getElementById("fv_wp_flowplayer_field_ad_skip").checked != '' )
501
- fv_wp_fp_shortcode += ' ad_skip=yes';
502
 
503
  if( jQuery('#fv-flowplayer-playlist table').length > 0 ) {
504
  var aPlaylistItems = new Array();
505
  var aPlaylistCaptions = new Array();
506
  jQuery('#fv-flowplayer-playlist table').each(function(i,e) {
507
  aPlaylistCaptions.push(jQuery('[name=fv_wp_flowplayer_field_caption]',this).attr('value').trim().replace(/\;/gi,'\\;').replace(/"/gi,'&amp;quot;') );
508
- console.log(aPlaylistCaptions);
509
 
510
  if( i == 0 ) return;
511
  var aPlaylistItem = new Array();
@@ -531,7 +527,7 @@ function fv_wp_flowplayer_submit() {
531
 
532
  var bPlaylistCaptionExists = false;
533
  for( var i in aPlaylistCaptions ){
534
- if( aPlaylistCaptions[i].trim().length > 0 ) {
535
  bPlaylistCaptionExists = true;
536
  }
537
  }
@@ -581,3 +577,87 @@ function fv_wp_flowplayer_add_rtmp() {
581
  jQuery("#add_rtmp_wrapper").hide();
582
  fv_wp_flowplayer_dialog_resize();
583
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  var FVFP_iStoreHeight = 0;
3
  var FVFP_sStoreRTMP = 0;
4
 
5
+ jQuery(document).ready(function($){
6
  if( jQuery(".fv-wordpress-flowplayer-button").length > 0 && jQuery().colorbox ) {
7
  jQuery(".fv-wordpress-flowplayer-button").colorbox( {
8
  width:"620px",
37
  jQuery('#fv-flowplayer-playlist table:first .fv_wp_flowplayer_field_height').val( FVFP_iStoreHeight );
38
  jQuery('#fv-flowplayer-playlist table:first .fv_wp_flowplayer_field_rtmp').val( FVFP_sStoreRTMP );
39
  }
40
+ });
41
+
42
+ var fv_flowplayer_uploader;
43
+ var fv_flowplayer_uploader_button;
44
+
45
+ $(document).on( 'click', '#fv-wordpress-flowplayer-popup .button', function(e) {
46
+ e.preventDefault();
47
+
48
+ fv_flowplayer_uploader_button = jQuery(this);
49
+ jQuery('.fv_flowplayer_target').removeClass('fv_flowplayer_target' );
50
+ fv_flowplayer_uploader_button.siblings('input[type=text]').addClass('fv_flowplayer_target' );
51
+
52
+ //If the uploader object has already been created, reopen the dialog
53
+ if (fv_flowplayer_uploader) {
54
+ fv_flowplayer_uploader.open();
55
+ return;
56
+ }
57
+
58
+ //Extend the wp.media object
59
+ fv_flowplayer_uploader = wp.media.frames.file_frame = wp.media({
60
+ title: 'Add Video',
61
+ button: {
62
+ text: 'Choose'
63
+ },
64
+ multiple: false
65
+ });
66
+
67
+ fv_flowplayer_uploader.on('open', function() {
68
+ jQuery('.media-frame-title h1').text(fv_flowplayer_uploader_button.text());
69
+ });
70
+
71
+ //When a file is selected, grab the URL and set it as the text field's value
72
+ fv_flowplayer_uploader.on('select', function() {
73
+ attachment = fv_flowplayer_uploader.state().get('selection').first().toJSON();
74
+
75
+ $('.fv_flowplayer_target').val(attachment.url);
76
+ $('.fv_flowplayer_target').removeClass('fv_flowplayer_target' );
77
+
78
+ if( attachment.type == 'video' ) {
79
+ if( typeof(attachment.width) != "undefined" && attachment.width > 0 ) {
80
+ $('#fv_wp_flowplayer_field_width').val(attachment.width);
81
+ }
82
+ if( typeof(attachment.height) != "undefined" && attachment.height > 0 ) {
83
+ $('#fv_wp_flowplayer_field_height').val(attachment.height);
84
+ }
85
+ if( typeof(attachment.fileLength) != "undefined" ) {
86
+ $('#fv_wp_flowplayer_file_info').show();
87
+ $('#fv_wp_flowplayer_file_duration').html(attachment.fileLength);
88
+ }
89
+ if( typeof(attachment.filesizeHumanReadable) != "undefined" ) {
90
+ $('#fv_wp_flowplayer_file_info').show();
91
+ $('#fv_wp_flowplayer_file_size').html(attachment.filesizeHumanReadable);
92
+ }
93
+
94
+ } else if( attachment.type == 'image' && typeof(fv_flowplayer_set_post_thumbnail_id) != "undefined" ) {
95
+ if( jQuery('#remove-post-thumbnail').length > 0 ){
96
+ return;
97
+ }
98
+ jQuery.post(ajaxurl, {
99
+ action:"set-post-thumbnail",
100
+ post_id: fv_flowplayer_set_post_thumbnail_id,
101
+ thumbnail_id: attachment.id,
102
+ _ajax_nonce: fv_flowplayer_set_post_thumbnail_nonce,
103
+ cookie: encodeURIComponent(document.cookie)
104
+ }, function(str){
105
+ var win = window.dialogArguments || opener || parent || top;
106
+ if ( str == '0' ) {
107
+ alert( setPostThumbnailL10n.error );
108
+ } else {
109
+ jQuery('#postimagediv .inside').html(str);
110
+ jQuery('#postimagediv .inside #plupload-upload-ui').hide();
111
+ }
112
+ } );
113
+
114
+ }
115
+
116
+ });
117
+
118
+ //Open the uploader dialog
119
+ fv_flowplayer_uploader.open();
120
+
121
+ });
122
  });
123
 
124
 
204
  jQuery('[name=fv_wp_flowplayer_field_caption]',jQuery('#fv-flowplayer-playlist table:last')).val(sCaption);
205
  }
206
  }
207
+
208
+ jQuery('#fv-flowplayer-playlist table:last #fv_wp_flowplayer_file_info').hide();
209
  fv_wp_flowplayer_dialog_resize();
210
  return false;
211
  }
213
 
214
  function fv_wp_flowplayer_edit() {
215
 
216
+ var dialog = jQuery('#colorbox.fv-flowplayer-shortcode-editor');
217
+ dialog.removeAttr('tabindex');
218
+
219
  fv_wp_flowplayer_init();
220
 
221
  jQuery("#fv-wordpress-flowplayer-popup input").each( function() { jQuery(this).val( '' ); jQuery(this).attr( 'checked', false ) } );
223
  jQuery("[name=fv_wp_flowplayer_field_caption]").each( function() { jQuery(this).val( '' ) } );
224
  jQuery('#fv_wp_flowplayer_field_autoplay').prop('selectedIndex',0);
225
  jQuery('#fv_wp_flowplayer_field_embed').prop('selectedIndex',0);
226
+ jQuery('#fv_wp_flowplayer_field_align').prop('selectedIndex',0);
227
+ jQuery('#fv_wp_flowplayer_field_controlbar').prop('selectedIndex',0);
228
  jQuery("#fv_wp_flowplayer_field_insert-button").attr( 'value', 'Insert' );
229
 
230
  if( fv_wp_flowplayer_hTinyMCE == undefined || tinyMCE.activeEditor.isHidden() ) {
250
 
251
  var shortcode = content.match( fv_wp_flowplayer_re_edit );
252
 
253
+ if( shortcode != null ) {
254
  shortcode = shortcode.join('');
255
+ shortcode = shortcode.replace(/^\[|\]+$/gm,'');
 
256
  shortcode = shortcode.replace( fv_wp_flowplayer_re_insert, '' );
257
 
258
  shortcode = shortcode.replace( /\\'/g,'&#039;' );
259
+
260
+ var shortcode_parse_fix = shortcode.replace(/(popup|ad)='[^']*?'/g, '');
261
+ shortcode_parse_fix = shortcode_parse_fix.replace(/(popup|ad)="(.*?[^\\\\/])"/g, '');
262
  fv_wp_fp_shortcode_remains = shortcode_parse_fix.replace( /^\S+\s*?/, '' );
263
 
264
+ var srcurl = fv_wp_flowplayer_shortcode_parse_arg( shortcode_parse_fix, 'src' );
265
+ var srcurl1 = fv_wp_flowplayer_shortcode_parse_arg( shortcode, 'src1' );
266
+ var srcurl2 = fv_wp_flowplayer_shortcode_parse_arg( shortcode, 'src2' );
267
+
268
+ var srcrtmp = fv_wp_flowplayer_shortcode_parse_arg( shortcode, 'rtmp' );
269
+ var srcrtmp_path = fv_wp_flowplayer_shortcode_parse_arg( shortcode, 'rtmp_path' );
270
+
271
+ var iwidth = fv_wp_flowplayer_shortcode_parse_arg( shortcode_parse_fix, 'width' );
272
+ var iheight = fv_wp_flowplayer_shortcode_parse_arg( shortcode_parse_fix, 'height' );
273
 
274
+ var sad_skip = fv_wp_flowplayer_shortcode_parse_arg( shortcode, 'ad_skip' );
275
+ var salign = fv_wp_flowplayer_shortcode_parse_arg( shortcode, 'align' );
276
+ var scontrolbar = fv_wp_flowplayer_shortcode_parse_arg( shortcode, 'controlbar' );
277
+ var sautoplay = fv_wp_flowplayer_shortcode_parse_arg( shortcode, 'autoplay' );
278
+ var sembed = fv_wp_flowplayer_shortcode_parse_arg( shortcode_parse_fix, 'embed' );
279
+ var sloop = fv_wp_flowplayer_shortcode_parse_arg( shortcode, 'loop' );
280
+ var slive = fv_wp_flowplayer_shortcode_parse_arg( shortcode, 'live' );
281
+ var ssplash = fv_wp_flowplayer_shortcode_parse_arg( shortcode, 'splash' );
282
+ var ssplashend = fv_wp_flowplayer_shortcode_parse_arg( shortcode, 'splashend' );
283
 
 
 
 
 
 
 
284
 
285
+ var ssubtitles = fv_wp_flowplayer_shortcode_parse_arg( shortcode, 'subtitles' );
286
+ var smobile = fv_wp_flowplayer_shortcode_parse_arg( shortcode, 'mobile' );
287
+ var sredirect = fv_wp_flowplayer_shortcode_parse_arg( shortcode, 'redirect' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
288
 
289
+ var sCaptions = fv_wp_flowplayer_shortcode_parse_arg( shortcode, 'caption' );
290
+ var sPlaylist = fv_wp_flowplayer_shortcode_parse_arg( shortcode, 'playlist' );
291
+ var spopup = fv_wp_flowplayer_shortcode_parse_arg( shortcode, 'popup', true );
292
+
293
+
294
+ var sad = fv_wp_flowplayer_shortcode_parse_arg( shortcode, 'ad', true );
295
+ var iadwidth = fv_wp_flowplayer_shortcode_parse_arg( shortcode, 'ad_width' );
296
+ var iadheight = fv_wp_flowplayer_shortcode_parse_arg( shortcode, 'ad_height' );
297
 
 
 
 
298
  if( srcrtmp != null && srcrtmp[1] != null ) {
299
  jQuery(".fv_wp_flowplayer_field_rtmp").val( srcrtmp[1] );
300
  jQuery(".fv_wp_flowplayer_field_rtmp_wrapper").css( 'display', 'table-row' );
365
  document.getElementById("fv_wp_flowplayer_field_redirect").value = sredirect[1];
366
  if( sloop != null && sloop[1] != null && sloop[1] == 'true' )
367
  document.getElementById("fv_wp_flowplayer_field_loop").checked = 1;
368
+ if( slive != null && slive[1] != null && slive[1] == 'true' )
369
+ document.getElementById("fv_wp_flowplayer_field_live").checked = 1;
370
  if( ssplashend != null && ssplashend[1] != null && ssplashend[1] == 'show' )
371
  document.getElementById("fv_wp_flowplayer_field_splashend").checked = 1;
372
 
375
  document.getElementById("fv_wp_flowplayer_field_align").selectedIndex = 1;
376
  if (salign[1] == 'right')
377
  document.getElementById("fv_wp_flowplayer_field_align").selectedIndex = 2;
378
+ }
379
+
380
+ if( scontrolbar != null && scontrolbar[1] != null ) {
381
+ if (scontrolbar[1] == 'yes' || scontrolbar[1] == 'show' )
382
+ document.getElementById("fv_wp_flowplayer_field_controlbar").selectedIndex = 1;
383
+ if (scontrolbar[1] == 'no' || scontrolbar[1] == 'hide' )
384
+ document.getElementById("fv_wp_flowplayer_field_controlbar").selectedIndex = 2;
385
+ }
386
 
387
  var aCaptions = false;
388
  if( sCaptions ) {
467
 
468
  fv_wp_fp_shortcode = '[' + shorttag;
469
 
470
+ fv_wp_flowplayer_shortcode_write_arg('fv_wp_flowplayer_field_src','src');
471
+ fv_wp_flowplayer_shortcode_write_arg('fv_wp_flowplayer_field_src_1','src1');
472
+ fv_wp_flowplayer_shortcode_write_arg('fv_wp_flowplayer_field_src_2','src2');
473
+ fv_wp_flowplayer_shortcode_write_arg('fv_wp_flowplayer_field_rtmp','rtmp');
474
+ fv_wp_flowplayer_shortcode_write_arg('fv_wp_flowplayer_field_rtmp_path','rtmp_path');
 
 
 
 
 
475
 
476
+ fv_wp_flowplayer_shortcode_write_arg('fv_wp_flowplayer_field_width','width','int');
477
+ fv_wp_flowplayer_shortcode_write_arg('fv_wp_flowplayer_field_height','height','int');
478
+
479
+ fv_wp_flowplayer_shortcode_write_arg( 'fv_wp_flowplayer_field_align', 'align', false, false, ['left', 'right'] );
480
+ fv_wp_flowplayer_shortcode_write_arg( 'fv_wp_flowplayer_field_autoplay', 'autoplay', false, false, ['true', 'false'] );
481
+ fv_wp_flowplayer_shortcode_write_arg( 'fv_wp_flowplayer_field_controlbar', 'controlbar', false, false, ['yes', 'no'] );
482
+ fv_wp_flowplayer_shortcode_write_arg( 'fv_wp_flowplayer_field_embed', 'embed', false, false, ['true', 'false'] );
483
+
484
+ fv_wp_flowplayer_shortcode_write_arg( 'fv_wp_flowplayer_field_loop', 'loop', false, true );
485
+ fv_wp_flowplayer_shortcode_write_arg( 'fv_wp_flowplayer_field_live', 'live', false, true );
486
+ fv_wp_flowplayer_shortcode_write_arg( 'fv_wp_flowplayer_field_splashend', 'splashend', false, true, ['show'] );
487
+
488
+ fv_wp_flowplayer_shortcode_write_arg('fv_wp_flowplayer_field_mobile','mobile');
489
+ fv_wp_flowplayer_shortcode_write_arg('fv_wp_flowplayer_field_redirect','redirect');
490
+ fv_wp_flowplayer_shortcode_write_arg('fv_wp_flowplayer_field_splash','splash');
491
+ fv_wp_flowplayer_shortcode_write_arg('fv_wp_flowplayer_field_subtitles','subtitles');
492
+
493
+ fv_wp_flowplayer_shortcode_write_arg('fv_wp_flowplayer_field_ad','ad','html');
494
+ fv_wp_flowplayer_shortcode_write_arg('fv_wp_flowplayer_field_popup','popup','html');
495
+
496
+ fv_wp_flowplayer_shortcode_write_arg('fv_wp_flowplayer_field_ad_height','ad_height','int');
497
+ fv_wp_flowplayer_shortcode_write_arg('fv_wp_flowplayer_field_ad_skip','ad_skip', false, true, ['yes']);
498
+ fv_wp_flowplayer_shortcode_write_arg('fv_wp_flowplayer_field_ad_width','ad_width','int');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
499
 
500
  if( jQuery('#fv-flowplayer-playlist table').length > 0 ) {
501
  var aPlaylistItems = new Array();
502
  var aPlaylistCaptions = new Array();
503
  jQuery('#fv-flowplayer-playlist table').each(function(i,e) {
504
  aPlaylistCaptions.push(jQuery('[name=fv_wp_flowplayer_field_caption]',this).attr('value').trim().replace(/\;/gi,'\\;').replace(/"/gi,'&amp;quot;') );
 
505
 
506
  if( i == 0 ) return;
507
  var aPlaylistItem = new Array();
527
 
528
  var bPlaylistCaptionExists = false;
529
  for( var i in aPlaylistCaptions ){
530
+ if( typeof(aPlaylistCaptions[i]) == "string" && aPlaylistCaptions[i].trim().length > 0 ) {
531
  bPlaylistCaptionExists = true;
532
  }
533
  }
577
  jQuery("#add_rtmp_wrapper").hide();
578
  fv_wp_flowplayer_dialog_resize();
579
  }
580
+
581
+ function fv_wp_flowplayer_shortcode_parse_arg( sShortcode, sArg, bHTML ) {
582
+ var sOutput;
583
+
584
+ var rDoubleQ = new RegExp(sArg+"=\"","g");
585
+ var rSingleQ = new RegExp(sArg+"='","g");
586
+ var rNoQ = new RegExp(sArg+"=[^\"']","g");
587
+
588
+ var rMatch = false;
589
+ if( sShortcode.match(rDoubleQ) ) {
590
+ //rMatch = new RegExp(sArg+'="(.*?[^\\\\/])"',"g");
591
+ rMatch = new RegExp(sArg+'="(.*?[^\\\\])"',"g");
592
+ } else if( sShortcode.match(rSingleQ) ) {
593
+ rMatch = new RegExp(sArg+"='([^']*?)'","g");
594
+ } else if( sShortcode.match(rNoQ) ) {
595
+ rMatch = new RegExp(sArg+"=([^\\]\\s,]+)","g");
596
+ }
597
+
598
+ if( !rMatch ){
599
+ return false;
600
+ }
601
+
602
+ var aOutput = rMatch.exec(sShortcode);
603
+ fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( rMatch, '' );
604
+
605
+ if( bHTML ) {
606
+ aOutput[1] = aOutput[1].replace(/\\"/g, '"').replace(/\\(\[|\])/g, '$1');
607
+ }
608
+ return aOutput;
609
+ }
610
+
611
+ function fv_wp_flowplayer_shortcode_write_arg( sField, sArg, sKind, bCheckbox, aValues ) {
612
+ if( typeof(document.getElementById(sField)) == "undefined") {
613
+ return false;
614
+ }
615
+
616
+ var sValue = false;
617
+ if( bCheckbox ) {
618
+ if( document.getElementById(sField).checked ){
619
+ if( aValues ) {
620
+ sValue = aValues[0];
621
+ } else {
622
+ sValue = 'true';
623
+ }
624
+ }
625
+ } else if( aValues ){
626
+ if( typeof(aValues[document.getElementById(sField).selectedIndex -1 ]) == "undefined" ) {
627
+ return false;
628
+ }
629
+ sValue = aValues[document.getElementById(sField).selectedIndex -1 ];
630
+ } else if( document.getElementById(sField).value != '' ) {
631
+ sValue = document.getElementById(sField).value.trim();
632
+ var sOutput = false;
633
+
634
+ if( sKind == "int" ) {
635
+ if( sValue % 1 !=0 ){
636
+ return false;
637
+ }
638
+ } else if( sKind == 'html' ){
639
+ sValue = sValue.replace(/&/g,'&amp;');
640
+ //sValue = sValue.replace(/'/g,'\\\'');
641
+ //sValue = sValue.replace(/"/g,'&quot;');
642
+ sValue = sValue.replace(/</g,'&lt;');
643
+ sValue = sValue.replace(/>/g,'&gt;');
644
+ }
645
+ } else {
646
+ return false;
647
+ }
648
+
649
+ if( !sValue ){
650
+ return false;
651
+ }
652
+
653
+ if( sValue.match(/"/) || sKind == 'html' ){
654
+ sOutput = '"'+sValue.replace(/"/g, '\\"').replace(/(\[|\])/g, '\\$1')+'"';
655
+ } else {
656
+ sOutput = '"'+sValue+'"';
657
+ }
658
+
659
+ if( sOutput ){
660
+ fv_wp_fp_shortcode += ' '+sArg+'='+sOutput;
661
+ }
662
+ return sValue;
663
+ }
models/checker.php ADDED
@@ -0,0 +1,465 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* FV Wordpress Flowplayer - HTML5 video player with Flash fallback
3
+ Copyright (C) 2013 Foliovision
4
+
5
+ This program is free software: you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation, either version 3 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+
19
+ class FV_Player_Checker {
20
+
21
+
22
+ var $is_cron = false;
23
+
24
+
25
+ function __construct() {
26
+ add_filter( 'cron_schedules', array( $this, 'cron_schedules' ) );
27
+ add_action( 'fv_flowplayer_checker_event', array( $this, 'checker_cron' ) );
28
+ add_action( 'init', array( $this, 'cron_init' ) );
29
+ }
30
+
31
+
32
+
33
+ public static function check_headers( $headers, $remotefilename, $random, $args = false ) {
34
+ global $fv_fp;
35
+
36
+ $args = wp_parse_args( $args, array( 'talk_bad_mime' => 'Video served with a bad mime type' , 'wrap'=>'p' ) );
37
+
38
+ $sOutput = '';
39
+
40
+ $video_errors = array();
41
+
42
+ $bFatal = false;
43
+ if( $headers && $headers['response']['code'] == '404' ) {
44
+ $video_errors[] = 'File not found (HTTP 404)!';
45
+ $bFatal = true;
46
+ } else if( $headers && $headers['response']['code'] == '403' ) {
47
+ $video_errors[] = 'Access to video forbidden (HTTP 403)!';
48
+ $bFatal = true;
49
+ } else if( $headers && $headers['response']['code'] != '200' && $headers['response']['code'] != '206' ) {
50
+ $video_errors[] = 'Can\'t check the video (HTTP '.$headers['response']['code'].')!';
51
+ $bFatal = true;
52
+ } else {
53
+
54
+ if(
55
+ ( !isset($headers['headers']['accept-ranges']) || $headers['headers']['accept-ranges'] != 'bytes' ) &&
56
+ !isset($headers['headers']['content-range'])
57
+ ) {
58
+ $video_errors[] = 'Server does not support HTTP range requests! Please check <a href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/faq#getting-error-about-range-requests">our FAQ</a>.';
59
+ }
60
+
61
+ if(
62
+ ( stripos( $remotefilename, '.mp4' ) !== FALSE && $headers['headers']['content-type'] != 'video/mp4' ) ||
63
+ ( stripos( $remotefilename, '.m4v' ) !== FALSE && $headers['headers']['content-type'] != 'video/x-m4v' ) ||
64
+ ( stripos( $remotefilename, '.webm' ) !== FALSE && $headers['headers']['content-type'] != 'video/webm' ) ||
65
+ ( stripos( $remotefilename, '.mov' ) !== FALSE && $headers['headers']['content-type'] != 'video/mp4' )
66
+ ) {
67
+ if( stripos( $remotefilename, '.mov' ) !== FALSE ) {
68
+ $meta_note_addition = ' Firefox on Windows does not like MOV files with video/quicktime mime type.';
69
+ } else if( stripos( $remotefilename, '.webm' ) !== FALSE ) {
70
+ $meta_note_addition = ' Older Firefox versions don\'t like WEBM files with mime type other than video/webm.';
71
+ } else {
72
+ $meta_note_addition = ' Some web browsers may experience playback issues in HTML5 mode (Internet Explorer 9 - 10).';
73
+ /*if( $fv_fp->conf['engine'] == 'default' ) {
74
+ $meta_note_addition .= ' Currently you are using the "Default (mixed)" <a href="'.site_url().'/wp-admin/options-general.php?page=fvplayer">Preferred Flowplayer engine</a> setting, so IE will always use Flash and will play fine.';
75
+ }*/
76
+ }
77
+
78
+ $fix = '<div class="fix-meta-'.$random.'" style="display: none; ">
79
+ <p>If the video is hosted on Amazon S3:</p>
80
+ <blockquote>Using your Amazon AWS Management Console, you can go though your videos and find file content type under the "Metadata" tab in an object\'s "Properties" pane and fix it to "video/mp4" for MP4, "video/x-m4v" for M4V files, "video/mp4" for MOV files and "video/webm" for WEBM files.</blockquote>
81
+ <p>If the video is hosted on your server, put this into your .htaccess:</p>
82
+ <pre>AddType video/mp4 .mp4
83
+ AddType video/webm .webm
84
+ AddType video/ogg .ogv
85
+ AddType application/x-mpegurl .m3u8
86
+ AddType video/x-m4v .m4v
87
+ AddType video/mp4 .mov
88
+ # hls transport stream segments:
89
+ AddType video/mp2t .ts</pre>
90
+ <p>If you are using Microsoft IIS, you need to use the IIS manager. Check our <a href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/faq#video-doesnt-play-internet-explorer" target="_blank">FAQ</a> for more info.</p>
91
+ </div>';
92
+
93
+ $sOutput = ( $args['wrap'] ) ? '<'.$args['wrap'].'>' : '';
94
+ $sOutput .= '<strong>Bad mime type</strong>: '.$args['talk_bad_mime'].' <tt>'.$headers['headers']['content-type'].'</tt>!'.$meta_note_addition.' (<a href="#" onclick="jQuery(\'.fix-meta-'.$random.'\').toggle(); return false">show fix</a>)';
95
+ $sOutput .= ( $args['wrap'] ) ? '</'.$args['wrap'].'>' : '';
96
+ $sOutput .= $fix;
97
+ $video_errors[] = $sOutput;
98
+ }
99
+ }
100
+
101
+ return array( $video_errors, (isset($headers['headers']['content-type'])) ? $headers['headers']['content-type'] : '', $bFatal );
102
+ }
103
+
104
+
105
+
106
+
107
+ public function check_mimetype( $URLs = false, $meta = false ) {
108
+
109
+ add_action( 'http_api_curl', array( 'FV_Player_Checker', 'http_api_curl' ) );
110
+
111
+ $tStart = microtime(true);
112
+
113
+ global $fv_wp_flowplayer_ver, $fv_fp;
114
+
115
+ if( !empty($meta) ) {
116
+ extract( $meta, EXTR_SKIP );
117
+ }
118
+
119
+ if( defined('DOING_AJAX') && DOING_AJAX && isset( $_POST['media'] ) && stripos( $_SERVER['HTTP_REFERER'], home_url() ) === 0 ) {
120
+ $URLs = json_decode( stripslashes( trim($_POST['media']) ));
121
+ }
122
+
123
+ if( isset($URLs) ) {
124
+ $all_sources = $URLs;
125
+
126
+ foreach( $all_sources AS $source ) {
127
+ if( preg_match( '!^rtmp://!', $source, $match ) ) {
128
+ $found_rtmp = true;
129
+ } else if( !isset($media) && !preg_match( '!\.(m3u8ALLOW|m3uALLOW|avi)$!', $source) ) {
130
+ $media = $source;
131
+ }
132
+ }
133
+
134
+ //$random = rand( 0, 10000 );
135
+ $random = (isset($_POST['hash'])) ? trim($_POST['hash']) : false;
136
+
137
+ if( isset($media) ) {
138
+ $remotefilename = $media;
139
+ $remotefilename_encoded = flowplayer::get_encoded_url($remotefilename);
140
+
141
+ if( $fv_fp->is_secure_amazon_s3($remotefilename_encoded) || 1>0 ) { // skip headers check for Amazon S3, as it's slow
142
+ $headers = false;
143
+ } else {
144
+ $headers = wp_remote_head( trim( str_replace(' ', '%20', $remotefilename_encoded ) ), array( 'method' => 'GET', 'redirection' => 3 ) );
145
+ }
146
+
147
+ $bValidFile = true;
148
+ if( is_wp_error($headers) ) {
149
+ $video_errors[] = 'Error checking '.$media.'!<br />'.print_r($headers,true);
150
+ } else {
151
+ if( $headers ) {
152
+ list( $aVideoErrors, $sContentType, $bFatal ) = $this->check_headers( $headers, $remotefilename, $random );
153
+ if( $bFatal ) {
154
+ $bValidFile = false;
155
+ }
156
+ if( $aVideoErrors ) {
157
+ $video_errors = array_merge( $video_errors, $aVideoErrors );
158
+ }
159
+ }
160
+
161
+ if( function_exists('is_utf8') && is_utf8($remotefilename) ) {
162
+ $video_errors[] = '<p><strong>UTF-8 error</strong>: Your file name is using non-latin characters, the file might not play in browsers using Flash for the video!</p>';
163
+ }
164
+
165
+ if( @ini_get('safe_mode') ) {
166
+ $video_warnings[] = 'Detailed video check is not available with PHP Safe Mode On. Please contact your webhost support.';
167
+ } else {
168
+
169
+ if ( ! class_exists( 'getID3' ) ) {
170
+ require( ABSPATH . WPINC . '/ID3/getid3.php' );
171
+ }
172
+ $getID3 = new getID3;
173
+
174
+ if( !function_exists('curl_init') ) {
175
+ $video_errors[] = 'cURL for PHP not found, please contact your server administrator.';
176
+ } else {
177
+ $message = '<p>Analysis of <a class="bluelink" target="_blank" href="'.esc_attr($remotefilename_encoded).'">'.$remotefilename_encoded.'</a></p>';
178
+
179
+ // taken from: http://www.getid3.org/phpBB3/viewtopic.php?f=3&t=1141
180
+ $upload_dir = wp_upload_dir();
181
+ $localtempfilename = trailingslashit( $upload_dir['basedir'] ).'fv_flowlayer_tmp_'.md5(rand(1,999)).'_'.basename( substr($remotefilename_encoded,0,32) );
182
+
183
+ $out = fopen( $localtempfilename,'wb' );
184
+
185
+ if( $out ) {
186
+ $aArgs = array( 'file' => $localtempfilename );
187
+ if( !$this->is_cron ) {
188
+ $aArgs['quick_check'] = apply_filters( 'fv_flowplayer_checker_timeout_quick', 2 );
189
+ }
190
+ list( $header, $sHTTPError ) = $this->http_request( $remotefilename_encoded, $aArgs );
191
+
192
+ $video_errors = array();
193
+ if( $sHTTPError ) {
194
+ $video_errors[] = $sHTTPError;
195
+ $bValidFile = false;
196
+ }
197
+ fclose($out);
198
+
199
+ if( !$headers ) {
200
+ $headers = WP_Http::processHeaders( $header );
201
+
202
+ list( $aVideoErrors, $sContentType, $bFatal ) = $this->check_headers( $headers, $remotefilename, $random );
203
+ if( $bFatal ) {
204
+ $bValidFile = false;
205
+ }
206
+
207
+ if( $aVideoErrors ) {
208
+ $video_errors = array_merge( $video_errors, $aVideoErrors );
209
+ }
210
+
211
+ if( isset($hearders['headers']['server']) && $hearders['headers']['server'] == 'AmazonS3' && $headers['response']['code'] == '403' ) {
212
+ $error = new SimpleXMLElement($body);
213
+
214
+ if( stripos( $error->Message, 'Request has expired' ) !== false ) {
215
+ $video_errors[] = '<p><strong>Amazon S3</strong>: Your secure link is expired, there might be problem with your Amazon S3 plugin. Please test if the above URL opens in your browser.</p>';
216
+ } else {
217
+ $video_errors[] = '<p><strong>Amazon S3</strong>: '.$error->Message.'</p>';
218
+ }
219
+
220
+ }
221
+ }
222
+
223
+ if( $bValidFile ) {
224
+ $ThisFileInfo = $getID3->analyze( $localtempfilename );
225
+ }
226
+ if( !@unlink($localtempfilename) ) {
227
+ $video_errors[] = 'Can\'t remove temporary file for video analysis in <tt>'.$localtempfilename.'</tt>!';
228
+ }
229
+ } else {
230
+ $video_errors[] = 'Can\'t create temporary file for video analysis in <tt>'.$localtempfilename.'</tt>!';
231
+ }
232
+ }
233
+
234
+
235
+ /*
236
+ Only check file length
237
+ */
238
+ if( isset($meta_action) && $meta_action == 'check_time' ) {
239
+ $time = false;
240
+ if( isset($ThisFileInfo) && isset($ThisFileInfo['playtime_seconds']) ) {
241
+ $time = $ThisFileInfo['playtime_seconds'];
242
+ }
243
+
244
+ $time = apply_filters( 'fv_flowplayer_checker_time', $time, $meta_original );
245
+
246
+ global $post;
247
+ $fv_flowplayer_meta = get_post_meta( $post->ID, flowplayer::get_video_key($meta_original), true );
248
+ $fv_flowplayer_meta = ($fv_flowplayer_meta) ? $fv_flowplayer_meta : array();
249
+ $fv_flowplayer_meta['duration'] = $time;
250
+ $fv_flowplayer_meta['etag'] = isset($headers['headers']['etag']) ? $headers['headers']['etag'] : false; // todo: check!
251
+ $fv_flowplayer_meta['date'] = time();
252
+ $fv_flowplayer_meta['check_time'] = microtime(true) - $tStart;
253
+
254
+ if( $time > 0 || $this->is_cron ) {
255
+ update_post_meta( $post->ID, flowplayer::get_video_key($meta_original), $fv_flowplayer_meta );
256
+ return true;
257
+ }
258
+ //} else {
259
+ //self::queue_add($post->ID);
260
+ //return false;
261
+ //}
262
+
263
+ }
264
+
265
+ }
266
+ } // end is_wp_error check
267
+
268
+ } // end isset($media)
269
+ }
270
+ }
271
+
272
+
273
+
274
+
275
+ function checker_cron() {
276
+ if( !$aQueue = self::queue_get() ) return;
277
+ $tStart = microtime(true);
278
+ $this->is_cron = true;
279
+ foreach( $aQueue AS $key => $item ) {
280
+ if( microtime(true) - $tStart > apply_filters( 'fv_flowplayer_checker_cron_time', 20 ) ) {
281
+ break;
282
+ }
283
+ global $post;
284
+ $tmp = $post;
285
+ $post = get_post($key);
286
+
287
+ do_action( 'fv_flowplayer_checker_cron_post', $key );
288
+
289
+ fv_wp_flowplayer_save_post($key);
290
+ $post = $tmp;
291
+ }
292
+
293
+ }
294
+
295
+
296
+
297
+
298
+ function cron_init() {
299
+ global $fv_fp;
300
+ if( isset($fv_fp->conf['db_duration']) && $fv_fp->conf['db_duration'] == 'true' ) {
301
+ if ( !wp_next_scheduled( 'fv_flowplayer_checker_event' ) ) {
302
+ wp_schedule_event( time(), '5minutes', 'fv_flowplayer_checker_event' );
303
+ }
304
+ } else if( wp_next_scheduled( 'fv_flowplayer_checker_event' ) ) {
305
+ wp_clear_scheduled_hook( 'fv_flowplayer_checker_event' );
306
+ }
307
+ }
308
+
309
+
310
+
311
+
312
+ function cron_schedules( $schedules ) {
313
+ $schedules['5minutes'] = array(
314
+ 'interval' => 300,
315
+ 'display' => __('Every 5 minutes')
316
+ );
317
+ return $schedules;
318
+ }
319
+
320
+
321
+
322
+
323
+ public static function get_videos( $content ) {
324
+ global $fv_fp;
325
+
326
+ preg_match_all( '~\[(?:flowplayer|fvplayer).*?\]~', $content, $matches );
327
+
328
+ $videos = array();
329
+ if( isset($matches[0]) && count($matches[0]) ) {
330
+ $aPlaylistItems = array();
331
+ foreach( $matches[0] AS $shortcode ) {
332
+ $aArgs = shortcode_parse_atts( rtrim($shortcode,']') );
333
+ list( $playlist_items_external_html, $aPlaylistItems ) = $fv_fp->build_playlist( $aArgs, isset($aArgs['src']) ? $aArgs['src'] : false, false, false, false, false, true );
334
+ if( count($aPlaylistItems) > 0 ) {
335
+ foreach( $aPlaylistItems AS $aItem ) {
336
+ if( isset($aItem[0]) ) {
337
+ $aKeys = array_keys($aItem[0]);
338
+ $videos[] = $aItem[0][$aKeys[0]];
339
+ }
340
+ }
341
+ }
342
+ }
343
+ }
344
+
345
+ if( count($videos) > 0 ) {
346
+ $videos = array_unique($videos);
347
+ } else {
348
+ $videos = false;
349
+ }
350
+ return $videos;
351
+ }
352
+
353
+
354
+
355
+
356
+ public static function http_api_curl( $handle ) {
357
+ curl_setopt( $handle, CURLOPT_NOBODY, true ); // don't include body in our wp_remote_head requests. We have to use GET instead of HEAD because of Amazon
358
+ }
359
+
360
+
361
+
362
+
363
+ public static function http_request( $sURL, $args ) {
364
+ global $fv_wp_flowplayer_ver;
365
+
366
+ $args = wp_parse_args( $args, array( 'file' => false, 'size' => 2097152, 'quick_check' => false ) );
367
+ extract($args);
368
+
369
+ $iTimeout = ($quick_check) ? $quick_check : 20;
370
+
371
+ $ch = curl_init();
372
+ curl_setopt( $ch, CURLOPT_URL, $sURL );
373
+ curl_setopt( $ch, CURLOPT_RANGE, '0-'.$size );
374
+ curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
375
+ if( !@ini_get('open_basedir') ) {
376
+ @curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
377
+ }
378
+ curl_setopt( $ch, CURLOPT_HEADER, true );
379
+ curl_setopt( $ch, CURLOPT_VERBOSE, 1 );
380
+ curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, $iTimeout );
381
+ curl_setopt( $ch, CURLOPT_TIMEOUT, $iTimeout );
382
+ curl_setopt( $ch, CURLOPT_USERAGENT, 'FV Flowplayer video checker/'.$fv_wp_flowplayer_ver);
383
+
384
+ $data = curl_exec($ch);
385
+
386
+ $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
387
+ $header = substr($data, 0, $header_size);
388
+ $body = substr($data, $header_size);
389
+
390
+ if( $file ) {
391
+ file_put_contents( $file, $body);
392
+ }
393
+ $sError = ($ch == false) ? 'CURL Error: '.curl_error ( $ch) : false;
394
+ if( curl_errno($ch) == 28 ) {
395
+ $sError .= "Connection timeout, can't check the video.";
396
+ } else if(!curl_errno($ch) ) {
397
+ $aInfo = curl_getinfo($ch);
398
+ if( $aInfo['total_time'] > $iTimeout*0.9 ) {
399
+ $sError .= "Connection timeout, can't check the video.";
400
+ }
401
+ }
402
+ curl_close($ch);
403
+
404
+ return array( $header, $sError );
405
+ }
406
+
407
+
408
+
409
+
410
+ public static function queue_add( $post_id ) {
411
+ $aQueue = get_option( 'fv_flowplayer_checker_queue' ) ? get_option( 'fv_flowplayer_checker_queue' ) : array();
412
+ $aQueue[$post_id] = true;
413
+ update_option( 'fv_flowplayer_checker_queue', $aQueue );
414
+ }
415
+
416
+
417
+
418
+
419
+ public static function queue_add_all() {
420
+ global $wpdb;
421
+ if( $aPosts = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_status = 'publish' AND post_content LIKE '%[fvplayer%' ORDER BY post_date DESC" ) ) {
422
+ $aQueue = array();
423
+ foreach( $aPosts AS $iPostId ) {
424
+ $aQueue[$iPostId] = true;
425
+ }
426
+ update_option( 'fv_flowplayer_checker_queue', $aQueue );
427
+ }
428
+
429
+ }
430
+
431
+
432
+
433
+
434
+ public static function queue_check( $post_id = false ) {
435
+ global $post;
436
+ $post_id = ( isset($post->ID) ) ? $post->ID : $post_id;
437
+ $aQueue = get_option( 'fv_flowplayer_checker_queue' ) ? get_option( 'fv_flowplayer_checker_queue' ) : array();
438
+ if( in_array($post_id,array_keys($aQueue)) ) {
439
+ return true;
440
+ }
441
+ return false;
442
+ }
443
+
444
+
445
+
446
+
447
+ public static function queue_get() {
448
+ return get_option( 'fv_flowplayer_checker_queue' );
449
+ }
450
+
451
+
452
+
453
+
454
+ public static function queue_remove( $post_id ) {
455
+ $aQueue = get_option( 'fv_flowplayer_checker_queue' ) ? get_option( 'fv_flowplayer_checker_queue' ) : array();
456
+ if( isset($aQueue[$post_id]) ) {
457
+ unset($aQueue[$post_id]);
458
+ }
459
+ update_option( 'fv_flowplayer_checker_queue', $aQueue );
460
+ }
461
+
462
+
463
+
464
+
465
+ }
models/flowplayer-backend.php DELETED
@@ -1,40 +0,0 @@
1
- <?php
2
- /* FV Wordpress Flowplayer - HTML5 video player with Flash fallback
3
- Copyright (C) 2013 Foliovision
4
-
5
- This program is free software: you can redistribute it and/or modify
6
- it under the terms of the GNU General Public License as published by
7
- the Free Software Foundation, either version 3 of the License, or
8
- (at your option) any later version.
9
-
10
- This program is distributed in the hope that it will be useful,
11
- but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- GNU General Public License for more details.
14
-
15
- You should have received a copy of the GNU General Public License
16
- along with this program. If not, see <http://www.gnu.org/licenses/>.
17
- */
18
-
19
- /**
20
- * Extension of original flowplayer class intended for administrator backend.
21
- */
22
- class flowplayer_backend extends flowplayer
23
- {
24
- /**
25
- * Displays elements that need to be added into head in administrator backend.
26
- */
27
- function flowplayer_head() {
28
- /**
29
- * Standard JS and CSS same as for frontend
30
- */
31
- include dirname( __FILE__ ) . '/../view/frontend-head.php';
32
- /**
33
- * Admin specific CSS and JS
34
- */
35
- if( isset($_GET['page']) && $_GET['page'] == 'fvplayer' ) {
36
- include dirname( __FILE__ ) . '/../view/backend-head.php';
37
- }
38
- }
39
- }
40
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
models/flowplayer-frontend.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /* FV Wordpress Flowplayer - HTML5 video player with Flash fallback
3
- Copyright (C) 2013 Foliovision
4
 
5
  This program is free software: you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
@@ -30,13 +30,17 @@ class flowplayer_frontend extends flowplayer
30
 
31
  var $expire_time = 0;
32
 
 
 
33
  var $aPlaylists = array();
34
 
 
 
35
  var $aCurArgs = false;
36
 
37
- var $sHTMLAfter = false;
38
-
39
 
 
40
  /**
41
  * Builds the HTML and JS code of single flowplayer instance on a page/post.
42
  * @param string $media URL or filename (in case it is in the /videos/ directory) of video file to be played.
@@ -96,11 +100,11 @@ class flowplayer_frontend extends flowplayer
96
  $rtmp = $media_item;
97
  }
98
  }
99
-
100
  if( ( !empty($this->aCurArgs['rtmp']) || ( !empty($this->conf['rtmp']) && $this->conf['rtmp'] != 'false' ) ) && !empty($this->aCurArgs['rtmp_path']) ) {
101
  $rtmp = trim( $this->aCurArgs['rtmp_path'] );
102
  }
103
-
104
  list( $media, $src1, $src2 ) = apply_filters( 'fv_flowplayer_media_pre', array( $media, $src1, $src2 ), $this );
105
 
106
 
@@ -114,10 +118,12 @@ class flowplayer_frontend extends flowplayer
114
  }
115
 
116
  global $post;
117
- $fv_flowplayer_meta = get_post_meta( $post->ID, '_fv_flowplayer', true );
118
- if( $fv_flowplayer_meta && isset($fv_flowplayer_meta[sanitize_title($media_item)]['time']) ) {
119
- $this->expire_time = $fv_flowplayer_meta[sanitize_title($media_item)]['time'];
120
- }
 
 
121
  }
122
 
123
  if( preg_match( "~(youtu\.be/|youtube\.com/(watch\?(.*&)?v=|(embed|v)/))([^\?&\"'>]+)~i", $media, $aYoutube ) ) {
@@ -158,6 +164,18 @@ class flowplayer_frontend extends flowplayer
158
  * Video player
159
  */
160
  if( $player_type == 'video' ) {
 
 
 
 
 
 
 
 
 
 
 
 
161
 
162
  foreach( array( $media, $src1, $src2 ) AS $media_item ) {
163
  //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
@@ -187,7 +205,6 @@ class flowplayer_frontend extends flowplayer
187
  }
188
 
189
  $popup = '';
190
- $controlbar = 'hide';
191
 
192
  //check user agents
193
  $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');
@@ -199,7 +216,6 @@ class flowplayer_frontend extends flowplayer
199
 
200
  $redirect = '';
201
 
202
- if (isset($this->aCurArgs['controlbar'])&&($this->aCurArgs['controlbar']=='show')) $controlbar = 'show';
203
  if (isset($this->aCurArgs['redirect'])&&!empty($this->aCurArgs['redirect'])) $redirect = trim($this->aCurArgs['redirect']);
204
  $scaling = "scale";
205
  if (isset($this->conf['scaling'])&&($this->conf['scaling']=="true"))
@@ -216,13 +232,7 @@ class flowplayer_frontend extends flowplayer
216
  $show_splashend = true;
217
  $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>';
218
  }
219
-
220
- // change engine for IE9 and 10
221
-
222
- if( $this->conf['engine'] == 'false' ) {
223
- $this->ret['script']['fv_flowplayer_browser_ie'][$this->hash] = true;
224
- }
225
-
226
 
227
  if ( !empty($redirect) ) {
228
  $this->ret['script']['fv_flowplayer_redirect'][$this->hash] = $redirect;
@@ -232,7 +242,7 @@ class flowplayer_frontend extends flowplayer
232
  $attributes = array();
233
  $attributes['class'] = 'flowplayer';
234
 
235
- if( $autoplay == false ) {
236
  $attributes['class'] .= ' is-splash';
237
  }
238
 
@@ -240,10 +250,39 @@ class flowplayer_frontend extends flowplayer
240
  $attributes['class'] .= ' playlist-hidden';
241
  }
242
 
243
- if( $controlbar == 'show' ) {
244
- $attributes['class'] .= ' fixed-controls';
245
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
246
 
 
247
  if( isset($this->aCurArgs['align']) ) {
248
  if( $this->aCurArgs['align'] == 'left' ) {
249
  $attributes['class'] .= ' alignleft';
@@ -281,13 +320,19 @@ class flowplayer_frontend extends flowplayer
281
  $attributes['data-analytics'] = $this->conf['googleanalytics'];
282
  }
283
 
 
284
  if( isset($this->aCurArgs['rtmp']) && !empty($this->aCurArgs['rtmp']) ) {
285
  $attributes['data-rtmp'] = trim( $this->aCurArgs['rtmp'] );
286
  } else if( isset($rtmp) && stripos( $rtmp, 'rtmp://' ) === 0 && !(isset($this->conf['rtmp']) && $this->conf['rtmp'] != 'false' && stripos($rtmp,$this->conf['rtmp']) !== false ) ) {
287
- $rtmp_info = parse_url($rtmp);
288
- if( isset($rtmp_info['host']) && strlen(trim($rtmp_info['host']) ) > 0 ) {
289
- $attributes['data-rtmp'] = 'rtmp://'.$rtmp_info['host'].'/cfx/st';
290
- }
 
 
 
 
 
291
  } else if( !empty($this->conf['rtmp']) && $this->conf['rtmp'] != 'false' ) {
292
  if( stripos( $this->conf['rtmp'], 'rtmp://' ) === 0 ) {
293
  $attributes['data-rtmp'] = $this->conf['rtmp'];
@@ -296,8 +341,7 @@ class flowplayer_frontend extends flowplayer
296
  $attributes['data-rtmp'] = 'rtmp://' . $this->conf['rtmp'] . '/cfx/st/';
297
  }
298
  }
299
-
300
-
301
  $this->get_video_checker_media($attributes, $media, $src1, $src2, $rtmp);
302
 
303
 
@@ -308,7 +352,7 @@ class flowplayer_frontend extends flowplayer
308
  $ratio = round($height / $width, 4);
309
  $this->fRatio = $ratio;
310
 
311
- $attributes['data-ratio'] = $ratio;
312
  if( $scaling == "fit" && $this->conf['fixed_size'] == 'fixed' ) {
313
  $attributes['data-flashfit'] = 'true';
314
  }
@@ -328,8 +372,14 @@ class flowplayer_frontend extends flowplayer
328
  $attributes['style'] .= "background-image: url({$splash_img});";
329
  if( $autoplay ) {
330
  $this->ret['script']['fv_flowplayer_autoplay'][$this->hash] = true; // todo: any better way?
 
331
  }
332
- }
 
 
 
 
 
333
 
334
  if( isset($this->aCurArgs['admin_warning']) ) {
335
  $this->sHTMLAfter .= wpautop($this->aCurArgs['admin_warning']);
@@ -359,9 +409,9 @@ class flowplayer_frontend extends flowplayer
359
  $this->ret['html'] .= ' loop';
360
 
361
  }
362
- if( isset($this->conf['auto_buffer']) && $this->conf['auto_buffer'] == 'true' && $this->autobuffer_count < apply_filters( 'fv_flowplayer_autobuffer_limit', 2 )) {
363
- $this->ret['html'] .= ' preload="auto"';
364
- $this->ret['html'] .= ' id="wpfp_'.$this->hash.'_video"';
365
  } else if ($autoplay == false) {
366
  $this->ret['html'] .= ' preload="none"';
367
  }
@@ -373,11 +423,11 @@ class flowplayer_frontend extends flowplayer
373
  $this->ret['html'] .= ">\n";
374
 
375
  foreach( apply_filters( 'fv_player_media', array($media, $src1, $src2), $this ) AS $media_item ) {
376
- $this->ret['html'] .= $this->get_video_src($media_item, $mobileUserAgent, null, $rtmp);
377
  }
378
  if (!empty($mobile)) {
379
  $this->ret['script']['fv_flowplayer_mobile_switch'][$this->hash] = true;
380
- $this->ret['html'] .= $this->get_video_src($mobile, $mobileUserAgent, 'wpfp_'.$this->hash.'_mobile', $rtmp);
381
  }
382
 
383
  if( isset($rtmp) && !empty($rtmp) ) {
@@ -385,10 +435,21 @@ class flowplayer_frontend extends flowplayer
385
  foreach( apply_filters( 'fv_player_media_rtmp', array($rtmp),$this ) AS $rtmp_item ) {
386
  $rtmp_item = apply_filters( 'fv_flowplayer_video_src', $rtmp_item, $this );
387
 
388
- $rtmp_url = parse_url($rtmp_item);
389
- $rtmp_file = $rtmp_url['path'] . ( ( !empty($rtmp_url['query']) ) ? '?'. str_replace( '&amp;', '&', $rtmp_url['query'] ) : '' );
390
-
391
- $extension = $this->get_file_extension($rtmp_url['path'], null);
 
 
 
 
 
 
 
 
 
 
 
392
  if( $extension ) {
393
  $extension .= ':';
394
  }
@@ -400,7 +461,7 @@ class flowplayer_frontend extends flowplayer
400
  $this->ret['html'] .= "\t"."\t".'<track src="'.esc_attr($subtitles).'" />'."\n";
401
  }
402
 
403
- $this->ret['html'] .= "\t".'</video>'."\n";
404
  }
405
 
406
 
@@ -408,13 +469,13 @@ class flowplayer_frontend extends flowplayer
408
  $this->ret['html'] .= $splashend_contents;
409
  }
410
  if( $popup_contents = $this->get_popup_code() ) {
411
- $this->ret['html'] .= $popup_contents;
412
  }
413
  if( $ad_contents = $this->get_ad_code() ) {
414
- $this->ret['html'] .= $ad_contents;
415
  }
416
  if( current_user_can('manage_options') && !isset($playlist_items_external_html) ) {
417
- $this->ret['html'] .= '<div id="wpfp_'.$this->hash.'_admin_error" class="fvfp_admin_error"><div class="fvfp_admin_error_content"><h4>Admin warning:</h4>I\'m sorry, your JavaScript appears to be broken. Please use "Check template" in plugin settings or <a href="http://foliovision.com/wordpress/pro-install">order our pro support</a> and we will get it fixed for you.</div></div>';
418
  }
419
 
420
  $this->ret['html'] .= apply_filters( 'fv_flowplayer_inner_html', null, $this );
@@ -429,6 +490,11 @@ class flowplayer_frontend extends flowplayer
429
 
430
  $this->ret['html'] .= $this->sHTMLAfter.$scripts_after;
431
 
 
 
 
 
 
432
  } // end Video player
433
 
434
 
@@ -475,148 +541,11 @@ class flowplayer_frontend extends flowplayer
475
 
476
  $this->ret['script']['mediaelementplayer'][$this->hash] = true;
477
  $this->ret['html'] .= '<div id="wpfp_' . $this->hash . '" class="fvplayer fv-mediaelement">'."\n";
478
- $this->ret['html'] .= "\t".'<audio src="'.$this->get_amazon_secure($media, $this).'" type="audio/'.$this->get_file_extension($media).'" controls="controls" width="'.$width.'"'.$preload.'></audio>'."\n";
479
  $this->ret['html'] .= '</div>'."\n";
480
  }
481
 
482
 
483
- function build_playlist( $aArgs, $media, $src1, $src2, $rtmp, $splash_img ) {
484
-
485
- $sShortcode = $aArgs['playlist'];
486
- $sCaption = $aArgs['caption'];
487
-
488
- $replace_from = array('&amp;','\;', '\,');
489
- $replace_to = array('<!--amp-->','<!--semicolon-->','<!--comma-->');
490
- $sShortcode = str_replace( $replace_from, $replace_to, $sShortcode );
491
- $sItems = explode( ';', $sShortcode );
492
-
493
- if( $sCaption ) {
494
- $replace_from = array('&amp;quot;','&amp;','\;','&quot;');
495
- $replace_to = array('"','<!--amp-->','<!--semicolon-->','"');
496
- $sCaption = str_replace( $replace_from, $replace_to, $sCaption );
497
- $aCaption = explode( ';', $sCaption );
498
- }
499
- foreach( $aCaption AS $key => $item ) {
500
- $aCaption[$key] = str_replace('<!--amp-->','&',$item);
501
- }
502
-
503
-
504
- $aItem = array();
505
- $flash_media = array();
506
-
507
- if( $rtmp ) {
508
- $rtmp = 'rtmp:'.$rtmp;
509
- }
510
-
511
- foreach( apply_filters( 'fv_player_media', array($media, $src1, $src2, $rtmp), $this ) AS $key => $media_item ) {
512
- if( !$media_item ) continue;
513
- $media_url = $this->get_video_src( preg_replace( '~^rtmp:~', '', $media_item ), false, false, false, true );
514
- if( is_array($media_url) ) {
515
- $actual_media_url = $media_url['media'];
516
- if( $this->get_file_extension($actual_media_url) == 'mp4' ) {
517
- $flash_media[] = $media_url['flash'];
518
- }
519
- } else {
520
- $actual_media_url = $media_url;
521
- }
522
- $aItem[] = array( ( stripos( $media_item, 'rtmp:' ) === 0 ) ? 'flash' : $this->get_file_extension($actual_media_url) => $actual_media_url ); // hmm how to add Flash items?
523
- }
524
-
525
- if( count($flash_media) ) {
526
- $bHaveFlash = false;
527
- foreach( $aItem AS $key => $aItemFile ) { // how to avoid duplicates?
528
- if( in_array( 'flash', array_keys($aItemFile) ) ) {
529
- $bHaveFlash = true;
530
- }
531
- }
532
-
533
- if( !$bHaveFlash ) {
534
- foreach( $flash_media AS $flash_media_items ) {
535
- $aItem[] = array( 'flash' => $flash_media_items );
536
- }
537
- }
538
- }
539
-
540
- $aPlaylistItems[] = $aItem;
541
-
542
- $sHTML = '';
543
- if( $sShortcode && count($sItems) > 0 ) {
544
-
545
- $sHTML = array();
546
-
547
- $sItemCaption = ( isset($aCaption) ) ? array_shift($aCaption) : false;
548
- $sHTML[] = "\t\t<a href='#' class='is-active' onclick='return false'><span ".( (isset($splash_img) && !empty($splash_img)) ? "style='background-image: url(\"".$splash_img."\")' " : "" )."></span>$sItemCaption</a>\n";
549
-
550
-
551
- foreach( $sItems AS $iKey => $sItem ) {
552
- $aPlaylist_item = explode( ',', $sItem );
553
-
554
- foreach( $aPlaylist_item AS $key => $item ) {
555
- if( $key > 0 && ( stripos($item,'http:') !== 0 && stripos($item,'https:') !== 0 && stripos($item,'rtmp:') !== 0 && stripos($item,'/') !== 0 ) ) {
556
- $aPlaylist_item[$key-1] .= ','.$item;
557
- $aPlaylist_item[$key] = $aPlaylist_item[$key-1];
558
- unset($aPlaylist_item[$key-1]);
559
- }
560
- $aPlaylist_item[$key] = str_replace( $replace_to, $replace_from, $aPlaylist_item[$key] );
561
- }
562
-
563
- $aItem = array();
564
- $sSplashImage = false;
565
- $flash_media = array();
566
- foreach( apply_filters( 'fv_player_media', $aPlaylist_item, $this ) AS $aPlaylist_item_i ) {
567
- if( preg_match('~\.(png|gif|jpg|jpe|jpeg)($|\?)~',$aPlaylist_item_i) ) {
568
- $sSplashImage = $aPlaylist_item_i;
569
- continue;
570
- }
571
-
572
- $media_url = $this->get_video_src( preg_replace( '~^rtmp:~', '', $aPlaylist_item_i ), false, false, false, true );
573
- if( is_array($media_url) ) {
574
- $actual_media_url = $media_url['media'];
575
- if( $this->get_file_extension($actual_media_url) == 'mp4' ) {
576
- $flash_media[] = $media_url['flash'];
577
- }
578
- } else {
579
- $actual_media_url = $media_url;
580
- }
581
- $aItem[] = array( ( stripos( $aPlaylist_item_i, 'rtmp:' ) === 0 ) ? 'flash' : $this->get_file_extension($aPlaylist_item_i) => $actual_media_url );
582
- }
583
-
584
- if( count($flash_media) ) {
585
- $bHaveFlash = false;
586
- foreach( $aItem AS $key => $aItemFile ) {
587
- if( in_array( 'flash', array_keys($aItemFile) ) ) {
588
- $bHaveFlash = true;
589
- }
590
- }
591
-
592
- if( !$bHaveFlash ) {
593
- foreach( $flash_media AS $flash_media_items ) {
594
- $aItem[] = array( 'flash' => $flash_media_items );
595
- }
596
- }
597
- }
598
-
599
- $aPlaylistItems[] = $aItem;
600
- $sItemCaption = ( isset($aCaption[$iKey]) ) ? __($aCaption[$iKey]) : false;
601
-
602
- if( $sSplashImage ) {
603
- $sHTML[] = "\t\t<a href='#' onclick='return false'><span style='background-image: url(\"".$sSplashImage."\")'></span>$sItemCaption</a>\n";
604
- } else {
605
- $sHTML[] = "\t\t<a href='#' onclick='return false'><span></span>$sItemCaption</a>\n";
606
- }
607
-
608
- }
609
-
610
- $sHTML = "\t<div class='fp-playlist-external' rel='wpfp_{$this->hash}'>\n".implode( '', $sHTML )."\t</div>\n";
611
-
612
- $jsonPlaylistItems = str_replace( array('\\/', ','), array('/', ",\n\t\t"), json_encode($aPlaylistItems) );
613
- //$jsonPlaylistItems = preg_replace( '~"(.*)":"~', '$1:"', $jsonPlaylistItems );
614
- }
615
-
616
- return array( $sHTML, $aPlaylistItems );
617
- }
618
-
619
-
620
  function get_ad_code() {
621
  $ad_contents = false;
622
 
@@ -629,22 +558,33 @@ class flowplayer_frontend extends flowplayer
629
  !strlen($this->aCurArgs['ad_skip'])
630
  ) {
631
  if (isset($this->aCurArgs['ad']) && !empty($this->aCurArgs['ad'])) {
632
- $ad = html_entity_decode( str_replace('&#039;',"'", trim($this->aCurArgs['ad']) ) );
633
- $ad_width = ( isset($this->aCurArgs['ad_width']) ) ? $this->aCurArgs['ad_width'].'px' : '60%';
634
- $ad_height = ( isset($this->aCurArgs['ad_height']) ) ? $this->aCurArgs['ad_height'].'px' : '';
 
 
 
 
 
 
 
635
  }
636
  else {
637
  $ad = trim($this->conf['ad']);
638
- $ad_width = ( isset($this->conf['ad_width']) && $this->conf['ad_width'] ) ? $this->conf['ad_width'].'px' : '60%';
639
  $ad_height = ( isset($this->conf['ad_height']) && $this->conf['ad_height'] ) ? $this->conf['ad_height'].'px' : '';
640
  }
641
 
642
  $ad = apply_filters( 'fv_flowplayer_ad_html', $ad);
643
  if( strlen(trim($ad)) > 0 ) {
644
- $ad_contents = "\t<div id='wpfp_".$this->hash."_ad' class='wpfp_custom_ad'>\n\t\t<div class='wpfp_custom_ad_content' style='max-width: $ad_width; max-height: $ad_height; '>\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>\n\t</div>\n";
 
 
 
 
645
  }
646
  }
647
-
648
  return $ad_contents;
649
  }
650
 
@@ -679,21 +619,19 @@ class flowplayer_frontend extends flowplayer
679
  }
680
 
681
  $scripts_after = false;
682
- if( $mp4_position > $webm_position ) {
683
- if (isset($this->conf['auto_buffer']) && $this->conf['auto_buffer'] == 'true' && $this->autobuffer_count < apply_filters( 'fv_flowplayer_autobuffer_limit', 2 )) {
684
  $scripts_after = '<script type="text/javascript">
685
- if( /chrom(e|ium)/.test(navigator.userAgent.toLowerCase()) ) {
686
  document.getElementById("wpfp_'.$this->hash.'_video").setAttribute("preload", "none");
687
  }
688
  </script>
689
  ';
690
  }
691
 
692
- // tricky way of moving over the error handler
693
- $tmp = $this;
694
- $mp4_video = $this->get_amazon_secure( $mp4_video, $tmp );
695
 
696
- $this->ret['script']['fv_flowplayer_browser_chrome_fail'][$this->hash] = array( 'attrs' => $attributes_html, 'mp4' => $mp4_video, 'auto_buffer' => ( (isset($this->conf['auto_buffer']) && $this->conf['auto_buffer'] == 'true') ? "true" : "false" ) );
697
  }
698
 
699
  return $scripts_after;
@@ -704,7 +642,12 @@ class flowplayer_frontend extends flowplayer
704
  if ( ( ( isset($this->conf['popupbox']) ) && ( $this->conf['popupbox'] == "true" ) ) || ( isset($this->aCurArgs['popup']) && !empty($this->aCurArgs['popup']) ) ) {
705
  if (isset($this->aCurArgs['popup']) && !empty($this->aCurArgs['popup'])) {
706
  $popup = trim($this->aCurArgs['popup']);
707
- $popup = html_entity_decode( str_replace('&#039;',"'",$popup ) );
 
 
 
 
 
708
  }
709
  else {
710
  $popup = 'Would you like to replay the video?';
@@ -712,7 +655,9 @@ class flowplayer_frontend extends flowplayer
712
 
713
  $popup = apply_filters( 'fv_flowplayer_popup_html', $popup );
714
  if( strlen(trim($popup)) > 0 ) {
715
- $popup_contents = '<div id="wpfp_'.$this->hash.'_custom_popup" class="wpfp_custom_popup"><div class="wpfp_custom_popup_content">'.$popup.'</div></div>';
 
 
716
  return $popup_contents;
717
  }
718
  }
@@ -725,25 +670,31 @@ class flowplayer_frontend extends flowplayer
725
  if (isset($this->aCurArgs['splash']) && !empty($this->aCurArgs['splash'])) {
726
  $splash_img = $this->aCurArgs['splash'];
727
  if( strpos($splash_img,'http://') === false && strpos($splash_img,'https://') === false ) {
 
 
728
  //$splash_img = VIDEO_PATH.trim($this->aCurArgs['splash']);
729
  if($splash_img[0]=='/') $splash_img = substr($splash_img, 1);
730
  if((dirname($_SERVER['PHP_SELF'])!='/')&&(file_exists($_SERVER['DOCUMENT_ROOT'].dirname($_SERVER['PHP_SELF']).VIDEO_DIR.$splash_img))){ //if the site does not live in the document root
731
- $splash_img = 'http://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']).VIDEO_DIR.$splash_img;
732
  }
733
  else
734
  if(file_exists($_SERVER['DOCUMENT_ROOT'].VIDEO_DIR.$splash_img)){ // if the videos folder is in the root
735
- $splash_img = 'http://'.$_SERVER['SERVER_NAME'].VIDEO_DIR.$splash_img;//VIDEO_PATH.$media;
736
  }
737
  else {
738
  //if the videos are not in the videos directory but they are adressed relatively
739
  $splash_img_path = str_replace('//','/',$_SERVER['SERVER_NAME'].'/'.$splash_img);
740
- $splash_img = 'http://'.$splash_img_path;
741
  }
742
  }
743
  else {
744
  $splash_img = trim($this->aCurArgs['splash']);
745
  }
 
 
746
  }
 
 
747
  return $splash_img;
748
  }
749
 
@@ -793,7 +744,7 @@ class flowplayer_frontend extends flowplayer
793
  $aTest_media = array();
794
  foreach( array( $media, $src1, $src2, $rtmp_test ) AS $media_item ) {
795
  if( $media_item ) {
796
- $aTest_media[] = $this->get_amazon_secure( $media_item, $this );
797
  //break;
798
  }
799
  }
@@ -806,63 +757,49 @@ class flowplayer_frontend extends flowplayer
806
  }
807
 
808
 
809
- function get_video_url($media) {
810
- if( strpos($media,'rtmp://') !== false ) {
811
- return null;
812
- }
813
- if( strpos($media,'http://') === false && strpos($media,'https://') === false ) {
814
- // strip the first / from $media
815
- if($media[0]=='/') $media = substr($media, 1);
816
- if((dirname($_SERVER['PHP_SELF'])!='/')&&(file_exists($_SERVER['DOCUMENT_ROOT'].dirname($_SERVER['PHP_SELF']).VIDEO_DIR.$media))){ //if the site does not live in the document root
817
- $media = 'http://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']).VIDEO_DIR.$media;
818
- }
819
- else if(file_exists($_SERVER['DOCUMENT_ROOT'].VIDEO_DIR.$media)){ // if the videos folder is in the root
820
- $media = 'http://'.$_SERVER['SERVER_NAME'].VIDEO_DIR.$media;//VIDEO_PATH.$media;
821
- }
822
- else{ // if the videos are not in the videos directory but they are adressed relatively
823
- $media_path = str_replace('//','/',$_SERVER['SERVER_NAME'].'/'.$media);
824
- $media = 'http://'.$media_path;
825
- }
826
- }
827
-
828
- $media = apply_filters( 'fv_flowplayer_media', $media, $this );
829
-
830
- return $media;
831
- }
832
-
833
-
834
  function get_sharing_html() {
835
 
836
- $sPermalink = urlencode(get_permalink());
837
- $sMail = urlencode( apply_filters( 'fv_player_sharing_mail_content', 'Check the amazing video here: '.get_permalink() ) );
838
- $sTitle = urlencode( (is_singular()) ? get_the_title() : get_bloginfo().' ');
839
-
840
- $sHTMLSharing = <<< HTML
841
- <label>Share the video</label>
842
- <ul class="fvp-sharing">
843
- <li><a class="sharing-facebook" href="https://www.facebook.com/sharer/sharer.php?u=$sPermalink" target="_blank">Facebook</a></li>
844
- <li><a class="sharing-twitter" href="https://twitter.com/home?status=$sTitle$sPermalink" target="_blank">Twitter</a></li>
845
- <li><a class="sharing-google" href="https://plus.google.com/share?url=$sPermalink" target="_blank">Google+</a></li>
846
- <li><a class="sharing-email" href="mailto:?body=$sMail" target="_blank">Email</a></li>
847
- </ul>
848
- HTML;
 
 
 
 
 
 
 
 
 
 
 
 
 
849
 
850
- $sHTMLEmbed = <<< HTML
851
- <label><a class="embed-code-toggle" href="#"><strong>Embed</strong></a></label>
852
- <div class="embed-code">
853
- <label>Copy and paste this HTML code into your webpage to embed.</label>
854
- <textarea></textarea>
855
- </div>
856
- HTML;
857
 
858
  if( $this->aCurArgs['embed'] == 'false' || ( $this->conf['disableembedding'] == 'true' && $this->aCurArgs['embed'] != 'true' ) ) {
859
  $sHTMLEmbed = '';
860
  }
861
 
862
- if( $this->aCurArgs['sharing'] == 'false' || ( $this->conf['disablesharing'] == 'true' && $this->aCurArgs['sharing'] != 'true' ) ) {
863
  $sHTMLSharing = '';
864
- }
 
 
 
 
865
 
 
866
  if( $sHTMLSharing || $sHTMLEmbed ) {
867
  $sHTML = "<div class='fvp-share-bar'>$sHTMLSharing$sHTMLEmbed</div>";
868
  }
@@ -884,12 +821,10 @@ HTML;
884
  </div>
885
  <div class="support-{$this->hash}">
886
  <textarea style="width: 98%; height: 150px" onclick="if( this.value == 'Enter your comment' ) this.value = ''" class="wpfp_message_field" id="wpfp_support_{$this->hash}">Enter your comment</textarea>
887
- <p><a class="techinfo" href="#" onclick="jQuery('.more-{$this->hash}').toggle(); return false">Technical info</a> <img style="display: none; " src="{$sSpinURL}" id="wpfp_spin_{$this->hash}"> <input type="button" value="Send report to Foliovision" onclick="fv_wp_flowplayer_admin_support_mail('{$this->hash}', this); return false"></p>
888
- </div>
889
  <div class="more-{$this->hash} mail-content-details" style="display: none; ">
890
  <p>Plugin version: {$fv_wp_flowplayer_ver}</p>
891
- <div class="fv-wp-flowplayer-notice-parsed level-0"></div>
892
- </div>
893
  </div>
894
  </div>
895
  HTML;
@@ -898,101 +833,6 @@ HTML;
898
  }
899
 
900
 
901
- function get_video_src($media, $mobileUserAgent, $id = '', $rtmp = false, $url_only = false ) {
902
- if( $media ) {
903
- $extension = $this->get_file_extension($media);
904
- //do not use https on mobile devices
905
- if (strpos($media, 'https') !== false && $mobileUserAgent) {
906
- $media = str_replace('https', 'http', $media);
907
- }
908
- $id = ($id) ? 'id="'.$id.'" ' : '';
909
-
910
- $media = apply_filters( 'fv_flowplayer_video_src', $media, $this );
911
-
912
- $media = $this->get_amazon_secure( $media, $this, $url_only );
913
-
914
- $media = apply_filters( 'fv_flowplayer_video_src_after', $media, $this );
915
-
916
- // fix for signed Amazon URLs, we actually need it for Flash only, so it gets into an extra source tag
917
- $source_flash_encoded = false;
918
- if( $this->is_secure_amazon_s3($media) /*&& stripos($media,'.webm') === false && stripos($media,'.ogv') === false */) {
919
- $media_fixed = str_replace('%2B', '%25252B',$media);
920
- // only if there was a change and we don't have an RTMP for Flash
921
- if( $media_fixed != $media && empty($rtmp) ) {
922
- $source_flash_encoded = $media_fixed;
923
- }
924
- }
925
-
926
- $url_parts = parse_url( ($source_flash_encoded) ? $source_flash_encoded : $media );
927
- if( stripos( $url_parts['path'], '+' ) !== false ) {
928
-
929
- if( !empty($url_parts['path']) ) {
930
- $url_parts['path'] = join('/', array_map('rawurlencode', explode('/', $url_parts['path'])));
931
- }
932
- if( !empty($url_parts['query']) ) {
933
- //$url_parts['query'] = str_replace( '&amp;', '&', $url_parts['query'] );
934
- }
935
-
936
- $source_flash_encoded = http_build_url( ($source_flash_encoded) ? $source_flash_encoded : $media, $url_parts);
937
- }
938
-
939
- if( $url_only ) {
940
- if( $source_flash_encoded ) {
941
- return array( 'media' => $media, 'flash' => $source_flash_encoded );
942
- } else {
943
- return trim($media);
944
- }
945
- } else {
946
- $mime_type = ( $extension == 'x-mpegurl' ) ? 'application/x-mpegurl' : 'video/'.$extension;
947
- $sReturn = '<source '.$id.'src="'.trim($media).'" type="'.$mime_type.'" />'."\n";
948
-
949
- if( $source_flash_encoded && strcmp($extension,'mp4') == 0 ) {
950
- $sReturn .= '<source '.$id.'src="'.trim($source_flash_encoded).'" type="video/flash" />'."\n";
951
- }
952
- return $sReturn;
953
- }
954
- }
955
- return null;
956
- }
957
-
958
-
959
- function get_file_extension($media, $default = 'flash' ) {
960
- $pathinfo = pathinfo( trim($media) );
961
-
962
- $extension = ( isset($pathinfo['extension']) ) ? $pathinfo['extension'] : false;
963
- $extension = preg_replace( '~[?#].+$~', '', $extension );
964
- $extension = strtolower($extension);
965
-
966
- if( !$extension ) {
967
- $output = $default;
968
- } else {
969
- if ($extension == 'm3u8' || $extension == 'm3u') {
970
- $output = 'x-mpegurl';
971
- } else if ($extension == 'm4v') {
972
- $output = 'mp4';
973
- } else if( $extension == 'mp3' ) {
974
- $output = 'mpeg';
975
- } else if( $extension == 'wav' ) {
976
- $output = 'wav';
977
- } else if( $extension == 'ogg' ) {
978
- $output = 'ogg';
979
- } else if( $extension == 'ogv' ) {
980
- $output = 'ogg';
981
- } else if( $extension == 'mov' ) {
982
- $output = 'mp4';
983
- } else if( $extension == '3gp' ) {
984
- $output = 'mp4';
985
- } else if( !in_array($extension, array('mp4', 'm4v', 'webm', 'ogv', 'mp3', 'ogg', 'wav', '3gp')) ) {
986
- $output = $default;
987
- } else {
988
- $output = $extension;
989
- }
990
- }
991
-
992
- return apply_filters( 'fv_flowplayer_get_file_extension', $output, $media );
993
- }
994
-
995
-
996
  /**
997
  * Displays the elements that need to be added to frontend.
998
  */
@@ -1001,3 +841,4 @@ HTML;
1001
  }
1002
 
1003
  }
 
1
  <?php
2
  /* FV Wordpress Flowplayer - HTML5 video player with Flash fallback
3
+ Copyright (C) 2015 Foliovision
4
 
5
  This program is free software: you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
30
 
31
  var $expire_time = 0;
32
 
33
+ var $aAds = array();
34
+
35
  var $aPlaylists = array();
36
 
37
+ var $aPopups = array();
38
+
39
  var $aCurArgs = false;
40
 
41
+ var $sHTMLAfter = false;
 
42
 
43
+
44
  /**
45
  * Builds the HTML and JS code of single flowplayer instance on a page/post.
46
  * @param string $media URL or filename (in case it is in the /videos/ directory) of video file to be played.
100
  $rtmp = $media_item;
101
  }
102
  }
103
+
104
  if( ( !empty($this->aCurArgs['rtmp']) || ( !empty($this->conf['rtmp']) && $this->conf['rtmp'] != 'false' ) ) && !empty($this->aCurArgs['rtmp_path']) ) {
105
  $rtmp = trim( $this->aCurArgs['rtmp_path'] );
106
  }
107
+
108
  list( $media, $src1, $src2 ) = apply_filters( 'fv_flowplayer_media_pre', array( $media, $src1, $src2 ), $this );
109
 
110
 
118
  }
119
 
120
  global $post;
121
+ if( $post ) {
122
+ $fv_flowplayer_meta = get_post_meta( $post->ID, '_fv_flowplayer', true );
123
+ if( $fv_flowplayer_meta && isset($fv_flowplayer_meta[sanitize_title($media_item)]['time']) ) {
124
+ $this->expire_time = $fv_flowplayer_meta[sanitize_title($media_item)]['time'];
125
+ }
126
+ }
127
  }
128
 
129
  if( preg_match( "~(youtu\.be/|youtube\.com/(watch\?(.*&)?v=|(embed|v)/))([^\?&\"'>]+)~i", $media, $aYoutube ) ) {
164
  * Video player
165
  */
166
  if( $player_type == 'video' ) {
167
+
168
+ if( is_feed() ) {
169
+ $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]') );
170
+ if( $splash_img ) {
171
+ $this->ret['html'] .= '<br /><img src="'.$splash_img.'" width="400" />';
172
+ }
173
+ $this->ret['html'] .= '</a></p>';
174
+
175
+ $this->ret['html'] = apply_filters( 'fv_flowplayer_rss', $this->ret['html'], $this );
176
+
177
+ return $this->ret;
178
+ }
179
 
180
  foreach( array( $media, $src1, $src2 ) AS $media_item ) {
181
  //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
205
  }
206
 
207
  $popup = '';
 
208
 
209
  //check user agents
210
  $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');
216
 
217
  $redirect = '';
218
 
 
219
  if (isset($this->aCurArgs['redirect'])&&!empty($this->aCurArgs['redirect'])) $redirect = trim($this->aCurArgs['redirect']);
220
  $scaling = "scale";
221
  if (isset($this->conf['scaling'])&&($this->conf['scaling']=="true"))
232
  $show_splashend = true;
233
  $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>';
234
  }
235
+
 
 
 
 
 
 
236
 
237
  if ( !empty($redirect) ) {
238
  $this->ret['script']['fv_flowplayer_redirect'][$this->hash] = $redirect;
242
  $attributes = array();
243
  $attributes['class'] = 'flowplayer';
244
 
245
+ if( $autoplay == false && !(isset($this->conf['auto_buffering']) && $this->conf['auto_buffering'] == 'trueDISABLED' && $this->autobuffer_count < apply_filters( 'fv_flowplayer_autobuffer_limit', 2 )) ) {
246
  $attributes['class'] .= ' is-splash';
247
  }
248
 
250
  $attributes['class'] .= ' playlist-hidden';
251
  }
252
 
253
+ // Fixed control bar
254
+ $bFixedControlbar = false;
255
+ if( isset($this->conf['ui_fixed_controlbar']) && strcmp($this->conf['ui_fixed_controlbar'],'true') == 0 ) {
256
+ $bFixedControlbar = true;
257
+ }
258
+ if( isset($this->aCurArgs['controlbar']) ) {
259
+ if( strcmp($this->aCurArgs['controlbar'],'yes') == 0 || strcmp($this->aCurArgs['controlbar'],'show') == 0 ) {
260
+ $bFixedControlbar = true;
261
+ } else if( strcmp($this->aCurArgs['controlbar'],'no') == 0 ) {
262
+ $attributes['class'] .= ' no-controlbar';
263
+ }
264
+ }
265
+ if( $bFixedControlbar ) {
266
+ $attributes['class'] .= ' fixed-controls';
267
+ }
268
+
269
+ // Play button
270
+ $bPlayButton = false;
271
+ if( isset($this->conf['ui_play_button']) && strcmp($this->conf['ui_play_button'],'true') == 0 ) {
272
+ $bPlayButton = true;
273
+ }
274
+ if( isset($this->aCurArgs['play_button']) ) {
275
+ if( strcmp($this->aCurArgs['play_button'],'yes') == 0 ) {
276
+ $bPlayButton = true;
277
+ } else if( strcmp($this->aCurArgs['play_button'],'no') == 0 ) {
278
+ $bPlayButton = false;
279
+ }
280
+ }
281
+ if( $bPlayButton ) {
282
+ $attributes['class'] .= ' play-button';
283
+ }
284
 
285
+ // Align
286
  if( isset($this->aCurArgs['align']) ) {
287
  if( $this->aCurArgs['align'] == 'left' ) {
288
  $attributes['class'] .= ' alignleft';
320
  $attributes['data-analytics'] = $this->conf['googleanalytics'];
321
  }
322
 
323
+ // determine the RTMP server
324
  if( isset($this->aCurArgs['rtmp']) && !empty($this->aCurArgs['rtmp']) ) {
325
  $attributes['data-rtmp'] = trim( $this->aCurArgs['rtmp'] );
326
  } else if( isset($rtmp) && stripos( $rtmp, 'rtmp://' ) === 0 && !(isset($this->conf['rtmp']) && $this->conf['rtmp'] != 'false' && stripos($rtmp,$this->conf['rtmp']) !== false ) ) {
327
+ if( preg_match( '~/([a-zA-Z0-9]+)?:~', $rtmp ) ) {
328
+ $aTMP = preg_split( '~/([a-zA-Z0-9]+)?:~', $rtmp, -1, PREG_SPLIT_DELIM_CAPTURE );
329
+ $attributes['data-rtmp'] = $aTMP[0];
330
+ } else {
331
+ $rtmp_info = parse_url($rtmp);
332
+ if( isset($rtmp_info['host']) && strlen(trim($rtmp_info['host']) ) > 0 ) {
333
+ $attributes['data-rtmp'] = 'rtmp://'.$rtmp_info['host'].'/cfx/st';
334
+ }
335
+ }
336
  } else if( !empty($this->conf['rtmp']) && $this->conf['rtmp'] != 'false' ) {
337
  if( stripos( $this->conf['rtmp'], 'rtmp://' ) === 0 ) {
338
  $attributes['data-rtmp'] = $this->conf['rtmp'];
341
  $attributes['data-rtmp'] = 'rtmp://' . $this->conf['rtmp'] . '/cfx/st/';
342
  }
343
  }
344
+
 
345
  $this->get_video_checker_media($attributes, $media, $src1, $src2, $rtmp);
346
 
347
 
352
  $ratio = round($height / $width, 4);
353
  $this->fRatio = $ratio;
354
 
355
+ $attributes['data-ratio'] = str_replace(',','.',$ratio);
356
  if( $scaling == "fit" && $this->conf['fixed_size'] == 'fixed' ) {
357
  $attributes['data-flashfit'] = 'true';
358
  }
372
  $attributes['style'] .= "background-image: url({$splash_img});";
373
  if( $autoplay ) {
374
  $this->ret['script']['fv_flowplayer_autoplay'][$this->hash] = true; // todo: any better way?
375
+ $attributes['class'] .= ' is-splash';
376
  }
377
+
378
+ } else if( strlen($this->aCurArgs['caption']) > 0 ) {
379
+ $attributes['class'] .= ' has-caption';
380
+ $this->sHTMLAfter = apply_filters( 'fv_player_caption', "<p class='fp-caption'>".$this->aCurArgs['caption']."</p>", $this );
381
+
382
+ }
383
 
384
  if( isset($this->aCurArgs['admin_warning']) ) {
385
  $this->sHTMLAfter .= wpautop($this->aCurArgs['admin_warning']);
409
  $this->ret['html'] .= ' loop';
410
 
411
  }
412
+ if( isset($this->conf['auto_buffering']) && $this->conf['auto_buffering'] == 'trueDISABLED' && $this->autobuffer_count < apply_filters( 'fv_flowplayer_autobuffer_limit', 2 )) {
413
+ $this->ret['html'] .= ' preload';
414
+ //$this->ret['html'] .= ' id="wpfp_'.$this->hash.'_video"';
415
  } else if ($autoplay == false) {
416
  $this->ret['html'] .= ' preload="none"';
417
  }
423
  $this->ret['html'] .= ">\n";
424
 
425
  foreach( apply_filters( 'fv_player_media', array($media, $src1, $src2), $this ) AS $media_item ) {
426
+ $this->ret['html'] .= $this->get_video_src($media_item, array( 'mobileUserAgent' => $mobileUserAgent, 'rtmp' => $rtmp ) );
427
  }
428
  if (!empty($mobile)) {
429
  $this->ret['script']['fv_flowplayer_mobile_switch'][$this->hash] = true;
430
+ $this->ret['html'] .= $this->get_video_src($mobile, array( 'id' => 'wpfp_'.$this->hash.'_mobile', 'mobileUserAgent' => $mobileUserAgent, 'rtmp' => $rtmp ) );
431
  }
432
 
433
  if( isset($rtmp) && !empty($rtmp) ) {
435
  foreach( apply_filters( 'fv_player_media_rtmp', array($rtmp),$this ) AS $rtmp_item ) {
436
  $rtmp_item = apply_filters( 'fv_flowplayer_video_src', $rtmp_item, $this );
437
 
438
+ if( preg_match( '~/([a-zA-Z0-9]+)?:~', $rtmp ) ) {
439
+ $aTMP = preg_split( '~/([a-zA-Z0-9]+)?:~', $rtmp, -1, PREG_SPLIT_DELIM_CAPTURE );
440
+ if( isset($aTMP[1]) && isset($aTMP[2]) ) {
441
+ $rtmp_file = $aTMP[2];
442
+ $extension = $this->get_file_extension($rtmp_file, $aTMP[1]);
443
+ } else {
444
+ $rtmp_file = $aTMP[1];
445
+ $extension = $this->get_file_extension($rtmp_file, false);
446
+ }
447
+ } else {
448
+ $rtmp_url = parse_url($rtmp_item);
449
+ $rtmp_file = $rtmp_url['path'] . ( ( !empty($rtmp_url['query']) ) ? '?'. str_replace( '&amp;', '&', $rtmp_url['query'] ) : '' );
450
+ $extension = $this->get_file_extension($rtmp_url['path'], 'mp4');
451
+ }
452
+
453
  if( $extension ) {
454
  $extension .= ':';
455
  }
461
  $this->ret['html'] .= "\t"."\t".'<track src="'.esc_attr($subtitles).'" />'."\n";
462
  }
463
 
464
+ $this->ret['html'] .= "\t".'</video>';//."\n";
465
  }
466
 
467
 
469
  $this->ret['html'] .= $splashend_contents;
470
  }
471
  if( $popup_contents = $this->get_popup_code() ) {
472
+ $this->aPopups["wpfp_{$this->hash}"] = $popup_contents;
473
  }
474
  if( $ad_contents = $this->get_ad_code() ) {
475
+ $this->aAds["wpfp_{$this->hash}"] = $ad_contents;
476
  }
477
  if( current_user_can('manage_options') && !isset($playlist_items_external_html) ) {
478
+ $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">troubleshooting guide</a> or <a href="http://foliovision.com/wordpress/pro-install">order our pro support</a> and we will get it fixed for you.</p></div></div>';
479
  }
480
 
481
  $this->ret['html'] .= apply_filters( 'fv_flowplayer_inner_html', null, $this );
490
 
491
  $this->ret['html'] .= $this->sHTMLAfter.$scripts_after;
492
 
493
+ // change engine for IE9 and 10
494
+ if( $this->aCurArgs['engine'] == 'false' ) {
495
+ $this->ret['script']['fv_flowplayer_browser_ie'][$this->hash] = true;
496
+ }
497
+
498
  } // end Video player
499
 
500
 
541
 
542
  $this->ret['script']['mediaelementplayer'][$this->hash] = true;
543
  $this->ret['html'] .= '<div id="wpfp_' . $this->hash . '" class="fvplayer fv-mediaelement">'."\n";
544
+ $this->ret['html'] .= "\t".'<audio src="'.$this->get_video_src( $media, array( 'url_only' => true ) ).'" type="audio/'.$this->get_file_extension($media).'" controls="controls" '.$preload.' style="width:100%;height:100%"></audio>'."\n";
545
  $this->ret['html'] .= '</div>'."\n";
546
  }
547
 
548
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
549
  function get_ad_code() {
550
  $ad_contents = false;
551
 
558
  !strlen($this->aCurArgs['ad_skip'])
559
  ) {
560
  if (isset($this->aCurArgs['ad']) && !empty($this->aCurArgs['ad'])) {
561
+ $ad = trim($this->aCurArgs['ad']);
562
+ if( stripos($ad,'<!--fv_flowplayer_base64_encoded-->') !== false ) {
563
+ $ad = str_replace('<!--fv_flowplayer_base64_encoded-->','',$ad);
564
+ $ad = html_entity_decode( str_replace( array('\"','\[','\]'), array('"','[',']'), base64_decode($ad) ) );
565
+ } else {
566
+ $ad = html_entity_decode( str_replace('&#039;',"'",$ad ) );
567
+ }
568
+
569
+ $ad_width = ( isset($this->aCurArgs['ad_width']) && intval($this->aCurArgs['ad_width']) > 0 ) ? intval($this->aCurArgs['ad_width']).'px' : '100%';
570
+ $ad_height = ( isset($this->aCurArgs['ad_height']) && intval($this->aCurArgs['ad_height']) > 0 ) ? intval($this->aCurArgs['ad_height']).'px' : '';
571
  }
572
  else {
573
  $ad = trim($this->conf['ad']);
574
+ $ad_width = ( isset($this->conf['ad_width']) && $this->conf['ad_width'] ) ? $this->conf['ad_width'].'px' : '100%';
575
  $ad_height = ( isset($this->conf['ad_height']) && $this->conf['ad_height'] ) ? $this->conf['ad_height'].'px' : '';
576
  }
577
 
578
  $ad = apply_filters( 'fv_flowplayer_ad_html', $ad);
579
  if( strlen(trim($ad)) > 0 ) {
580
+ $ad_contents = array(
581
+ 'html' => "<div class='wpfp_custom_ad_content' style='width: $ad_width; height: $ad_height; '>\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>",
582
+ 'width' => $ad_width,
583
+ 'height' => $ad_height
584
+ );
585
  }
586
  }
587
+ //var_dump($ad_contents);die();
588
  return $ad_contents;
589
  }
590
 
619
  }
620
 
621
  $scripts_after = false;
622
+ if( 1<0 && $mp4_position > $webm_position ) {
623
+ if (isset($this->conf['auto_buffering']) && $this->conf['auto_buffering'] == 'trueDISABLED' && $this->autobuffer_count < apply_filters( 'fv_flowplayer_autobuffer_limit', 2 )) {
624
  $scripts_after = '<script type="text/javascript">
625
+ if( /chrom(e|ium)/.test(navigator.userAgent.toLowerCase()) && document.getElementById("wpfp_'.$this->hash.'_video") ) {
626
  document.getElementById("wpfp_'.$this->hash.'_video").setAttribute("preload", "none");
627
  }
628
  </script>
629
  ';
630
  }
631
 
632
+ $mp4_video = $this->get_video_src( $mp4_video, array( 'url_only' => true ) );
 
 
633
 
634
+ $this->ret['script']['fv_flowplayer_browser_chrome_fail'][$this->hash] = array( 'attrs' => $attributes_html, 'mp4' => $mp4_video, 'auto_buffer' => ( (isset($this->conf['auto_buffering']) && $this->conf['auto_buffering'] == 'trueDISABLED') ? "true" : "false" ) );
635
  }
636
 
637
  return $scripts_after;
642
  if ( ( ( isset($this->conf['popupbox']) ) && ( $this->conf['popupbox'] == "true" ) ) || ( isset($this->aCurArgs['popup']) && !empty($this->aCurArgs['popup']) ) ) {
643
  if (isset($this->aCurArgs['popup']) && !empty($this->aCurArgs['popup'])) {
644
  $popup = trim($this->aCurArgs['popup']);
645
+ if( stripos($popup,'<!--fv_flowplayer_base64_encoded-->') !== false ) {
646
+ $popup = str_replace('<!--fv_flowplayer_base64_encoded-->','',$popup);
647
+ $popup = html_entity_decode( str_replace( array('\"','\[','\]'), array('"','[',']'), base64_decode($popup) ) );
648
+ } else {
649
+ $popup = html_entity_decode( str_replace('&#039;',"'",$popup ) );
650
+ }
651
  }
652
  else {
653
  $popup = 'Would you like to replay the video?';
655
 
656
  $popup = apply_filters( 'fv_flowplayer_popup_html', $popup );
657
  if( strlen(trim($popup)) > 0 ) {
658
+ $popup_contents = array(
659
+ 'html' => '<div class="wpfp_custom_popup_content">'.$popup.'</div>'
660
+ );
661
  return $popup_contents;
662
  }
663
  }
670
  if (isset($this->aCurArgs['splash']) && !empty($this->aCurArgs['splash'])) {
671
  $splash_img = $this->aCurArgs['splash'];
672
  if( strpos($splash_img,'http://') === false && strpos($splash_img,'https://') === false ) {
673
+ $http = is_ssl() ? 'https://' : 'http://';
674
+
675
  //$splash_img = VIDEO_PATH.trim($this->aCurArgs['splash']);
676
  if($splash_img[0]=='/') $splash_img = substr($splash_img, 1);
677
  if((dirname($_SERVER['PHP_SELF'])!='/')&&(file_exists($_SERVER['DOCUMENT_ROOT'].dirname($_SERVER['PHP_SELF']).VIDEO_DIR.$splash_img))){ //if the site does not live in the document root
678
+ $splash_img = $http.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']).VIDEO_DIR.$splash_img;
679
  }
680
  else
681
  if(file_exists($_SERVER['DOCUMENT_ROOT'].VIDEO_DIR.$splash_img)){ // if the videos folder is in the root
682
+ $splash_img = $http.$_SERVER['SERVER_NAME'].VIDEO_DIR.$splash_img;//VIDEO_PATH.$media;
683
  }
684
  else {
685
  //if the videos are not in the videos directory but they are adressed relatively
686
  $splash_img_path = str_replace('//','/',$_SERVER['SERVER_NAME'].'/'.$splash_img);
687
+ $splash_img = $http.$splash_img_path;
688
  }
689
  }
690
  else {
691
  $splash_img = trim($this->aCurArgs['splash']);
692
  }
693
+ } else if( isset($this->conf['splash']) && strlen(trim($this->conf['splash'])) > 0 ) {
694
+ $splash_img = $this->conf['splash'];
695
  }
696
+
697
+ $splash_img = apply_filters( 'fv_flowplayer_splash', $splash_img, $this );
698
  return $splash_img;
699
  }
700
 
744
  $aTest_media = array();
745
  foreach( array( $media, $src1, $src2, $rtmp_test ) AS $media_item ) {
746
  if( $media_item ) {
747
+ $aTest_media[] = $this->get_video_src( $media_item, array( 'flash' => false, 'url_only' => true, 'dynamic' => true ) );
748
  //break;
749
  }
750
  }
757
  }
758
 
759
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
760
  function get_sharing_html() {
761
 
762
+ if( isset($this->aCurArgs['share']) ) {
763
+ $aSharing = explode( ';', $this->aCurArgs['share'] );
764
+ if( count($aSharing) == 2 ) {
765
+ $sPermalink = urlencode($aSharing[1]);
766
+ $sMail = rawurlencode( apply_filters( 'fv_player_sharing_mail_content', 'Check the amazing video here: '.$aSharing[1] ) );
767
+ $sTitle = urlencode( $aSharing[0].' ');
768
+ } else if( count($aSharing) == 1 && $this->aCurArgs['share'] != 'yes' && $this->aCurArgs['share'] != 'no' ) {
769
+ $sPermalink = urlencode($aSharing[0]);
770
+ $sMail = rawurlencode( apply_filters( 'fv_player_sharing_mail_content', 'Check the amazing video here: '.$aSharing[0] ) );
771
+ $sTitle = urlencode( get_bloginfo().' ');
772
+ }
773
+ }
774
+
775
+ if( !isset($sPermalink) || empty($sPermalink) ) {
776
+ $sPermalink = urlencode(get_permalink());
777
+ $sMail = rawurlencode( apply_filters( 'fv_player_sharing_mail_content', 'Check the amazing video here: '.get_permalink() ) );
778
+ $sTitle = urlencode( (is_singular()) ? get_the_title().' ' : get_bloginfo().' ');
779
+ }
780
+
781
+ $sHTMLSharing = '<label>Share the video</label><ul class="fvp-sharing">
782
+ <li><a class="sharing-facebook" href="https://www.facebook.com/sharer/sharer.php?u='.$sPermalink.'" target="_blank">Facebook</a></li>
783
+ <li><a class="sharing-twitter" href="https://twitter.com/home?status='.$sTitle.$sPermalink.'" target="_blank">Twitter</a></li>
784
+ <li><a class="sharing-google" href="https://plus.google.com/share?url='.$sPermalink.'" target="_blank">Google+</a></li>
785
+ <li><a class="sharing-email" href="mailto:?body='.$sMail.'" target="_blank">Email</a></li></ul>';
786
+
787
+ $sHTMLEmbed = '<div><label><a class="embed-code-toggle" href="#"><strong>Embed</strong></a></label></div><div class="embed-code"><label>Copy and paste this HTML code into your webpage to embed.</label><textarea></textarea></div>';
788
 
 
 
 
 
 
 
 
789
 
790
  if( $this->aCurArgs['embed'] == 'false' || ( $this->conf['disableembedding'] == 'true' && $this->aCurArgs['embed'] != 'true' ) ) {
791
  $sHTMLEmbed = '';
792
  }
793
 
794
+ if( isset($this->aCurArgs['share']) && $this->aCurArgs['share'] == 'no' ) {
795
  $sHTMLSharing = '';
796
+ } else if( isset($this->aCurArgs['share']) && $this->aCurArgs['share'] && $this->aCurArgs['share'] != 'no' ) {
797
+
798
+ } else if( $this->conf['disablesharing'] == 'true' ) {
799
+ $sHTMLSharing = '';
800
+ }
801
 
802
+ $sHTML = false;
803
  if( $sHTMLSharing || $sHTMLEmbed ) {
804
  $sHTML = "<div class='fvp-share-bar'>$sHTMLSharing$sHTMLEmbed</div>";
805
  }
821
  </div>
822
  <div class="support-{$this->hash}">
823
  <textarea style="width: 98%; height: 150px" onclick="if( this.value == 'Enter your comment' ) this.value = ''" class="wpfp_message_field" id="wpfp_support_{$this->hash}">Enter your comment</textarea>
824
+ <p><a class="techinfo" href="#" onclick="jQuery('.more-{$this->hash}').toggle(); return false">Technical info</a> <img style="display: none; " src="{$sSpinURL}" id="wpfp_spin_{$this->hash}"> <input type="button" value="Send report to Foliovision" onclick="fv_wp_flowplayer_admin_support_mail('{$this->hash}', this); return false"></p></div>
 
825
  <div class="more-{$this->hash} mail-content-details" style="display: none; ">
826
  <p>Plugin version: {$fv_wp_flowplayer_ver}</p>
827
+ <div class="fv-wp-flowplayer-notice-parsed level-0"></div></div>
 
828
  </div>
829
  </div>
830
  HTML;
833
  }
834
 
835
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
836
  /**
837
  * Displays the elements that need to be added to frontend.
838
  */
841
  }
842
 
843
  }
844
+
models/flowplayer.php CHANGED
@@ -19,77 +19,88 @@
19
  require_once( dirname(__FILE__) . '/../includes/fp-api.php' );
20
 
21
  class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
22
- private $count = 0;
23
- /**
24
- * Relative URL path
25
- */
26
- const FV_FP_RELATIVE_PATH = '';
27
- /**
28
- * Where videos should be stored
29
- */
30
- const VIDEO_PATH = '';
31
- /**
32
- * Where the config file should be
33
- */
34
- private $conf_path = '';
35
- /**
36
- * Configuration variables array
37
- */
38
- public $conf = array();
39
- /**
40
- * We set this to true in shortcode parsing and then determine if we need to enqueue the JS, or if it's already included
41
- */
42
- public $load_mediaelement = false;
43
- /**
44
- * Store scripts to load in footer
45
- */
46
- public $scripts = array();
47
-
48
- var $ret = array('html' => false, 'script' => false);
49
-
50
- var $hash = false;
51
-
52
- public $ad_css_default = ".wpfp_custom_ad { position: absolute; bottom: 10%; z-index: 2; width: 100%; }\n.wpfp_custom_ad_content { background: white; margin: 0 auto; position: relative }";
53
-
54
- public $ad_css_bottom = ".wpfp_custom_ad { position: absolute; bottom: 0; z-index: 2; width: 100%; }\n.wpfp_custom_ad_content { background: white; margin: 0 auto; position: relative }";
55
-
56
- /**
57
- * Class constructor
58
- */
59
- public function __construct() {
60
- //load conf data into stack
61
- $this->_get_conf();
62
-
63
- if( is_admin() ) {
64
- // update notices
65
- $this->readme_URL = 'http://plugins.trac.wordpress.org/browser/fv-wordpress-flowplayer/trunk/readme.txt?format=txt';
66
- if( !has_action( 'in_plugin_update_message-fv-wordpress-flowplayer/flowplayer.php' ) ) {
67
- add_action( 'in_plugin_update_message-fv-wordpress-flowplayer/flowplayer.php', array( &$this, 'plugin_update_message' ) );
68
- }
69
-
70
- // pointer boxes
71
- parent::__construct();
72
- }
73
-
74
-
75
- // define needed constants
76
- if (!defined('FV_FP_RELATIVE_PATH')) {
77
- define('FV_FP_RELATIVE_PATH', flowplayer::get_plugin_url() );
78
 
79
- $vid = 'http://'.$_SERVER['SERVER_NAME'];
80
- if (dirname($_SERVER['PHP_SELF']) != '/')
81
- $vid .= dirname($_SERVER['PHP_SELF']);
82
- define('VIDEO_DIR', '/videos/');
83
- define('VIDEO_PATH', $vid.VIDEO_DIR);
84
- }
85
- }
86
- /**
87
- * Gets configuration from cfg file.
88
- *
89
- * @return bool Returns false on failiure, true on success.
90
- */
91
- private function _get_conf() {
92
- /// Addition 2010/07/12 mv
 
 
 
 
 
 
 
 
 
 
 
93
  $conf = get_option( 'fvwpflowplayer' );
94
 
95
  if( !isset( $conf['autoplay'] ) ) $conf['autoplay'] = 'false';
@@ -97,7 +108,7 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
97
  if( !isset( $conf['key'] ) ) $conf['key'] = 'false';
98
  if( !isset( $conf['logo'] ) ) $conf['logo'] = 'false';
99
  if( !isset( $conf['rtmp'] ) ) $conf['rtmp'] = 'false';
100
- if( !isset( $conf['auto_buffer'] ) ) $conf['auto_buffer'] = 'false';
101
  if( !isset( $conf['scaling'] ) ) $conf['scaling'] = 'true';
102
  if( !isset( $conf['disableembedding'] ) ) $conf['disableembedding'] = 'false';
103
  if( !isset( $conf['popupbox'] ) ) $conf['popupbox'] = 'false';
@@ -108,8 +119,8 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
108
  if( !isset( $conf['backgroundColor'] ) ) $conf['backgroundColor'] = '#333333';
109
  if( !isset( $conf['canvas'] ) ) $conf['canvas'] = '#000000';
110
  if( !isset( $conf['sliderColor'] ) ) $conf['sliderColor'] = '#ffffff';
111
- if( !isset( $conf['buttonColor'] ) ) $conf['buttonColor'] = '#ffffff';
112
- if( !isset( $conf['buttonOverColor'] ) ) $conf['buttonOverColor'] = '#ffffff';
113
  if( !isset( $conf['durationColor'] ) ) $conf['durationColor'] = '#eeeeee';
114
  if( !isset( $conf['timeColor'] ) ) $conf['timeColor'] = '#eeeeee';
115
  if( !isset( $conf['progressColor'] ) ) $conf['progressColor'] = '#00a7c8';
@@ -120,76 +131,250 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
120
  if( !isset( $conf['adTextColor'] ) ) $conf['adTextColor'] = '#888';
121
  if( !isset( $conf['adLinksColor'] ) ) $conf['adLinksColor'] = '#ff3333';
122
  if( !isset( $conf['parse_commas'] ) ) $conf['parse_commas'] = 'false';
123
- if( !isset( $conf['width'] ) ) $conf['width'] = '600';
124
- if( !isset( $conf['height'] ) ) $conf['height'] = '400';
125
  if( !isset( $conf['engine'] ) ) $conf['engine'] = 'false';
126
  if( !isset( $conf['font-face'] ) ) $conf['font-face'] = 'Tahoma, Geneva, sans-serif';
127
- if( !isset( $conf['ad'] ) ) $conf['ad'] = '';
128
- if( !isset( $conf['ad_width'] ) ) $conf['ad_width'] = '';
129
- if( !isset( $conf['ad_height'] ) ) $conf['ad_height'] = '';
130
- if( !isset( $conf['ad_css'] ) ) $conf['ad_css'] = $this->ad_css_default;
131
- if( !isset( $conf['disable_videochecker'] ) ) $conf['disable_videochecker'] = 'false';
132
  if( isset( $conf['videochecker'] ) && $conf['videochecker'] == 'off' ) { $conf['disable_videochecker'] = 'true'; unset($conf['videochecker']); }
133
  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 );
134
  if( !isset( $conf['interface']['popup'] ) ) $conf['interface']['popup'] = 'true';
135
- if( !isset( $conf['amazon_bucket'] ) || !is_array($conf['amazon_bucket']) ) $conf['amazon_bucket'] = array('');
136
- if( !isset( $conf['amazon_key'] ) || !is_array($conf['amazon_key']) ) $conf['amazon_key'] = array('');
137
- if( !isset( $conf['amazon_secret'] ) || !is_array($conf['amazon_secret']) ) $conf['amazon_secret'] = array('');
138
- if( !isset( $conf['amazon_expire'] ) ) $conf['amazon_expire'] = '5';
139
- if( !isset( $conf['fixed_size'] ) ) $conf['fixed_size'] = 'false';
140
- if( isset( $conf['responsive'] ) && $conf['responsive'] == 'fixed' ) { $conf['fixed_size'] = true; unset($conf['responsive']); }
 
 
141
  if( !isset( $conf['js-everywhere'] ) ) $conf['js-everywhere'] = 'false';
142
- if( !isset( $conf['marginBottom'] ) ) $conf['marginBottom'] = '28';
 
 
 
143
 
144
  update_option( 'fvwpflowplayer', $conf );
145
  $this->conf = $conf;
146
- return true;
147
  /// End of addition
148
- }
149
- /**
150
- * Writes configuration into file.
151
- */
152
- public function _set_conf() {
153
- $aNewOptions = $_POST;
154
- $sKey = $aNewOptions['key'];
155
-
156
- foreach( $aNewOptions AS $key => $value ) {
157
- if( is_array($value) ) {
158
- $aNewOptions[$key] = $value;
159
- } else if( !in_array( $key, array('amazon_bucket', 'amazon_key', 'amazon_secret', 'font-face', 'ad', 'ad_css') ) ) {
160
- $aNewOptions[$key] = trim( preg_replace('/[^A-Za-z0-9.:\-_\/]/', '', $value) );
161
  } else {
162
- $aNewOptions[$key] = stripslashes($value);
 
 
 
163
  }
164
- if( (strpos( $key, 'Color' ) !== FALSE )||(strpos( $key, 'canvas' ) !== FALSE)) {
165
- $aNewOptions[$key] = '#'.strtolower($aNewOptions[$key]);
166
- }
167
- }
168
- $aNewOptions['key'] = trim($sKey);
169
  $aOldOptions = is_array(get_option('fvwpflowplayer')) ? get_option('fvwpflowplayer') : array();
170
 
171
- if( !isset($aNewOptions['pro']) ) {
 
 
 
 
 
172
  $aNewOptions['pro'] = array();
173
  }
174
 
 
 
 
 
 
175
  $aNewOptions['pro'] = array_merge($aOldOptions['pro'],$aNewOptions['pro']);
176
  $aNewOptions = array_merge($aOldOptions,$aNewOptions);
177
-
178
- update_option( 'fvwpflowplayer', $aNewOptions );
179
  $this->conf = $aNewOptions;
180
 
181
  $this->css_writeout();
182
-
183
- return true;
184
- }
185
- /**
186
- * Salt function - returns pseudorandom string hash.
187
- * @return Pseudorandom string hash.
188
- */
189
- public function _salt() {
190
  $salt = substr(md5(uniqid(rand(), true)), 0, 10);
191
  return $salt;
192
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
193
 
194
 
195
  function css_generate( $style_tag = true ) {
@@ -201,7 +386,7 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
201
  <style type="text/css">
202
  <?php endif;
203
 
204
- if ( isset($fv_fp->conf['key']) && $fv_fp->conf['key'] != 'false' && strlen($fv_fp->conf['key']) > 0 && isset($fv_fp->conf['logo']) && $fv_fp->conf['logo'] != 'false' && strlen($fv_fp->conf['logo']) > 0 ) : ?>
205
  .flowplayer .fp-logo { display: block; opacity: 1; }
206
  <?php endif;
207
 
@@ -210,6 +395,7 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
210
  <?php endif; ?>
211
 
212
  .flowplayer, flowplayer * { margin: 0 auto <?php echo $iMarginBottom; ?>px auto; display: block; }
 
213
  .flowplayer .fp-controls { background-color: <?php echo trim($fv_fp->conf['backgroundColor']); ?> !important; }
214
  .flowplayer { background-color: <?php echo trim($fv_fp->conf['canvas']); ?> !important; }
215
  .flowplayer .fp-duration { color: <?php echo trim($fv_fp->conf['durationColor']); ?> !important; }
@@ -228,9 +414,9 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
228
  .fvplayer .me-cannotplay span { padding: 5px; }
229
  #content .fvplayer .mejs-container .mejs-controls div { font-family: <?php echo trim($fv_fp->conf['font-face']); ?>; }
230
 
231
- .wpfp_custom_background { display: none; }
232
- .wpfp_custom_popup { display: none; position: absolute; top: 10%; z-index: 2; text-align: center; width: 100%; color: #fff; }
233
- .is-finished .wpfp_custom_popup, .is-finished .wpfp_custom_background { display: block; }
234
  .wpfp_custom_popup_content { background: <?php echo trim($fv_fp->conf['backgroundColor']) ?>; padding: 1% 5%; width: 65%; margin: 0 auto; }
235
 
236
  <?php echo trim($this->conf['ad_css']); ?>
@@ -241,6 +427,21 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
241
  .fvfp_admin_error a { color: <?php echo trim($fv_fp->conf['durationColor']); ?>; }
242
  #content .fvfp_admin_error a { color: <?php echo trim($fv_fp->conf['durationColor']); ?>; }
243
  .fvfp_admin_error_content { background: <?php echo trim($fv_fp->conf['backgroundColor']); ?>; opacity:0.75;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=75); }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
244
 
245
  <?php if( $style_tag ) : ?>
246
  </style>
@@ -260,7 +461,7 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
260
  $site_id = 1;
261
  }
262
 
263
- if( isset($this->conf[$this->css_option()]) && $this->conf[$this->css_option()] ) {
264
  $filename = trailingslashit(WP_CONTENT_DIR).'fv-flowplayer-custom/style-'.$site_id.'.css';
265
  if( @file_exists($filename) ) {
266
  $sURL = trailingslashit( str_replace( array('/plugins','\\plugins'), '', plugins_url() )).'fv-flowplayer-custom/style-'.$site_id.'.css?ver='.$this->conf[$this->css_option()];
@@ -282,6 +483,10 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
282
 
283
 
284
  function css_writeout() {
 
 
 
 
285
  $aOptions = get_option( 'fvwpflowplayer' );
286
  $aOptions[$this->css_option()] = false;
287
  update_option( 'fvwpflowplayer', $aOptions );
@@ -337,120 +542,190 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
337
  }
338
 
339
 
340
- function get_amazon_secure( $media, &$fv_fp, $url_only= false ) {
341
-
342
- $amazon_key = -1;
343
- if( !empty($fv_fp->conf['amazon_key']) && !empty($fv_fp->conf['amazon_secret']) && !empty($fv_fp->conf['amazon_bucket']) ) {
344
- foreach( $fv_fp->conf['amazon_bucket'] AS $key => $item ) {
345
- if( stripos($media,$item.'/') != false || stripos($media,$item.'.') != false ) {
346
- $amazon_key = $key;
347
- break;
348
- }
349
- }
350
- }
351
-
352
- if( $amazon_key != -1 && !empty($fv_fp->conf['amazon_key'][$amazon_key]) && !empty($fv_fp->conf['amazon_secret'][$amazon_key]) && !empty($fv_fp->conf['amazon_bucket'][$amazon_key]) && stripos( $media, trim($fv_fp->conf['amazon_bucket'][$amazon_key]) ) !== false && apply_filters( 'fv_flowplayer_amazon_secure_exclude', $media ) ) {
353
-
354
- $resource = trim( $media );
355
-
356
- if( !isset($fv_fp->expire_time) ) {
357
- $time = 60 * intval($fv_fp->conf['amazon_expire'][$amazon_key]);
358
- } else {
359
- $time = intval(ceil($fv_fp->expire_time));
360
- }
361
- if( $time < 900 ) {
362
- $time = 900;
363
- }
364
- $time = apply_filters( 'fv_flowplayer_amazon_expires', $time, $media );
365
- $expires = time() + $time;
366
-
367
- $url_components = parse_url($resource);
368
- $url_components['path'] = rawurlencode($url_components['path']);
369
- $url_components['path'] = str_replace('%2F', '/', $url_components['path']);
370
- $url_components['path'] = str_replace('%2B', '+', $url_components['path']);
371
- if( strpos( $url_components['path'], $fv_fp->conf['amazon_bucket'][$amazon_key] ) === false ) {
372
- $url_components['path'] = '/'.$fv_fp->conf['amazon_bucket'][$amazon_key].$url_components['path'];
373
- }
374
-
375
- do {
376
- $expires++;
377
- $stringToSign = "GET\n\n\n$expires\n{$url_components['path']}";
378
 
379
- $signature = utf8_encode($stringToSign);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
380
 
381
- $signature = hash_hmac('sha1', $signature, $fv_fp->conf['amazon_secret'][$amazon_key], true);
382
- $signature = base64_encode($signature);
 
 
 
 
 
 
 
 
383
 
384
- $signature = urlencode($signature);
385
- } while( stripos($signature,'%2B') !== false );
386
-
387
- $url = $resource;
 
 
 
388
 
389
- if( $url_only ) {
390
- $url .= '?AWSAccessKeyId='.$fv_fp->conf['amazon_key'][$amazon_key].'&Expires='.$expires.'&Signature='.$signature;
391
- } else {
392
- $url .= '?AWSAccessKeyId='.$fv_fp->conf['amazon_key'][$amazon_key].'&amp;Expires='.$expires.'&amp;Signature='.$signature;
393
- }
394
-
395
-
396
- $media = $url;
397
-
398
- $this->ret['script']['fv_flowplayer_amazon_s3'][$this->hash] = $time;
399
- }
400
-
401
- return $media;
402
  }
403
 
404
 
405
- function get_cloudfront_secure( $resource, $timeout = 900 ) {
406
- //This comes from key pair you generated for cloudfront
407
- $keyPairId = "YOUR_CLOUDFRONT_KEY_PAIR_ID";
408
-
409
- $expires = time() + $timeout; //Time out in seconds
410
- $json = '{"Statement":[{"Resource":"'.$resource.'","Condition":{"DateLessThan":{"AWS:EpochTime":'.$expires.'}}}]}';
411
-
412
- //Read Cloudfront Private Key Pair
413
- $fp=fopen("private_key.pem","r");
414
- $priv_key=fread($fp,8192);
415
- fclose($fp);
416
-
417
- //Create the private key
418
- $key = openssl_get_privatekey($priv_key);
419
- if(!$key)
420
- {
421
- echo "<p>Failed to load private key!</p>";
422
- die();
423
- return;
424
- }
425
-
426
- //Sign the policy with the private key
427
- if(!openssl_sign($json, $signed_policy, $key, OPENSSL_ALGO_SHA1))
428
- {
429
- echo '<p>Failed to sign policy: '.openssl_error_string().'</p>';
430
- die();
431
- return;
432
- }
433
-
434
- //Create url safe signed policy
435
- $base64_signed_policy = base64_encode($signed_policy);
436
- $signature = str_replace(array('+','=','/'), array('-','_','~'), $base64_signed_policy);
437
-
438
- //Construct the URL
439
- $url = $resource.'?Expires='.$expires.'&Signature='.$signature.'&Key-Pair-Id='.$keyPairId;
440
-
441
- return $url;
 
 
 
 
 
 
 
 
 
 
442
  }
443
 
444
 
 
 
 
 
 
 
 
 
 
 
 
 
 
445
  public static function get_encoded_url( $sURL ) {
446
  //if( !preg_match('~%[0-9A-F]{2}~',$sURL) ) {
447
  $url_parts = parse_url( $sURL );
448
- $url_parts_encoded = parse_url( $sURL );
449
  if( !empty($url_parts['path']) ) {
450
  $url_parts['path'] = join('/', array_map('rawurlencode', explode('/', $url_parts_encoded['path'])));
451
  }
452
  if( !empty($url_parts['query']) ) {
453
- $url_parts['query'] = str_replace( '&amp;', '&', $url_parts_encoded['query'] );
454
  }
455
 
456
  $url_parts['path'] = str_replace( '%2B', '+', $url_parts['path'] );
@@ -461,6 +736,43 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
461
  }
462
 
463
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
464
  public static function get_plugin_url() {
465
  if( stripos( __FILE__, '/themes/' ) !== false || stripos( __FILE__, '\\themes\\' ) !== false ) {
466
  return get_template_directory_uri().'/fv-wordpress-flowplayer';
@@ -470,33 +782,200 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
470
  }
471
 
472
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
473
  public static function is_licensed() {
474
  global $fv_fp;
475
- return preg_match( '!^\$\d+!', $fv_fp->conf['key'] );
476
- }
477
-
478
-
479
- public function is_secure_amazon_s3( $url ) {
480
- return preg_match( '/^.+?s3.*?\.amazonaws\.com\/.+Signature=.+?$/', $url ) || preg_match( '/^.+?\.cloudfront\.net\/.+Signature=.+?$/', $url );
481
- }
482
-
483
-
484
- public function is_secure_cloudfront( $url ) {
485
- return preg_match( '/^.+?\.cloudfront\.net\/.+Signature=.+?$/', $url );
486
- }
 
 
 
 
487
  }
488
  /**
489
  * Defines some needed constants and loads the right flowplayer_head() function.
490
  */
491
  function flowplayer_head() {
492
- global $fv_fp;
493
  $fv_fp->flowplayer_head();
494
  }
495
 
496
 
 
 
497
  function flowplayer_jquery() {
498
  global $fv_wp_flowplayer_ver, $fv_fp;
499
 
500
  }
501
 
502
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  require_once( dirname(__FILE__) . '/../includes/fp-api.php' );
20
 
21
  class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
22
+ private $count = 0;
23
+ /**
24
+ * Relative URL path
25
+ */
26
+ const FV_FP_RELATIVE_PATH = '';
27
+ /**
28
+ * Where videos should be stored
29
+ */
30
+ const VIDEO_PATH = '';
31
+ /**
32
+ * Where the config file should be
33
+ */
34
+ private $conf_path = '';
35
+ /**
36
+ * Configuration variables array
37
+ */
38
+ public $conf = array();
39
+ /**
40
+ * We set this to true in shortcode parsing and then determine if we need to enqueue the JS, or if it's already included
41
+ */
42
+ public $load_mediaelement = false;
43
+ /**
44
+ * Store scripts to load in footer
45
+ */
46
+ public $scripts = array();
47
+
48
+ var $ret = array('html' => false, 'script' => false);
49
+
50
+ var $hash = false;
51
+
52
+ public $ad_css_default = ".wpfp_custom_ad { position: absolute; bottom: 10%; z-index: 2; width: 100%; }\n.wpfp_custom_ad_content { background: white; margin: 0 auto; position: relative }";
53
+
54
+ public $ad_css_bottom = ".wpfp_custom_ad { position: absolute; bottom: 0; z-index: 2; width: 100%; }\n.wpfp_custom_ad_content { background: white; margin: 0 auto; position: relative }";
55
+
56
+ /**
57
+ * Class constructor
58
+ */
59
+ public function __construct() {
60
+ //load conf data into stack
61
+ $this->_get_conf();
62
+
63
+ if( is_admin() ) {
64
+ // update notices
65
+ $this->readme_URL = 'http://plugins.trac.wordpress.org/browser/fv-wordpress-flowplayer/trunk/readme.txt?format=txt';
66
+ if( !has_action( 'in_plugin_update_message-fv-wordpress-flowplayer/flowplayer.php' ) ) {
67
+ add_action( 'in_plugin_update_message-fv-wordpress-flowplayer/flowplayer.php', array( &$this, 'plugin_update_message' ) );
68
+ }
69
+
70
+ // pointer boxes
71
+ parent::__construct();
72
+ }
73
+
74
+
75
+ // define needed constants
76
+ if (!defined('FV_FP_RELATIVE_PATH')) {
77
+ define('FV_FP_RELATIVE_PATH', flowplayer::get_plugin_url() );
78
 
79
+ $vid = 'http://'.$_SERVER['SERVER_NAME'];
80
+ if (dirname($_SERVER['PHP_SELF']) != '/')
81
+ $vid .= dirname($_SERVER['PHP_SELF']);
82
+ define('VIDEO_DIR', '/videos/');
83
+ define('VIDEO_PATH', $vid.VIDEO_DIR);
84
+ }
85
+
86
+
87
+ add_filter( 'fv_flowplayer_caption', array( $this, 'get_duration_playlist' ), 10, 3 );
88
+ add_filter( 'fv_flowplayer_inner_html', array( $this, 'get_duration_video' ), 10, 2 );
89
+
90
+ add_filter( 'fv_flowplayer_video_src', array( $this, 'get_amazon_secure'), 10, 2 );
91
+
92
+ add_filter('fv_flowplayer_css_writeout', array( $this, 'css_writeout_option' ) );
93
+
94
+ }
95
+
96
+
97
+ /**
98
+ * Gets configuration from cfg file.
99
+ *
100
+ * @return bool Returns false on failiure, true on success.
101
+ */
102
+ private function _get_conf() {
103
+ /// Addition 2010/07/12 mv
104
  $conf = get_option( 'fvwpflowplayer' );
105
 
106
  if( !isset( $conf['autoplay'] ) ) $conf['autoplay'] = 'false';
108
  if( !isset( $conf['key'] ) ) $conf['key'] = 'false';
109
  if( !isset( $conf['logo'] ) ) $conf['logo'] = 'false';
110
  if( !isset( $conf['rtmp'] ) ) $conf['rtmp'] = 'false';
111
+ if( !isset( $conf['auto_buffering'] ) ) $conf['auto_buffering'] = 'false';
112
  if( !isset( $conf['scaling'] ) ) $conf['scaling'] = 'true';
113
  if( !isset( $conf['disableembedding'] ) ) $conf['disableembedding'] = 'false';
114
  if( !isset( $conf['popupbox'] ) ) $conf['popupbox'] = 'false';
119
  if( !isset( $conf['backgroundColor'] ) ) $conf['backgroundColor'] = '#333333';
120
  if( !isset( $conf['canvas'] ) ) $conf['canvas'] = '#000000';
121
  if( !isset( $conf['sliderColor'] ) ) $conf['sliderColor'] = '#ffffff';
122
+ /*if( !isset( $conf['buttonColor'] ) ) $conf['buttonColor'] = '#ffffff';
123
+ if( !isset( $conf['buttonOverColor'] ) ) $conf['buttonOverColor'] = '#ffffff';*/
124
  if( !isset( $conf['durationColor'] ) ) $conf['durationColor'] = '#eeeeee';
125
  if( !isset( $conf['timeColor'] ) ) $conf['timeColor'] = '#eeeeee';
126
  if( !isset( $conf['progressColor'] ) ) $conf['progressColor'] = '#00a7c8';
131
  if( !isset( $conf['adTextColor'] ) ) $conf['adTextColor'] = '#888';
132
  if( !isset( $conf['adLinksColor'] ) ) $conf['adLinksColor'] = '#ff3333';
133
  if( !isset( $conf['parse_commas'] ) ) $conf['parse_commas'] = 'false';
134
+ if( !isset( $conf['width'] ) ) $conf['width'] = '720';
135
+ if( !isset( $conf['height'] ) ) $conf['height'] = '480';
136
  if( !isset( $conf['engine'] ) ) $conf['engine'] = 'false';
137
  if( !isset( $conf['font-face'] ) ) $conf['font-face'] = 'Tahoma, Geneva, sans-serif';
138
+ if( !isset( $conf['ad'] ) ) $conf['ad'] = '';
139
+ if( !isset( $conf['ad_width'] ) ) $conf['ad_width'] = '';
140
+ if( !isset( $conf['ad_height'] ) ) $conf['ad_height'] = '';
141
+ if( !isset( $conf['ad_css'] ) ) $conf['ad_css'] = $this->ad_css_default;
142
+ if( !isset( $conf['disable_videochecker'] ) ) $conf['disable_videochecker'] = 'false';
143
  if( isset( $conf['videochecker'] ) && $conf['videochecker'] == 'off' ) { $conf['disable_videochecker'] = 'true'; unset($conf['videochecker']); }
144
  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 );
145
  if( !isset( $conf['interface']['popup'] ) ) $conf['interface']['popup'] = 'true';
146
+ if( !isset( $conf['amazon_bucket'] ) || !is_array($conf['amazon_bucket']) ) $conf['amazon_bucket'] = array('');
147
+ if( !isset( $conf['amazon_key'] ) || !is_array($conf['amazon_key']) ) $conf['amazon_key'] = array('');
148
+ if( !isset( $conf['amazon_secret'] ) || !is_array($conf['amazon_secret']) ) $conf['amazon_secret'] = array('');
149
+ if( !isset( $conf['amazon_region'] ) || !is_array($conf['amazon_region']) ) $conf['amazon_region'] = array('');
150
+ if( !isset( $conf['amazon_expire'] ) ) $conf['amazon_expire'] = '5';
151
+ if( !isset( $conf['amazon_expire_force'] ) ) $conf['amazon_expire_force'] = 'false';
152
+ if( !isset( $conf['fixed_size'] ) ) $conf['fixed_size'] = 'false';
153
+ if( isset( $conf['responsive'] ) && $conf['responsive'] == 'fixed' ) { $conf['fixed_size'] = true; unset($conf['responsive']); }
154
  if( !isset( $conf['js-everywhere'] ) ) $conf['js-everywhere'] = 'false';
155
+ if( !isset( $conf['marginBottom'] ) ) $conf['marginBottom'] = '28';
156
+ if( !isset( $conf['ui_play_button'] ) ) $conf['ui_play_button'] = 'true';
157
+ if( !isset( $conf['volume'] ) ) $conf['volume'] = 1;
158
+ if( !isset( $conf['player-position'] ) ) $conf['player-position'] = '';
159
 
160
  update_option( 'fvwpflowplayer', $conf );
161
  $this->conf = $conf;
162
+ return true;
163
  /// End of addition
164
+ }
165
+ /**
166
+ * Writes configuration into file.
167
+ */
168
+ public function _set_conf() {
169
+ $aNewOptions = $_POST;
170
+ $sKey = $aNewOptions['key'];
171
+
172
+ foreach( $aNewOptions AS $key => $value ) {
173
+ if( is_array($value) ) {
174
+ $aNewOptions[$key] = $value;
175
+ } else if( !in_array( $key, array('amazon_region', 'amazon_bucket', 'amazon_key', 'amazon_secret', 'font-face', 'ad', 'ad_css') ) ) {
176
+ $aNewOptions[$key] = trim( preg_replace('/[^A-Za-z0-9.:\-_\/]/', '', $value) );
177
  } else {
178
+ $aNewOptions[$key] = stripslashes($value);
179
+ }
180
+ if( (strpos( $key, 'Color' ) !== FALSE )||(strpos( $key, 'canvas' ) !== FALSE)) {
181
+ $aNewOptions[$key] = '#'.strtolower($aNewOptions[$key]);
182
  }
183
+ }
184
+ $aNewOptions['key'] = trim($sKey);
 
 
 
185
  $aOldOptions = is_array(get_option('fvwpflowplayer')) ? get_option('fvwpflowplayer') : array();
186
 
187
+ if( isset($aNewOptions['db_duration']) && $aNewOptions['db_duration'] == "true" && ( !isset($aOldOptions['db_duration']) || $aOldOptions['db_duration'] == "false" ) ) {
188
+ global $FV_Player_Checker;
189
+ $FV_Player_Checker->queue_add_all();
190
+ }
191
+
192
+ if( !isset($aNewOptions['pro']) || !is_array($aNewOptions['pro']) ) {
193
  $aNewOptions['pro'] = array();
194
  }
195
 
196
+ if( !isset($aOldOptions['pro']) || !is_array($aOldOptions['pro']) ) {
197
+ $aOldOptions['pro'] = array();
198
+ }
199
+
200
+
201
  $aNewOptions['pro'] = array_merge($aOldOptions['pro'],$aNewOptions['pro']);
202
  $aNewOptions = array_merge($aOldOptions,$aNewOptions);
203
+ $aNewOptions = apply_filters( 'fv_flowplayer_settings_save', $aNewOptions, $aOldOptions );
204
+ update_option( 'fvwpflowplayer', $aNewOptions );
205
  $this->conf = $aNewOptions;
206
 
207
  $this->css_writeout();
208
+
209
+ return true;
210
+ }
211
+ /**
212
+ * Salt function - returns pseudorandom string hash.
213
+ * @return Pseudorandom string hash.
214
+ */
215
+ public function _salt() {
216
  $salt = substr(md5(uniqid(rand(), true)), 0, 10);
217
  return $salt;
218
+ }
219
+
220
+ // todo: this could be parsin rtmp://host/path/mp4:rtmp_path links as well
221
+ function build_playlist( $aArgs, $media, $src1, $src2, $rtmp, $splash_img, $suppress_filters = false ) {
222
+
223
+ $sShortcode = isset($aArgs['playlist']) ? $aArgs['playlist'] : false;
224
+ $sCaption = isset($aArgs['caption']) ? $aArgs['caption'] : false;
225
+
226
+ $replace_from = array('&amp;','\;', '\,');
227
+ $replace_to = array('<!--amp-->','<!--semicolon-->','<!--comma-->');
228
+ $sShortcode = str_replace( $replace_from, $replace_to, $sShortcode );
229
+ $sItems = explode( ';', $sShortcode );
230
+
231
+ if( $sCaption ) {
232
+ $replace_from = array('&amp;quot;','&amp;','\;','&quot;');
233
+ $replace_to = array('"','<!--amp-->','<!--semicolon-->','"');
234
+ $sCaption = str_replace( $replace_from, $replace_to, $sCaption );
235
+ $aCaption = explode( ';', $sCaption );
236
+ }
237
+ if( isset($aCaption) && count($aCaption) > 0 ) {
238
+ foreach( $aCaption AS $key => $item ) {
239
+ $aCaption[$key] = str_replace('<!--amp-->','&',$item);
240
+ }
241
+ }
242
+
243
+ $aItem = array();
244
+ $flash_media = array();
245
+
246
+ if( $rtmp ) {
247
+ $rtmp = 'rtmp:'.$rtmp;
248
+ }
249
+
250
+ foreach( apply_filters( 'fv_player_media', array($media, $src1, $src2, $rtmp), $this ) AS $key => $media_item ) {
251
+ if( !$media_item ) continue;
252
+ $media_url = $this->get_video_src( preg_replace( '~^rtmp:~', '', $media_item ), array( 'url_only' => true, 'suppress_filters' => $suppress_filters ) );
253
+ if( is_array($media_url) ) {
254
+ $actual_media_url = $media_url['media'];
255
+ if( $this->get_file_extension($actual_media_url) == 'mp4' ) {
256
+ $flash_media[] = $media_url['flash'];
257
+ }
258
+ } else {
259
+ $actual_media_url = $media_url;
260
+ }
261
+ if( stripos( $media_item, 'rtmp:' ) === 0 ) {
262
+ $aItem[] = array( 'flash' => $this->get_file_extension($actual_media_url,'mp4').':'.str_replace( '+', ' ', $actual_media_url ) );
263
+ } else {
264
+ $aItem[] = array( $this->get_file_extension($actual_media_url) => $actual_media_url );
265
+ }
266
+ }
267
+
268
+ if( count($flash_media) ) {
269
+ $bHaveFlash = false;
270
+ foreach( $aItem AS $key => $aItemFile ) { // how to avoid duplicates?
271
+ if( in_array( 'flash', array_keys($aItemFile) ) ) {
272
+ $bHaveFlash = true;
273
+ }
274
+ }
275
+
276
+ if( !$bHaveFlash ) {
277
+ foreach( $flash_media AS $flash_media_items ) {
278
+ $aItem[] = array( 'flash' => $flash_media_items );
279
+ }
280
+ }
281
+ }
282
+
283
+ $aPlaylistItems[] = $aItem;
284
+
285
+ $sHTML = '';
286
+ if( $sShortcode && count($sItems) > 0 ) {
287
+
288
+ $sHTML = array();
289
+
290
+ $sItemCaption = ( isset($aCaption) ) ? array_shift($aCaption) : false;
291
+ $sItemCaption = apply_filters( 'fv_flowplayer_caption', $sItemCaption, $aItem, $aArgs );
292
+
293
+ $splash_img = apply_filters( 'fv_flowplayer_playlist_splash', $splash_img, $this );
294
+
295
+ $sHTML[] = "\t\t<a href='#' class='is-active' onclick='return false'><span ".( (isset($splash_img) && !empty($splash_img)) ? "style='background-image: url(\"".$splash_img."\")' " : "" )."></span>$sItemCaption</a>\n";
296
+
297
+
298
+ foreach( $sItems AS $iKey => $sItem ) {
299
+ $aPlaylist_item = explode( ',', $sItem );
300
+
301
+ foreach( $aPlaylist_item AS $key => $item ) {
302
+ if( $key > 0 && ( stripos($item,'http:') !== 0 && stripos($item,'https:') !== 0 && stripos($item,'rtmp:') !== 0 && stripos($item,'/') !== 0 ) ) {
303
+ $aPlaylist_item[$key-1] .= ','.$item;
304
+ $aPlaylist_item[$key] = $aPlaylist_item[$key-1];
305
+ unset($aPlaylist_item[$key-1]);
306
+ }
307
+ $aPlaylist_item[$key] = str_replace( $replace_to, $replace_from, $aPlaylist_item[$key] );
308
+ }
309
+
310
+ $aItem = array();
311
+ $sSplashImage = false;
312
+ $flash_media = array();
313
+
314
+ $sSplashImage = apply_filters( 'fv_flowplayer_playlist_splash', $sSplashImage, $this, $aPlaylist_item );
315
+
316
+ foreach( apply_filters( 'fv_player_media', $aPlaylist_item, $this ) AS $aPlaylist_item_i ) {
317
+ if( preg_match('~\.(png|gif|jpg|jpe|jpeg)($|\?)~',$aPlaylist_item_i) ) {
318
+ $sSplashImage = $aPlaylist_item_i;
319
+ continue;
320
+ }
321
+
322
+ $media_url = $this->get_video_src( preg_replace( '~^rtmp:~', '', $aPlaylist_item_i ), array( 'url_only' => true, 'suppress_filters' => $suppress_filters ) );
323
+ if( is_array($media_url) ) {
324
+ $actual_media_url = $media_url['media'];
325
+ if( $this->get_file_extension($actual_media_url) == 'mp4' ) {
326
+ $flash_media[] = $media_url['flash'];
327
+ }
328
+ } else {
329
+ $actual_media_url = $media_url;
330
+ }
331
+ if( stripos( $aPlaylist_item_i, 'rtmp:' ) === 0 ) {
332
+ $aItem[] = array( 'flash' => $this->get_file_extension($actual_media_url,'mp4').':'.str_replace( '+', ' ', $actual_media_url ) );
333
+ } else {
334
+ $aItem[] = array( $this->get_file_extension($aPlaylist_item_i) => $actual_media_url );
335
+ }
336
+
337
+ }
338
+
339
+ if( count($flash_media) ) {
340
+ $bHaveFlash = false;
341
+ foreach( $aItem AS $key => $aItemFile ) {
342
+ if( in_array( 'flash', array_keys($aItemFile) ) ) {
343
+ $bHaveFlash = true;
344
+ }
345
+ }
346
+
347
+ if( !$bHaveFlash ) {
348
+ foreach( $flash_media AS $flash_media_items ) {
349
+ $aItem[] = array( 'flash' => $flash_media_items );
350
+ }
351
+ }
352
+ }
353
+
354
+ $aPlaylistItems[] = $aItem;
355
+ $sItemCaption = ( isset($aCaption[$iKey]) ) ? __($aCaption[$iKey]) : false;
356
+ $sItemCaption = apply_filters( 'fv_flowplayer_caption', $sItemCaption, $aItem, $aArgs );
357
+
358
+ if( $sSplashImage ) {
359
+ $sHTML[] = "\t\t<a href='#' onclick='return false'><span style='background-image: url(\"".$sSplashImage."\")'></span>$sItemCaption</a>\n";
360
+ } else {
361
+ $sHTML[] = "\t\t<a href='#' onclick='return false'><span></span>$sItemCaption</a>\n";
362
+ }
363
+
364
+ }
365
+
366
+ $sHTML = apply_filters( 'fv_flowplayer_playlist_item_html', $sHTML );
367
+
368
+ $sHTML = "\t<div class='fp-playlist-external' rel='wpfp_{$this->hash}'>\n".implode( '', $sHTML )."\t</div>\n";
369
+
370
+ $jsonPlaylistItems = str_replace( array('\\/', ','), array('/', ",\n\t\t"), json_encode($aPlaylistItems) );
371
+ //$jsonPlaylistItems = preg_replace( '~"(.*)":"~', '$1:"', $jsonPlaylistItems );
372
+ }
373
+
374
+ return array( $sHTML, $aPlaylistItems );
375
+ }
376
+
377
+
378
 
379
 
380
  function css_generate( $style_tag = true ) {
386
  <style type="text/css">
387
  <?php endif;
388
 
389
+ if ( isset($fv_fp->conf['key']) && $fv_fp->conf['key'] != 'false' && strlen($fv_fp->conf['key']) > 0 && isset($fv_fp->conf['logo']) && $fv_fp->conf['logo'] != 'false' && strlen($fv_fp->conf['logo']) > 0 ) : ?>
390
  .flowplayer .fp-logo { display: block; opacity: 1; }
391
  <?php endif;
392
 
395
  <?php endif; ?>
396
 
397
  .flowplayer, flowplayer * { margin: 0 auto <?php echo $iMarginBottom; ?>px auto; display: block; }
398
+ .flowplayer.has-caption, flowplayer.has-caption * { margin: 0 auto; }
399
  .flowplayer .fp-controls { background-color: <?php echo trim($fv_fp->conf['backgroundColor']); ?> !important; }
400
  .flowplayer { background-color: <?php echo trim($fv_fp->conf['canvas']); ?> !important; }
401
  .flowplayer .fp-duration { color: <?php echo trim($fv_fp->conf['durationColor']); ?> !important; }
414
  .fvplayer .me-cannotplay span { padding: 5px; }
415
  #content .fvplayer .mejs-container .mejs-controls div { font-family: <?php echo trim($fv_fp->conf['font-face']); ?>; }
416
 
417
+ .wpfp_custom_background { display: none; }
418
+ .wpfp_custom_popup { position: absolute; top: 10%; z-index: 2; text-align: center; width: 100%; color: #fff; }
419
+ .is-finished .wpfp_custom_background { display: block; }
420
  .wpfp_custom_popup_content { background: <?php echo trim($fv_fp->conf['backgroundColor']) ?>; padding: 1% 5%; width: 65%; margin: 0 auto; }
421
 
422
  <?php echo trim($this->conf['ad_css']); ?>
427
  .fvfp_admin_error a { color: <?php echo trim($fv_fp->conf['durationColor']); ?>; }
428
  #content .fvfp_admin_error a { color: <?php echo trim($fv_fp->conf['durationColor']); ?>; }
429
  .fvfp_admin_error_content { background: <?php echo trim($fv_fp->conf['backgroundColor']); ?>; opacity:0.75;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=75); }
430
+
431
+ <?php if( isset($fv_fp->conf['subtitleSize']) ) : ?>.flowplayer .fp-subtitle p { font-size: <?php echo intval($fv_fp->conf['subtitleSize']); ?>px; }<?php endif; ?>
432
+ <?php if( isset($fv_fp->conf['logoPosition']) ) :
433
+ if( $fv_fp->conf['logoPosition'] == 'bottom-left' ) {
434
+ $sCSS = "bottom: 30px; left: 15px";
435
+ } else if( $fv_fp->conf['logoPosition'] == 'bottom-right' ) {
436
+ $sCSS = "bottom: 30px; right: 15px; left: auto";
437
+ } else if( $fv_fp->conf['logoPosition'] == 'top-left' ) {
438
+ $sCSS = "top: 30px; left: 15px; bottom: auto";
439
+ } else if( $fv_fp->conf['logoPosition'] == 'top-right' ) {
440
+ $sCSS = "top: 30px; right: 15px; bottom: auto; left: auto";
441
+ }
442
+ ?>.flowplayer .fp-logo { <?php echo $sCSS; ?> }<?php endif; ?>
443
+
444
+ <?php if( isset($fv_fp->conf['player-position']) && 'left' == $fv_fp->conf['player-position'] ) : ?>.flowplayer { margin-left: 0; }<?php endif; ?>
445
 
446
  <?php if( $style_tag ) : ?>
447
  </style>
461
  $site_id = 1;
462
  }
463
 
464
+ if( apply_filters('fv_flowplayer_css_writeout', true ) && isset($this->conf[$this->css_option()]) && $this->conf[$this->css_option()] ) {
465
  $filename = trailingslashit(WP_CONTENT_DIR).'fv-flowplayer-custom/style-'.$site_id.'.css';
466
  if( @file_exists($filename) ) {
467
  $sURL = trailingslashit( str_replace( array('/plugins','\\plugins'), '', plugins_url() )).'fv-flowplayer-custom/style-'.$site_id.'.css?ver='.$this->conf[$this->css_option()];
483
 
484
 
485
  function css_writeout() {
486
+ if( !apply_filters('fv_flowplayer_css_writeout', true ) ) {
487
+ return false;
488
+ }
489
+
490
  $aOptions = get_option( 'fvwpflowplayer' );
491
  $aOptions[$this->css_option()] = false;
492
  update_option( 'fvwpflowplayer', $aOptions );
542
  }
543
 
544
 
545
+ function get_amazon_secure( $media ) {
546
+ $aArgs = func_get_args();
547
+ $aArgs = $aArgs[1];
548
+ global $fv_fp;
549
+
550
+ $amazon_key = -1;
551
+ if( !empty($fv_fp->conf['amazon_key']) && !empty($fv_fp->conf['amazon_secret']) && !empty($fv_fp->conf['amazon_bucket']) ) {
552
+ foreach( $fv_fp->conf['amazon_bucket'] AS $key => $item ) {
553
+ if( stripos($media,$item.'/') != false || stripos($media,$item.'.') != false ) {
554
+ $amazon_key = $key;
555
+ break;
556
+ }
557
+ }
558
+ }
559
+
560
+ if( $amazon_key != -1 && !empty($fv_fp->conf['amazon_key'][$amazon_key]) && !empty($fv_fp->conf['amazon_secret'][$amazon_key]) && !empty($fv_fp->conf['amazon_bucket'][$amazon_key]) && stripos( $media, trim($fv_fp->conf['amazon_bucket'][$amazon_key]) ) !== false && apply_filters( 'fv_flowplayer_amazon_secure_exclude', $media ) ) {
561
+
562
+ $resource = trim( $media );
563
+
564
+ if( !isset($fv_fp->expire_time) ) {
565
+ $time = 60 * intval($fv_fp->conf['amazon_expire']);
566
+ } else {
567
+ $time = intval(ceil($fv_fp->expire_time));
568
+ }
569
+
570
+ if( isset($fv_fp->conf['amazon_expire']) && $fv_fp->conf['amazon_expire_force'] == 'true' ) {
571
+ $time = 60 * intval($fv_fp->conf['amazon_expire']);
572
+ }
573
+
574
+ if( $time < 900 ) {
575
+ $time = 900;
576
+ }
 
 
 
 
 
 
577
 
578
+ $time = apply_filters( 'fv_flowplayer_amazon_expires', $time, $media );
579
+
580
+ $url_components = parse_url($resource);
581
+ $url_components['path'] = rawurlencode($url_components['path']);
582
+ $url_components['path'] = str_replace('%2F', '/', $url_components['path']);
583
+ $url_components['path'] = str_replace('%2B', '+', $url_components['path']);
584
+
585
+ $sGlue = ( $aArgs['url_only'] ) ? '&' : '&amp;';
586
+
587
+ if( isset($fv_fp->conf['amazon_region'][$amazon_key]) && $fv_fp->conf['amazon_region'][$amazon_key] ) {
588
+
589
+ $sXAMZDate = date('Ymd\THis\Z');
590
+ $sDate = date('Ymd');
591
+ $sCredentialScope = $sDate."/".$fv_fp->conf['amazon_region'][$amazon_key]."/s3/aws4_request"; // todo: variable
592
+ $sSignedHeaders = "host";
593
+ $sXAMZCredential = urlencode($fv_fp->conf['amazon_key'][$amazon_key].'/'.$sCredentialScope);
594
+
595
+ // 1. http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html
596
+ $sCanonicalRequest = "GET\n";
597
+ $sCanonicalRequest .= $url_components['path']."\n";
598
+ $sCanonicalRequest .= "X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=$sXAMZCredential&X-Amz-Date=$sXAMZDate&X-Amz-Expires=$time&X-Amz-SignedHeaders=$sSignedHeaders\n";
599
+ $sCanonicalRequest .= "host:".$url_components['host']."\n";
600
+ $sCanonicalRequest .= "\n$sSignedHeaders\n";
601
+ $sCanonicalRequest .= "UNSIGNED-PAYLOAD";
602
+
603
+ // 2. http://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html
604
+ $sStringToSign = "AWS4-HMAC-SHA256\n";
605
+ $sStringToSign .= "$sXAMZDate\n";
606
+ $sStringToSign .= "$sCredentialScope\n";
607
+ $sStringToSign .= hash('sha256',$sCanonicalRequest);
608
+
609
+ // 3. http://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html
610
+ $sSignature = hash_hmac('sha256', $sDate, "AWS4".$fv_fp->conf['amazon_secret'][$amazon_key], true );
611
+ $sSignature = hash_hmac('sha256', $fv_fp->conf['amazon_region'][$amazon_key], $sSignature, true ); // todo: variable
612
+ $sSignature = hash_hmac('sha256', 's3', $sSignature, true );
613
+ $sSignature = hash_hmac('sha256', 'aws4_request', $sSignature, true );
614
+ $sSignature = hash_hmac('sha256', $sStringToSign, $sSignature );
615
+
616
+ // 4. http://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html
617
+ $resource .= "?X-Amz-Algorithm=AWS4-HMAC-SHA256";
618
+ $resource .= $sGlue."X-Amz-Credential=$sXAMZCredential";
619
+ $resource .= $sGlue."X-Amz-Date=$sXAMZDate";
620
+ $resource .= $sGlue."X-Amz-Expires=$time";
621
+ $resource .= $sGlue."X-Amz-SignedHeaders=$sSignedHeaders";
622
+ $resource .= $sGlue."X-Amz-Signature=".$sSignature;
623
+
624
+ $this->ret['script']['fv_flowplayer_amazon_s3'][$this->hash] = $time;
625
 
626
+ } else {
627
+ $expires = time() + $time;
628
+
629
+ if( strpos( $url_components['path'], $fv_fp->conf['amazon_bucket'][$amazon_key] ) === false ) {
630
+ $url_components['path'] = '/'.$fv_fp->conf['amazon_bucket'][$amazon_key].$url_components['path'];
631
+ }
632
+
633
+ do {
634
+ $expires++;
635
+ $stringToSign = "GET\n\n\n$expires\n{$url_components['path']}";
636
 
637
+ $signature = utf8_encode($stringToSign);
638
+
639
+ $signature = hash_hmac('sha1', $signature, $fv_fp->conf['amazon_secret'][$amazon_key], true);
640
+ $signature = base64_encode($signature);
641
+
642
+ $signature = urlencode($signature);
643
+ } while( stripos($signature,'%2B') !== false );
644
 
645
+ $resource .= '?AWSAccessKeyId='.$fv_fp->conf['amazon_key'][$amazon_key].$sGlue.'Expires='.$expires.$sGlue.'Signature='.$signature;
646
+
647
+ }
648
+
649
+ $media = $resource;
650
+
651
+ }
652
+
653
+ return $media;
 
 
 
 
654
  }
655
 
656
 
657
+ public static function get_duration( $post_id, $video_src ) {
658
+ $sDuration = false;
659
+ if( $sVideoMeta = get_post_meta( $post_id, flowplayer::get_video_key($video_src), true ) ) { // todo: should probably work regardles of quality version
660
+ if( isset($sVideoMeta['duration']) && $sVideoMeta['duration'] > 0 ) {
661
+ $tDuration = $sVideoMeta['duration'];
662
+ if( $tDuration < 3600 ) {
663
+ $sDuration = gmdate( "i:s", $tDuration );
664
+ } else {
665
+ $sDuration = gmdate( "H:i:s", $tDuration );
666
+ }
667
+ }
668
+ }
669
+ return $sDuration;
670
+ }
671
+
672
+
673
+ public static function get_duration_post( $post_id = false ) {
674
+ global $post, $fv_fp;
675
+ $post_id = ( $post_id ) ? $post_id : $post->ID;
676
+
677
+ $content = false;
678
+ $objPost = get_post($post_id);
679
+ if( $aVideos = FV_Player_Checker::get_videos($objPost->post_content) ) {
680
+ if( $sDuration = flowplayer::get_duration($post_id, $aVideos[0]) ) {
681
+ $content = $sDuration;
682
+ }
683
+ }
684
+
685
+ return $content;
686
+ }
687
+
688
+
689
+ public static function get_duration_playlist( $caption ) {
690
+ global $fv_fp;
691
+ if( !isset($fv_fp->conf['db_duration']) || $fv_fp->conf['db_duration'] != 'true' || !$caption ) return $caption;
692
+
693
+ global $post;
694
+ $aArgs = func_get_args();
695
+
696
+ if( isset($aArgs[1][0]) && is_array($aArgs[1][0]) ) {
697
+ $sItemKeys = array_keys($aArgs[1][0]);
698
+ if( $sDuration = flowplayer::get_duration( $post->ID, $aArgs[1][0][$sItemKeys[0]] ) ) {
699
+ $caption .= '<i class="dur">'.$sDuration.'</i>';
700
+ }
701
+ }
702
+
703
+ return $caption;
704
  }
705
 
706
 
707
+ public static function get_duration_video( $content ) {
708
+ global $fv_fp, $post;
709
+ if( !$post || !isset($fv_fp->conf['db_duration']) || $fv_fp->conf['db_duration'] != 'true' ) return $content;
710
+
711
+ $aArgs = func_get_args();
712
+ if( $sDuration = flowplayer::get_duration( $post->ID, $aArgs[1]->aCurArgs['src']) ) {
713
+ $content .= '<div class="fvfp_duration">'.$sDuration.'</div>';
714
+ }
715
+
716
+ return $content;
717
+ }
718
+
719
+
720
  public static function get_encoded_url( $sURL ) {
721
  //if( !preg_match('~%[0-9A-F]{2}~',$sURL) ) {
722
  $url_parts = parse_url( $sURL );
723
+ $url_parts_encoded = parse_url( $sURL );
724
  if( !empty($url_parts['path']) ) {
725
  $url_parts['path'] = join('/', array_map('rawurlencode', explode('/', $url_parts_encoded['path'])));
726
  }
727
  if( !empty($url_parts['query']) ) {
728
+ $url_parts['query'] = str_replace( '&amp;', '&', $url_parts_encoded['query'] );
729
  }
730
 
731
  $url_parts['path'] = str_replace( '%2B', '+', $url_parts['path'] );
736
  }
737
 
738
 
739
+ function get_file_extension($media, $default = 'flash' ) {
740
+ $pathinfo = pathinfo( trim($media) );
741
+
742
+ $extension = ( isset($pathinfo['extension']) ) ? $pathinfo['extension'] : false;
743
+ $extension = preg_replace( '~[?#].+$~', '', $extension );
744
+ $extension = strtolower($extension);
745
+
746
+ if( !$extension ) {
747
+ $output = $default;
748
+ } else {
749
+ if ($extension == 'm3u8' || $extension == 'm3u') {
750
+ $output = 'x-mpegurl';
751
+ } else if ($extension == 'm4v') {
752
+ $output = 'mp4';
753
+ } else if( $extension == 'mp3' ) {
754
+ $output = 'mpeg';
755
+ } else if( $extension == 'wav' ) {
756
+ $output = 'wav';
757
+ } else if( $extension == 'ogg' ) {
758
+ $output = 'ogg';
759
+ } else if( $extension == 'ogv' ) {
760
+ $output = 'ogg';
761
+ } else if( $extension == 'mov' ) {
762
+ $output = 'mp4';
763
+ } else if( $extension == '3gp' ) {
764
+ $output = 'mp4';
765
+ } else if( !in_array($extension, array('mp4', 'm4v', 'webm', 'ogv', 'mp3', 'ogg', 'wav', '3gp')) ) {
766
+ $output = $default;
767
+ } else {
768
+ $output = $extension;
769
+ }
770
+ }
771
+
772
+ return apply_filters( 'fv_flowplayer_get_file_extension', $output, $media );
773
+ }
774
+
775
+
776
  public static function get_plugin_url() {
777
  if( stripos( __FILE__, '/themes/' ) !== false || stripos( __FILE__, '\\themes\\' ) !== false ) {
778
  return get_template_directory_uri().'/fv-wordpress-flowplayer';
782
  }
783
 
784
 
785
+ public static function get_video_key( $sURL ) {
786
+ $sURL = str_replace( '?v=', '-v=', $sURL );
787
+ $sURL = preg_replace( '~\?.*$~', '', $sURL );
788
+ $sURL = str_replace( array('/','://'), array('-','-'), $sURL );
789
+ return '_fv_flowplayer_'.sanitize_title($sURL);
790
+ }
791
+
792
+
793
+
794
+
795
+ function get_video_src($media, $aArgs ) {
796
+ $aArgs = wp_parse_args( $aArgs, array(
797
+ 'dynamic' => false,
798
+ 'flash' => true,
799
+ 'id' => false,
800
+ 'mobileUserAgent' => false,
801
+ 'rtmp' => false,
802
+ 'suppress_filters' => false,
803
+ 'url_only' => false
804
+ )
805
+ );
806
+
807
+ if( $media ) {
808
+ $extension = $this->get_file_extension($media);
809
+ //do not use https on mobile devices
810
+ if (strpos($media, 'https') !== false && $aArgs['mobileUserAgent']) {
811
+ $media = str_replace('https', 'http', $media);
812
+ }
813
+ $sID = ($aArgs['id']) ? 'id="'.$aArgs['id'].'" ' : '';
814
+
815
+ if( !$aArgs['suppress_filters'] ) {
816
+ $media = apply_filters( 'fv_flowplayer_video_src', $media, $aArgs );
817
+ }
818
+
819
+ // fix for signed Amazon URLs, we actually need it for Flash only, so it gets into an extra source tag
820
+ $source_flash_encoded = false;
821
+ if( $this->is_secure_amazon_s3($media) /*&& stripos($media,'.webm') === false && stripos($media,'.ogv') === false */) {
822
+ $media_fixed = str_replace('%2B', '%25252B',$media);
823
+ // only if there was a change and we don't have an RTMP for Flash
824
+ if( $media_fixed != $media && empty($aArgs['rtmp']) ) {
825
+ $source_flash_encoded = $media_fixed;
826
+ }
827
+ }
828
+
829
+ $url_parts = parse_url( ($source_flash_encoded) ? $source_flash_encoded : $media );
830
+ if( isset($url_parts['path']) && stripos( $url_parts['path'], '+' ) !== false ) {
831
+
832
+ if( !empty($url_parts['path']) ) {
833
+ $url_parts['path'] = join('/', array_map('rawurlencode', explode('/', $url_parts['path'])));
834
+ }
835
+ if( !empty($url_parts['query']) ) {
836
+ //$url_parts['query'] = str_replace( '&amp;', '&', $url_parts['query'] );
837
+ }
838
+
839
+ $source_flash_encoded = http_build_url( ($source_flash_encoded) ? $source_flash_encoded : $media, $url_parts);
840
+ }
841
+
842
+ if( $aArgs['url_only'] ) {
843
+ if( $aArgs['flash'] && $source_flash_encoded ) {
844
+ return array( 'media' => $media, 'flash' => $source_flash_encoded );
845
+ } else {
846
+ return trim($media);
847
+ }
848
+ } else {
849
+ $mime_type = ( $extension == 'x-mpegurl' ) ? 'application/x-mpegurl' : 'video/'.$extension;
850
+ $sReturn = '<source '.$sID.'src="'.trim($media).'" type="'.$mime_type.'" />'."\n";
851
+
852
+ if( $source_flash_encoded && strcmp($extension,'mp4') == 0 ) {
853
+ $sReturn .= '<source '.$sID.'src="'.trim($source_flash_encoded).'" type="video/flash" />'."\n";
854
+ }
855
+ return $sReturn;
856
+ }
857
+ }
858
+ return null;
859
+ }
860
+
861
+
862
+ function get_video_url($media) {
863
+ if( strpos($media,'rtmp://') !== false ) {
864
+ return null;
865
+ }
866
+ if( strpos($media,'http://') === false && strpos($media,'https://') === false ) {
867
+ $http = is_ssl() ? 'https://' : 'http://';
868
+ // strip the first / from $media
869
+ if($media[0]=='/') $media = substr($media, 1);
870
+ if((dirname($_SERVER['PHP_SELF'])!='/')&&(file_exists($_SERVER['DOCUMENT_ROOT'].dirname($_SERVER['PHP_SELF']).VIDEO_DIR.$media))){ //if the site does not live in the document root
871
+ $media = $http.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']).VIDEO_DIR.$media;
872
+ }
873
+ else if(file_exists($_SERVER['DOCUMENT_ROOT'].VIDEO_DIR.$media)){ // if the videos folder is in the root
874
+ $media = $http.$_SERVER['SERVER_NAME'].VIDEO_DIR.$media;//VIDEO_PATH.$media;
875
+ }
876
+ else{ // if the videos are not in the videos directory but they are adressed relatively
877
+ $media_path = str_replace('//','/',$_SERVER['SERVER_NAME'].'/'.$media);
878
+ $media = $http.$media_path;
879
+ }
880
+ }
881
+
882
+ $media = apply_filters( 'fv_flowplayer_media', $media, $this );
883
+
884
+ return $media;
885
+ }
886
+
887
+
888
  public static function is_licensed() {
889
  global $fv_fp;
890
+ return preg_match( '!^\$\d+!', $fv_fp->conf['key'] );
891
+ }
892
+
893
+
894
+ public function is_secure_amazon_s3( $url ) {
895
+ return preg_match( '/^.+?s3.*?\.amazonaws\.com\/.+Signature=.+?$/', $url ) || preg_match( '/^.+?\.cloudfront\.net\/.+Signature=.+?$/', $url );
896
+ }
897
+
898
+
899
+ function css_writeout_option() {
900
+ if( isset($this->conf['css_disable']) && $this->conf['css_disable'] == 'true' ) {
901
+ return false;
902
+ }
903
+ return true;
904
+ }
905
+
906
  }
907
  /**
908
  * Defines some needed constants and loads the right flowplayer_head() function.
909
  */
910
  function flowplayer_head() {
911
+ global $fv_fp;
912
  $fv_fp->flowplayer_head();
913
  }
914
 
915
 
916
+
917
+
918
  function flowplayer_jquery() {
919
  global $fv_wp_flowplayer_ver, $fv_fp;
920
 
921
  }
922
 
923
+
924
+
925
+
926
+ function fv_wp_flowplayer_save_post( $post_id ) {
927
+ if( $parent_id = wp_is_post_revision($post_id) ) {
928
+ $post_id = $parent_id;
929
+ }
930
+
931
+ global $post;
932
+ $post_id = ( isset($post->ID) ) ? $post->ID : $post_id;
933
+
934
+ global $fv_fp, $post, $FV_Player_Checker;
935
+ if( !$FV_Player_Checker->is_cron && $FV_Player_Checker->queue_check($post_id) ) {
936
+ //return;
937
+ }
938
+
939
+ $saved_post = get_post($post_id);
940
+ $videos = FV_Player_Checker::get_videos($saved_post->post_content);
941
+
942
+ $iDone = 0;
943
+ if( is_array($videos) && count($videos) > 0 ) {
944
+ $tStart = microtime(true);
945
+ foreach( $videos AS $video ) {
946
+ if( microtime(true) - $tStart > apply_filters( 'fv_flowplayer_checker_save_post_time', 5 ) ) {
947
+ FV_Player_Checker::queue_add($post_id);
948
+ break;
949
+ }
950
+
951
+ if( isset($post->ID) && !get_post_meta( $post->ID, flowplayer::get_video_key($video), true ) ) {
952
+ $video_secured = $fv_fp->get_video_src( $video, array( 'dynamic' => true, 'url_only' => true, 'flash' => false ) );
953
+ if( !is_array($video_secured) ) {
954
+ $video_secured = array( 'media' => $video_secured );
955
+ }
956
+ if( isset($video_secured['media']) && $FV_Player_Checker->check_mimetype( array($video_secured['media']), array( 'meta_action' => 'check_time', 'meta_original' => $video ) ) ) {
957
+ $iDone++;
958
+ if( isset($_GET['fv_flowplayer_checker'] ) ) {
959
+ echo "<p>Post $post_id video '$video' ok!</p>\n";
960
+ }
961
+ } else {
962
+ if( isset($_GET['fv_flowplayer_checker'] ) ) {
963
+ echo "<p>Post $post_id video '$video' not done, adding into queue!</p>\n";
964
+ }
965
+ FV_Player_Checker::queue_add($post_id);
966
+ }
967
+ } else {
968
+ $iDone++;
969
+ }
970
+
971
+ }
972
+ }
973
+
974
+ if( !$videos || $iDone == count($videos) ) {
975
+ FV_Player_Checker::queue_remove($post_id);
976
+ if( isset($_GET['fv_flowplayer_checker'] ) ) {
977
+ echo "<p>Post $post_id done, removing from queue!</p>\n";
978
+ }
979
+ }
980
+ }
981
+
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: FolioVision
3
  Donate link: http://foliovision.com/donate/
4
  Tags: video, flash, flowplayer, player, jwplayer, mobile, mobile video, html5, Vimeo, Vimeo Pro, video player, video plugin, Video Player plugin, video widget, videos, flash player, html5 video, html5 player, HTML5 video player, youtube, youtube player, youtube Video Player, youtube videos, embed youtube, youtube widget, youtube plugin, youtube playlist, MP4, m4v, WebM, h264, h.264, flv, video embed, video blog, playlist, playlists, video playlist, high definition Video Player, flash video player, WP flash Video Player, embed video
5
  Requires at least: 3.5
6
- Tested up to: 3.9
7
  Stable tag: trunk
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -22,7 +22,7 @@ FV Wordpress Flowplayer WordPress plugin is a free, easy-to-use, and complete so
22
  * Enjoy unlimited instances in a single page.
23
  * No expensive plugins: unlike other players who nickel and dime you for every feature, with FV Flowplayer all advanced features are available in the standard license (Google Analytics, Cuepoints, Native fullscreen, Keyboard shortcuts, Subtitles, Slow motion, Random seeking, Retina ready)
24
  * Beautiful playlists which you can skin with CSS.
25
- * Ultra-efficient player: just 43kB of JavaScript and 4kB of Flash code. You can extend Flowplayer using just HTML and CSS, leaving the JavaScript heavy lifting up to us.
26
  * 98% Browser coverage. Built-in Flash fallback will get the job done on older browsers.
27
  * Full support for Amazon S3 and other CDN's.
28
  * Totally Brandable. Stop selling YouTube and start selling yourself. Even design your own player.
@@ -72,24 +72,28 @@ Visit [out site](http://wordpress.org/plugins/fv-wordpress-flowplayer/installati
72
 
73
  This should be related to your video format or mime type issues.
74
 
75
- Each browser supports different video format, MP4 is the recommended format: http://flowplayer.org/docs/#video-formats
76
-
77
  Each browser supports different video format, MP4 is the recommended format. In general, it's recommended to use constant frame rate. Detailed instructions about [video encoding for HTML 5](http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/encoding).
78
 
79
  It seems HTML5 is more picky about what video it can play than Flash.
80
 
81
  Please note that MP4 is just a container, it might contain various streams for audio and video. You should check what audio and video stream are you using. Read next question to find out how.
82
 
 
 
 
 
 
 
83
  = How to check my video properties using the built-in checker and how to report video not playing =
84
 
85
  * Login to your site as administrator (please use the browser in which the video is not playing for you)
86
- * Double check Settings -> FV Wordpress Flowplayer -> "Front-end video checker" is set to "Enabled"
87
  * Come to any post which was video
88
  * A message in top left corner of the video should appear saying: "Checking the video file...". The check takes usually 1-2 seconds.
89
  * Once it's finished, it changes color based on what problem is detected and you can click it to get video details.
90
  * The dialog also includes our tips on how to resolve the issues found. There is also a button labeled "Send to Foliovision" which sends your video with details straight to our private support tickets.
91
 
92
- Note: The checker works much better for local files (on the same server as site). For the remote files, we only grab first 2MB of the file, store it temporarily in your uploads folder, analyze it and then delete. Since we don't get the full file, some values might not be correct, but basic things like codecs should be not affected.
93
 
94
  = My video doesn't play in Internet Explorer 9 and 10 =
95
 
@@ -106,7 +110,6 @@ AddType video/webm .webm
106
  AddType video/ogg .ogv
107
  AddType application/x-mpegurl .m3u8
108
  AddType video/x-m4v .m4v
109
- # hls transport stream segments:
110
  AddType video/mp2t .ts`
111
 
112
  If you use Microsoft IIS, add following into web.config (one should be in your root website folder) into configuration/system.webServer/staticContent section:
@@ -134,6 +137,10 @@ Also for Internet Explorer, it's not recommended to use MPEG-4 Visual or MPEG-4
134
 
135
  = How do I fix the bad metadata (moov) position? =
136
 
 
 
 
 
137
  If you are using Mac, try Lillipot (just remember to rename the file back to .mp4 extension): http://www.qtbridge.com/lillipot/lillipot.html
138
 
139
  If you have Quick Time Pro, just open the video and in the Movie Properties -> Video Track -> Other Settings turn on the "Cache (hint)" - [screenshot](http://drop.foliovision.com/webwork/it/quick-time-pro-cache-hint.png).
@@ -150,8 +157,9 @@ Other possible cause is that you are using some membership plugin to protect dow
150
 
151
  = Are there any known compatibility issues? =
152
 
153
- 1. We heard about problems when using some fancy pro templates like OptimizePress (read below for fixing instructions) or Gantry framework. These templates often break the Wordpress conventions (probably as they often try to add too many non-template functions, like video support built-in into the template). We can debug the issues for you, just head over to our website and order the pro support.
154
- 1. If you use plugin called Photo Gallery (version 1.1.8) by webdorado, then you may encounter issues with fullscreen function. The video goes into fullscreen without any issues, but then it's not possible to exit the fullscreen view and user has to reload the page.
 
155
 
156
  = I'm using OptimizePress version 1 template. =
157
 
@@ -255,14 +263,7 @@ The image needs to be 100x106px normal version nad 200x212px hi res version. You
255
 
256
  = How can I change position of my custom logo? =
257
 
258
- You need to put the code below into your theme CSS. Also add some element ID in front of it to make sure it overrides the default Flowplayer CSS, in the following example we use #content which is present in most templates. The code sample puts it into top right corner, but you can move the values around to get the placement you need:
259
-
260
- `#content .flowplayer .fp-logo, #colorbox .flowplayer .fp-logo {
261
- top: 10px;
262
- right: 10px;
263
- bottom: auto;
264
- left: auto;
265
- }`
266
 
267
  = Volume control in player looks weird =
268
 
@@ -317,15 +318,192 @@ Thank you for being part of the HMTL 5 mobile video revolution!
317
 
318
  == Changelog ==
319
 
320
- = What's coming =
321
- * cue points support
322
- * VAST/VPAID support
323
- * improved checking of videos with improved integration in wp-admin (check all of your videos in one place)
324
- * tools for fixing of slow loading videos (bad meta data location)
325
- * other bugfixes
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
326
 
 
327
 
328
- = 2.2.9 - 2014/06/04 =
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
329
 
330
  * Feature - share bar added!
331
  * Bugfix - annoying iOS 7 bug where black lines appear after videos - fixed!
@@ -811,6 +989,20 @@ On the right side of this screen, you can see the current visual configuration o
811
 
812
  == Upgrade Notice ==
813
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
814
  = 2.2.4 =
815
  * Amazon S3 protected content playlist fixes. Please check you playlist after the upgrade.
816
 
3
  Donate link: http://foliovision.com/donate/
4
  Tags: video, flash, flowplayer, player, jwplayer, mobile, mobile video, html5, Vimeo, Vimeo Pro, video player, video plugin, Video Player plugin, video widget, videos, flash player, html5 video, html5 player, HTML5 video player, youtube, youtube player, youtube Video Player, youtube videos, embed youtube, youtube widget, youtube plugin, youtube playlist, MP4, m4v, WebM, h264, h.264, flv, video embed, video blog, playlist, playlists, video playlist, high definition Video Player, flash video player, WP flash Video Player, embed video
5
  Requires at least: 3.5
6
+ Tested up to: 4.1
7
  Stable tag: trunk
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
22
  * Enjoy unlimited instances in a single page.
23
  * No expensive plugins: unlike other players who nickel and dime you for every feature, with FV Flowplayer all advanced features are available in the standard license (Google Analytics, Cuepoints, Native fullscreen, Keyboard shortcuts, Subtitles, Slow motion, Random seeking, Retina ready)
24
  * Beautiful playlists which you can skin with CSS.
25
+ * Ultra-efficient player: just 62kB of JavaScript and 8kB of Flash code. You can extend Flowplayer using just HTML and CSS, leaving the JavaScript heavy lifting up to us.
26
  * 98% Browser coverage. Built-in Flash fallback will get the job done on older browsers.
27
  * Full support for Amazon S3 and other CDN's.
28
  * Totally Brandable. Stop selling YouTube and start selling yourself. Even design your own player.
72
 
73
  This should be related to your video format or mime type issues.
74
 
 
 
75
  Each browser supports different video format, MP4 is the recommended format. In general, it's recommended to use constant frame rate. Detailed instructions about [video encoding for HTML 5](http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/encoding).
76
 
77
  It seems HTML5 is more picky about what video it can play than Flash.
78
 
79
  Please note that MP4 is just a container, it might contain various streams for audio and video. You should check what audio and video stream are you using. Read next question to find out how.
80
 
81
+ = I want to align my player (left/right/middle) =
82
+
83
+ By default the player is positioned in the middle. To change alignment of the player to either left or right:
84
+ Go to FV WordPress Flowplayer settings > scroll down to post interface options > tick "Align". Now you can insert your video. In the interface you can now choose you alignment from the drop down menu: default (middle), left, or right.
85
+ You can check [demo in here](https://foliovision.com/player/demos/align-settings).
86
+
87
  = How to check my video properties using the built-in checker and how to report video not playing =
88
 
89
  * Login to your site as administrator (please use the browser in which the video is not playing for you)
90
+ * Double check Settings -> FV Wordpress Flowplayer -> Sitewide Flowplayer Defaults -> "Disable admin video checker" is not checked
91
  * Come to any post which was video
92
  * A message in top left corner of the video should appear saying: "Checking the video file...". The check takes usually 1-2 seconds.
93
  * Once it's finished, it changes color based on what problem is detected and you can click it to get video details.
94
  * The dialog also includes our tips on how to resolve the issues found. There is also a button labeled "Send to Foliovision" which sends your video with details straight to our private support tickets.
95
 
96
+ Note: The checker doesn't work for localhost files, as our service is not able to access them.
97
 
98
  = My video doesn't play in Internet Explorer 9 and 10 =
99
 
110
  AddType video/ogg .ogv
111
  AddType application/x-mpegurl .m3u8
112
  AddType video/x-m4v .m4v
 
113
  AddType video/mp2t .ts`
114
 
115
  If you use Microsoft IIS, add following into web.config (one should be in your root website folder) into configuration/system.webServer/staticContent section:
137
 
138
  = How do I fix the bad metadata (moov) position? =
139
 
140
+ This means that the video information (such as what codecs are used) is not stored at the beginning of the file. In our experience, video with bad meta data position might be slow to load in Flash engine (check some browser which doesn't play MP4 format in Flash - like Opera) and Firefox. Although Safary and iOS (iPAd, iPhone) may play it just fine.
141
+
142
+ In general we recommend you to re-encode your video as [per our instructions](https://foliovision.com/player/encoding#encoding-samples), but here are some quick tools:
143
+
144
  If you are using Mac, try Lillipot (just remember to rename the file back to .mp4 extension): http://www.qtbridge.com/lillipot/lillipot.html
145
 
146
  If you have Quick Time Pro, just open the video and in the Movie Properties -> Video Track -> Other Settings turn on the "Cache (hint)" - [screenshot](http://drop.foliovision.com/webwork/it/quick-time-pro-cache-hint.png).
157
 
158
  = Are there any known compatibility issues? =
159
 
160
+ We heard about problems when using some fancy pro templates like OptimizePress (read below for fixing instructions) or Gantry framework. These templates often break the Wordpress conventions (probably as they often try to add too many non-template functions, like video support built-in into the template). We can debug the issues for you, just head over to our website and order the pro support.
161
+
162
+ Full list of conflicting plugins is available here: https://foliovision.com/player/compatibility
163
 
164
  = I'm using OptimizePress version 1 template. =
165
 
263
 
264
  = How can I change position of my custom logo? =
265
 
266
+ Check out Settings -> FV WordPress Flowplayer -> Sitewide Flowplayer Defaults -> Logo.
 
 
 
 
 
 
 
267
 
268
  = Volume control in player looks weird =
269
 
318
 
319
  == Changelog ==
320
 
321
+ = 2.3.12 - 2015/02/13 =
322
+
323
+ * Feature - player position setting - lets you change the default centering to left align with no text wrapping
324
+ * Feature - RSS - improving player appearance
325
+ * Bugfix - FV Flowplayer preview in admin screen conflict with WP Media Library fixed
326
+
327
+ = 2.3.11 - 2015/01/30 =
328
+
329
+ * Feature - setting for default splash screen added in Settings -> FV Wordpress Flowplayer -> Sitewide Flowplayer Defaults -> Splash Image
330
+ * Bugfix - iOS 8 playback issues when using Video app
331
+ * Bugfix - playback issues when Google Analytics is configured for FV Flowplayer and it's blocked by some browser extension (like Ghostery)
332
+
333
+ = 2.3.10 - 2015/01/21 =
334
+
335
+ * Fix - admin player preview fixes
336
+ * Fix - code revisions, code optimizations for wp-admin
337
+ * Fix - src attribute parsing when fv_flowplayer_shortcode filter is used
338
+ * Fix - touch devices now use the device native fullscreen playback due to the inperfections in the browser fullscreen modes in different mobile browsers
339
+
340
+ = 2.3.9 - 2015/01/07 =
341
+
342
+ * Fix - added "Region" setting for the Amazon S3 buckets. It's required for AWS Signature Version 4 used by Frankfurt region.
343
+ * Bugfix - audio player responsivendess
344
+ * Bugfix - ratio uses coma instead of dot for decimal numbers on some servers - breaking things
345
+ * Bugfix - some PHP warnings
346
+ * Pro - YouTube Android < 4.3 fixes
347
+
348
+ = 2.3.8 - 2014/12/09 =
349
+
350
+ * Feature - upgrade to latest core Flowplayer (5.5.2 you- fixed for HLS, Flash performance, Windows Phone 8.1)
351
+ * Feature - [fvplayer post="{post id or 'this'}"] shows all the attached video files
352
+ * Feature - caption now shows up even for single videos
353
+ * Feature - live streams now show this message if the loading fails: "Live stream load failed. Please try again later, perhaps the stream is currently offline."
354
+ * Feature - playlist editor now has all the media upload buttons it needs
355
+ * Bugfix - player alignment was aligning it to the wrong/oposite side
356
+ * Bugfix - playlist editor showing duration of the last video added for new items
357
+ * Pro - Vimeo - improved loading for mobile users and quality switching improvements
358
+
359
+ = 2.3.7 - 2014/12/01 =
360
+
361
+ * Fix - changing retina CSS sprites to use a different post-fix. @x2 has issues with "All In One WP Security & Firewall" plugin
362
+ * Pro - fix for Lightbox splash image responsiveness
363
+
364
+ = 2.3.6 - 2014/11/20 =
365
+
366
+ * Bugfix - fix for auto play of playlists affecting other players on the page.
367
+ * Bugfix - fix for handling of videos on attachment pages
368
+ * Bugfix - fix for RTMP URLs with no file type like rtmp://host/live:stream-name
369
+ * Pro - fix for dynamic playlist (Vimeo, CloudFront) autoplay
370
+
371
+ = 2.3.5 - 2014/10/30 =
372
+
373
+ * Feature - added logo position option - see Settings -> FV Wordpress Flowplayer -> Sitewide Flowplayer Defaults -> Logo
374
+ * Feature - added subtitle font size option - see Settings -> FV Wordpress Flowplayer -> Player Skin -> Subitle Font Size
375
+ * Bugfix - bugfix for default volumne setting when set to 0 (mute)
376
+ * Pro - YouTube playlist items duration fix
377
+
378
+ = 2.3.4 - 2014/10/16 =
379
+
380
+ * Feature - add %random% to your ad code to put in a random number if required by the ad provider
381
+ * Feature - added option to skip CSS optimization (see Integrations settings)
382
+ * Feature - shortcode editor now uses the latest Media Library interface to upload the videos
383
+ * Bugfix - ad codes don't need to be responsive now that we check the player size before showing the code
384
+ * Bugfix - fixes for Google Chrome version checks
385
+ * Bugfix - shortcode editor fixes for /"
386
+ * Pro - Vimeo quality switching added (beta)
387
+
388
+ = 2.3.3 - 2014/10/13 =
389
+
390
+ * Feature - ad and popup feature now only loads the HTML content if the event (video playback or video end) occurs - making it more suitable for ads (as they won't load on background)
391
+ * Feature - custom plugin row action links added for easier access to Settings
392
+ * Feature - Scan video length - more information about videos in queue
393
+ * Feature - Scan video length - "Scan Now" button added!
394
+ * Bugfix - Scan video length was using Flash encoded URLs
395
+ * Bugfix - video splash image appearing around the video when video aspect ratio doesn't match the player size
396
+ * Pro - video lightbox links
397
+
398
+ = 2.3.2 - 2014/10/06 =
399
+
400
+ * Bugfix - bad Twitter sharing URLs
401
+ * Bugfix - fix for [fvplayer] shortcode handling in text widgets
402
+ * Pro - fix for start/end time in seconds
403
+
404
+ = 2.3.1 - 2014/10/06 =
405
+
406
+ * Feature - Colorbox compatibility (enhancement for programmers, Pro version has its own video and image lightbox gallery)
407
+ * Bugfix - fix for volume setting (no values above 1)
408
+ * Pro - easier video lightbox - type in <a href="http://your-server.com/videos/your-video.mp4" class="colorbox">click here to play video</a> and it will be open a lightbox with the video playing
409
+ * Pro - fixed YouTube video end bug when using Google Analytics tracking
410
+ * Pro - Quality Switching interface improved
411
+ * Pro (Beta) - added custom video ads (pre-roll, post-roll)
412
+ * Pro (Beta) - added support for custom video start and end time
413
+
414
+ = 2.3 - 2014/09/23 =
415
+
416
+ * Feature - upgreaded to latest core Flowplayer (5.5.0)
417
+ * Fix - fix for Windows Mobile 8.1 Update 1
418
+ * Bugfix - editor bug in rate cases
419
+ * Bugfix - video duratation checker fixes
420
+ * Pro - YouTube - added support for Google Developer API to parse the video durations and splash screens properly
421
 
422
+ = 2.2.22 - 2014/09/05 =
423
 
424
+ * Fix - Wordpress 4.0 compatibility fix
425
+ * Fix - logo CSS fix
426
+ * Fix - video checker fixes
427
+ * Feature - playlist_hide added
428
+
429
+ = 2.2.21 - 2014/08/07 =
430
+
431
+ * Fix - mobile video is now used if there is no primary video
432
+ * Fix - UI fade out changed from 2 to 5 seconds for touch devices
433
+ * Fix - improved RTMP URL parsing to support rtmp://server/path/mp4:file-path URLs - however use RTMP server and RTMP path separately if possible
434
+ * Bugfix - sharing buttons were appearing even when disabled globally
435
+ * Pro - YouTube fix for Internet Explorer
436
+ * Pro - Quality switching enabled for HLS and other fixes
437
+
438
+ = 2.2.20 - 2014/08/05 =
439
+
440
+ * Feature - use share="Title;URL" to specify a custom URL for sharing using the video sharing buttons. Use "no" and "yes" to enable/disabled the sharing on the video.
441
+ * Fix - admin JavaScript check made less scary - it only shows up if you hover the player (and the JavaScript is broken of course)
442
+ * Fix - relative video paths were not respecting HTTP/HTTPS preference
443
+ * Fix - video checker won't work in IE 9 - added a warnings about that
444
+ * Fix - Android 4.x fullscreen compatibility fix (switch to native full screen mode as it's more compatible)
445
+ * Fix - Windows Mobile 8.1 compatibility fix (set to use inline playback)
446
+ * Fix - RTMP streams without extension now don't need "mp4:" entered at the start of path
447
+ * Pro - YouTube support added (enable in settings first)!
448
+ * Pro - Vimeo splash screen parsing (re-save your post to take effect)
449
+
450
+ = 2.2.19 - 2014/07/21 =
451
+
452
+ * Fix - missing controlbar="no" option for shortcode added
453
+ * Bugfix - video checker display issues
454
+
455
+ = 2.2.18 - 2014/07/16 =
456
+
457
+ * Bugfix - fix for PHP warnings
458
+
459
+ = 2.2.17 - 2014/07/11 =
460
+
461
+ * Fix - plugin HTML made more robust - it won't get damaged by some weird templates which put in P tags anymore
462
+ * Fix - share bar CSS improved to not be affected by template CSS
463
+ * Bugfix - plugin was failing to load its own JavaScript libraries in some rare cases (found on a website with Genesis framework, but we haven't found a compatibility issue when using it)
464
+
465
+ = 2.2.16 - 2014/07/07 =
466
+
467
+ * Feature - better support for Amazon S3 protected URLs and cache plugins - you can force a set expiry time now to match your cache timeout
468
+ * Pro (version 0.1.8) - support for secured CloudFront
469
+
470
+ = 2.2.15 - 2014/07/03 =
471
+
472
+ * Feature - added setting for default volume
473
+ * Bugfix - rare IE 11 issues with splash screen on autoplay videos
474
+
475
+ = 2.2.14 - 2014/06/24 =
476
+
477
+ * Bugfix - important fix for Chrome - share bar embed button was triggering video loading on background and thus causing extra traffic to the server
478
+ * Bugfix - some PHP and admin JS warnings
479
+
480
+ = 2.2.13 - 2014/06/23 =
481
+
482
+ * Bugfix - fix for embed function call when not available (non-fatal JavaScript error)
483
+ * Bugfix - shortcode editor fixes for quotes in file URLs etc.
484
+ * Bugfix - video checker was sometimes listing JavaScript objects
485
+
486
+ = 2.2.12 - 2014/06/19 =
487
+
488
+ * Feature - play button now visible by default. Added option into Player Skin section.
489
+ * Fix - settings screen cleanup
490
+ * Beta feature - video duration scanning (check Integrations)
491
+ * Pro (version 0.1.7.3) - fixing PHP warnings
492
+
493
+ = 2.2.11 - 2014/06/17 =
494
+
495
+ * Bugfix - PHP warnings on fresh install settings save
496
+ * Pro (version 0.1.7.2) - fixing image lightbox to add class only for images.
497
+ * Pro (version 0.1.7.1) - bugfix for quality switching.
498
+
499
+ = 2.2.10 - 2014/06/13 =
500
+
501
+ * Bugfix - compatibility issues with "NextGen Gallery" plugin fixed
502
+ * Bugfix - loading indicator fixes for IE (was causing rendering issues in some configurations)
503
+ * Bugfix - share bar fixes for IE
504
+ * Pro - quality switching now happens live, without reloading of the webpage!
505
+
506
+ = 2.2.9 - 2014/06/05 =
507
 
508
  * Feature - share bar added!
509
  * Bugfix - annoying iOS 7 bug where black lines appear after videos - fixed!
989
 
990
  == Upgrade Notice ==
991
 
992
+ = 2.3.8 =
993
+
994
+ * New core Flowplayer - fixed for HLS, Flash performance, Windows Phone 8.1
995
+
996
+ = 2.3.3 =
997
+
998
+ * Fix for ad and popup codes, please check!
999
+
1000
+ = 2.2.22 =
1001
+ * Fix for Amazon RTMP path parsing - plus signs in the path were handled incorrectly for Flash engine
1002
+
1003
+ = 2.2.14 =
1004
+ * Important fix for share bar embed function in Chrome - it was triggering video loading on background in and thus causing extra traffic to the server
1005
+
1006
  = 2.2.4 =
1007
  * Amazon S3 protected content playlist fixes. Please check you playlist after the upgrade.
1008
 
screenshot-4.png CHANGED
Binary file
view/admin.php CHANGED
@@ -26,7 +26,7 @@ delete_option('fv_wordpress_flowplayer_deferred_notices');
26
  function fv_flowplayer_admin_ads() {
27
  global $fv_fp;
28
  ?>
29
- <table class="form-table2" style="width: 100%">
30
  <tr>
31
  <td colspan="2">
32
  <label for="ad">Default Ad Code:</label><br />
@@ -34,12 +34,8 @@ function fv_flowplayer_admin_ads() {
34
  </td>
35
  </tr>
36
  <tr>
37
- <td><label for="width">Default ad size [px]:</label></td>
38
- <td style="text-align:right">
39
- <label for="ad_width">W:</label>&nbsp;<input type="text" size="4" name="ad_width" id="ad_width" value="<?php echo trim($fv_fp->conf['ad_width']); ?>" />
40
- <label for="ad_height">H:</label>&nbsp;<input type="text" size="4" name="ad_height" id="ad_height" value="<?php echo trim($fv_fp->conf['ad_height']); ?>" />
41
- </td>
42
- </tr>
43
  <tr>
44
  <td colspan="2">
45
  <label for="width">Ad CSS:</label>
@@ -65,7 +61,7 @@ function fv_flowplayer_admin_ads() {
65
  </tr>
66
  <tr>
67
  <td colspan="4">
68
- <input type="submit" name="fv-wp-flowplayer-submit" class="button-primary" value="Save All Changes" style="margin-top: 2ex;"/>
69
  </td>
70
  </tr>
71
  </table>
@@ -96,19 +92,25 @@ function fv_flowplayer_admin_amazon_options() {
96
 
97
  var_dump($message);*/
98
  ?>
99
- <style>
100
- #fv_flowplayer_amazon_options label { float: right }
101
- </style>
102
- <table class="form-table2" style="margin: 5px; ">
103
  <tr>
104
  <td colspan="2">
105
- <p>Secured Amazon S3 URLs are only recommended for member-only sections of the site. They don't work well with cache plugins, as they expire. Member-only sections in general require users to log in and thus use no WP cache. Read more in the <a href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/secure-amazon-s3-guide#wp-cache" target="_blank">Using Amazon S3 secure content in FV Flowplayer guide</a>.</p>
 
106
  </td>
107
  </tr>
108
  <tr>
109
- <td style="width: 200px"><label for="amazon_expire">Default Expire Time [minutes] (<abbr title="Each video duration is stored on post save and then used as the expire time.">?</abbr>):</label></td>
110
- <td><input type="text" size="40" name="amazon_expire" id="amazon_expire" value="<?php echo intval($fv_fp->conf['amazon_expire']); ?>" style="width: 100%" /></td>
111
- </tr>
 
 
 
 
 
 
 
 
112
  <?php
113
  if( !isset($fv_fp->conf['amazon_bucket']) ) {
114
  $fv_fp->conf['amazon_bucket'] = array('');
@@ -119,22 +121,40 @@ function fv_flowplayer_admin_amazon_options() {
119
  foreach( $fv_fp->conf['amazon_bucket'] AS $key => $item ) :
120
  $count++;
121
  $amazon_tr_class = ($count==1) ? ' class="amazon-s3-first"' : ' class="amazon-s3-'.$count.'"';
 
122
  ?>
123
  <tr<?php echo $amazon_tr_class; ?>>
124
  <td><label for="amazon_bucket[]">Amazon Bucket (<abbr title="We recommend that you simply put all of your protected video into a single bucket and enter its name here. All matching videos will use the protected URLs.">?</abbr>):</label></td>
125
- <td><input type="text" size="40" name="amazon_bucket[]" id="amazon_bucket[]" value="<?php echo trim($item); ?>" style="width: 100%" /></td>
126
- </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  <tr<?php echo $amazon_tr_class; ?>>
128
  <td><label for="amazon_key[]">Access Key ID:</label></td>
129
- <td><input type="text" size="40" name="amazon_key[]" id="amazon_key[]" value="<?php echo trim($fv_fp->conf['amazon_key'][$key]); ?>" style="width: 100%" /></td>
130
  </tr>
131
  <tr<?php echo $amazon_tr_class; ?>>
132
  <td><label for="amazon_secret[]">Secret Access Key:</label></td>
133
- <td><input type="text" size="40" name="amazon_secret[]" id="amazon_secret[]" value="<?php echo trim($fv_fp->conf['amazon_secret'][$key]); ?>" style="width: 100%" /></td>
134
  </tr>
135
  <tr<?php echo $amazon_tr_class; ?>>
136
  <td colspan="2">
137
- <div class="alignright fv_fp_amazon_remove"><a href="#" onclick="fv_fp_amazon_s3_remove(this); return false">remove</a></div><div style="clear: both"></div>
138
  <hr style="border: 0; border-top: 1px solid #ccc;" />
139
  </td>
140
  </tr>
@@ -156,112 +176,191 @@ function fv_flowplayer_admin_amazon_options() {
156
  function fv_flowplayer_admin_default_options() {
157
  global $fv_fp;
158
  ?>
159
- <table class="form-table2" style="margin: 5px; ">
160
  <tr>
161
- <td style="width: 250px;"><label for="autoplay">AutoPlay:</label></td>
162
- <td style="text-align:left">
163
  <?php fv_flowplayer_admin_checkbox('autoplay'); ?>
164
  </td>
165
  </tr>
166
  <tr>
167
- <td><label for="auto_buffer">Auto Buffering (<abbr title="Works for first 2 videos on the page only, to preserve your bandwidth.">?</abbr>):</label></td>
168
- <td style="text-align:left">
169
- <?php fv_flowplayer_admin_checkbox('auto_buffer'); ?>
170
  </td>
171
  </tr>
172
  <tr>
173
  <td><label for="popupbox">Popup Box:</label></td>
174
- <td style="text-align:left">
175
  <?php fv_flowplayer_admin_checkbox('popupbox'); ?>
176
  </td>
177
  </tr>
178
- <tr>
179
- <td><label for="allowfullscreen">Enable Full-screen Mode:</label></td>
180
- <td style="text-align:left">
181
- <?php fv_flowplayer_admin_checkbox('allowfullscreen'); ?>
182
- </td>
183
- </tr>
184
  <tr>
185
  <td><label for="scaling">Fit scaling (<abbr title="If set to true, the original aspect ratio of the video will be used to display the video in fullscreen mode as well as when embedded in the page.">?</abbr>):</label></td>
186
- <td style="text-align:left">
187
  <?php fv_flowplayer_admin_checkbox('scaling'); ?>
188
  </td>
189
- </tr>
190
- <tr>
191
- <td><label for="disableembedding">Disable embedding:</label></td>
192
- <td style="text-align:left">
193
- <?php fv_flowplayer_admin_checkbox('disableembedding'); ?>
194
- </td>
195
- </tr>
196
  <tr>
197
- <td><label for="disablesharing">Disable sharing:</label></td>
198
- <td style="text-align:left">
199
- <?php fv_flowplayer_admin_checkbox('disablesharing'); ?>
200
- </td>
201
- </tr>
202
- <tr>
203
- <td><label for="postthumbnail">Enable Post Thumbnail:</label></td>
204
- <td style="text-align:left">
205
  <?php fv_flowplayer_admin_checkbox('postthumbnail'); ?>
206
  </td>
207
  </tr>
208
  <tr>
209
  <td><label for="parse_commas">Convert old shortcodes with commas (<abbr title="Older versions of this plugin used commas to sepparate shortcode parameters. This option will make sure it works with current version. Turn this off if you have some problems with display or other plugins which use shortcodes.">?</abbr>):</label></td>
210
- <td style="text-align:left">
211
  <?php fv_flowplayer_admin_checkbox('parse_commas'); ?>
212
  </td>
213
  </tr>
214
  <tr>
215
  <td><label for="engine">Prefer Flash player by default (<abbr title="Default setting is off - IE9 and IE10 get Flash (due to server compatibility issues), Firefox in Windows gets Flash for M4V files (due to issues with M4V in it on PC), everyone else gets HTML5 (with Flash fallback)">?</abbr>):</label></td>
216
- <td style="text-align:left">
217
  <?php fv_flowplayer_admin_checkbox('engine'); ?>
218
  </td>
219
  </tr>
220
  <tr>
221
  <td><label for="fixed_size">Always use fixed size player (<abbr title="Default setting - respects width and height setting of the video, but allows it to size down to be responsive">?</abbr>):</label></td>
222
- <td style="text-align:left">
223
  <?php fv_flowplayer_admin_checkbox('fixed_size'); ?>
224
  </td>
225
  </tr>
226
  <tr>
227
  <td><label for="disable_videochecker">Disable admin video checker</label></td>
228
- <td style="text-align:left">
229
  <?php fv_flowplayer_admin_checkbox('disable_videochecker'); ?>
230
  </td>
231
  </tr>
232
  <tr>
233
  <td><label for="width">Default video size [px]:</label></td>
234
- <td style="text-align:left">
235
- <label for="width">W:</label>&nbsp;<input type="text" size="4" name="width" id="width" value="<?php echo trim($fv_fp->conf['width']); ?>" />
236
- <label for="height">H:</label>&nbsp;<input type="text" size="4" name="height" id="height" value="<?php echo trim($fv_fp->conf['height']); ?>" />
237
  </td>
238
  </tr>
239
  <tr>
240
  <td><label for="googleanalytics">Google Analytics ID:</label></td>
241
- <td><input type="text" size="40" name="googleanalytics" id="googleanalytics" value="<?php echo trim($fv_fp->conf['googleanalytics']); ?>" /></td>
242
  </tr>
243
  <tr>
244
  <td><label for="key">Commercial License Key:</label></td>
245
- <td><input type="text" size="40" name="key" id="key" value="<?php echo trim($fv_fp->conf['key']); ?>" /></td>
246
  </tr>
247
  <tr>
248
  <td><label for="logo">Logo:</label></td>
249
- <td><input type="text" size="40" name="logo" id="logo" value="<?php echo trim($fv_fp->conf['logo']); ?>" /></td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
250
  </tr>
251
- <tr>
252
- <td colspan="2" style="text-align: right">Or <a title="Add FV WP Flowplayer Logo" href="media-upload.php?type=fvplayer_logo&TB_iframe=true&width=500&height=300" class="thickbox" >open media library</a> to upload logo.</td>
253
- </tr>
254
  <tr>
255
  <td><label for="rtmp">Flash streaming server<br />(Amazon CloudFront domain) (<abbr title="Enter your default RTMP streaming server here">?</abbr>):</label></td>
256
- <td><input type="text" size="40" name="rtmp" id="rtmp" value="<?php echo trim($fv_fp->conf['rtmp']); ?>" /></td>
257
  </tr>
258
  <tr>
259
  <td colspan="4">
260
- <input type="submit" name="fv-wp-flowplayer-submit" class="button-primary" value="Save All Changes" style="margin-top: 2ex;"/>
261
  </td>
262
  </tr>
263
- </table>
264
- <div style="clear: both"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
265
  <?php
266
  }
267
 
@@ -270,7 +369,7 @@ function fv_flowplayer_admin_description() {
270
  ?>
271
  <table class="form-table">
272
  <tr>
273
- <td colspan="4" style="text-align: justify;">
274
  <p>FV WordPress Flowplayer WordPress plugin is a free, easy-to-use, and complete solution for embedding <strong>MP4</strong>, <strong>WEBM</strong>, <strong>OGV</strong>, <strong>MOV</strong> and <strong>FLV</strong>. videos into your posts or pages. With MP4 videos, FV WordPress Flowplayer offers 98% coverage even on mobile devices.</p>
275
  </td>
276
  </tr>
@@ -282,31 +381,72 @@ function fv_flowplayer_admin_description() {
282
  function fv_flowplayer_admin_integrations() {
283
  global $fv_fp;
284
  ?>
285
- <table class="form-table2" style="margin: 5px; ">
 
286
  <tr>
287
- <td style="width: 350px"><label for="js-everywhere">Load FV Flowplayer JS everywhere (<abbr title="If you use some special JavaScript integration, you might prefer this option, otherwise it loads only if the shortcode is found.">?</abbr>):</label></td>
288
- <td style="text-align:right">
 
 
 
 
 
 
 
289
  <input type="hidden" name="js-everywhere" value="false" />
290
  <input type="checkbox" name="js-everywhere" id="js-everywhere" value="true" <?php if( isset($fv_fp->conf['js-everywhere']) && $fv_fp->conf['js-everywhere'] == 'true' ) echo 'checked="checked"'; ?> />
291
  </td>
292
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
293
  <!--<tr>
294
  <td style="width: 350px"><label for="optimizepress2">Handle OptimizePress 2 videos (<abbr title="Following attributes are not currently supported: margin, border">?</abbr>):</label></td>
295
- <td style="text-align:right">
296
  <input type="hidden" name="integrations[optimizepress2]" value="false" />
297
  <input type="checkbox" name="integrations[optimizepress2]" id="optimizepress2" value="true" <?php if( isset($fv_fp->conf['integrations']['optimizepress2']) && $fv_fp->conf['integrations']['optimizepress2'] == 'true' ) echo 'checked="checked"'; ?> />
298
  </td>
299
  </tr>
300
  <tr>
301
  <td><label for="wp_core_video">Handle Wordpress <code><small>[video]</small></code> shortcodes:</label></td>
302
- <td style="text-align:right">
303
  <input type="hidden" name="integrations[wp_core_video]" value="false" />
304
  <input type="checkbox" name="integrations[wp_core_video]" id="wp_core_video" value="true" <?php if( isset($fv_fp->conf['integrations']['wp_core_video']) && $fv_fp->conf['integrations']['wp_core_video'] == 'true' ) echo 'checked="checked"'; ?> />
305
  </td>
306
  </tr>-->
307
  <tr>
308
  <td colspan="4">
309
- <input type="submit" name="fv-wp-flowplayer-submit" class="button-primary" value="Save All Changes" style="margin-top: 2ex;"/>
310
  </td>
311
  </tr>
312
  </table>
@@ -318,101 +458,115 @@ function fv_flowplayer_admin_interface_options() {
318
  global $fv_fp;
319
  ?>
320
  <p>Which features should be available in shortcode editor?</p>
321
- <table class="form-table2" style="margin: 5px; ">
322
  <tr>
323
- <td style="width: 250px"><label for="allowuploads">Allow User Uploads:</label></td>
324
- <td style="text-align:right">
325
  <input type="hidden" name="allowuploads" value="false" />
326
  <input type="checkbox" name="allowuploads" id="allowuploads" value="true" <?php if( isset($fv_fp->conf['allowuploads']) && $fv_fp->conf['allowuploads'] == 'true' ) echo 'checked="checked"'; ?> />
327
  </td>
328
  </tr>
329
  <tr>
330
  <td><label for="interface[playlist]">Playlist:</label></td>
331
- <td style="text-align:right">
332
  <input type="hidden" name="interface[playlist]" value="false" />
333
  <input type="checkbox" name="interface[playlist]" id="interface[playlist]" value="true" <?php if( isset($fv_fp->conf['interface']['playlist']) && $fv_fp->conf['interface']['playlist'] == 'true' ) echo 'checked="checked"'; ?> />
334
  </td>
335
  </tr>
336
  <tr>
337
- <td><label for="interface[playlist]">Playlist captions: <span style="color: #e00; font-weight: bold">NEW</span></label></td>
338
- <td style="text-align:right">
339
  <input type="hidden" name="interface[playlist_captions]" value="false" />
340
  <input type="checkbox" name="interface[playlist_captions]" id="interface[playlist_captions]" value="true" <?php if( isset($fv_fp->conf['interface']['playlist_captions']) && $fv_fp->conf['interface']['playlist_captions'] == 'true' ) echo 'checked="checked"'; ?> />
341
  </td>
342
  </tr>
343
  <tr>
344
  <td><label for="interface[popup]">HTML popup:</label></td>
345
- <td style="text-align:right">
346
  <input type="hidden" name="interface[popup]" value="false" />
347
  <input type="checkbox" name="interface[popup]" id="interface[popup]" value="true" <?php if( isset($fv_fp->conf['interface']['popup']) && $fv_fp->conf['interface']['popup'] == 'true' ) echo 'checked="checked"'; ?> />
348
  </td>
349
  </tr>
350
  <tr>
351
  <td><label for="interface[redirect]">Redirect:</label></td>
352
- <td style="text-align:right;">
353
  <input type="hidden" name="interface[redirect]" value="false" />
354
  <input type="checkbox" name="interface[redirect]" id="interface[redirect]" value="true" <?php if( isset($fv_fp->conf['interface']['redirect']) && $fv_fp->conf['interface']['redirect'] == 'true' ) echo 'checked="checked"'; ?> />
355
  </td>
356
  </tr>
357
  <tr>
358
- <td><label for="interface[autoplay]">AutoPlay:</label></td>
359
- <td style="text-align:right;">
360
  <input type="hidden" name="interface[autoplay]" value="false" />
361
  <input type="checkbox" name="interface[autoplay]" id="interface[autoplay]" value="true" <?php if( isset($fv_fp->conf['interface']['autoplay']) && $fv_fp->conf['interface']['autoplay'] == 'true' ) echo 'checked="checked"'; ?> />
362
  </td>
363
  </tr>
364
  <tr>
365
  <td><label for="interface[loop]">Loop:</label></td>
366
- <td style="text-align:right;">
367
  <input type="hidden" name="interface[loop]" value="false" />
368
  <input type="checkbox" name="interface[loop]" id="interface[loop]" value="true" <?php if( isset($fv_fp->conf['interface']['loop']) && $fv_fp->conf['interface']['loop'] == 'true' ) echo 'checked="checked"'; ?> />
369
  </td>
370
  </tr>
371
  <tr>
372
  <td><label for="interface[splashend]">Splash end:</label></td>
373
- <td style="text-align:right;">
374
  <input type="hidden" name="interface[splashend]" value="false" />
375
  <input type="checkbox" name="interface[splashend]" id="interface[splashend]" value="true" <?php if( isset($fv_fp->conf['interface']['splashend']) && $fv_fp->conf['interface']['splashend'] == 'true' ) echo 'checked="checked"'; ?> />
376
  </td>
377
  </tr>
378
  <tr>
379
  <td><label for="interface[embed]">Embed:</label></td>
380
- <td style="text-align:right;">
381
  <input type="hidden" name="interface[embed]" value="false" />
382
  <input type="checkbox" name="interface[embed]" id="interface[embed]" value="true" <?php if( isset($fv_fp->conf['interface']['embed']) && $fv_fp->conf['interface']['embed'] == 'true' ) echo 'checked="checked"'; ?> />
383
  </td>
384
  </tr>
385
  <tr>
386
  <td><label for="interface[subtitles]">Subtitles:</label></td>
387
- <td style="text-align:right;">
388
  <input type="hidden" name="interface[subtitles]" value="false" />
389
  <input type="checkbox" name="interface[subtitles]" id="interface[subtitles]" value="true" <?php if( isset($fv_fp->conf['interface']['subtitles']) && $fv_fp->conf['interface']['subtitles'] == 'true' ) echo 'checked="checked"'; ?> />
390
  </td>
391
  </tr>
392
  <tr>
393
  <td><label for="interface[ads]">Ads:</label></td>
394
- <td style="text-align:right;">
395
  <input type="hidden" name="interface[ads]" value="false" />
396
  <input type="checkbox" name="interface[ads]" id="interface[ads]" value="true" <?php if( isset($fv_fp->conf['interface']['ads']) && $fv_fp->conf['interface']['ads'] == 'true' ) echo 'checked="checked"'; ?> />
397
  </td>
398
  </tr>
399
  <tr>
400
  <td><label for="interface[mobile]">Mobile video:</label></td>
401
- <td style="text-align:right;">
402
  <input type="hidden" name="interface[mobile]" value="false" />
403
  <input type="checkbox" name="interface[mobile]" id="interface[mobile]" value="true" <?php if( isset($fv_fp->conf['interface']['mobile']) && $fv_fp->conf['interface']['mobile'] == 'true' ) echo 'checked="checked"'; ?> />
404
  </td>
405
  </tr>
406
  <tr>
407
  <td><label for="interface[align]">Align:</label></td>
408
- <td style="text-align:right;">
409
  <input type="hidden" name="interface[align]" value="false" />
410
  <input type="checkbox" name="interface[align]" id="interface[align]" value="true" <?php if( isset($fv_fp->conf['interface']['align']) && $fv_fp->conf['interface']['align'] == 'true' ) echo 'checked="checked"'; ?> />
411
  </td>
412
- </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
413
  <tr>
414
  <td colspan="4">
415
- <input type="submit" name="fv-wp-flowplayer-submit" class="button-primary" value="Save All Changes" style="margin-top: 2ex;"/>
416
  </td>
417
  </tr>
418
  </table>
@@ -432,9 +586,9 @@ function fv_flowplayer_admin_pro() {
432
  <?php else : ?>
433
  <p><a href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/download">Purchase FV Flowplayer license</a> to enable Pro features!</p>
434
  <?php endif; ?>
435
- <table class="form-table2" style="margin: 5px; ">
436
  <tr>
437
- <td style="width: 250px"><label>Advanced Vimeo embeding:</label></td>
438
  <td>
439
  <p class="description">
440
  <input type="checkbox" checked="checked" disabled="true" />
@@ -443,7 +597,7 @@ function fv_flowplayer_admin_pro() {
443
  </td>
444
  </tr>
445
  <tr>
446
- <td style="width: 250px"><label>Enable video lightbox:</label></td>
447
  <td>
448
  <p class="description">
449
  <input type="checkbox" checked="checked" disabled="true" />
@@ -452,7 +606,16 @@ function fv_flowplayer_admin_pro() {
452
  </td>
453
  </tr>
454
  <tr>
455
- <td style="width: 250px"><label>Use video lightbox for images as well:</label></td>
 
 
 
 
 
 
 
 
 
456
  <td>
457
  <p class="description">
458
  <input type="checkbox" disabled="true" />
@@ -461,7 +624,7 @@ function fv_flowplayer_admin_pro() {
461
  </td>
462
  </tr>
463
  <tr>
464
- <td style="width: 250px"><label>Autoplay just once:</label></td>
465
  <td>
466
  <p class="description">
467
  <input type="checkbox" disabled="true" />
@@ -471,9 +634,9 @@ function fv_flowplayer_admin_pro() {
471
  </tr>
472
  </table>
473
  <p>Upcoming pro features:</p>
474
- <table class="form-table2" style="margin: 5px; ">
475
  <tr>
476
- <td style="width: 250px"><label>Advanced Youtube embeding:</label></td>
477
  <td>
478
  <p class="description">
479
  <input type="checkbox" checked="checked" disabled="true" />
@@ -482,7 +645,7 @@ function fv_flowplayer_admin_pro() {
482
  </td>
483
  </tr>
484
  <tr>
485
- <td style="width: 250px"><label>Enable PayWall:</label></td>
486
  <td>
487
  <p class="description">
488
  <input type="checkbox" checked="checked" disabled="true" />
@@ -491,7 +654,7 @@ function fv_flowplayer_admin_pro() {
491
  </td>
492
  </tr>
493
  <tr>
494
- <td style="width: 250px"><label>Amazon CloudFront protected content:</label></td>
495
  <td>
496
  <p class="description">
497
  <input type="checkbox" checked="checked" disabled="true" />
@@ -507,42 +670,98 @@ function fv_flowplayer_admin_pro() {
507
  function fv_flowplayer_admin_skin() {
508
  global $fv_fp;
509
  ?>
510
- <div class="flowplayer-wrapper">
511
- <div class="flowplayer is-splash"
512
- <?php if ($fv_fp->conf['engine'] == 'flash') echo 'data-engine="flash"'; ?>
513
- data-swf="<?php echo FV_FP_RELATIVE_PATH ?>/flowplayer/flowplayer.swf"
514
- data-ratio="0.417"
515
- style="max-width:<?php echo $fv_fp->conf['width']; ?>px; max-height:<?php echo $fv_fp->conf['height']; ?>px;"
516
- <?php if ($fv_fp->conf['allowfullscreen'] == 'false') echo 'data-fullscreen="false"'; ?>
517
- <?php if (isset($fv_fp->conf['key']) && $fv_fp->conf['key'] != 'false' && strlen($fv_fp->conf['key']) > 0) {echo 'data-key="' . $fv_fp->conf['key'] . '"'; $commercial_key = true;} ?>
518
- <?php if ( isset($commercial_key) && isset($fv_fp->conf['logo']) && $fv_fp->conf['logo'] != 'false' && strlen($fv_fp->conf['logo']) > 0) echo ' data-logo="' . $fv_fp->conf['logo'] . '"'; ?>
519
- <?php if ($fv_fp->conf['scaling'] == "fit") echo 'data-flashfit="true"';; ?>
520
- >
521
- <video poster="http://foliovision.com/videos/example.jpg"<?php if (isset($fv_fp->conf['autoplay']) && $fv_fp->conf['autoplay'] == 'true') echo ' autoplay'; ?><?php if (isset($fv_fp->conf['auto_buffer']) && $fv_fp->conf['auto_buffer'] == 'true') echo ' preload'; ?>>
522
- <source src="http://foliovision.com/videos/example.mp4" type="video/mp4" />
523
- </video>
524
- </div>
525
- </div>
526
- <table class="form-table2 flowplayer-settings" style="width: 46%;">
527
- <?php include dirname( __FILE__ ) . '/../view/colours.php'; ?>
528
- <tr>
529
- <td><label for="marginBottom">bottom margin</label></td>
530
- <td style="text-align:right"><input type="text" size="6" name="marginBottom" id="marginBottom" value="<?php echo $fv_fp->conf['marginBottom']; ?>" title="Enter value in pixels" /></td>
531
- <td style="padding-left:20px;"><label for="font-face">font face</label></td>
532
- <td style="text-align:right">
533
- <select id="font-face" name="font-face">
534
- <option value="&quot;Courier New&quot;, Courier, monospace"<?php if( $fv_fp->conf['font-face'] == "\"Courier New\", Courier, monospace" ) echo ' selected="selected"'; ?>>Courier New</option>
535
- <option value="Tahoma, Geneva, sans-serif"<?php if( $fv_fp->conf['font-face'] == "Tahoma, Geneva, sans-serif" ) echo ' selected="selected"'; ?>>Tahoma, Geneva</option>
536
- <option value="inherit"<?php if( $fv_fp->conf['font-face'] == 'inherit' ) echo ' selected="selected"'; ?>>(inherit from template)</option>
537
- </select>
538
- </td>
539
- </tr>
540
- <tr>
541
- <td colspan="4">
542
- <input type="submit" name="fv-wp-flowplayer-submit" class="button-primary" value="Save All Changes" style="margin-top: 2ex;"/>
543
- </td>
544
- </tr>
545
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
546
  <?php
547
  }
548
 
@@ -551,11 +770,11 @@ function fv_flowplayer_admin_usage() {
551
  ?>
552
  <table class="form-table">
553
  <tr>
554
- <td colspan="4" style="text-align: justify;">
555
- <div style="float: left; width: 49%">
556
  <div class="icon32" id="icon-users"><br></div>
557
  <p>Illustrated user guides:</p>
558
- <div style="clear: both"></div>
559
  <ul>
560
  <li><a target="_blank" href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/user-guide">Inserting videos</a>
561
  <li><a target="_blank" href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/user-guide#license">License key and custom logo</a>
@@ -566,10 +785,10 @@ function fv_flowplayer_admin_usage() {
566
  <li><a target="_blank" href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/secure-amazon-s3-guide">Amazon S3 secure content guide</a></li>
567
  </ul>
568
  </div>
569
- <div style="float: left; width: 49%">
570
  <div class="icon32" id="icon-tools"><br></div>
571
  <p>Troubleshooting:</p>
572
- <div style="clear: both"></div>
573
  <ul>
574
  <li><a target="_blank" href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/installation">Automated checks</a></li>
575
  <li><a target="_blank" href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/encoding">Video encoding tips</a></li>
@@ -580,7 +799,7 @@ function fv_flowplayer_admin_usage() {
580
  <li><a target="_blank" href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/installation/downgrading">Downgrading the plugin</a></li>
581
  </ul>
582
  </div>
583
- <div style="clear: both"></div>
584
  <!--<p>
585
  To embed video "example.mp4", simply include the following code inside any post or page:
586
  <code>[fvplayer src=example.mp4]</code>
@@ -640,12 +859,6 @@ add_meta_box( 'fv_flowplayer_usage', 'Usage', 'fv_flowplayer_admin_usage', 'fv_f
640
 
641
  ?>
642
 
643
- <style>
644
- div.green { background-color: #e0ffe0; border-color: #88AA88; }
645
- .amazon-s3-first .fv_fp_amazon_remove { display: none; }
646
- .form-table2 td p { line-height: 20px; }
647
- </style>
648
-
649
  <div class="wrap">
650
  <div style="position: absolute; margin-top: 10px; right: 10px;">
651
  <a href="https://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer" target="_blank" title="Documentation"><img alt="visit foliovision" src="http://foliovision.com/shared/fv-logo.png" /></a>
@@ -658,11 +871,18 @@ div.green { background-color: #e0ffe0; border-color: #88AA88; }
658
  <input type="button" class="button" onclick="fv_flowplayer_ajax_check('fv_wp_flowplayer_check_template'); return false" value="Check template" />
659
  <input type="button" class="button" onclick="fv_flowplayer_ajax_check('fv_wp_flowplayer_check_files')" value="Check videos" />
660
  <img class="fv_wp_flowplayer_check_template-spin" style="display: none; " src="<?php echo site_url(); ?>/wp-includes/images/wpspin.gif" width="16" height="16" />
661
- <img class="fv_wp_flowplayer_check_files-spin" style="display: none; " src="<?php echo site_url(); ?>/wp-includes/images/wpspin.gif" width="16" height="16" />
 
662
  </p>
663
  <div id="fv_flowplayer_admin_notices">
664
  </div>
665
- <?php
 
 
 
 
 
 
666
 
667
  if( flowplayer::is_licensed() ) {
668
  $aCheck = get_transient( 'fv_flowplayer_license' );
@@ -685,7 +905,7 @@ div.green { background-color: #e0ffe0; border-color: #88AA88; }
685
  endif;
686
 
687
 
688
- if( preg_match( '!^\$\d+!', $fv_fp->conf['key'] ) ) : ?>
689
  <?php else : ?>
690
  <div id="fv_flowplayer_ad">
691
  <div class="text-part">
@@ -696,7 +916,7 @@ div.green { background-color: #e0ffe0; border-color: #88AA88; }
696
  <li>Or remove the logo completely</li>
697
  <li>The best video plugin for Wordpress</li>
698
  </ul>
699
- <a href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/download" class="red-button"><strong>Easter sale!</strong><br />All Licenses 20% Off</a></p>
700
  </div>
701
  <div class="graphic-part">
702
  <a href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/buy">
@@ -704,13 +924,10 @@ div.green { background-color: #e0ffe0; border-color: #88AA88; }
704
  </div>
705
  </div>
706
  <?php endif; ?>
707
- <style>
708
- #wpfp_options .postbox h3 { cursor: default; }
709
- </style>
710
 
711
  <form id="wpfp_options" method="post" action="">
712
  <div id="dashboard-widgets" class="metabox-holder columns-1">
713
- <div id='postbox-container-1' class='postbox-container' style="width: 100%;">
714
  <?php
715
  do_meta_boxes('fv_flowplayer_settings', 'normal', false );
716
  wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
26
  function fv_flowplayer_admin_ads() {
27
  global $fv_fp;
28
  ?>
29
+ <table class="form-table2">
30
  <tr>
31
  <td colspan="2">
32
  <label for="ad">Default Ad Code:</label><br />
34
  </td>
35
  </tr>
36
  <tr>
37
+ <td colspan="2"><label for="width">Default ad size [px]:</label> <label for="ad_width">W:</label>&nbsp;<input type="text" name="ad_width" id="ad_width" value="<?php echo trim($fv_fp->conf['ad_width']); ?>" class="small" /> <label for="ad_height">H:</label>&nbsp;<input type="text" name="ad_height" id="ad_height" value="<?php echo trim($fv_fp->conf['ad_height']); ?>" class="small" /> <label for="adTextColor">Ad text</label> <input class="color small" type="text" name="adTextColor" id="adTextColor" value="<?php echo $fv_fp->conf['adTextColor']; ?>" /> <label for="adLinksColor">Ad links</label> <input class="color small" type="text" name="adLinksColor" id="adLinksColor" value="<?php echo $fv_fp->conf['adLinksColor']; ?>" /> </td>
38
+ </tr>
 
 
 
 
39
  <tr>
40
  <td colspan="2">
41
  <label for="width">Ad CSS:</label>
61
  </tr>
62
  <tr>
63
  <td colspan="4">
64
+ <input type="submit" name="fv-wp-flowplayer-submit" class="button-primary" value="Save All Changes" />
65
  </td>
66
  </tr>
67
  </table>
92
 
93
  var_dump($message);*/
94
  ?>
95
+ <table class="form-table2">
 
 
 
96
  <tr>
97
  <td colspan="2">
98
+ <p>Secured Amazon S3 URLs are recommended for member-only sections of the site. We check the video length and make sure the link expiration time is big enough for the video to buffer properly</p>
99
+ <p>If you use a cache plugin (such as Hyper Cache, WP Super Cache or W3 Total Cache), we recommend that you set the "Default Expire Time" to twice as much as your cache timeout and check "Force the default expiration time". That way the video length won't be accounted and the video source URLs in your cached pages won't expire. Read more in the <a href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/secure-amazon-s3-guide#wp-cache" target="_blank">Using Amazon S3 secure content in FV Flowplayer guide</a>.</p>
100
  </td>
101
  </tr>
102
  <tr>
103
+ <td class="first"><label for="amazon_expire">Default Expire Time [minutes] (<abbr title="Each video duration is stored on post save and then used as the expire time. If the duration is not available, this value is used.">?</abbr>):</label></td>
104
+ <td>
105
+ <input type="text" size="40" name="amazon_expire" id="amazon_expire" value="<?php echo intval($fv_fp->conf['amazon_expire']); ?>" />
106
+ </td>
107
+ </tr>
108
+ <tr>
109
+ <td class="first"><label for="amazon_expire_force">Force the default expiration time:</label></td>
110
+ <td>
111
+ <?php fv_flowplayer_admin_checkbox('amazon_expire_force'); ?>
112
+ </td>
113
+ </tr>
114
  <?php
115
  if( !isset($fv_fp->conf['amazon_bucket']) ) {
116
  $fv_fp->conf['amazon_bucket'] = array('');
121
  foreach( $fv_fp->conf['amazon_bucket'] AS $key => $item ) :
122
  $count++;
123
  $amazon_tr_class = ($count==1) ? ' class="amazon-s3-first"' : ' class="amazon-s3-'.$count.'"';
124
+ $sRegion = ( isset($fv_fp->conf['amazon_region'][$key]) ) ? $fv_fp->conf['amazon_region'][$key] : false;
125
  ?>
126
  <tr<?php echo $amazon_tr_class; ?>>
127
  <td><label for="amazon_bucket[]">Amazon Bucket (<abbr title="We recommend that you simply put all of your protected video into a single bucket and enter its name here. All matching videos will use the protected URLs.">?</abbr>):</label></td>
128
+ <td><input id="amazon_bucket[]" name="amazon_bucket[]" type="text" value="<?php echo trim($item); ?>" /></td>
129
+ </tr>
130
+ <tr<?php echo $amazon_tr_class; ?>>
131
+ <td><label for="amazon_region[]">Region</td>
132
+ <td>
133
+ <select id="amazon_region[]" name="amazon_region[]">
134
+ <option value="">Select the region</option>
135
+ <option value="eu-central-1"<?php if( $sRegion == 'eu-central-1' ) echo " selected"; ?>>Frankfurt</option>
136
+ <option value="eu-west-1"<?php if( $sRegion == 'eu-west-1' ) echo " selected"; ?>>Ireland</option>
137
+ <option value="us-west-1"<?php if( $sRegion == 'us-west-1' ) echo " selected"; ?>>Northern California</option>
138
+ <option value="us-west-2"<?php if( $sRegion == 'us-west-2' ) echo " selected"; ?>>Oregon</option>
139
+ <option value="sa-east-1"<?php if( $sRegion == 'sa-east-1' ) echo " selected"; ?>>Sao Paulo</option>
140
+ <option value="ap-southeast-1"<?php if( $sRegion == 'ap-southeast-1' ) echo " selected"; ?>>Singapore</option>
141
+ <option value="ap-southeast-2"<?php if( $sRegion == 'ap-southeast-2' ) echo " selected"; ?>>Sydney</option>
142
+ <option value="ap-northeast-1"<?php if( $sRegion == 'ap-northeast-1' ) echo " selected"; ?>>Tokyo</option>
143
+ <option value="us-east-1"<?php if( $sRegion == 'us-east-1' ) echo " selected"; ?>>US Standard</option>
144
+ </select>
145
+ </td>
146
+ </tr>
147
  <tr<?php echo $amazon_tr_class; ?>>
148
  <td><label for="amazon_key[]">Access Key ID:</label></td>
149
+ <td><input id="amazon_key[]" name="amazon_key[]" type="text" value="<?php echo trim($fv_fp->conf['amazon_key'][$key]); ?>" /></td>
150
  </tr>
151
  <tr<?php echo $amazon_tr_class; ?>>
152
  <td><label for="amazon_secret[]">Secret Access Key:</label></td>
153
+ <td><input id="amazon_secret[]" name="amazon_secret[]" type="text" value="<?php echo trim($fv_fp->conf['amazon_secret'][$key]); ?>" /></td>
154
  </tr>
155
  <tr<?php echo $amazon_tr_class; ?>>
156
  <td colspan="2">
157
+ <div class="alignright fv_fp_amazon_remove"><a href="#" onclick="fv_fp_amazon_s3_remove(this); return false">remove</a></div><div class="clear"></div>
158
  <hr style="border: 0; border-top: 1px solid #ccc;" />
159
  </td>
160
  </tr>
176
  function fv_flowplayer_admin_default_options() {
177
  global $fv_fp;
178
  ?>
179
+ <table class="form-table2">
180
  <tr>
181
+ <td class="first"><label for="autoplay">AutoPlay (<abbr title="We make sure only one video per page autoplays">?</abbr>):</label></td>
182
+ <td colspan="2">
183
  <?php fv_flowplayer_admin_checkbox('autoplay'); ?>
184
  </td>
185
  </tr>
186
  <tr>
187
+ <td><label for="auto_buffering">Auto Buffering (<abbr title="Works for first 2 videos on the page only, to preserve your bandwidth.">?</abbr>):</label></td>
188
+ <td colspan="2">
189
+ <?php fv_flowplayer_admin_checkbox('auto_buffering'); ?>
190
  </td>
191
  </tr>
192
  <tr>
193
  <td><label for="popupbox">Popup Box:</label></td>
194
+ <td colspan="2">
195
  <?php fv_flowplayer_admin_checkbox('popupbox'); ?>
196
  </td>
197
  </tr>
 
 
 
 
 
 
198
  <tr>
199
  <td><label for="scaling">Fit scaling (<abbr title="If set to true, the original aspect ratio of the video will be used to display the video in fullscreen mode as well as when embedded in the page.">?</abbr>):</label></td>
200
+ <td colspan="2">
201
  <?php fv_flowplayer_admin_checkbox('scaling'); ?>
202
  </td>
203
+ </tr>
 
 
 
 
 
 
204
  <tr>
205
+ <td><label for="postthumbnail">Enable Post Thumbnail (<abbr title="When you set a splash screen from the media library, it will automatically become the splash image if there is none.">?</abbr>):</label></td>
206
+ <td colspan="2">
 
 
 
 
 
 
207
  <?php fv_flowplayer_admin_checkbox('postthumbnail'); ?>
208
  </td>
209
  </tr>
210
  <tr>
211
  <td><label for="parse_commas">Convert old shortcodes with commas (<abbr title="Older versions of this plugin used commas to sepparate shortcode parameters. This option will make sure it works with current version. Turn this off if you have some problems with display or other plugins which use shortcodes.">?</abbr>):</label></td>
212
+ <td colspan="2">
213
  <?php fv_flowplayer_admin_checkbox('parse_commas'); ?>
214
  </td>
215
  </tr>
216
  <tr>
217
  <td><label for="engine">Prefer Flash player by default (<abbr title="Default setting is off - IE9 and IE10 get Flash (due to server compatibility issues), Firefox in Windows gets Flash for M4V files (due to issues with M4V in it on PC), everyone else gets HTML5 (with Flash fallback)">?</abbr>):</label></td>
218
+ <td colspan="2">
219
  <?php fv_flowplayer_admin_checkbox('engine'); ?>
220
  </td>
221
  </tr>
222
  <tr>
223
  <td><label for="fixed_size">Always use fixed size player (<abbr title="Default setting - respects width and height setting of the video, but allows it to size down to be responsive">?</abbr>):</label></td>
224
+ <td colspan="2">
225
  <?php fv_flowplayer_admin_checkbox('fixed_size'); ?>
226
  </td>
227
  </tr>
228
  <tr>
229
  <td><label for="disable_videochecker">Disable admin video checker</label></td>
230
+ <td colspan="2">
231
  <?php fv_flowplayer_admin_checkbox('disable_videochecker'); ?>
232
  </td>
233
  </tr>
234
  <tr>
235
  <td><label for="width">Default video size [px]:</label></td>
236
+ <td colspan="2">
237
+ <label for="width">W:</label>&nbsp;<input type="text" class="small" name="width" id="width" value="<?php echo trim($fv_fp->conf['width']); ?>" />
238
+ <label for="height">H:</label>&nbsp;<input type="text" class="small" name="height" id="height" value="<?php echo trim($fv_fp->conf['height']); ?>" />
239
  </td>
240
  </tr>
241
  <tr>
242
  <td><label for="googleanalytics">Google Analytics ID:</label></td>
243
+ <td colspan="3"><input type="text" name="googleanalytics" id="googleanalytics" value="<?php echo trim($fv_fp->conf['googleanalytics']); ?>" /></td>
244
  </tr>
245
  <tr>
246
  <td><label for="key">Commercial License Key:</label></td>
247
+ <td colspan="3"><input type="text" name="key" id="key" value="<?php echo trim($fv_fp->conf['key']); ?>" /></td>
248
  </tr>
249
  <tr>
250
  <td><label for="logo">Logo:</label></td>
251
+ <td><input type="text" name="logo" id="logo" value="<?php echo trim($fv_fp->conf['logo']); ?>" /></td>
252
+ <td style="width: 5%"><input id="upload_image_button" class="upload_image_button button no-margin" type="button" value="Upload Image" alt="Select Logo" /></td>
253
+ <td style="width: 5%">
254
+ <select name="logoPosition">
255
+ <option value="bottom-left">Position</option>
256
+ <option <?php if( !isset($fv_fp->conf['logoPosition']) || $fv_fp->conf['logoPosition'] == 'bottom-left' ) echo "selected"; ?> value="bottom-left">Bottom-left</option>
257
+ <option <?php if( isset($fv_fp->conf['logoPosition']) && $fv_fp->conf['logoPosition'] == 'bottom-right' ) echo "selected"; ?> value="bottom-right">Bottom-right</option>
258
+ <option <?php if( isset($fv_fp->conf['logoPosition']) && $fv_fp->conf['logoPosition'] == 'top-left' ) echo "selected"; ?> value="top-left">Top-left</option>
259
+ <option <?php if( isset($fv_fp->conf['logoPosition']) && $fv_fp->conf['logoPosition'] == 'top-right' ) echo "selected"; ?> value="top-right">Top-right</option>
260
+ </select>
261
+ </td>
262
+ </tr>
263
+ <tr>
264
+ <td><label for="logo">Splash Image (<abbr title="Default which will be used for any player without its own splash image">?</abbr>):</label></td>
265
+ <td colspan="2"><input type="text" name="splash" id="splash" value="<?php if( isset($fv_fp->conf['splash']) ) echo trim($fv_fp->conf['splash']); ?>" /></td>
266
+ <td style="width: 5%"><input id="upload_image_button" class="upload_image_button button no-margin" type="button" value="Upload Image" alt="Select default Splash Screen" /></td>
267
  </tr>
 
 
 
268
  <tr>
269
  <td><label for="rtmp">Flash streaming server<br />(Amazon CloudFront domain) (<abbr title="Enter your default RTMP streaming server here">?</abbr>):</label></td>
270
+ <td colspan="3"><input type="text" name="rtmp" id="rtmp" value="<?php echo trim($fv_fp->conf['rtmp']); ?>" /></td>
271
  </tr>
272
  <tr>
273
  <td colspan="4">
274
+ <input type="submit" name="fv-wp-flowplayer-submit" class="button-primary" value="Save All Changes" />
275
  </td>
276
  </tr>
277
+ </table>
278
+ <script>
279
+ jQuery(document).ready(function($) {
280
+ var fv_flowplayer_uploader;
281
+ var fv_flowplayer_uploader_button;
282
+
283
+ $(document).on( 'click', '.upload_image_button', function(e) {
284
+ e.preventDefault();
285
+
286
+ fv_flowplayer_uploader_button = jQuery(this);
287
+ jQuery('.fv_flowplayer_target').removeClass('fv_flowplayer_target' );
288
+ fv_flowplayer_uploader_button.parents('tr').find('input[type=text]').addClass('fv_flowplayer_target' );
289
+
290
+ //If the uploader object has already been created, reopen the dialog
291
+ if (fv_flowplayer_uploader) {
292
+ fv_flowplayer_uploader.open();
293
+ return;
294
+ }
295
+
296
+ //Extend the wp.media object
297
+ fv_flowplayer_uploader = wp.media.frames.file_frame = wp.media({
298
+ title: 'Pick the image',
299
+ button: {
300
+ text: 'Choose'
301
+ },
302
+ multiple: false
303
+ });
304
+
305
+ fv_flowplayer_uploader.on('open', function() {
306
+ jQuery('.media-frame-title h1').text(fv_flowplayer_uploader_button.attr('alt'));
307
+ });
308
+
309
+ //When a file is selected, grab the URL and set it as the text field's value
310
+ fv_flowplayer_uploader.on('select', function() {
311
+ attachment = fv_flowplayer_uploader.state().get('selection').first().toJSON();
312
+
313
+ $('.fv_flowplayer_target').val(attachment.url);
314
+ $('.fv_flowplayer_target').removeClass('fv_flowplayer_target' );
315
+
316
+ /*if( attachment.type == 'video' ) {
317
+ if( typeof(attachment.width) != "undefined" && attachment.width > 0 ) {
318
+ $('#fv_wp_flowplayer_field_width').val(attachment.width);
319
+ }
320
+ if( typeof(attachment.height) != "undefined" && attachment.height > 0 ) {
321
+ $('#fv_wp_flowplayer_field_height').val(attachment.height);
322
+ }
323
+ if( typeof(attachment.fileLength) != "undefined" ) {
324
+ $('#fv_wp_flowplayer_file_info').show();
325
+ $('#fv_wp_flowplayer_file_duration').html(attachment.fileLength);
326
+ }
327
+ if( typeof(attachment.filesizeHumanReadable) != "undefined" ) {
328
+ $('#fv_wp_flowplayer_file_info').show();
329
+ $('#fv_wp_flowplayer_file_size').html(attachment.filesizeHumanReadable);
330
+ }
331
+
332
+ } else if( attachment.type == 'image' && typeof(fv_flowplayer_set_post_thumbnail_id) != "undefined" ) {
333
+ if( jQuery('#remove-post-thumbnail').length > 0 ){
334
+ return;
335
+ }
336
+ jQuery.post(ajaxurl, {
337
+ action:"set-post-thumbnail",
338
+ post_id: fv_flowplayer_set_post_thumbnail_id,
339
+ thumbnail_id: attachment.id,
340
+ _ajax_nonce: fv_flowplayer_set_post_thumbnail_nonce,
341
+ cookie: encodeURIComponent(document.cookie)
342
+ }, function(str){
343
+ var win = window.dialogArguments || opener || parent || top;
344
+ if ( str == '0' ) {
345
+ alert( setPostThumbnailL10n.error );
346
+ } else {
347
+ jQuery('#postimagediv .inside').html(str);
348
+ jQuery('#postimagediv .inside #plupload-upload-ui').hide();
349
+ }
350
+ } );
351
+
352
+ }*/
353
+
354
+ });
355
+
356
+ //Open the uploader dialog
357
+ fv_flowplayer_uploader.open();
358
+
359
+ });
360
+
361
+ });
362
+ </script>
363
+ <div class="clear"></div>
364
  <?php
365
  }
366
 
369
  ?>
370
  <table class="form-table">
371
  <tr>
372
+ <td colspan="4">
373
  <p>FV WordPress Flowplayer WordPress plugin is a free, easy-to-use, and complete solution for embedding <strong>MP4</strong>, <strong>WEBM</strong>, <strong>OGV</strong>, <strong>MOV</strong> and <strong>FLV</strong>. videos into your posts or pages. With MP4 videos, FV WordPress Flowplayer offers 98% coverage even on mobile devices.</p>
374
  </td>
375
  </tr>
381
  function fv_flowplayer_admin_integrations() {
382
  global $fv_fp;
383
  ?>
384
+ <p>Following options are suitable for web developers and programmers.</p>
385
+ <table class="form-table2">
386
  <tr>
387
+ <td class="first"><label for="cbox_compatibility">Colobox Compatibility (<abbr title="Use if your theme is using colorbox lightbox to show content and clones the HTML content into it.">?</abbr>):</label></td>
388
+ <td>
389
+ <input type="hidden" name="cbox_compatibility" value="false" />
390
+ <input type="checkbox" name="cbox_compatibility" id="cbox_compatibility" value="true" <?php if( isset($fv_fp->conf['cbox_compatibility']) && $fv_fp->conf['cbox_compatibility'] == 'true' ) echo 'checked="checked"'; ?> />
391
+ </td>
392
+ </tr>
393
+ <tr>
394
+ <td class="first"><label for="js-everywhere">Load FV Flowplayer JS everywhere (<abbr title="If you use some special JavaScript integration, you might prefer this option, otherwise it loads only if the shortcode is found.">?</abbr>):</label></td>
395
+ <td>
396
  <input type="hidden" name="js-everywhere" value="false" />
397
  <input type="checkbox" name="js-everywhere" id="js-everywhere" value="true" <?php if( isset($fv_fp->conf['js-everywhere']) && $fv_fp->conf['js-everywhere'] == 'true' ) echo 'checked="checked"'; ?> />
398
  </td>
399
  </tr>
400
+ <tr>
401
+ <td class="first"><label for="db_duration">Scan video length (<abbr title="Beta version! Turn on to enable video duration scanning. Turn off if you experience issues when saving posts.">?</abbr>):</label></td>
402
+ <td>
403
+ <input type="hidden" name="db_duration" value="false" />
404
+ <input type="checkbox" name="db_duration" id="db_duration" value="true" <?php if( isset($fv_fp->conf['db_duration']) && $fv_fp->conf['db_duration'] == 'true' ) echo 'checked="checked"'; ?> />
405
+ <?php
406
+ global $wpdb;
407
+ $iCount = $wpdb->get_var( "SELECT count(meta_id) FROM $wpdb->postmeta WHERE meta_key LIKE '_fv_flowplayer_%'" );
408
+ $iQueue = count(FV_Player_Checker::queue_get());
409
+ if( $iQueue && $aQueue = FV_Player_Checker::queue_get() ) {
410
+ $htmlQueue = "<a href='#' onclick='jQuery(this).siblings(\"span\").toggle(); return false'>$iQueue</a> <span style='display: none'>(";
411
+ foreach( $aQueue as $k => $i ) {
412
+ $htmlQueue .= "<a href='".get_edit_post_link($k)."'>$k</a> ";
413
+ }
414
+ $htmlQueue .= ") <a href='".site_url()."/wp-admin/options-general.php?page=fvplayer&fv_flowplayer_checker'>Scan now!</a></span>";
415
+ }
416
+ if( $iCount && $iQueue ) {
417
+ echo "Currently $iCount videos in database and $htmlQueue posts in queue.";
418
+ } else if( $iCount ) {
419
+ echo "Currently $iCount videos in database.";
420
+ } else if( $iQueue ) {
421
+ echo "Currently $htmlQueue posts in queue.";
422
+ }
423
+ ?>
424
+ </td>
425
+ </tr>
426
+ <tr>
427
+ <td class="first"><label for="css_disable">Disable saving of color settings into a static file (<abbr title="Normally the player CSS configuration is stored in wp-content/fv-player-custom/style-{blog_id}.css, you can disable this here.">?</abbr>):</label></td>
428
+ <td>
429
+ <input type="hidden" name="css_disable" value="false" />
430
+ <input type="checkbox" name="css_disable" id="css_disable" value="true" <?php if( isset($fv_fp->conf['css_disable']) && $fv_fp->conf['css_disable'] == 'true' ) echo 'checked="checked"'; ?> />
431
+ </td>
432
+ </tr>
433
  <!--<tr>
434
  <td style="width: 350px"><label for="optimizepress2">Handle OptimizePress 2 videos (<abbr title="Following attributes are not currently supported: margin, border">?</abbr>):</label></td>
435
+ <td>
436
  <input type="hidden" name="integrations[optimizepress2]" value="false" />
437
  <input type="checkbox" name="integrations[optimizepress2]" id="optimizepress2" value="true" <?php if( isset($fv_fp->conf['integrations']['optimizepress2']) && $fv_fp->conf['integrations']['optimizepress2'] == 'true' ) echo 'checked="checked"'; ?> />
438
  </td>
439
  </tr>
440
  <tr>
441
  <td><label for="wp_core_video">Handle Wordpress <code><small>[video]</small></code> shortcodes:</label></td>
442
+ <td>
443
  <input type="hidden" name="integrations[wp_core_video]" value="false" />
444
  <input type="checkbox" name="integrations[wp_core_video]" id="wp_core_video" value="true" <?php if( isset($fv_fp->conf['integrations']['wp_core_video']) && $fv_fp->conf['integrations']['wp_core_video'] == 'true' ) echo 'checked="checked"'; ?> />
445
  </td>
446
  </tr>-->
447
  <tr>
448
  <td colspan="4">
449
+ <input type="submit" name="fv-wp-flowplayer-submit" class="button-primary" value="Save All Changes" />
450
  </td>
451
  </tr>
452
  </table>
458
  global $fv_fp;
459
  ?>
460
  <p>Which features should be available in shortcode editor?</p>
461
+ <table class="form-table2">
462
  <tr>
463
+ <td class="first"><label for="allowuploads">Allow User Uploads:</label></td>
464
+ <td>
465
  <input type="hidden" name="allowuploads" value="false" />
466
  <input type="checkbox" name="allowuploads" id="allowuploads" value="true" <?php if( isset($fv_fp->conf['allowuploads']) && $fv_fp->conf['allowuploads'] == 'true' ) echo 'checked="checked"'; ?> />
467
  </td>
468
  </tr>
469
  <tr>
470
  <td><label for="interface[playlist]">Playlist:</label></td>
471
+ <td>
472
  <input type="hidden" name="interface[playlist]" value="false" />
473
  <input type="checkbox" name="interface[playlist]" id="interface[playlist]" value="true" <?php if( isset($fv_fp->conf['interface']['playlist']) && $fv_fp->conf['interface']['playlist'] == 'true' ) echo 'checked="checked"'; ?> />
474
  </td>
475
  </tr>
476
  <tr>
477
+ <td><label for="interface[playlist]">Playlist captions:</label></td>
478
+ <td>
479
  <input type="hidden" name="interface[playlist_captions]" value="false" />
480
  <input type="checkbox" name="interface[playlist_captions]" id="interface[playlist_captions]" value="true" <?php if( isset($fv_fp->conf['interface']['playlist_captions']) && $fv_fp->conf['interface']['playlist_captions'] == 'true' ) echo 'checked="checked"'; ?> />
481
  </td>
482
  </tr>
483
  <tr>
484
  <td><label for="interface[popup]">HTML popup:</label></td>
485
+ <td>
486
  <input type="hidden" name="interface[popup]" value="false" />
487
  <input type="checkbox" name="interface[popup]" id="interface[popup]" value="true" <?php if( isset($fv_fp->conf['interface']['popup']) && $fv_fp->conf['interface']['popup'] == 'true' ) echo 'checked="checked"'; ?> />
488
  </td>
489
  </tr>
490
  <tr>
491
  <td><label for="interface[redirect]">Redirect:</label></td>
492
+ <td>
493
  <input type="hidden" name="interface[redirect]" value="false" />
494
  <input type="checkbox" name="interface[redirect]" id="interface[redirect]" value="true" <?php if( isset($fv_fp->conf['interface']['redirect']) && $fv_fp->conf['interface']['redirect'] == 'true' ) echo 'checked="checked"'; ?> />
495
  </td>
496
  </tr>
497
  <tr>
498
+ <td class="first"><label for="interface[autoplay]">AutoPlay:</label></td>
499
+ <td>
500
  <input type="hidden" name="interface[autoplay]" value="false" />
501
  <input type="checkbox" name="interface[autoplay]" id="interface[autoplay]" value="true" <?php if( isset($fv_fp->conf['interface']['autoplay']) && $fv_fp->conf['interface']['autoplay'] == 'true' ) echo 'checked="checked"'; ?> />
502
  </td>
503
  </tr>
504
  <tr>
505
  <td><label for="interface[loop]">Loop:</label></td>
506
+ <td>
507
  <input type="hidden" name="interface[loop]" value="false" />
508
  <input type="checkbox" name="interface[loop]" id="interface[loop]" value="true" <?php if( isset($fv_fp->conf['interface']['loop']) && $fv_fp->conf['interface']['loop'] == 'true' ) echo 'checked="checked"'; ?> />
509
  </td>
510
  </tr>
511
  <tr>
512
  <td><label for="interface[splashend]">Splash end:</label></td>
513
+ <td>
514
  <input type="hidden" name="interface[splashend]" value="false" />
515
  <input type="checkbox" name="interface[splashend]" id="interface[splashend]" value="true" <?php if( isset($fv_fp->conf['interface']['splashend']) && $fv_fp->conf['interface']['splashend'] == 'true' ) echo 'checked="checked"'; ?> />
516
  </td>
517
  </tr>
518
  <tr>
519
  <td><label for="interface[embed]">Embed:</label></td>
520
+ <td>
521
  <input type="hidden" name="interface[embed]" value="false" />
522
  <input type="checkbox" name="interface[embed]" id="interface[embed]" value="true" <?php if( isset($fv_fp->conf['interface']['embed']) && $fv_fp->conf['interface']['embed'] == 'true' ) echo 'checked="checked"'; ?> />
523
  </td>
524
  </tr>
525
  <tr>
526
  <td><label for="interface[subtitles]">Subtitles:</label></td>
527
+ <td>
528
  <input type="hidden" name="interface[subtitles]" value="false" />
529
  <input type="checkbox" name="interface[subtitles]" id="interface[subtitles]" value="true" <?php if( isset($fv_fp->conf['interface']['subtitles']) && $fv_fp->conf['interface']['subtitles'] == 'true' ) echo 'checked="checked"'; ?> />
530
  </td>
531
  </tr>
532
  <tr>
533
  <td><label for="interface[ads]">Ads:</label></td>
534
+ <td>
535
  <input type="hidden" name="interface[ads]" value="false" />
536
  <input type="checkbox" name="interface[ads]" id="interface[ads]" value="true" <?php if( isset($fv_fp->conf['interface']['ads']) && $fv_fp->conf['interface']['ads'] == 'true' ) echo 'checked="checked"'; ?> />
537
  </td>
538
  </tr>
539
  <tr>
540
  <td><label for="interface[mobile]">Mobile video:</label></td>
541
+ <td>
542
  <input type="hidden" name="interface[mobile]" value="false" />
543
  <input type="checkbox" name="interface[mobile]" id="interface[mobile]" value="true" <?php if( isset($fv_fp->conf['interface']['mobile']) && $fv_fp->conf['interface']['mobile'] == 'true' ) echo 'checked="checked"'; ?> />
544
  </td>
545
  </tr>
546
  <tr>
547
  <td><label for="interface[align]">Align:</label></td>
548
+ <td>
549
  <input type="hidden" name="interface[align]" value="false" />
550
  <input type="checkbox" name="interface[align]" id="interface[align]" value="true" <?php if( isset($fv_fp->conf['interface']['align']) && $fv_fp->conf['interface']['align'] == 'true' ) echo 'checked="checked"'; ?> />
551
  </td>
552
+ </tr>
553
+ <tr>
554
+ <td><label for="interface[controlbar]">Controlbar: </label></td>
555
+ <td>
556
+ <input type="hidden" name="interface[controlbar]" value="false" />
557
+ <input type="checkbox" name="interface[controlbar]" id="interface[controlbar]" value="true" <?php if( isset($fv_fp->conf['interface']['controlbar']) && $fv_fp->conf['interface']['controlbar'] == 'true' ) echo 'checked="checked"'; ?> />
558
+ </td>
559
+ </tr>
560
+ <tr>
561
+ <td><label for="interface[live]">Live stream: </label></td>
562
+ <td>
563
+ <input type="hidden" name="interface[live]" value="false" />
564
+ <input type="checkbox" name="interface[live]" id="interface[live]" value="true" <?php if( isset($fv_fp->conf['interface']['live']) && $fv_fp->conf['interface']['live'] == 'true' ) echo 'checked="checked"'; ?> />
565
+ </td>
566
+ </tr>
567
  <tr>
568
  <td colspan="4">
569
+ <input type="submit" name="fv-wp-flowplayer-submit" class="button-primary" value="Save All Changes" />
570
  </td>
571
  </tr>
572
  </table>
586
  <?php else : ?>
587
  <p><a href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/download">Purchase FV Flowplayer license</a> to enable Pro features!</p>
588
  <?php endif; ?>
589
+ <table class="form-table2">
590
  <tr>
591
+ <td><label>Advanced Vimeo embeding:</label></td>
592
  <td>
593
  <p class="description">
594
  <input type="checkbox" checked="checked" disabled="true" />
597
  </td>
598
  </tr>
599
  <tr>
600
+ <td><label>Enable video lightbox:</label></td>
601
  <td>
602
  <p class="description">
603
  <input type="checkbox" checked="checked" disabled="true" />
606
  </td>
607
  </tr>
608
  <tr>
609
+ <td><label>Enable quality switching:</label></td>
610
+ <td>
611
+ <p class="description">
612
+ <input type="checkbox" checked="checked" disabled="true" />
613
+ Upload your videos in multiple quality for best user experience with Youtube-like quality switching!
614
+ </p>
615
+ </td>
616
+ </tr>
617
+ <tr>
618
+ <td><label>Use video lightbox for images as well:</label></td>
619
  <td>
620
  <p class="description">
621
  <input type="checkbox" disabled="true" />
624
  </td>
625
  </tr>
626
  <tr>
627
+ <td><label>Autoplay just once:</label></td>
628
  <td>
629
  <p class="description">
630
  <input type="checkbox" disabled="true" />
634
  </tr>
635
  </table>
636
  <p>Upcoming pro features:</p>
637
+ <table class="form-table2">
638
  <tr>
639
+ <td><label>Advanced Youtube embeding:</label></td>
640
  <td>
641
  <p class="description">
642
  <input type="checkbox" checked="checked" disabled="true" />
645
  </td>
646
  </tr>
647
  <tr>
648
+ <td><label>Enable PayWall:</label></td>
649
  <td>
650
  <p class="description">
651
  <input type="checkbox" checked="checked" disabled="true" />
654
  </td>
655
  </tr>
656
  <tr>
657
+ <td><label>Amazon CloudFront protected content:</label></td>
658
  <td>
659
  <p class="description">
660
  <input type="checkbox" checked="checked" disabled="true" />
670
  function fv_flowplayer_admin_skin() {
671
  global $fv_fp;
672
  ?>
673
+ <div class="flowplayer-wrapper">
674
+ <?php echo do_shortcode('[fvplayer src="http://foliovision.com/videos/example.mp4" splash="http://foliovision.com/videos/example.jpg" autoplay="false"]'); ?>
675
+ </div>
676
+
677
+ <table class="form-table2 flowplayer-settings">
678
+ <tr>
679
+ <td><label for="bufferColor">Buffer</label></td>
680
+ <td><input class="color small" id="bufferColor" name="bufferColor" type="text" value="<?php echo $fv_fp->conf['bufferColor']; ?>" /></td>
681
+ <td><label for="player-position">Player position</label> (<abbr title='You can still use align="right" where needed'>?</abbr>)</td>
682
+ <td>
683
+ <select id="player-position" name="player-position">
684
+ <option value=""<?php if( $fv_fp->conf['player-position'] == "" ) echo ' selected="selected"'; ?>>Centered</option>
685
+ <option value="left"<?php if( $fv_fp->conf['player-position'] == 'left' ) echo ' selected="selected"'; ?>>Left (no text-wrap)</option>
686
+ </select>
687
+ </td>
688
+ </tr>
689
+ <tr>
690
+ <td><label for="canvas">Canvas</label></td>
691
+ <td><input class="color small" id="canvas" name="canvas" type="text" value="<?php echo $fv_fp->conf['canvas']; ?>" /></td>
692
+ <td><label for="marginBottom">Bottom Margin</label></td>
693
+ <td><input class="small" id="marginBottom" name="marginBottom" title="Enter value in pixels" type="text" value="<?php echo $fv_fp->conf['marginBottom']; ?>" /></td>
694
+ </tr>
695
+ <tr>
696
+ <td><label for="backgroundColor">Controlbar</label></td>
697
+ <td><input class="color small" id="backgroundColor" name="backgroundColor" type="text" value="<?php echo $fv_fp->conf['backgroundColor']; ?>" /></td>
698
+ <td class="second-column"><label for="disableembedding">Disable Embed Button</label></td>
699
+ <td><?php fv_flowplayer_admin_checkbox('disableembedding'); ?></td>
700
+ </tr>
701
+ <tr>
702
+ <td><label for="progressColor">Progress</label></td>
703
+ <td><input class="color small" id="progressColor" name="progressColor" type="text" value="<?php echo $fv_fp->conf['progressColor']; ?>" /></td>
704
+ <td><label for="disablesharing">Disable Sharing</label></td>
705
+ <td><?php fv_flowplayer_admin_checkbox('disablesharing'); ?></td>
706
+ </tr>
707
+ <tr>
708
+ <td><label for="sliderColor">Sliders</label></td>
709
+ <td><input class="color small" id="sliderColor" name="sliderColor" type="text" value="<?php echo $fv_fp->conf['sliderColor']; ?>" /></td>
710
+ <td><label for="allowfullscreen">Enable Fullscreen</label></td>
711
+ <td><?php fv_flowplayer_admin_checkbox('allowfullscreen'); ?></td>
712
+ </tr>
713
+ <tr>
714
+ <td><label for="timeColor">Time</label></td>
715
+ <td><input class="color small" id="timeColor" name="timeColor" type="text" value="<?php echo $fv_fp->conf['timeColor']; ?>" /></td>
716
+ <!--<td><label for="ui_fixed_controlbar">Fixed Controlbar</label></td>
717
+ <td><?php fv_flowplayer_admin_checkbox('ui_fixed_controlbar'); ?></td>-->
718
+ <td><label for="font-face">Font Face</label></td>
719
+ <td>
720
+ <select id="font-face" name="font-face">
721
+ <option value="&quot;Courier New&quot;, Courier, monospace"<?php if( $fv_fp->conf['font-face'] == "\"Courier New\", Courier, monospace" ) echo ' selected="selected"'; ?>>Courier New</option>
722
+ <option value="Tahoma, Geneva, sans-serif"<?php if( $fv_fp->conf['font-face'] == "Tahoma, Geneva, sans-serif" ) echo ' selected="selected"'; ?>>Tahoma, Geneva</option>
723
+ <option value="inherit"<?php if( $fv_fp->conf['font-face'] == 'inherit' ) echo ' selected="selected"'; ?>>(inherit from template)</option>
724
+ </select>
725
+ </td>
726
+ </tr>
727
+ <tr>
728
+ <td><label for="timeline">Timeline</label></td>
729
+ <td><input class="color small" id="timelineColor" name="timelineColor" type="text" value="<?php echo $fv_fp->conf['timelineColor']; ?>" /></td>
730
+ <td><label for="subtitleSize">Subitle Font Size</label></td>
731
+ <td><input class="small" id="subtitleSize" name="subtitleSize" title="Enter value in pixels" type="text" value="<?php echo ( isset($fv_fp->conf['subtitleSize']) ) ? intval($fv_fp->conf['subtitleSize']) : '16'; ?>" /></td>
732
+ </tr>
733
+ <tr>
734
+ <td><label for="durationColor">Total time</label></td>
735
+ <td><input class="color small" id="durationColor" name="durationColor" type="text" value="<?php echo $fv_fp->conf['durationColor']; ?>" /></td>
736
+ <td><label for="ui_play_button">Play Button</label></td>
737
+ <td colspan="2"><?php fv_flowplayer_admin_checkbox('ui_play_button'); ?></td>
738
+ <!--<td><label for="db_duration">Show Playlist Duration (<abbr title="Beta version! Turn on to enable video duration scanning. Turn off if you experience issues when saving posts.">?!</abbr>)</label></td>
739
+ <td><?php fv_flowplayer_admin_checkbox('db_duration'); ?></td>-->
740
+ </tr>
741
+ <!--<tr>
742
+ <td><label for="buttonColor">Buttons</label></td>
743
+ <td><input class="color small" type="text" name="buttonColor" id="buttonColor" value="<?php //echo $fv_fp->conf['buttonColor']; ?>" /></td>
744
+ <td><label for="buttonOverColor">Mouseover</label></td>
745
+ <td><input class="color small" type="text" name="buttonOverColor" id="buttonOverColor" value="<?php //echo $fv_fp->conf['buttonOverColor']; ?>" /></td>
746
+ <tr>-->
747
+ <tr>
748
+ <td><label for="durationColor">Border color</label></td>
749
+ <td><input class="color small" id="borderColor" name="borderColor" type="text" value="<?php echo $fv_fp->conf['borderColor']; ?>" /></td>
750
+ <td><label for="volume">Default Volume</label></td>
751
+ <td><input class="small" id="volume" name="volume" title="Enter number between 0 and 1, like 0.5" type="text" value="<?php echo $fv_fp->conf['volume']; ?>" /></td>
752
+ </tr>
753
+ <tr>
754
+ <td><label for="hasBorder">Border</label></td>
755
+ <td><?php fv_flowplayer_admin_checkbox('hasBorder'); ?></td>
756
+ <td colspan="2"></td>
757
+ </tr>
758
+ <tr>
759
+ <td colspan="4">
760
+ <input type="submit" name="fv-wp-flowplayer-submit" class="button-primary" value="Save All Changes" />
761
+ </td>
762
+ </tr>
763
+ </table>
764
+ <div style="clear: both"></div>
765
  <?php
766
  }
767
 
770
  ?>
771
  <table class="form-table">
772
  <tr>
773
+ <td colspan="4">
774
+ <div class="column">
775
  <div class="icon32" id="icon-users"><br></div>
776
  <p>Illustrated user guides:</p>
777
+ <div class="clear"></div>
778
  <ul>
779
  <li><a target="_blank" href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/user-guide">Inserting videos</a>
780
  <li><a target="_blank" href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/user-guide#license">License key and custom logo</a>
785
  <li><a target="_blank" href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/secure-amazon-s3-guide">Amazon S3 secure content guide</a></li>
786
  </ul>
787
  </div>
788
+ <div class="column">
789
  <div class="icon32" id="icon-tools"><br></div>
790
  <p>Troubleshooting:</p>
791
+ <div class="clear"></div>
792
  <ul>
793
  <li><a target="_blank" href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/installation">Automated checks</a></li>
794
  <li><a target="_blank" href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/encoding">Video encoding tips</a></li>
799
  <li><a target="_blank" href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/installation/downgrading">Downgrading the plugin</a></li>
800
  </ul>
801
  </div>
802
+ <div class="clear"></div>
803
  <!--<p>
804
  To embed video "example.mp4", simply include the following code inside any post or page:
805
  <code>[fvplayer src=example.mp4]</code>
859
 
860
  ?>
861
 
 
 
 
 
 
 
862
  <div class="wrap">
863
  <div style="position: absolute; margin-top: 10px; right: 10px;">
864
  <a href="https://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer" target="_blank" title="Documentation"><img alt="visit foliovision" src="http://foliovision.com/shared/fv-logo.png" /></a>
871
  <input type="button" class="button" onclick="fv_flowplayer_ajax_check('fv_wp_flowplayer_check_template'); return false" value="Check template" />
872
  <input type="button" class="button" onclick="fv_flowplayer_ajax_check('fv_wp_flowplayer_check_files')" value="Check videos" />
873
  <img class="fv_wp_flowplayer_check_template-spin" style="display: none; " src="<?php echo site_url(); ?>/wp-includes/images/wpspin.gif" width="16" height="16" />
874
+ <img class="fv_wp_flowplayer_check_files-spin" style="display: none; " src="<?php echo site_url(); ?>/wp-includes/images/wpspin.gif" width="16" height="16" />
875
+ <?php do_action('fv_flowplayer_admin_buttons_after'); ?>
876
  </p>
877
  <div id="fv_flowplayer_admin_notices">
878
  </div>
879
+ <?php
880
+
881
+ do_action('fv_player_settings_pre');
882
+
883
+ if( isset($_GET['fv_flowplayer_checker'] ) ) {
884
+ do_action('fv_flowplayer_checker_event');
885
+ }
886
 
887
  if( flowplayer::is_licensed() ) {
888
  $aCheck = get_transient( 'fv_flowplayer_license' );
905
  endif;
906
 
907
 
908
+ if( preg_match( '!^\$\d+!', $fv_fp->conf['key'] ) || apply_filters('fv_player_skip_ads',false) ) : ?>
909
  <?php else : ?>
910
  <div id="fv_flowplayer_ad">
911
  <div class="text-part">
916
  <li>Or remove the logo completely</li>
917
  <li>The best video plugin for Wordpress</li>
918
  </ul>
919
+ <a href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/download" class="red-button"><strong>Christmas sale!</strong><br />All Licenses 20% Off</a></p>
920
  </div>
921
  <div class="graphic-part">
922
  <a href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/buy">
924
  </div>
925
  </div>
926
  <?php endif; ?>
 
 
 
927
 
928
  <form id="wpfp_options" method="post" action="">
929
  <div id="dashboard-widgets" class="metabox-holder columns-1">
930
+ <div id='postbox-container-1' class='postbox-container'>
931
  <?php
932
  do_meta_boxes('fv_flowplayer_settings', 'normal', false );
933
  wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
view/backend-head.php DELETED
@@ -1,27 +0,0 @@
1
- <?php
2
- /* FV Wordpress Flowplayer - HTML5 video player with Flash fallback
3
- Copyright (C) 2013 Foliovision
4
-
5
- This program is free software: you can redistribute it and/or modify
6
- it under the terms of the GNU General Public License as published by
7
- the Free Software Foundation, either version 3 of the License, or
8
- (at your option) any later version.
9
-
10
- This program is distributed in the hope that it will be useful,
11
- but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- GNU General Public License for more details.
14
-
15
- You should have received a copy of the GNU General Public License
16
- along with this program. If not, see <http://www.gnu.org/licenses/>.
17
- */
18
-
19
- /**
20
- * Displays metatags for administrator backend.
21
- */
22
-
23
- global $fv_wp_flowplayer_ver;
24
- ?>
25
-
26
- <script type="text/javascript" src="<?php echo FV_FP_RELATIVE_PATH; ?>/js/jscolor/jscolor.js"></script>
27
- <link rel="stylesheet" type="text/css" href="<?php echo flowplayer::get_plugin_url().'/css/license.css'; ?>?ver=<?php echo $fv_wp_flowplayer_ver; ?>" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
view/colours.php DELETED
@@ -1,70 +0,0 @@
1
- <?php
2
- /* FV Wordpress Flowplayer - HTML5 video player with Flash fallback
3
- Copyright (C) 2013 Foliovision
4
-
5
- This program is free software: you can redistribute it and/or modify
6
- it under the terms of the GNU General Public License as published by
7
- the Free Software Foundation, either version 3 of the License, or
8
- (at your option) any later version.
9
-
10
- This program is distributed in the hope that it will be useful,
11
- but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- GNU General Public License for more details.
14
-
15
- You should have received a copy of the GNU General Public License
16
- along with this program. If not, see <http://www.gnu.org/licenses/>.
17
- */
18
-
19
- /**
20
- * Displays input elements for color settings form.
21
- */
22
- ?>
23
- <tr>
24
- <td></td>
25
- <td><input type="hidden" name="tgt" id="tgt" value="backgroundColor" /></td>
26
- </tr>
27
- <tr>
28
- <td><label for="backgroundColor">controlbar</label></td>
29
- <td style="text-align:right"><input class="color" type="text" size="6" name="backgroundColor" id="backgroundColor" value="<?php echo $fv_fp->conf['backgroundColor']; ?>" /></td>
30
- <td style="padding-left:20px;"><label for="timeline">timeline</label></td>
31
- <td style="text-align:right"><input class="color" type="text" size="6" name="timelineColor" id="timelineColor" value="<?php echo $fv_fp->conf['timelineColor']; ?>" /></td>
32
- </tr>
33
- <tr>
34
- <td><label for="canvas">canvas</label></td>
35
- <td style="text-align:right"><input class="color" type="text" size="6" name="canvas" id="canvas" value="<?php echo $fv_fp->conf['canvas']; ?>" /></td>
36
- <td style="padding-left:20px;"><label for="progressColor">progress</label></td>
37
- <td style="text-align:right"><input class="color" type="text" size="6" name="progressColor" id="progressColor" value="<?php echo $fv_fp->conf['progressColor']; ?>" /></td>
38
-
39
- </tr>
40
- <tr>
41
- <td><label for="sliderColor">sliders</label></td>
42
- <td style="text-align:right"><input class="color" type="text" size="6" name="sliderColor" id="sliderColor" value="<?php echo $fv_fp->conf['sliderColor']; ?>" /></td>
43
- <td style="padding-left:20px;"><label for="bufferColor">buffer</label></td>
44
- <td style="text-align:right"><input class="color" type="text" size="6" name="bufferColor" id="bufferColor" value="<?php echo $fv_fp->conf['bufferColor']; ?>" /></td>
45
-
46
- </tr>
47
- <tr>
48
- <td><label for="buttonColor">buttons</label></td>
49
- <td style="text-align:right"><input class="color" type="text" size="6" name="buttonColor" id="buttonColor" value="<?php echo $fv_fp->conf['buttonColor']; ?>" /></td>
50
- <td style="padding-left:20px;"><label for="timeColor">time</label></td>
51
- <td style="text-align:right"><input class="color" type="text" size="6" name="timeColor" id="timeColor" value="<?php echo $fv_fp->conf['timeColor']; ?>" /></td>
52
- </tr>
53
- <tr>
54
- <td><label for="buttonOverColor">mouseover</label></td>
55
- <td style="text-align:right"><input class="color" type="text" size="6" name="buttonOverColor" id="buttonOverColor" value="<?php echo $fv_fp->conf['buttonOverColor']; ?>" /></td>
56
- <td style="padding-left:20px;"><label for="durationColor">total time</label></td>
57
- <td style="text-align:right"><input class="color" type="text" size="6" name="durationColor" id="durationColor" value="<?php echo $fv_fp->conf['durationColor']; ?>" /></td>
58
- </tr>
59
- <tr>
60
- <td><label for="hasBorder">border</label></td>
61
- <td style="text-align:right"><?php fv_flowplayer_admin_checkbox('hasBorder'); ?></td>
62
- <td style="padding-left:20px;"><label for="durationColor">border color</label></td>
63
- <td style="text-align:right"><input class="color" type="text" size="6" name="borderColor" id="borderColor" value="<?php echo $fv_fp->conf['borderColor']; ?>" /></td>
64
- </tr>
65
- <tr>
66
- <td><label for="buttonOverColor">ad text</label></td>
67
- <td style="text-align:right"><input class="color" type="text" size="6" name="adTextColor" id="adTextColor" value="<?php echo $fv_fp->conf['adTextColor']; ?>" /></td>
68
- <td style="padding-left:20px;"><label for="durationColor">ad links</label></td>
69
- <td style="text-align:right"><input class="color" type="text" size="6" name="adLinksColor" id="adLinksColor" value="<?php echo $fv_fp->conf['adLinksColor']; ?>" /></td>
70
- </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
view/frontend-head.php CHANGED
@@ -16,17 +16,13 @@
16
  along with this program. If not, see <http://www.gnu.org/licenses/>.
17
  */
18
 
19
- global $fv_wp_flowplayer_ver;
20
 
21
- if( is_admin() ) : ?>
22
- <script type="text/javascript" src="<?php echo FV_FP_RELATIVE_PATH ?>/flowplayer/fv-flowplayer.min.js?ver=<?php echo $fv_wp_flowplayer_ver; ?>"></script>
23
- <?php endif; ?>
24
 
25
- <?php echo $this->css_get(); ?>
26
-
27
- <?php if( current_user_can('manage_options') ) : ?>
28
  <link rel="stylesheet" href="<?php echo FV_FP_RELATIVE_PATH; ?>/css/admin.css?ver=<?php echo $fv_wp_flowplayer_ver; ?>" type="text/css" media="screen" />
29
  <style type="text/css">
30
- .fv-wp-flowplayer-notice-small { color: <?php echo trim($this->conf['timeColor']); ?> !important; }
31
  </style>
32
  <?php endif;
16
  along with this program. If not, see <http://www.gnu.org/licenses/>.
17
  */
18
 
19
+ global $fv_wp_flowplayer_ver, $fv_fp;
20
 
21
+ echo $fv_fp->css_get();
 
 
22
 
23
+ if( current_user_can('manage_options') ) : ?>
 
 
24
  <link rel="stylesheet" href="<?php echo FV_FP_RELATIVE_PATH; ?>/css/admin.css?ver=<?php echo $fv_wp_flowplayer_ver; ?>" type="text/css" media="screen" />
25
  <style type="text/css">
26
+ .fv-wp-flowplayer-notice-small { color: <?php echo trim($fv_fp->conf['timeColor']); ?> !important; }
27
  </style>
28
  <?php endif;
view/wizard.php CHANGED
@@ -38,26 +38,30 @@
38
  .fv_wp_flowplayer_playlist_remove { display: none; }
39
  #fv-flowplayer-playlist table { border-bottom: 1px #eee solid; }
40
  #fv-flowplayer-playlist table input, #fv-flowplayer-playlist table input.with-button { width: 93%; }
41
- #fv-flowplayer-playlist table:first-child input.with-button { width: 70%; }
42
  #fv-flowplayer-playlist table tr.video-size { display: none; }
43
  #fv-flowplayer-playlist table tr#fv_wp_flowplayer_add_format_wrapper { display: none; }
44
  #fv-flowplayer-playlist table tr#fv_wp_flowplayer_file_info { display: none; }
45
  #fv-flowplayer-playlist table .fv_wp_flowplayer_field_rtmp { visibility: hidden; }
46
  #fv-flowplayer-playlist table .fv_wp_flowplayer_field_rtmp_wrapper th { visibility: hidden; }
47
- #fv-flowplayer-playlist table .button { display: none; }
48
  #fv-flowplayer-playlist table:first-child tr.video-size { display: table-row; }
49
  #fv-flowplayer-playlist table:first-child tr#fv_wp_flowplayer_add_format_wrapper { display: table-row; }
50
  #fv-flowplayer-playlist table:first-child tr#fv_wp_flowplayer_file_info { display: none; }
51
  #fv-flowplayer-playlist table:first-child .fv_wp_flowplayer_field_rtmp { visibility: visible; }
52
  #fv-flowplayer-playlist table:first-child .fv_wp_flowplayer_field_rtmp_wrapper th { visibility: visible; }
53
- #fv-flowplayer-playlist table:first-child .button { display: inline-block; }
54
  /*#colorbox, #cboxOverlay, #cboxWrapper{ z-index: 100000; }*/
55
  </style>
56
 
57
  <script>
58
  var fvwpflowplayer_helper_tag = '<?php echo $fv_flowplayer_helper_tag ?>';
59
- var fv_wp_flowplayer_re_edit = /\[[^\]]*?<<?php echo $fv_flowplayer_helper_tag; ?>[^>]*?rel="FCKFVWPFlowplayerPlaceholder"[^>]*?>.*?<\/<?php echo $fv_flowplayer_helper_tag; ?>>[^\]]*?\]/mi;
60
  var fv_wp_flowplayer_re_insert = /<<?php echo $fv_flowplayer_helper_tag; ?>[^>]*?rel="FCKFVWPFlowplayerPlaceholder"[^>]*?>.*?<\/<?php echo $fv_flowplayer_helper_tag; ?>>/gi;
 
 
 
 
61
  </script>
62
 
63
  <div style="display: none">
@@ -73,7 +77,7 @@ var fv_wp_flowplayer_re_insert = /<<?php echo $fv_flowplayer_helper_tag; ?>[^>]*
73
  </th>
74
  <td colspan="2" class="field"><input type="text" class="text<?php echo $upload_field_class; ?>" id="fv_wp_flowplayer_field_src" name="fv_wp_flowplayer_field_src" value="" />
75
  <?php if ($allow_uploads=="true") { ?>
76
- <a class="thickbox button add_media" href="media-upload.php?post_id=<?php echo $post_id; ?>&amp;type=fvplayer_video&amp;TB_iframe=true&amp;width=500&amp;height=300"><span class="wp-media-buttons-icon"></span> Add Video</a>
77
  <?php }; //allow uplads video ?></td>
78
  </tr>
79
 
@@ -81,7 +85,7 @@ var fv_wp_flowplayer_re_insert = /<<?php echo $fv_flowplayer_helper_tag; ?>[^>]*
81
  <th></th>
82
  <td>
83
  Video Duration: <span id="fv_wp_flowplayer_file_duration"></span><br />
84
- File size: <span id="fv_wp_flowplayer_file_size"></span>MB
85
  </td>
86
  </tr>
87
  <tr class="video-size"><th></th>
@@ -92,7 +96,7 @@ var fv_wp_flowplayer_re_insert = /<<?php echo $fv_flowplayer_helper_tag; ?>[^>]*
92
  <th scope="row" class="label" style="width: 19%"><label for="fv_wp_flowplayer_field_src_1" class="alignright">Video <small>(another format)</small></label></th>
93
  <td colspan="2" class="field"><input type="text" class="text<?php echo $upload_field_class; ?>" id="fv_wp_flowplayer_field_src_1" name="fv_wp_flowplayer_field_src_1" value=""/>
94
  <?php if ($allow_uploads=="true") { ?>
95
- <a class="thickbox button add_media" href="media-upload.php?post_id=<?php echo $post_id; ?>&amp;type=fvplayer_video_1&amp;TB_iframe=true&amp;width=500&amp;height=300"><span class="wp-media-buttons-icon"></span> Add Video</a>
96
  <?php }; //allow uplads video ?>
97
  </td>
98
  </tr>
@@ -101,7 +105,7 @@ var fv_wp_flowplayer_re_insert = /<<?php echo $fv_flowplayer_helper_tag; ?>[^>]*
101
  <th scope="row" class="label" style="width: 19%"><label for="fv_wp_flowplayer_field_src_2" class="alignright">Video <small>(another format)</small></label></th>
102
  <td colspan="2" class="field"><input type="text" class="text<?php echo $upload_field_class; ?>" id="fv_wp_flowplayer_field_src_2" name="fv_wp_flowplayer_field_src_2" value=""/>
103
  <?php if ($allow_uploads=="true") { ?>
104
- <a class="thickbox button add_media" href="media-upload.php?post_id=<?php echo $post_id; ?>&amp;type=fvplayer_video_2&amp;TB_iframe=true&amp;width=500&amp;height=300"><span class="wp-media-buttons-icon"></span> Add Video</a>
105
  <?php }; //allow uplads video ?>
106
  </td>
107
  </tr>
@@ -123,9 +127,9 @@ var fv_wp_flowplayer_re_insert = /<<?php echo $fv_flowplayer_helper_tag; ?>[^>]*
123
 
124
  <tr<?php if( $fv_flowplayer_conf["interface"]["mobile"] !== 'true' ) echo ' style="display: none"'; ?>>
125
  <th scope="row" class="label"><label for="fv_wp_flowplayer_field_mobile" class="alignright">Mobile Video*</label></th>
126
- <td class="field" colspan="2"><input type="text" class="text<?php echo $upload_field_class; ?>" id="fv_wp_flowplayer_field_mobile" name="fv_wp_flowplayer_field_mobile" value=""/>
127
  <?php if ($allow_uploads=='true') { ?>
128
- <a class="thickbox button add_media" href="media-upload.php?post_id=<?php echo $post_id; ?>&amp;type=fvplayer_mobile&amp;TB_iframe=true&amp;width=500&amp;height=300"><span class="wp-media-buttons-icon"></span> Add Video</a>
129
  <?php }; //allow uploads splash image ?></td>
130
  </tr>
131
 
@@ -133,7 +137,7 @@ var fv_wp_flowplayer_re_insert = /<<?php echo $fv_flowplayer_helper_tag; ?>[^>]*
133
  <th scope="row" class="label"><label for="fv_wp_flowplayer_field_splash" class="alignright">Splash Image</label></th>
134
  <td class="field" colspan="2"><input type="text" class="text fv_wp_flowplayer_field_splash<?php echo $upload_field_class; ?>" id="fv_wp_flowplayer_field_splash" name="fv_wp_flowplayer_field_splash" value=""/>
135
  <?php if ($allow_uploads=='true') { ?>
136
- <a class="thickbox button add_media" href="media-upload.php?post_id=<?php echo $post_id; ?>&amp;type=fvplayer_splash&amp;TB_iframe=true&amp;width=500&amp;height=300"><span class="wp-media-buttons-icon"></span> Add Image</a>
137
  <?php }; //allow uploads splash image ?></td>
138
  </tr>
139
 
@@ -141,11 +145,11 @@ var fv_wp_flowplayer_re_insert = /<<?php echo $fv_flowplayer_helper_tag; ?>[^>]*
141
  <th scope="row" class="label"><label for="fv_wp_flowplayer_field_subtitles" class="alignright">Subtitles</label></th>
142
  <td class="field" colspan="2"><input type="text" class="text<?php echo $upload_field_class; ?>" id="fv_wp_flowplayer_field_subtitles" name="fv_wp_flowplayer_field_subtitles" value=""/>
143
  <?php if ($allow_uploads=='true') { ?>
144
- <a class="thickbox button add_media" href="media-upload.php?post_id=<?php echo $post_id; ?>&amp;type=fvplayer_subtitles&amp;TB_iframe=true&amp;width=500&amp;height=300"><span class="wp-media-buttons-icon"></span> Add Subtitles</a>
145
  <?php }; //allow uploads splash image ?></td>
146
  </tr>
147
 
148
- <tr class="<?php if( isset($fv_flowplayer_conf["interface"]["playlist_captions"]) && $fv_flowplayer_conf["interface"]["playlist_captions"] == 'true' ) echo 'playlist_caption'; ?>" style="display: none">
149
  <th scope="row" class="label"><label for="fv_wp_flowplayer_field_caption" class="alignright">Caption</label></th>
150
  <td class="field" colspan="2"><input type="text" class="text<?php echo $upload_field_class; ?>" id="fv_wp_flowplayer_field_caption" name="fv_wp_flowplayer_field_caption" value=""/></td>
151
  </tr>
@@ -163,6 +167,7 @@ var fv_wp_flowplayer_re_insert = /<<?php echo $fv_flowplayer_helper_tag; ?>[^>]*
163
  <table width="100%">
164
  <tbody>
165
  <?php
 
166
  foreach( $fv_flowplayer_conf["interface"] AS $option ) {
167
  if( $option == 'true' ) {
168
  $show_additonal_features = true;
@@ -237,6 +242,20 @@ var fv_wp_flowplayer_re_insert = /<<?php echo $fv_flowplayer_helper_tag; ?>[^>]*
237
  </select>
238
  </td>
239
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
240
  <?php do_action( 'fv_flowplayer_shortcode_editor_after' ); ?>
241
  <tr>
242
  <th scope="row" class="label"></th>
38
  .fv_wp_flowplayer_playlist_remove { display: none; }
39
  #fv-flowplayer-playlist table { border-bottom: 1px #eee solid; }
40
  #fv-flowplayer-playlist table input, #fv-flowplayer-playlist table input.with-button { width: 93%; }
41
+ #fv-flowplayer-playlist table/*:first-child*/ input.with-button { width: 70%; }
42
  #fv-flowplayer-playlist table tr.video-size { display: none; }
43
  #fv-flowplayer-playlist table tr#fv_wp_flowplayer_add_format_wrapper { display: none; }
44
  #fv-flowplayer-playlist table tr#fv_wp_flowplayer_file_info { display: none; }
45
  #fv-flowplayer-playlist table .fv_wp_flowplayer_field_rtmp { visibility: hidden; }
46
  #fv-flowplayer-playlist table .fv_wp_flowplayer_field_rtmp_wrapper th { visibility: hidden; }
47
+ /*#fv-flowplayer-playlist table .button { display: none; }*/
48
  #fv-flowplayer-playlist table:first-child tr.video-size { display: table-row; }
49
  #fv-flowplayer-playlist table:first-child tr#fv_wp_flowplayer_add_format_wrapper { display: table-row; }
50
  #fv-flowplayer-playlist table:first-child tr#fv_wp_flowplayer_file_info { display: none; }
51
  #fv-flowplayer-playlist table:first-child .fv_wp_flowplayer_field_rtmp { visibility: visible; }
52
  #fv-flowplayer-playlist table:first-child .fv_wp_flowplayer_field_rtmp_wrapper th { visibility: visible; }
53
+ /*#fv-flowplayer-playlist table:first-child .button { display: inline-block; }*/
54
  /*#colorbox, #cboxOverlay, #cboxWrapper{ z-index: 100000; }*/
55
  </style>
56
 
57
  <script>
58
  var fvwpflowplayer_helper_tag = '<?php echo $fv_flowplayer_helper_tag ?>';
59
+ var fv_wp_flowplayer_re_edit = /\[[^\]]*?<<?php echo $fv_flowplayer_helper_tag; ?>[^>]*?rel="FCKFVWPFlowplayerPlaceholder"[^>]*?>.*?<\/<?php echo $fv_flowplayer_helper_tag; ?>>.*?[^\\]\]/mi;
60
  var fv_wp_flowplayer_re_insert = /<<?php echo $fv_flowplayer_helper_tag; ?>[^>]*?rel="FCKFVWPFlowplayerPlaceholder"[^>]*?>.*?<\/<?php echo $fv_flowplayer_helper_tag; ?>>/gi;
61
+ <?php global $fv_fp; if( isset($fv_fp->conf['postthumbnail']) && $fv_fp->conf['postthumbnail'] == 'true' ) : ?>
62
+ var fv_flowplayer_set_post_thumbnail_id = <?php echo $post_id; ?>;
63
+ var fv_flowplayer_set_post_thumbnail_nonce = '<?php echo wp_create_nonce( "set_post_thumbnail-$post_id" ); ?>';
64
+ <?php endif; ?>
65
  </script>
66
 
67
  <div style="display: none">
77
  </th>
78
  <td colspan="2" class="field"><input type="text" class="text<?php echo $upload_field_class; ?>" id="fv_wp_flowplayer_field_src" name="fv_wp_flowplayer_field_src" value="" />
79
  <?php if ($allow_uploads=="true") { ?>
80
+ <a class="button add_media" href="#"><span class="wp-media-buttons-icon"></span> Add Video</a>
81
  <?php }; //allow uplads video ?></td>
82
  </tr>
83
 
85
  <th></th>
86
  <td>
87
  Video Duration: <span id="fv_wp_flowplayer_file_duration"></span><br />
88
+ File size: <span id="fv_wp_flowplayer_file_size"></span>
89
  </td>
90
  </tr>
91
  <tr class="video-size"><th></th>
96
  <th scope="row" class="label" style="width: 19%"><label for="fv_wp_flowplayer_field_src_1" class="alignright">Video <small>(another format)</small></label></th>
97
  <td colspan="2" class="field"><input type="text" class="text<?php echo $upload_field_class; ?>" id="fv_wp_flowplayer_field_src_1" name="fv_wp_flowplayer_field_src_1" value=""/>
98
  <?php if ($allow_uploads=="true") { ?>
99
+ <a class="button add_media" href="#"><span class="wp-media-buttons-icon"></span> Add Video</a>
100
  <?php }; //allow uplads video ?>
101
  </td>
102
  </tr>
105
  <th scope="row" class="label" style="width: 19%"><label for="fv_wp_flowplayer_field_src_2" class="alignright">Video <small>(another format)</small></label></th>
106
  <td colspan="2" class="field"><input type="text" class="text<?php echo $upload_field_class; ?>" id="fv_wp_flowplayer_field_src_2" name="fv_wp_flowplayer_field_src_2" value=""/>
107
  <?php if ($allow_uploads=="true") { ?>
108
+ <a class="button add_media" href="#"><span class="wp-media-buttons-icon"></span> Add Video</a>
109
  <?php }; //allow uplads video ?>
110
  </td>
111
  </tr>
127
 
128
  <tr<?php if( $fv_flowplayer_conf["interface"]["mobile"] !== 'true' ) echo ' style="display: none"'; ?>>
129
  <th scope="row" class="label"><label for="fv_wp_flowplayer_field_mobile" class="alignright">Mobile Video*</label></th>
130
+ <td class="field" colspan="2"><input type="text" class="text<?php echo $upload_field_class; ?>" id="fv_wp_flowplayer_field_mobile" name="fv_wp_flowplayer_field_mobile" value="" placeholder="Put low-bandwidth video here or leave blank" />
131
  <?php if ($allow_uploads=='true') { ?>
132
+ <a class="button add_media" href="#"><span class="wp-media-buttons-icon"></span> Add Video</a>
133
  <?php }; //allow uploads splash image ?></td>
134
  </tr>
135
 
137
  <th scope="row" class="label"><label for="fv_wp_flowplayer_field_splash" class="alignright">Splash Image</label></th>
138
  <td class="field" colspan="2"><input type="text" class="text fv_wp_flowplayer_field_splash<?php echo $upload_field_class; ?>" id="fv_wp_flowplayer_field_splash" name="fv_wp_flowplayer_field_splash" value=""/>
139
  <?php if ($allow_uploads=='true') { ?>
140
+ <a class="button add_media" href="#"><span class="wp-media-buttons-icon"></span> Add Image</a>
141
  <?php }; //allow uploads splash image ?></td>
142
  </tr>
143
 
145
  <th scope="row" class="label"><label for="fv_wp_flowplayer_field_subtitles" class="alignright">Subtitles</label></th>
146
  <td class="field" colspan="2"><input type="text" class="text<?php echo $upload_field_class; ?>" id="fv_wp_flowplayer_field_subtitles" name="fv_wp_flowplayer_field_subtitles" value=""/>
147
  <?php if ($allow_uploads=='true') { ?>
148
+ <a class="button add_media" href="#"><span class="wp-media-buttons-icon"></span> Add Subtitles</a>
149
  <?php }; //allow uploads splash image ?></td>
150
  </tr>
151
 
152
+ <tr class="<?php if( isset($fv_flowplayer_conf["interface"]["playlist_captions"]) && $fv_flowplayer_conf["interface"]["playlist_captions"] == 'true' ) echo 'playlist_caption'; ?>" <?php if( $fv_flowplayer_conf["interface"]["playlist_captions"] !== 'true' ) echo ' style="display: none"'; ?>>
153
  <th scope="row" class="label"><label for="fv_wp_flowplayer_field_caption" class="alignright">Caption</label></th>
154
  <td class="field" colspan="2"><input type="text" class="text<?php echo $upload_field_class; ?>" id="fv_wp_flowplayer_field_caption" name="fv_wp_flowplayer_field_caption" value=""/></td>
155
  </tr>
167
  <table width="100%">
168
  <tbody>
169
  <?php
170
+ $show_additonal_features = false;
171
  foreach( $fv_flowplayer_conf["interface"] AS $option ) {
172
  if( $option == 'true' ) {
173
  $show_additonal_features = true;
242
  </select>
243
  </td>
244
  </tr>
245
+ <tr<?php if( !isset($fv_flowplayer_conf["interface"]["controlbar"]) || $fv_flowplayer_conf["interface"]["controlbar"] !== 'true' ) echo ' style="display: none"'; ?>>
246
+ <th valign="top" scope="row" class="label" style="width: 19%"><label for="fv_wp_flowplayer_field_controlbar" class="alignright">Controlbar</label></th>
247
+ <td>
248
+ <select id="fv_wp_flowplayer_field_controlbar" name="fv_wp_flowplayer_field_controlbar">
249
+ <option>Default</option>
250
+ <option>Yes</option>
251
+ <option>No</option>
252
+ </select>
253
+ </td>
254
+ </tr>
255
+ <tr<?php if( $fv_flowplayer_conf["interface"]["live"] !== 'true' ) { echo ' style="display: none"'; } ?>>
256
+ <th scope="row" class="label"><label for="fv_wp_flowplayer_field_live" class="alignright">Live Stream</label></th>
257
+ <td class="field"><input type="checkbox" id="fv_wp_flowplayer_field_live" name="fv_wp_flowplayer_field_live" /></td>
258
+ </tr>
259
  <?php do_action( 'fv_flowplayer_shortcode_editor_after' ); ?>
260
  <tr>
261
  <th scope="row" class="label"></th>