FV Flowplayer Video Player - Version 2.4.2

Version Description

  • 2015/07/22 =

  • Flowplayer 6 - last preparations for the upgrade

Download this release

Release Info

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

Code changes from version 2.3.12 to 2.4.2

controller/backend.php CHANGED
@@ -72,7 +72,6 @@ function flowplayer_deactivate() {
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;
@@ -259,6 +258,13 @@ function fv_wp_flowplayer_admin_notice() {
259
  echo "</p></div>";
260
  }
261
  }*/
 
 
 
 
 
 
 
262
  }
263
 
264
 
@@ -301,6 +307,14 @@ function fv_wp_flowplayer_admin_init() {
301
  echo 'Error saving FV Flowplayer options.';
302
  }
303
  }
 
 
 
 
 
 
 
 
304
 
305
  global $fv_fp;
306
  global $fv_wp_flowplayer_ver, $fv_wp_flowplayer_core_ver;
@@ -354,7 +368,7 @@ function fv_wp_flowplayer_admin_init() {
354
  }
355
 
356
  $aOptions = get_option( 'fvwpflowplayer' );
357
- if( !isset($aOptions['version']) || version_compare( $fv_wp_flowplayer_ver, $aOptions['version'] ) ) {
358
  update_option( 'fv_wordpress_flowplayer_deferred_notices', 'FV Flowplayer upgraded - please click "Check template" and "Check videos" for automated check of your site at <a href="'.site_url().'/wp-admin/options-general.php?page=fvplayer">the settings page</a> for automated checks!' );
359
 
360
  $aOptions['version'] = $fv_wp_flowplayer_ver;
@@ -418,7 +432,7 @@ function fv_wp_flowplayer_license_check( $aArgs ) {
418
  global $fv_wp_flowplayer_ver, $fv_wp_flowplayer_core_ver;
419
 
420
  $args = array(
421
- 'body' => array( 'plugin' => 'fv-wordpress-flowplayer', 'version' => $fv_wp_flowplayer_ver, 'core_ver' => $fv_wp_flowplayer_core_ver, 'type' => home_url(), 'action' => $aArgs['action'] ),
422
  'timeout' => 20,
423
  'user-agent' => 'fv-wordpress-flowplayer-'.$fv_wp_flowplayer_ver.' ('.$fv_wp_flowplayer_core_ver.')'
424
  );
@@ -459,7 +473,7 @@ function fv_wp_flowplayer_after_plugin_row( $arg) {
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>
@@ -957,8 +971,163 @@ function fv_wp_flowplayer_plugin_action_links($links, $file) {
957
  }
958
 
959
 
 
 
 
 
 
 
 
 
 
 
 
 
960
  function fv_flowplayer_admin_scripts() {
961
  if (isset($_GET['page']) && $_GET['page'] == 'fvplayer') {
962
  wp_enqueue_media();
963
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
964
  }
72
 
73
 
74
  function flowplayer_admin_head() {
 
75
 
76
  if( !isset($_GET['page']) || $_GET['page'] != 'fvplayer' ) {
77
  return;
258
  echo "</p></div>";
259
  }
260
  }*/
261
+
262
+ if( isset($_GET['fv-licensing']) && $_GET['fv-licensing'] == "check" ){
263
+ echo '<div class="updated inline">
264
+ <p>Thank you for purchase. Your license will be renewed in couple of minutes.<br/>
265
+ Please make sure you upgrade <strong>FV Player Pro</strong> and <strong>FV Player VAST</strong> if you are using it.</p>
266
+ </div>';
267
+ }
268
  }
269
 
270
 
307
  echo 'Error saving FV Flowplayer options.';
308
  }
309
  }
310
+
311
+ if( isset($_GET['fv-licensing']) && $_GET['fv-licensing'] == "check" ){
312
+ delete_option("fv_wordpress_flowplayer_persistent_notices");
313
+
314
+ //license will expire in one minute
315
+ fv_wp_flowplayer_change_transient_expiration("fv_flowplayer_license",60);
316
+ fv_wp_flowplayer_delete_extensions_transients(60);
317
+ }
318
 
319
  global $fv_fp;
320
  global $fv_wp_flowplayer_ver, $fv_wp_flowplayer_core_ver;
368
  }
369
 
370
  $aOptions = get_option( 'fvwpflowplayer' );
371
+ if( !isset($aOptions['version']) /*|| version_compare( $fv_wp_flowplayer_ver, $aOptions['version'] )*/ ) {
372
  update_option( 'fv_wordpress_flowplayer_deferred_notices', 'FV Flowplayer upgraded - please click "Check template" and "Check videos" for automated check of your site at <a href="'.site_url().'/wp-admin/options-general.php?page=fvplayer">the settings page</a> for automated checks!' );
373
 
374
  $aOptions['version'] = $fv_wp_flowplayer_ver;
432
  global $fv_wp_flowplayer_ver, $fv_wp_flowplayer_core_ver;
433
 
434
  $args = array(
435
+ 'body' => array( 'plugin' => 'fv-wordpress-flowplayer', 'version' => $fv_wp_flowplayer_ver, 'core_ver' => $fv_wp_flowplayer_core_ver, 'type' => home_url(), 'action' => $aArgs['action'], 'admin-url' => admin_url() ),
436
  'timeout' => 20,
437
  'user-agent' => 'fv-wordpress-flowplayer-'.$fv_wp_flowplayer_ver.' ('.$fv_wp_flowplayer_core_ver.')'
438
  );
473
  <tr class="plugin-update-tr fv-wordpress-flowplayer-tr">
474
  <td class="plugin-update colspanchange" colspan="3">
475
  <div class="update-message">
476
+ <a href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/download">All Licenses 20% Off</a> - Easter sale!
477
  </div>
478
  </td>
479
  </tr>
971
  }
972
 
973
 
974
+ function fv_flowplayer_admin_block_update_now() {
975
+ $aCheck = get_transient( 'fv_flowplayer_license' );
976
+ if( $aCheck && isset($aCheck->expired) && $aCheck->expired ) :
977
+ ?>
978
+ <script>
979
+ jQuery(".update-link [href*='fv-wordpress-flowplayer']").click( function() { return confirm('Your FV Flowplayer license is expired.\n\nThanks for your early support for FV Player Pro. To enjoy the new features of Flowplayer 6 core, please renew your license. If proceed with the upgrade without renewing your license, you will lose your custom logo and your pro features.') });
980
+ </script>
981
+ <?php
982
+ endif;
983
+ }
984
+
985
+
986
  function fv_flowplayer_admin_scripts() {
987
  if (isset($_GET['page']) && $_GET['page'] == 'fvplayer') {
988
  wp_enqueue_media();
989
  }
990
+ }
991
+
992
+ //search for plugin path with {slug}.php
993
+ function fv_flowplayer_get_extension_path( $slug ){
994
+ $plugin_slugs = get_transient('plugin_slugs');
995
+ if( !$plugin_slugs )
996
+ return false;
997
+
998
+ foreach( $plugin_slugs as $item ){
999
+ if( stripos($item,$slug.'.php') !== false )
1000
+ return $item;
1001
+ }
1002
+
1003
+ return false;
1004
+ }
1005
+
1006
+
1007
+ add_action( "after_plugin_row_fv-wordpress-flowplayer/flowplayer.php", 'fv_flowplayer_after_plugin_row', 10, 2 );
1008
+ add_filter( 'pre_set_site_transient_update_plugins', 'fv_flowplayer_check_plugin_update' );
1009
+ add_action( 'admin_init', 'fv_flowplayer_allow_update' );
1010
+
1011
+ function fv_flowplayer_after_plugin_row( $file, $plugin_data ){
1012
+ if( !flowplayer::is_licensed() ) {
1013
+ return;
1014
+ }
1015
+
1016
+ $update_row = get_option('fvwpflowplayer_update_row');
1017
+
1018
+ $aCheck = get_transient( 'fv_flowplayer_license' );
1019
+ if( isset($aCheck->valid) && $aCheck->valid ){
1020
+ return;
1021
+ }
1022
+
1023
+ if( $update_row != 'removed' ){
1024
+ return;
1025
+ }
1026
+
1027
+ global $fv_player_pro_form;
1028
+ if( isset($fv_player_pro_form) ) return;
1029
+
1030
+ if ( is_network_admin() || !is_multisite() ) {
1031
+ $wp_list_table = _get_list_table('WP_Plugins_List_Table');
1032
+ $active_class = ( is_plugin_active( $plugin_data['plugin'] ) ) ? ' active' : '';
1033
+ echo '<tr class="plugin-update-tr' . $active_class . '" id="fv-wordpress-flowplayer-update" data-slug="fv-wordpress-flowplayer"><td colspan="' . esc_attr( $wp_list_table->get_column_count() ) . '" class="plugin-update colspanchange"><div class="update-message">';
1034
+
1035
+ global $fv_flowplayer_form;
1036
+ preg_match( '~<form[\s\S]*?</form>~', $aCheck->message, $fv_flowplayer_form );
1037
+ $fv_flowplayer_form = $fv_flowplayer_form[0];
1038
+ preg_match( '~<[^>]*?type="submit"[^>]*?>~', $aCheck->message, $button );
1039
+ $aCheck->message = preg_replace( '~<form[\s\S]*?</form>~', $button[0], $aCheck->message );
1040
+ echo $aCheck->message;
1041
+
1042
+ add_filter( 'admin_footer', 'fv_flowplayer_update_footer_html' );
1043
+
1044
+ echo '<a href="'.admin_url('plugins.php?fv_flowplayer_allow_update=1').'">Click here</a> to allow upgrade anyway.';
1045
+
1046
+ echo '</div></td></tr>';
1047
+
1048
+ echo '<script type="text/javascript">';
1049
+ echo "jQuery('#fv-wordpress-flowplayer-update').find('input[type=submit]').click( function() { jQuery('.fv_licensing_form').find('input[type=submit]').click(); return false;} );";
1050
+ echo 'jQuery(document).ready( function(){jQuery("#fv-wordpress-flowplayer").addClass("update"); });';
1051
+ echo '</script>';
1052
+ }
1053
+ }
1054
+
1055
+
1056
+
1057
+
1058
+ function fv_flowplayer_check_plugin_update( $data ){
1059
+ if( !flowplayer::is_licensed() ) {
1060
+ return $data;
1061
+ }
1062
+
1063
+ $update_row = get_option('fvwpflowplayer_update_row');
1064
+
1065
+ $aCheck = get_transient( 'fv_flowplayer_license' );
1066
+ if( isset($aCheck->valid) && $aCheck->valid ){
1067
+ return $data;
1068
+ }
1069
+
1070
+ if( $update_row == 'allowed' ){
1071
+ return $data;
1072
+ }
1073
+
1074
+ if( isset($data->response['fv-wordpress-flowplayer/flowplayer.php']) ){
1075
+
1076
+ global $fv_wp_flowplayer_ver;
1077
+ $old_version = substr($fv_wp_flowplayer_ver,0,1);
1078
+ $new_version = substr($data->response['fv-wordpress-flowplayer/flowplayer.php']->new_version,0,1);
1079
+
1080
+ if( $old_version == '2' && $new_version == '6'){
1081
+ unset($data->response['fv-wordpress-flowplayer/flowplayer.php']);
1082
+ update_option('fvwpflowplayer_update_row', 'removed');
1083
+ }
1084
+ }
1085
+
1086
+ return $data;
1087
+ }
1088
+
1089
+
1090
+
1091
+
1092
+ function fv_flowplayer_allow_update(){
1093
+ if( isset($_GET['fv_flowplayer_allow_update']) ){
1094
+ update_option('fvwpflowplayer_update_row', 'allowed');
1095
+ delete_site_transient('update_plugins');
1096
+
1097
+ wp_redirect( admin_url('plugins.php') );
1098
+ }
1099
+ }
1100
+
1101
+
1102
+
1103
+
1104
+ function fv_wp_flowplayer_change_transient_expiration( $transient_name, $time ){
1105
+ $transient_val = get_transient($transient_name);
1106
+ if( $transient_val ){
1107
+ set_transient($transient_name,$transient_val,$time);
1108
+ return true;
1109
+ }
1110
+ return false;
1111
+ }
1112
+
1113
+
1114
+ function fv_wp_flowplayer_delete_extensions_transients( $delete_delay = false ){
1115
+ if( !$delete_delay ){
1116
+ delete_transient("fv-player-pro_license");
1117
+ delete_transient("fv-player-vast_license");
1118
+ }
1119
+ else{
1120
+ fv_wp_flowplayer_change_transient_expiration("fv-player-pro_license",$delete_delay);
1121
+ fv_wp_flowplayer_change_transient_expiration("fv-player-vast_license",$delete_delay);
1122
+ }
1123
+ }
1124
+
1125
+
1126
+
1127
+
1128
+ function fv_flowplayer_update_footer_html() {
1129
+ global $fv_flowplayer_form;
1130
+ if( flowplayer::is_licensed() && isset($fv_flowplayer_form) ) {
1131
+ echo "<div style='display: none'>\n".$fv_flowplayer_form."</div>\n";
1132
+ }
1133
  }
controller/frontend.php CHANGED
@@ -17,16 +17,14 @@
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' );
@@ -36,7 +34,41 @@ 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) {
42
  preg_match('/.*popup=\'(.*?)\'.*/', $content, $matches);
@@ -252,6 +284,11 @@ function flowplayer_content( $content ) {
252
  */
253
  function flowplayer_prepare_scripts() {
254
  global $fv_fp, $fv_wp_flowplayer_ver;
 
 
 
 
 
255
 
256
  if(
257
  isset($GLOBALS['fv_fp_scripts']) ||
@@ -291,6 +328,7 @@ function flowplayer_prepare_scripts() {
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 ) {
@@ -312,7 +350,9 @@ function flowplayer_prepare_scripts() {
312
  * Prints flowplayer javascript content to the bottom of the page.
313
  */
314
  function flowplayer_display_scripts() {
315
- global $fv_fp;
 
 
316
 
317
  if( is_user_logged_in() || isset($_GET['fv_wp_flowplayer_check_template']) ) {
318
  echo "\n<!--fv-flowplayer-footer-->\n\n";
@@ -331,6 +371,10 @@ function flowplayer($shortcode) {
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;
@@ -378,6 +422,7 @@ add_filter( 'prepend_attachment', 'fv_flowplayer_attachment_page_video' );
378
 
379
  function fv_player_caption( $caption ) {
380
  global $post, $authordata;
 
381
  $caption = str_replace(
382
  array(
383
  '%post_title%',
@@ -388,7 +433,7 @@ function fv_player_caption( $caption ) {
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 );
17
  */
18
 
19
  //add_action('the_content', 'flowplayer_content_remove_commas');
 
20
  add_action('wp_footer','flowplayer_prepare_scripts',9);
21
  add_action('wp_footer','flowplayer_display_scripts',100);
22
  add_action('widget_text','do_shortcode');
 
23
 
24
  add_filter( 'run_ngg_resource_manager', '__return_false' );
25
 
26
 
27
+ function fv_flowplayer_remove_bad_scripts() {
28
  global $wp_scripts;
29
  if( isset($wp_scripts->registered['flowplayer']) && isset($wp_scripts->registered['flowplayer']->src) && stripos($wp_scripts->registered['flowplayer']->src, 'fv-wordpress-flowplayer') === false ) {
30
  wp_deregister_script( 'flowplayer' );
34
 
35
  add_filter( 'run_ngg_resource_manager', '__return_false' ); // Nextgen Gallery compatibility fix
36
 
37
+ function fv_flowplayer_ap_action_init(){
38
+ // Localization
39
+ load_plugin_textdomain('fv_flowplayer', false, dirname(dirname(plugin_basename(__FILE__))) . "/languages");
40
+ }
41
+ add_action('init', 'fv_flowplayer_ap_action_init');
42
+
43
+ function fv_flowplayer_get_js_translations() {
44
+
45
+ $aStrings = Array(
46
+ 0 => __('', 'flowplayer'),
47
+ 1 => __('Video loading aborted', 'fv_flowplayer'),
48
+ 2 => __('Network error', 'fv_flowplayer'),
49
+ 3 => __('Video not properly encoded', 'fv_flowplayer'),
50
+ 4 => __('Video file not found', 'fv_flowplayer'),
51
+ 5 => __('Unsupported video', 'fv_flowplayer'),
52
+ 6 => __('Skin not found', 'fv_flowplayer'),
53
+ 7 => __('SWF file not found', 'fv_flowplayer'),
54
+ 8 => __('Subtitles not found', 'fv_flowplayer'),
55
+ 9 => __('Invalid RTMP URL', 'fv_flowplayer'),
56
+ 10 => __('Unsupported video format. Try installing Adobe Flash.', 'fv_flowplayer'),
57
+ 11 => __('Click to watch the video', 'fv_flowplayer'),
58
+ 12 => __('[This post contains video, click to play]', 'fv_flowplayer'),
59
+ 'video_expired' => __('<h2>Video file expired.<br />Please reload the page and play it again.</h2>', 'fv_flowplayer'),
60
+ 'unsupported_format' => __('<h2>Unsupported video format.<br />Please use a Flash compatible device.</h2>','fv_flowplayer'),
61
+ 'mobile_browser_detected_1' => __('Mobile browser detected, serving low bandwidth video.','fv_flowplayer'),
62
+ 'mobile_browser_detected_2' => __('Click here','fv_flowplayer'),
63
+ 'mobile_browser_detected_3' => __('for full quality.','fv_flowplayer'),
64
+ 'live_stream_failed' => __('<h2>Live stream load failed.</h2><h3>Please try again later, perhaps the stream is currently offline.</h3>','fv_flowplayer'),
65
+ 'live_stream_failed_2' => __('<h2>Live stream load failed.</h2><h3>Please try again later, perhaps the stream is currently offline.</h3>','fv_flowplayer'),
66
+ 'what_is_wrong' => __('Please tell us what is wrong :','fv_flowplayer'),
67
+ 'full_sentence' => __('Please give us more information (a full sentence) so we can help you better','fv_flowplayer'),
68
+ );
69
+
70
+ return $aStrings;
71
+ }
72
 
73
  function flowplayer_content_remove_commas($content) {
74
  preg_match('/.*popup=\'(.*?)\'.*/', $content, $matches);
284
  */
285
  function flowplayer_prepare_scripts() {
286
  global $fv_fp, $fv_wp_flowplayer_ver;
287
+
288
+ // don't load script in Optimize Press 2 preview
289
+ if( flowplayer::is_optimizepress() ) {
290
+ return;
291
+ }
292
 
293
  if(
294
  isset($GLOBALS['fv_fp_scripts']) ||
328
  wp_localize_script( 'flowplayer', 'fv_flowplayer_admin_js_test', array(true) );
329
  }
330
 
331
+ wp_localize_script( 'flowplayer', 'fv_flowplayer_translations', fv_flowplayer_get_js_translations());
332
  wp_localize_script( 'flowplayer', 'fv_fp_ajaxurl', site_url().'/wp-admin/admin-ajax.php' );
333
  wp_localize_script( 'flowplayer', 'fv_flowplayer_playlists', $fv_fp->aPlaylists );
334
  if( count($fv_fp->aAds) > 0 ) {
350
  * Prints flowplayer javascript content to the bottom of the page.
351
  */
352
  function flowplayer_display_scripts() {
353
+ if( flowplayer::is_optimizepress() ) {
354
+ return;
355
+ }
356
 
357
  if( is_user_logged_in() || isset($_GET['fv_wp_flowplayer_check_template']) ) {
358
  echo "\n<!--fv-flowplayer-footer-->\n\n";
371
  Make sure our div won't be wrapped in any P tag and that html attributes don't break the shortcode
372
  */
373
  function fv_flowplayer_the_content( $c ) {
374
+ if( flowplayer::is_optimizepress() ) {
375
+ return $c;
376
+ }
377
+
378
  $c = preg_replace( '!<p[^>]*?>(\[(?:fvplayer|flowplayer).*?[^\\\]\])</p>!', "\n".'$1'."\n", $c );
379
  $c = preg_replace_callback( '!\[(?:fvplayer|flowplayer).*?[^\\\]\]!', 'fv_flowplayer_shortfcode_fix_attrs', $c );
380
  return $c;
422
 
423
  function fv_player_caption( $caption ) {
424
  global $post, $authordata;
425
+ $sAuthorInfo = ( $authordata ) ? 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() ) : false;
426
  $caption = str_replace(
427
  array(
428
  '%post_title%',
433
  array(
434
  get_the_title(),
435
  get_the_date(),
436
+ $sAuthorInfo,
437
  get_the_author()
438
  ),
439
  $caption );
controller/shortcodes.php CHANGED
@@ -123,6 +123,7 @@ function flowplayer_content_handle( $atts, $content = null, $tag ) {
123
  'logo' => '',
124
  'share' => '',
125
  'post' => '',
 
126
  ), $atts ) );
127
 
128
  if( $fv_fp->conf['parse_commas'] == 'true' && strcmp($tag,'flowplayer') == 0 ) {
@@ -157,6 +158,7 @@ function flowplayer_content_handle( $atts, $content = null, $tag ) {
157
  $arguments['logo'] = $logo;
158
  $arguments['share'] = $share;
159
  $arguments['post'] = $post;
 
160
  $arguments['src'] = trim( preg_replace('/\,/', '', $src) );
161
 
162
  } else {
@@ -192,7 +194,8 @@ function flowplayer_content_handle( $atts, $content = null, $tag ) {
192
  'caption' => '',
193
  'logo' => '',
194
  'share' => '',
195
- 'post' => ''
 
196
  ), $atts );
197
  }
198
 
@@ -342,4 +345,183 @@ function fv_player_time() {
342
  } else {
343
  return flowplayer::get_duration_post();
344
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
345
  }
123
  'logo' => '',
124
  'share' => '',
125
  'post' => '',
126
+ 'speed' => ''
127
  ), $atts ) );
128
 
129
  if( $fv_fp->conf['parse_commas'] == 'true' && strcmp($tag,'flowplayer') == 0 ) {
158
  $arguments['logo'] = $logo;
159
  $arguments['share'] = $share;
160
  $arguments['post'] = $post;
161
+ $arguments['speed'] = $speed;
162
  $arguments['src'] = trim( preg_replace('/\,/', '', $src) );
163
 
164
  } else {
194
  'caption' => '',
195
  'logo' => '',
196
  'share' => '',
197
+ 'post' => '',
198
+ 'speed' => ''
199
  ), $atts );
200
  }
201
 
345
  } else {
346
  return flowplayer::get_duration_post();
347
  }
348
+ }
349
+
350
+
351
+ global $fv_fp;
352
+ if( ( empty($_POST['action']) || $_POST['action'] != 'parse-media-shortcode' ) && ( empty($_GET['action']) || $_GET['action'] != 'edit' ) && !empty($fv_fp->conf['integrations']['wp_core_video']) && $fv_fp->conf['integrations']['wp_core_video'] == 'true' ) {
353
+
354
+ function fv_flowplayer_shortcode_video( $output ) {
355
+ $aArgs = func_get_args();
356
+ $atts = $aArgs[1];
357
+
358
+ $bridge_atts = array();
359
+ if( isset($atts['src']) ) {
360
+ $bridge_atts['src'] = $atts['src'];
361
+ }
362
+ foreach( array('mp4','webm','ogv','mov','flv','wmv','m4v') AS $key => $value ) {
363
+ $src = 'src'.(( $key > 0 ) ? $key : '');
364
+ if( isset($atts[$value]) ) {
365
+ $bridge_atts[$src] = $atts[$value];
366
+ }
367
+ }
368
+
369
+ if( isset($atts['poster']) ) {
370
+ $bridge_atts['splash'] = $atts['poster'];
371
+ }
372
+
373
+ if( isset($atts['loop']) && $atts['loop'] == 'on' ) {
374
+ $bridge_atts['loop'] = 'true';
375
+ } else if( isset($atts['loop']) && $atts['loop'] == 'off' ) {
376
+ $bridge_atts['loop'] = 'false';
377
+ }
378
+
379
+ if( isset($atts['autoplay']) && $atts['autoplay'] == 'on' ) {
380
+ $bridge_atts['autoplay'] = 'true';
381
+ } else if( isset($atts['loop']) && $atts['loop'] == 'off' ) {
382
+ $bridge_atts['autoplay'] = 'false';
383
+ }
384
+
385
+ if( isset($atts['width']) ) {
386
+ $bridge_atts['width'] = $atts['width'];
387
+ }
388
+ if( isset($atts['height']) ) {
389
+ $bridge_atts['height'] = $atts['height'];
390
+ }
391
+
392
+ if( count($bridge_atts) == 0 ) {
393
+ return "<!--FV Flowplayer video shortcode integration - no attributes recognized-->";
394
+ }
395
+ return flowplayer_content_handle( $bridge_atts, false, 'video' );
396
+ }
397
+
398
+ add_filter( 'wp_video_shortcode_override', 'fv_flowplayer_shortcode_video', 10, 4 );
399
+
400
+
401
+
402
+
403
+ function fv_flowplayer_shortcode_playlist( $output ) {
404
+ $aArgs = func_get_args();
405
+ $atts = $aArgs[1];
406
+
407
+ if( !empty($atts['type']) && $atts['type'] != 'video' ) {
408
+ return false;
409
+ }
410
+
411
+ // copy from wp-includes/media.php wp_playlist_shortcode()
412
+ global $post;
413
+ if ( ! empty( $attr['ids'] ) ) {
414
+ // 'ids' is explicitly ordered, unless you specify otherwise.
415
+ if ( empty( $attr['orderby'] ) ) {
416
+ $attr['orderby'] = 'post__in';
417
+ }
418
+ $attr['include'] = $attr['ids'];
419
+ }
420
+
421
+ $atts = shortcode_atts( array(
422
+ 'type' => 'audio',
423
+ 'order' => 'ASC',
424
+ 'orderby' => 'menu_order ID',
425
+ 'id' => $post ? $post->ID : 0,
426
+ 'include' => '',
427
+ 'exclude' => '',
428
+ 'style' => 'light',
429
+ 'tracklist' => true,
430
+ 'tracknumbers' => true,
431
+ 'images' => true,
432
+ 'artists' => true
433
+ ), $atts, 'playlist' );
434
+
435
+ $args = array(
436
+ 'post_status' => 'inherit',
437
+ 'post_type' => 'attachment',
438
+ 'post_mime_type' => $atts['type'],
439
+ 'order' => $atts['order'],
440
+ 'orderby' => $atts['orderby']
441
+ );
442
+
443
+ if( !empty($atts['include']) ) {
444
+ $args['include'] = $atts['include'];
445
+ $_attachments = get_posts( $args );
446
+ if( !count($_attachments) ) {
447
+ return false;
448
+ }
449
+
450
+ $attachments = array();
451
+ foreach( $_attachments as $key => $val ) {
452
+ $attachments[$val->ID] = $_attachments[$key];
453
+ }
454
+ } else {
455
+ return false;
456
+ }
457
+
458
+
459
+ $bridge_atts = array();
460
+ $aPlaylistItems = array();
461
+ $aPlaylistImages = array();
462
+ $i = 0;
463
+ foreach ( $attachments as $attachment ) {
464
+ $i++;
465
+
466
+ $url = wp_get_attachment_url( $attachment->ID );
467
+ if( $i == 1 ) {
468
+ $bridge_atts['src'] = $url;
469
+ } else {
470
+ $aPlaylistItems[] = $url;
471
+ }
472
+
473
+ $thumb_id = get_post_thumbnail_id( $attachment->ID );
474
+ $src = false;
475
+ if( !empty( $thumb_id ) ) {
476
+ list( $src, $width, $height ) = wp_get_attachment_image_src( $thumb_id, 'thumbnail' );
477
+ }
478
+ if( $i == 1 ) {
479
+ $bridge_atts['splash'] = $src;
480
+ } else {
481
+ $aPlaylistImages[] = $src;
482
+ }
483
+
484
+ }
485
+
486
+
487
+ $bridge_atts['playlist'] = '';
488
+ foreach( $aPlaylistItems AS $key => $src ) {
489
+ $bridge_atts['playlist'] .= $src;
490
+ if( $aPlaylistImages[$key] ) {
491
+ $bridge_atts['playlist'] .= ','.$aPlaylistImages[$key];
492
+ }
493
+ $bridge_atts['playlist'] .= ';';
494
+ }
495
+ $bridge_atts['playlist'] = trim($bridge_atts['playlist'],';');
496
+
497
+ if( isset($atts['width']) ) {
498
+ $bridge_atts['width'] = $atts['width'];
499
+ }
500
+ if( isset($atts['height']) ) {
501
+ $bridge_atts['height'] = $atts['height'];
502
+ }
503
+
504
+ if( count($bridge_atts) == 0 ) {
505
+ return "<!--FV Flowplayer video shortcode integration - no attributes recognized-->";
506
+ }
507
+
508
+ return flowplayer_content_handle( $bridge_atts, false, 'video' );
509
+ }
510
+
511
+ add_filter( 'post_playlist', 'fv_flowplayer_shortcode_playlist', 10, 2 );
512
+ }
513
+
514
+
515
+ add_filter( 'fv_flowplayer_shortcode', 'fv_flowplayer_shortcode_fix_fancy_quotes' );
516
+
517
+ function fv_flowplayer_shortcode_fix_fancy_quotes( $aArgs ) {
518
+
519
+ foreach( $aArgs AS $k => $v ) {
520
+ $v = preg_replace( "~^(\xe2\x80\x9c|\xe2\x80\x9d|\xe2\x80\xb3)~","", $v);
521
+ $v = preg_replace( "~(\xe2\x80\x9c|\xe2\x80\x9d|\xe2\x80\xb3)$~","", $v);
522
+
523
+ $aArgs[$k] = $v;
524
+ }
525
+
526
+ return $aArgs;
527
  }
css/colorbox.css CHANGED
@@ -5,32 +5,32 @@ 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: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;}
13
- #cboxLoadedContent iframe{display:block; width:100%; height:100%; border:0; background-color: white;}
14
- .fv-flowplayer-shortcode-editor #cboxTitle{margin:5px; text-align: left; bottom: auto }
15
- #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%;}
16
- #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
17
 
18
  /*
19
  ColorBox example user style
20
  The following rules are ordered and tabbed in a way that represents the
21
  order/nesting of the generated HTML, so that the structure easier to understand.
22
  */
23
- #cboxOverlay{background:#111;}
24
 
25
  #colorBox{}
26
- #cboxContent{background:#fff; padding: 5px;background:url(loading.gif) 50% 50% no-repeat #fff; }
27
- #cboxLoadedContent{margin-top:35px;}
28
- #cboxTitle{position:absolute; top:0px; left:0; padding: 8px 0 8px 18.5%; width:100%; color:#9D1A28; font-size: 14px;}
29
- #cboxCurrent{position:absolute; bottom:0px; left:100px; color:#999;}
30
- #cboxSlideshow{position:absolute; bottom:0px; right:42px; color:#444;}
31
- #cboxPrevious{position:absolute; bottom:0px; left:0; color:#444;}
32
- #cboxNext{position:absolute; bottom:0px; left:63px; color:#444;}
33
- /*#cboxLoadingOverlay{ text-align: center; background:url(loading.gif) 5px 5px no-repeat #fff;}*/
34
- #cboxClose{position:absolute; top:2px; right:2px; display:block; color:#444; height: 16px; width: 16px; overflow: hidden; text-indent: 25px; background: url("img/uploader-icons.png") -98px 0 no-repeat transparent; border: 0; }
35
- #cboxClose:hover { background-position: -98px 0; }
36
 
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
+ #fv_player_box, #fv_player_boxOverlay, #fv_player_boxWrapper, #fv_player_box.fv-flowplayer-shortcode-editor, #fv_player_boxOverlay.fv-flowplayer-shortcode-editor, #fv_player_boxWrapper.fv-flowplayer-shortcode-editor{position:absolute; top:0; left:0; z-index:100001; overflow:hidden;}
9
+ #fv_player_boxOverlay, #fv_player_boxOverlay.fv-flowplayer-shortcode-editor{position:fixed; width:100%; height:100%; z-index: 100000}
10
+ #fv_player_boxMiddleLeft, #fv_player_boxBottomLeft{clear:left;}
11
+ #fv_player_boxContent{position:relative; overflow:hidden;}
12
+ #fv_player_boxLoadedContent{overflow:auto;}
13
+ #fv_player_boxLoadedContent iframe{display:block; width:100%; height:100%; border:0; background-color: white;}
14
+ .fv-flowplayer-shortcode-editor #fv_player_boxTitle{margin:5px; text-align: left; bottom: auto }
15
+ #fv_player_boxLoadingOverlay, #fv_player_boxLoadingGraphic{position:absolute; top:0; left:0; width:100%;}
16
+ #fv_player_boxPrevious, #fv_player_boxNext, #fv_player_boxClose, #fv_player_boxSlideshow{cursor:pointer;}
17
 
18
  /*
19
  ColorBox example user style
20
  The following rules are ordered and tabbed in a way that represents the
21
  order/nesting of the generated HTML, so that the structure easier to understand.
22
  */
23
+ #fv_player_boxOverlay{background:#111;}
24
 
25
  #colorBox{}
26
+ #fv_player_boxContent{background:#fff; padding: 5px;background:url(loading.gif) 50% 50% no-repeat #fff; }
27
+ #fv_player_boxLoadedContent{margin-top:35px;}
28
+ #fv_player_boxTitle{position:absolute; top:0px; left:0; padding: 8px 0 8px 18.5%; width:100%; color:#9D1A28; font-size: 14px;}
29
+ #fv_player_boxCurrent{position:absolute; bottom:0px; left:100px; color:#999;}
30
+ #fv_player_boxSlideshow{position:absolute; bottom:0px; right:42px; color:#444;}
31
+ #fv_player_boxPrevious{position:absolute; bottom:0px; left:0; color:#444;}
32
+ #fv_player_boxNext{position:absolute; bottom:0px; left:63px; color:#444;}
33
+ /*#fv_player_boxLoadingOverlay{ text-align: center; background:url(loading.gif) 5px 5px no-repeat #fff;}*/
34
+ #fv_player_boxClose{position:absolute; top:2px; right:2px; display:block; color:#444; height: 16px; width: 16px; overflow: hidden; text-indent: 25px; background: url("img/uploader-icons.png") -98px 0 no-repeat transparent; border: 0; }
35
+ #fv_player_boxClose:hover { background-position: -98px 0; }
36
 
css/flowplayer.css CHANGED
@@ -8,7 +8,7 @@
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%;}
12
  .no-background.flowplayer .fp-controls{background-color:transparent !important;background-image:-moz-linear-gradient(transparent,transparent) !important;background-image:-webkit-gradient(linear,0 0,0 100%,from(transparent),to(transparent)) !important}
13
  .is-fullscreen.flowplayer .fp-controls{bottom:3px}
14
  .is-mouseover.flowplayer .fp-controls{bottom:0}
@@ -56,7 +56,7 @@
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}
@@ -167,10 +167,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}
171
  .flowplayer.is-mouseout .fp-timeline{margin:0 !important}
172
  .flowplayer.is-mouseout .fp-timeline{-webkit-transition:height .15s .3s,top .15s .3s,margin .15s .3s;-moz-transition:height .15s .3s,top .15s .3s,margin .15s .3s;transition:height .15s .3s,top .15s .3s,margin .15s .3s;height:4px;top:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}
173
- .flowplayer.is-mouseout .fp-fullscreen,.flowplayer.is-mouseout .fp-unload,.flowplayer.is-mouseout .fp-elapsed,.flowplayer.is-mouseout .fp-remaining,.flowplayer.is-mouseout .fp-duration,.flowplayer.is-mouseout .fp-embed,.flowplayer.is-mouseout .fp-volume,.flowplayer.is-mouseout .fp-play{opacity:0;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=0);-webkit-transition:opacity .15s .3s;-moz-transition:opacity .15s .3s;transition:opacity .15s .3s}
174
  .flowplayer.is-mouseover .fp-controls,.flowplayer.fixed-controls .fp-controls{height:20px}
175
  .flowplayer.is-mouseover .fp-fullscreen,.flowplayer.fixed-controls .fp-fullscreen,.flowplayer.is-mouseover .fp-unload,.flowplayer.fixed-controls .fp-unload,.flowplayer.is-mouseover .fp-elapsed,.flowplayer.fixed-controls .fp-elapsed,.flowplayer.is-mouseover .fp-remaining,.flowplayer.fixed-controls .fp-remaining,.flowplayer.is-mouseover .fp-duration,.flowplayer.fixed-controls .fp-duration,.flowplayer.is-mouseover .fp-embed,.flowplayer.fixed-controls .fp-embed,.flowplayer.is-mouseover .fp-logo,.flowplayer.fixed-controls .fp-logo,.flowplayer.is-mouseover .fp-volume,.flowplayer.fixed-controls .fp-volume,.flowplayer.is-mouseover .fp-play,.flowplayer.fixed-controls .fp-play{opacity:1;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100)}
176
  .flowplayer.fixed-controls .fp-volume{display:block}
@@ -327,7 +327,7 @@
327
  .flowplayer .fp-next{right:-20px;background-position:0 -400px;}
328
  .flowplayer .fp-next:hover{background-position:0 -500px}
329
 
330
- .fp-playlist-external { text-align:center; }
331
  .fp-playlist-external a { width:148px; display:inline-block; vertical-align:top; margin:5px 0px 0px 0px;}
332
  .fp-playlist-external a span { display:block;width:120px;height:80px;margin:0 10px;-webkit-transition:all .3s;-moz-transition:all .3s;transition:all .3s;border:4px solid #fff;background:gray;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;background-size:auto 100px;background-position:center;}
333
  .fp-playlist-external a:hover span { border-color:#ccc }
@@ -396,6 +396,105 @@ a #add-format, a #add-rtmp {
396
 
397
  p.fp-caption { text-align: center; }
398
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
399
  /*
400
  MediaElement.js
401
  */
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%;height:0;}
12
  .no-background.flowplayer .fp-controls{background-color:transparent !important;background-image:-moz-linear-gradient(transparent,transparent) !important;background-image:-webkit-gradient(linear,0 0,0 100%,from(transparent),to(transparent)) !important}
13
  .is-fullscreen.flowplayer .fp-controls{bottom:3px}
14
  .is-mouseover.flowplayer .fp-controls{bottom:0}
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:1;}
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}
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{all:0;-webkit-transition:height .15s ease .3s;-moz-transition:all .15s ease .3s;transition:all .15s ease .3s}
171
  .flowplayer.is-mouseout .fp-timeline{margin:0 !important}
172
  .flowplayer.is-mouseout .fp-timeline{-webkit-transition:height .15s .3s,top .15s .3s,margin .15s .3s;-moz-transition:height .15s .3s,top .15s .3s,margin .15s .3s;transition:height .15s .3s,top .15s .3s,margin .15s .3s;height:4px;top:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}
173
+ .flowplayer.is-mouseout .fp-fullscreen,.flowplayer.is-mouseout .fp-unload,.flowplayer.is-mouseout .fp-elapsed,.flowplayer.is-mouseout .fp-remaining,.flowplayer.is-mouseout .fp-duration,.flowplayer.is-mouseout .fp-embed,.flowplayer.is-mouseout .fp-volume,.flowplayer.is-mouseout .fp-play{opacity:0;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=0);-webkit-transition:opacity .15s ease .3s;-moz-transition:opacity .15s ease .3s;transition:opacity .15s ease .3s;}
174
  .flowplayer.is-mouseover .fp-controls,.flowplayer.fixed-controls .fp-controls{height:20px}
175
  .flowplayer.is-mouseover .fp-fullscreen,.flowplayer.fixed-controls .fp-fullscreen,.flowplayer.is-mouseover .fp-unload,.flowplayer.fixed-controls .fp-unload,.flowplayer.is-mouseover .fp-elapsed,.flowplayer.fixed-controls .fp-elapsed,.flowplayer.is-mouseover .fp-remaining,.flowplayer.fixed-controls .fp-remaining,.flowplayer.is-mouseover .fp-duration,.flowplayer.fixed-controls .fp-duration,.flowplayer.is-mouseover .fp-embed,.flowplayer.fixed-controls .fp-embed,.flowplayer.is-mouseover .fp-logo,.flowplayer.fixed-controls .fp-logo,.flowplayer.is-mouseover .fp-volume,.flowplayer.fixed-controls .fp-volume,.flowplayer.is-mouseover .fp-play,.flowplayer.fixed-controls .fp-play{opacity:1;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100)}
176
  .flowplayer.fixed-controls .fp-volume{display:block}
327
  .flowplayer .fp-next{right:-20px;background-position:0 -400px;}
328
  .flowplayer .fp-next:hover{background-position:0 -500px}
329
 
330
+ .fp-playlist-external { text-align:center; margin-bottom: 24px;}
331
  .fp-playlist-external a { width:148px; display:inline-block; vertical-align:top; margin:5px 0px 0px 0px;}
332
  .fp-playlist-external a span { display:block;width:120px;height:80px;margin:0 10px;-webkit-transition:all .3s;-moz-transition:all .3s;transition:all .3s;border:4px solid #fff;background:gray;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;background-size:auto 100px;background-position:center;}
333
  .fp-playlist-external a:hover span { border-color:#ccc }
396
 
397
  p.fp-caption { text-align: center; }
398
 
399
+ /* initially hide speed buttons while they cannot be used */
400
+ .is-splash.flowplayer .fv-player-buttons, .is-loading.flowplayer .fv-player-buttons {
401
+ display: none;
402
+ }
403
+ .fv-player-buttons-center {
404
+ position: absolute;
405
+ left: 50%;
406
+ margin-left: -34px;
407
+ bottom: 20px;
408
+ }
409
+ .fv-player-buttons > ul {
410
+ position: relative;
411
+ z-index: 2; /* make clickable */
412
+ display: block;
413
+ opacity: 1;
414
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
415
+ margin: 0 auto;
416
+ }
417
+ .fv-player-buttons > ul:last {
418
+ margin-left: 0px;
419
+ }
420
+ .fv-player-buttons-right {
421
+ position: absolute;
422
+ right: 0;
423
+ bottom: 20px;
424
+ }
425
+ .fv-player-buttons-right > ul {
426
+ /*position: relative;
427
+ left: -95%;*/
428
+ }
429
+ .fv-player-buttons-left {
430
+ position: absolute;
431
+ left: 0;
432
+ bottom: 20px;
433
+ }
434
+ .fv-player-buttons-left > ul {
435
+ left: 0;
436
+ }
437
+ .is-mouseout .fv-player-buttons > ul {
438
+ opacity: 0;
439
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
440
+ /* same transition as other ui elements like fullscreen */
441
+ -webkit-transition: opacity .15s ease .3s;
442
+ -moz-transition: opacity .15s ease .3s;
443
+ transition: opacity .15s ease .3s;
444
+ }
445
+ .fv-player-buttons li {
446
+ display: inline-block;
447
+ float: left;
448
+ margin: 0 0.3em;
449
+ }
450
+ .fv-player-buttons a {
451
+ display: inline-block;
452
+ float: left;
453
+ padding: 0.4ex 0.6ex;
454
+ margin: 0.5ex 0;
455
+ width: 100%;
456
+ text-align: center;
457
+ font-weight: 400;
458
+ background-color: #ccc;
459
+ background-color: rgba(255,255,255,0.5);
460
+ color: #fff;
461
+ cursor: pointer;
462
+ line-height: 1.3em;
463
+ -webkit-border-radius: 5px;
464
+ -moz-border-radius: 5px;
465
+ border-radius: 5px;
466
+ -webkit-transition: background-color 0.2s ease-out;
467
+ -moz-transition: background-color 0.2s ease-out;
468
+ -o-transition: background-color 0.2s ease-out;
469
+ transition: background-color 0.2s ease-out;
470
+ font-size: 14px;
471
+ box-sizing: border-box;
472
+ }
473
+ .fv-player-buttons a:active {
474
+ background-color: rgba(255,255,255,0.85);
475
+ }
476
+ .fv-player-buttons a.current {
477
+ color: #00a7c8;
478
+ background-color: #555;
479
+ cursor: default;
480
+ }
481
+ .fv-player-buttons a.fv_sp_slower {
482
+ -webkit-border-radius: 1ex 0 0 1ex;
483
+ -moz-border-radius: 1ex 0 0 1ex;
484
+ border-radius: 1ex 0 0 1ex;
485
+ margin-right: 2px;
486
+ width: 2.05em;
487
+ }
488
+ .fv-player-buttons a.fv_sp_faster {
489
+ -webkit-border-radius: 0 1ex 1ex 0;
490
+ -moz-border-radius: 0 1ex 1ex 0;
491
+ border-radius: 0 1ex 1ex 0;
492
+ width: 2em;
493
+ }
494
+ .fv-player-speed li {
495
+ margin: 0;
496
+ }
497
+
498
  /*
499
  MediaElement.js
500
  */
flowplayer.php CHANGED
@@ -2,8 +2,8 @@
2
  /*
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
@@ -25,8 +25,8 @@ License URI: http://www.gnu.org/licenses/gpl-3.0.txt
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' );
2
  /*
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.4.2
7
  Author URI: http://foliovision.com/
8
  License: GPL-3.0
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.txt
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.4.2';
30
  $fv_wp_flowplayer_core_ver = '5.5.2';
31
 
32
  include( dirname( __FILE__ ) . '/includes/extra-functions.php' );
flowplayer/fv-flowplayer.min.js CHANGED
@@ -2,10 +2,27 @@
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
  */
@@ -15,6 +32,9 @@ if( typeof(fv_flowplayer_conf) != "undefined" ) {
15
  flowplayer.conf.native_fullscreen = true;
16
  }
17
  }
 
 
 
18
 
19
  if( typeof(fv_flowplayer_admin_input) != "undefined" && fv_flowplayer_admin_input ) {
20
  jQuery(document).keyup(function(e) {
@@ -57,13 +77,13 @@ function fv_wp_flowplayer_admin_support_mail( hash, button ) {
57
  var comment_text = jQuery('#wpfp_support_'+hash).val();
58
  var comment_words = comment_text.split(/\s/);
59
  if( comment_words.length == 0 || comment_text.match(/Enter your comment/) ) {
60
- jQuery('#wpfp_support_'+hash).before('<p class="fv_flowplayer_submit_error" style="display:none; "><strong>Please tell us what is wrong</strong>:</p>');
61
  jQuery('.fv_flowplayer_submit_error').fadeIn();
62
  return false;
63
  }
64
 
65
  if( comment_words.length < 7 ) {
66
- jQuery('#wpfp_support_'+hash).before('<p class="fv_flowplayer_submit_error" style="display:none; "><strong>Please give us more information (a full sentence) so we can help you better</strong>:</p>');
67
  jQuery('.fv_flowplayer_submit_error').fadeIn();
68
  return false;
69
  }
@@ -208,7 +228,7 @@ function fv_flowplayer_amazon_s3( hash, time ) {
208
  var fv_fp_date = new Date();
209
  if( error.code == 4 && fv_fp_date.getTime() > (fv_fp_utime + parseInt(time)) ) {
210
  jQuery(e.target).find('.fp-message').delay(500).queue( function(n) {
211
- jQuery(this).html('<h2>Video file expired.<br />Please reload the page and play it again.</h2>'); n();
212
  } );
213
  }
214
  } );
@@ -262,7 +282,7 @@ if( (navigator.platform.indexOf("iPhone") != -1) || (navigator.platform.indexOf(
262
  flowplayer(function (api, root) {
263
  api.bind("error", function (e,api, error) {
264
  if( error.code == 10 ) {
265
- jQuery(e.target).find('.fp-message').html('<h2>Unsupported video format.<br />Please use a Flash compatible device.</h2>');
266
  }
267
  });
268
  });
@@ -313,7 +333,7 @@ function fv_flowplayer_mobile_switch(id) {
313
  }
314
  } );
315
  if( fv_fp_mobile ) {
316
- jQuery('#wpfp_'+id).after('<p class="fv-flowplayer-mobile-switch">Mobile browser detected, serving low bandwidth video. <a href="'+document.URL+'?fv_flowplayer_mobile=no">Click here</a> for full quality.</p>');
317
  }
318
  }
319
  }
@@ -369,7 +389,7 @@ function fv_flowplayer_safety_resize() {
369
  }
370
 
371
  if( typeof(flowplayer.conf.safety_resize) != "undefined" && flowplayer.conf.safety_resize ) {
372
- jQuery(document).ready(function() { fv_flowplayer_safety_resize(); } );
373
  }
374
 
375
  jQuery(document).ready( function() {
@@ -410,11 +430,9 @@ jQuery(document).ready( function() {
410
 
411
  jQuery( function() { jQuery('.flowplayer').unbind('contextmenu'); } );
412
 
413
- if( typeof(fv_flowplayer_playlists) != "undefined" ) {
414
- for( var i in fv_flowplayer_playlists ) {
415
- jQuery('#'+i).flowplayer( { playlist: fv_flowplayer_playlists[i] })
416
- }
417
- }
418
 
419
  var fv_fp_date = new Date();
420
  var fv_fp_utime = fv_fp_date.getTime();
@@ -469,9 +487,10 @@ if( jQuery.browser.msie && parseInt(jQuery.browser.version, 10) < 9 ) {
469
 
470
 
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
 
@@ -582,7 +601,7 @@ flowplayer(function (api, root) {
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);
@@ -592,7 +611,7 @@ flowplayer(function (api, root) {
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
  });
@@ -605,4 +624,279 @@ if( /ipad/.test(navigator.userAgent.toLowerCase()) && /os 8/.test(navigator.user
605
  }, 1000 );
606
  });
607
  });
608
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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:(d>=8.1&&v>=11)||(!f&&(!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
+
11
+ /*
12
+ * dash.all.js
13
+ */
14
+ function X2JS(a,b,c){function d(a){var b=a.localName;return null==b&&(b=a.baseName),(null==b||""==b)&&(b=a.nodeName),b}function e(a){return a.prefix}function f(a){return"string"==typeof a?a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;"):a}function g(a){return a.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#x27;/g,"'").replace(/&#x2F;/g,"/")}function h(f){if(f.nodeType==u.DOCUMENT_NODE){var i,j,k,l=f.firstChild;for(j=0,k=f.childNodes.length;k>j;j+=1)if(f.childNodes[j].nodeType!==u.COMMENT_NODE){l=f.childNodes[j];break}if(c)i=h(l);else{i={};var m=d(l);i[m]=h(l)}return i}if(f.nodeType==u.ELEMENT_NODE){var i=new Object;i.__cnt=0;for(var n=f.childNodes,o=0;o<n.length;o++){var l=n.item(o),m=d(l);if(i.__cnt++,null==i[m])i[m]=h(l),i[m+"_asArray"]=new Array(1),i[m+"_asArray"][0]=i[m];else{if(null!=i[m]&&!(i[m]instanceof Array)){var p=i[m];i[m]=new Array,i[m][0]=p,i[m+"_asArray"]=i[m]}for(var q=0;null!=i[m][q];)q++;i[m][q]=h(l)}}for(var r=0;r<f.attributes.length;r++){var s=f.attributes.item(r);i.__cnt++;for(var v=s.value,w=0,x=a.length;x>w;w++){var y=a[w];y.test.call(this,s)&&(v=y.converter.call(this,s.value))}i[b+s.name]=v}var z=e(f);return null!=z&&""!=z&&(i.__cnt++,i.__prefix=z),1==i.__cnt&&null!=i["#text"]&&(i=i["#text"]),null!=i["#text"]&&(i.__text=i["#text"],t&&(i.__text=g(i.__text)),delete i["#text"],delete i["#text_asArray"]),null!=i["#cdata-section"]&&(i.__cdata=i["#cdata-section"],delete i["#cdata-section"],delete i["#cdata-section_asArray"]),(null!=i.__text||null!=i.__cdata)&&(i.toString=function(){return(null!=this.__text?this.__text:"")+(null!=this.__cdata?this.__cdata:"")}),i}return f.nodeType==u.TEXT_NODE||f.nodeType==u.CDATA_SECTION_NODE?f.nodeValue:f.nodeType==u.COMMENT_NODE?null:void 0}function i(a,b,c,d){var e="<"+(null!=a&&null!=a.__prefix?a.__prefix+":":"")+b;if(null!=c)for(var f=0;f<c.length;f++){var g=c[f],h=a[g];e+=" "+g.substr(1)+"='"+h+"'"}return e+=d?"/>":">"}function j(a,b){return"</"+(null!=a.__prefix?a.__prefix+":":"")+b+">"}function k(a,b){return-1!==a.indexOf(b,a.length-b.length)}function l(a,b){return k(b.toString(),"_asArray")||0==b.toString().indexOf("_")||a[b]instanceof Function?!0:!1}function m(a){var b=0;if(a instanceof Object)for(var c in a)l(a,c)||b++;return b}function n(a){var b=[];if(a instanceof Object)for(var c in a)-1==c.toString().indexOf("__")&&0==c.toString().indexOf("_")&&b.push(c);return b}function o(a){var b="";return null!=a.__cdata&&(b+="<![CDATA["+a.__cdata+"]]>"),null!=a.__text&&(b+=t?f(a.__text):a.__text),b}function p(a){var b="";return a instanceof Object?b+=o(a):null!=a&&(b+=t?f(a):a),b}function q(a,b,c){var d="";if(0==a.length)d+=i(a,b,c,!0);else for(var e=0;e<a.length;e++)d+=i(a[e],b,n(a[e]),!1),d+=r(a[e]),d+=j(a[e],b);return d}function r(a){var b="",c=m(a);if(c>0)for(var d in a)if(!l(a,d)){var e=a[d],f=n(e);if(null==e||void 0==e)b+=i(e,d,f,!0);else if(e instanceof Object)if(e instanceof Array)b+=q(e,d,f);else{var g=m(e);g>0||null!=e.__text||null!=e.__cdata?(b+=i(e,d,f,!1),b+=r(e),b+=j(e,d)):b+=i(e,d,f,!0)}else b+=i(e,d,f,!1),b+=p(e),b+=j(e,d)}return b+=p(a)}(null===b||void 0===b)&&(b="_"),(null===c||void 0===c)&&(c=!1);var s="1.0.11",t=!1,u={ELEMENT_NODE:1,TEXT_NODE:3,CDATA_SECTION_NODE:4,COMMENT_NODE:8,DOCUMENT_NODE:9};this.parseXmlString=function(a){var b;if(window.DOMParser){var c=new window.DOMParser;b=c.parseFromString(a,"text/xml")}else 0==a.indexOf("<?")&&(a=a.substr(a.indexOf("?>")+2)),b=new ActiveXObject("Microsoft.XMLDOM"),b.async="false",b.loadXML(a);return b},this.xml2json=function(a){return h(a)},this.xml_str2json=function(a){var b=this.parseXmlString(a);return this.xml2json(b)},this.json2xml_str=function(a){return r(a)},this.json2xml=function(a){var b=this.json2xml_str(a);return this.parseXmlString(b)},this.getVersion=function(){return s},this.escapeMode=function(a){t=a}}function ObjectIron(a){var b;for(b=[],i=0,len=a.length;i<len;i+=1)b.push(a[i].isRoot?"root":a[i].name);var c=function(a,b){var c;if(null!==a&&null!==b)for(c in a)a.hasOwnProperty(c)&&(b.hasOwnProperty(c)||(b[c]=a[c]))},d=function(a,b,d){var e,f,g,h,i;if(null!==a&&0!==a.length)for(e=0,f=a.length;f>e;e+=1)g=a[e],b.hasOwnProperty(g.name)&&(d.hasOwnProperty(g.name)?g.merge&&(h=b[g.name],i=d[g.name],"object"==typeof h&&"object"==typeof i?c(h,i):d[g.name]=null!=g.mergeFunction?g.mergeFunction(h,i):h+i):d[g.name]=b[g.name])},e=function(a,b){var c,f,g,h,i,j,k,l=a;if(null!==l.children&&0!==l.children.length)for(c=0,f=l.children.length;f>c;c+=1)if(j=l.children[c],b.hasOwnProperty(j.name))if(j.isArray)for(i=b[j.name+"_asArray"],g=0,h=i.length;h>g;g+=1)k=i[g],d(l.properties,b,k),e(j,k);else k=b[j.name],d(l.properties,b,k),e(j,k)},f=function(c){var d,g,h,i,j,k,l;if(null===c)return c;if("object"!=typeof c)return c;for(d=0,g=b.length;g>d;d+=1)"root"===b[d]&&(j=a[d],k=c,e(j,k));for(i in c)if(c.hasOwnProperty(i)){if(h=b.indexOf(i),-1!==h)if(j=a[h],j.isArray)for(l=c[i+"_asArray"],d=0,g=l.length;g>d;d+=1)k=l[d],e(j,k);else k=c[i],e(j,k);f(c[i])}return c};return{run:f}}if(function(a){"use strict";var b={VERSION:"0.5.3"};b.System=function(){this._mappings={},this._outlets={},this._handlers={},this.strictInjections=!0,this.autoMapOutlets=!1,this.postInjectionHook="setup"},b.System.prototype={_createAndSetupInstance:function(a,b){var c=new b;return this.injectInto(c,a),c},_retrieveFromCacheOrCreate:function(a,b){"undefined"==typeof b&&(b=!1);var c;if(!this._mappings.hasOwnProperty(a))throw new Error(1e3);var d=this._mappings[a];return!b&&d.isSingleton?(null==d.object&&(d.object=this._createAndSetupInstance(a,d.clazz)),c=d.object):c=d.clazz?this._createAndSetupInstance(a,d.clazz):d.object,c},mapOutlet:function(a,b,c){if("undefined"==typeof a)throw new Error(1010);return b=b||"global",c=c||a,this._outlets.hasOwnProperty(b)||(this._outlets[b]={}),this._outlets[b][c]=a,this},getObject:function(a){if("undefined"==typeof a)throw new Error(1020);return this._retrieveFromCacheOrCreate(a)},mapValue:function(a,b){if("undefined"==typeof a)throw new Error(1030);return this._mappings[a]={clazz:null,object:b,isSingleton:!0},this.autoMapOutlets&&this.mapOutlet(a),this.hasMapping(a)&&this.injectInto(b,a),this},hasMapping:function(a){if("undefined"==typeof a)throw new Error(1040);return this._mappings.hasOwnProperty(a)},mapClass:function(a,b){if("undefined"==typeof a)throw new Error(1050);if("undefined"==typeof b)throw new Error(1051);return this._mappings[a]={clazz:b,object:null,isSingleton:!1},this.autoMapOutlets&&this.mapOutlet(a),this},mapSingleton:function(a,b){if("undefined"==typeof a)throw new Error(1060);if("undefined"==typeof b)throw new Error(1061);return this._mappings[a]={clazz:b,object:null,isSingleton:!0},this.autoMapOutlets&&this.mapOutlet(a),this},instantiate:function(a){if("undefined"==typeof a)throw new Error(1070);return this._retrieveFromCacheOrCreate(a,!0)},injectInto:function(a,b){if("undefined"==typeof a)throw new Error(1080);if("object"==typeof a){var c=[];this._outlets.hasOwnProperty("global")&&c.push(this._outlets.global),"undefined"!=typeof b&&this._outlets.hasOwnProperty(b)&&c.push(this._outlets[b]);for(var d in c){var e=c[d];for(var f in e){var g=e[f];(!this.strictInjections||f in a)&&(a[f]=this.getObject(g))}}"setup"in a&&a.setup.call(a)}return this},unmap:function(a){if("undefined"==typeof a)throw new Error(1090);return delete this._mappings[a],this},unmapOutlet:function(a,b){if("undefined"==typeof a)throw new Error(1100);if("undefined"==typeof b)throw new Error(1101);return delete this._outlets[a][b],this},mapHandler:function(a,b,c,d,e){if("undefined"==typeof a)throw new Error(1110);return b=b||"global",c=c||a,"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=!1),this._handlers.hasOwnProperty(a)||(this._handlers[a]={}),this._handlers[a].hasOwnProperty(b)||(this._handlers[a][b]=[]),this._handlers[a][b].push({handler:c,oneShot:d,passEvent:e}),this},unmapHandler:function(a,b,c){if("undefined"==typeof a)throw new Error(1120);if(b=b||"global",c=c||a,this._handlers.hasOwnProperty(a)&&this._handlers[a].hasOwnProperty(b)){var d=this._handlers[a][b];for(var e in d){var f=d[e];if(f.handler===c){d.splice(e,1);break}}}return this},notify:function(a){if("undefined"==typeof a)throw new Error(1130);var b=Array.prototype.slice.call(arguments),c=b.slice(1);if(this._handlers.hasOwnProperty(a)){var d=this._handlers[a];for(var e in d){var f,g=d[e];"global"!==e&&(f=this.getObject(e));var h,i,j=[];for(h=0,i=g.length;i>h;h++){var k,l=g[h];k=f&&"string"==typeof l.handler?f[l.handler]:l.handler,l.oneShot&&j.unshift(h),l.passEvent?k.apply(f,b):k.apply(f,c)}for(h=0,i=j.length;i>h;h++)g.splice(j[h],1)}}return this}},a.dijon=b}(this),"undefined"==typeof utils)var utils={};"undefined"==typeof utils.Math&&(utils.Math={}),utils.Math.to64BitNumber=function(a,b){var c,d,e;return c=new goog.math.Long(0,b),d=new goog.math.Long(a,0),e=c.add(d),e.toNumber()},goog={},goog.math={},goog.math.Long=function(a,b){this.low_=0|a,this.high_=0|b},goog.math.Long.IntCache_={},goog.math.Long.fromInt=function(a){if(a>=-128&&128>a){var b=goog.math.Long.IntCache_[a];if(b)return b}var c=new goog.math.Long(0|a,0>a?-1:0);return a>=-128&&128>a&&(goog.math.Long.IntCache_[a]=c),c},goog.math.Long.fromNumber=function(a){return isNaN(a)||!isFinite(a)?goog.math.Long.ZERO:a<=-goog.math.Long.TWO_PWR_63_DBL_?goog.math.Long.MIN_VALUE:a+1>=goog.math.Long.TWO_PWR_63_DBL_?goog.math.Long.MAX_VALUE:0>a?goog.math.Long.fromNumber(-a).negate():new goog.math.Long(a%goog.math.Long.TWO_PWR_32_DBL_|0,a/goog.math.Long.TWO_PWR_32_DBL_|0)},goog.math.Long.fromBits=function(a,b){return new goog.math.Long(a,b)},goog.math.Long.fromString=function(a,b){if(0==a.length)throw Error("number format error: empty string");var c=b||10;if(2>c||c>36)throw Error("radix out of range: "+c);if("-"==a.charAt(0))return goog.math.Long.fromString(a.substring(1),c).negate();if(a.indexOf("-")>=0)throw Error('number format error: interior "-" character: '+a);for(var d=goog.math.Long.fromNumber(Math.pow(c,8)),e=goog.math.Long.ZERO,f=0;f<a.length;f+=8){var g=Math.min(8,a.length-f),h=parseInt(a.substring(f,f+g),c);if(8>g){var i=goog.math.Long.fromNumber(Math.pow(c,g));e=e.multiply(i).add(goog.math.Long.fromNumber(h))}else e=e.multiply(d),e=e.add(goog.math.Long.fromNumber(h))}return e},goog.math.Long.TWO_PWR_16_DBL_=65536,goog.math.Long.TWO_PWR_24_DBL_=1<<24,goog.math.Long.TWO_PWR_32_DBL_=goog.math.Long.TWO_PWR_16_DBL_*goog.math.Long.TWO_PWR_16_DBL_,goog.math.Long.TWO_PWR_31_DBL_=goog.math.Long.TWO_PWR_32_DBL_/2,goog.math.Long.TWO_PWR_48_DBL_=goog.math.Long.TWO_PWR_32_DBL_*goog.math.Long.TWO_PWR_16_DBL_,goog.math.Long.TWO_PWR_64_DBL_=goog.math.Long.TWO_PWR_32_DBL_*goog.math.Long.TWO_PWR_32_DBL_,goog.math.Long.TWO_PWR_63_DBL_=goog.math.Long.TWO_PWR_64_DBL_/2,goog.math.Long.ZERO=goog.math.Long.fromInt(0),goog.math.Long.ONE=goog.math.Long.fromInt(1),goog.math.Long.NEG_ONE=goog.math.Long.fromInt(-1),goog.math.Long.MAX_VALUE=goog.math.Long.fromBits(-1,2147483647),goog.math.Long.MIN_VALUE=goog.math.Long.fromBits(0,-2147483648),goog.math.Long.TWO_PWR_24_=goog.math.Long.fromInt(1<<24),goog.math.Long.prototype.toInt=function(){return this.low_},goog.math.Long.prototype.toNumber=function(){return this.high_*goog.math.Long.TWO_PWR_32_DBL_+this.getLowBitsUnsigned()},goog.math.Long.prototype.toString=function(a){var b=a||10;if(2>b||b>36)throw Error("radix out of range: "+b);if(this.isZero())return"0";if(this.isNegative()){if(this.equals(goog.math.Long.MIN_VALUE)){var c=goog.math.Long.fromNumber(b),d=this.div(c),e=d.multiply(c).subtract(this);return d.toString(b)+e.toInt().toString(b)}return"-"+this.negate().toString(b)}for(var f=goog.math.Long.fromNumber(Math.pow(b,6)),e=this,g="";;){var h=e.div(f),i=e.subtract(h.multiply(f)).toInt(),j=i.toString(b);if(e=h,e.isZero())return j+g;for(;j.length<6;)j="0"+j;g=""+j+g}},goog.math.Long.prototype.getHighBits=function(){return this.high_},goog.math.Long.prototype.getLowBits=function(){return this.low_},goog.math.Long.prototype.getLowBitsUnsigned=function(){return this.low_>=0?this.low_:goog.math.Long.TWO_PWR_32_DBL_+this.low_},goog.math.Long.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.equals(goog.math.Long.MIN_VALUE)?64:this.negate().getNumBitsAbs();for(var a=0!=this.high_?this.high_:this.low_,b=31;b>0&&0==(a&1<<b);b--);return 0!=this.high_?b+33:b+1},goog.math.Long.prototype.isZero=function(){return 0==this.high_&&0==this.low_},goog.math.Long.prototype.isNegative=function(){return this.high_<0},goog.math.Long.prototype.isOdd=function(){return 1==(1&this.low_)},goog.math.Long.prototype.equals=function(a){return this.high_==a.high_&&this.low_==a.low_},goog.math.Long.prototype.notEquals=function(a){return this.high_!=a.high_||this.low_!=a.low_},goog.math.Long.prototype.lessThan=function(a){return this.compare(a)<0},goog.math.Long.prototype.lessThanOrEqual=function(a){return this.compare(a)<=0},goog.math.Long.prototype.greaterThan=function(a){return this.compare(a)>0},goog.math.Long.prototype.greaterThanOrEqual=function(a){return this.compare(a)>=0},goog.math.Long.prototype.compare=function(a){if(this.equals(a))return 0;var b=this.isNegative(),c=a.isNegative();return b&&!c?-1:!b&&c?1:this.subtract(a).isNegative()?-1:1},goog.math.Long.prototype.negate=function(){return this.equals(goog.math.Long.MIN_VALUE)?goog.math.Long.MIN_VALUE:this.not().add(goog.math.Long.ONE)},goog.math.Long.prototype.add=function(a){var b=this.high_>>>16,c=65535&this.high_,d=this.low_>>>16,e=65535&this.low_,f=a.high_>>>16,g=65535&a.high_,h=a.low_>>>16,i=65535&a.low_,j=0,k=0,l=0,m=0;return m+=e+i,l+=m>>>16,m&=65535,l+=d+h,k+=l>>>16,l&=65535,k+=c+g,j+=k>>>16,k&=65535,j+=b+f,j&=65535,goog.math.Long.fromBits(l<<16|m,j<<16|k)},goog.math.Long.prototype.subtract=function(a){return this.add(a.negate())},goog.math.Long.prototype.multiply=function(a){if(this.isZero())return goog.math.Long.ZERO;if(a.isZero())return goog.math.Long.ZERO;if(this.equals(goog.math.Long.MIN_VALUE))return a.isOdd()?goog.math.Long.MIN_VALUE:goog.math.Long.ZERO;if(a.equals(goog.math.Long.MIN_VALUE))return this.isOdd()?goog.math.Long.MIN_VALUE:goog.math.Long.ZERO;if(this.isNegative())return a.isNegative()?this.negate().multiply(a.negate()):this.negate().multiply(a).negate();if(a.isNegative())return this.multiply(a.negate()).negate();if(this.lessThan(goog.math.Long.TWO_PWR_24_)&&a.lessThan(goog.math.Long.TWO_PWR_24_))return goog.math.Long.fromNumber(this.toNumber()*a.toNumber());var b=this.high_>>>16,c=65535&this.high_,d=this.low_>>>16,e=65535&this.low_,f=a.high_>>>16,g=65535&a.high_,h=a.low_>>>16,i=65535&a.low_,j=0,k=0,l=0,m=0;return m+=e*i,l+=m>>>16,m&=65535,l+=d*i,k+=l>>>16,l&=65535,l+=e*h,k+=l>>>16,l&=65535,k+=c*i,j+=k>>>16,k&=65535,k+=d*h,j+=k>>>16,k&=65535,k+=e*g,j+=k>>>16,k&=65535,j+=b*i+c*h+d*g+e*f,j&=65535,goog.math.Long.fromBits(l<<16|m,j<<16|k)},goog.math.Long.prototype.div=function(a){if(a.isZero())throw Error("division by zero");if(this.isZero())return goog.math.Long.ZERO;if(this.equals(goog.math.Long.MIN_VALUE)){if(a.equals(goog.math.Long.ONE)||a.equals(goog.math.Long.NEG_ONE))return goog.math.Long.MIN_VALUE;if(a.equals(goog.math.Long.MIN_VALUE))return goog.math.Long.ONE;var b=this.shiftRight(1),c=b.div(a).shiftLeft(1);if(c.equals(goog.math.Long.ZERO))return a.isNegative()?goog.math.Long.ONE:goog.math.Long.NEG_ONE;var d=this.subtract(a.multiply(c)),e=c.add(d.div(a));return e}if(a.equals(goog.math.Long.MIN_VALUE))return goog.math.Long.ZERO;if(this.isNegative())return a.isNegative()?this.negate().div(a.negate()):this.negate().div(a).negate();if(a.isNegative())return this.div(a.negate()).negate();for(var f=goog.math.Long.ZERO,d=this;d.greaterThanOrEqual(a);){for(var c=Math.max(1,Math.floor(d.toNumber()/a.toNumber())),g=Math.ceil(Math.log(c)/Math.LN2),h=48>=g?1:Math.pow(2,g-48),i=goog.math.Long.fromNumber(c),j=i.multiply(a);j.isNegative()||j.greaterThan(d);)c-=h,i=goog.math.Long.fromNumber(c),j=i.multiply(a);i.isZero()&&(i=goog.math.Long.ONE),f=f.add(i),d=d.subtract(j)}return f},goog.math.Long.prototype.modulo=function(a){return this.subtract(this.div(a).multiply(a))},goog.math.Long.prototype.not=function(){return goog.math.Long.fromBits(~this.low_,~this.high_)},goog.math.Long.prototype.and=function(a){return goog.math.Long.fromBits(this.low_&a.low_,this.high_&a.high_)},goog.math.Long.prototype.or=function(a){return goog.math.Long.fromBits(this.low_|a.low_,this.high_|a.high_)},goog.math.Long.prototype.xor=function(a){return goog.math.Long.fromBits(this.low_^a.low_,this.high_^a.high_)},goog.math.Long.prototype.shiftLeft=function(a){if(a&=63,0==a)return this;var b=this.low_;if(32>a){var c=this.high_;return goog.math.Long.fromBits(b<<a,c<<a|b>>>32-a)}return goog.math.Long.fromBits(0,b<<a-32)},goog.math.Long.prototype.shiftRight=function(a){if(a&=63,0==a)return this;var b=this.high_;if(32>a){var c=this.low_;return goog.math.Long.fromBits(c>>>a|b<<32-a,b>>a)}return goog.math.Long.fromBits(b>>a-32,b>=0?0:-1)},goog.math.Long.prototype.shiftRightUnsigned=function(a){if(a&=63,0==a)return this;var b=this.high_;if(32>a){var c=this.low_;return goog.math.Long.fromBits(c>>>a|b<<32-a,b>>>a)}return 32==a?goog.math.Long.fromBits(b,0):goog.math.Long.fromBits(b>>>a-32,0)};var UTF8={};UTF8.encode=function(a){for(var b=[],c=0;c<a.length;++c){var d=a.charCodeAt(c);128>d?b.push(d):2048>d?(b.push(192|d>>6),b.push(128|63&d)):65536>d?(b.push(224|d>>12),b.push(128|63&d>>6),b.push(128|63&d)):(b.push(240|d>>18),b.push(128|63&d>>12),b.push(128|63&d>>6),b.push(128|63&d))}return b},UTF8.decode=function(a){for(var b=[],c=0;c<a.length;){var d=a[c++];128>d||(224>d?(d=(31&d)<<6,d|=63&a[c++]):240>d?(d=(15&d)<<12,d|=(63&a[c++])<<6,d|=63&a[c++]):(d=(7&d)<<18,d|=(63&a[c++])<<12,d|=(63&a[c++])<<6,d|=63&a[c++])),b.push(String.fromCharCode(d))}return b.join("")};var BASE64={};if(function(b){var c=function(a){for(var c=0,d=[],e=0|a.length/3;0<e--;){var f=(a[c]<<16)+(a[c+1]<<8)+a[c+2];c+=3,d.push(b.charAt(63&f>>18)),d.push(b.charAt(63&f>>12)),d.push(b.charAt(63&f>>6)),d.push(b.charAt(63&f))}if(2==a.length-c){var f=(a[c]<<16)+(a[c+1]<<8);d.push(b.charAt(63&f>>18)),d.push(b.charAt(63&f>>12)),d.push(b.charAt(63&f>>6)),d.push("=")}else if(1==a.length-c){var f=a[c]<<16;d.push(b.charAt(63&f>>18)),d.push(b.charAt(63&f>>12)),d.push("==")}return d.join("")},d=function(){for(var a=[],c=0;c<b.length;++c)a[b.charCodeAt(c)]=c;return a["=".charCodeAt(0)]=0,a}(),e=function(a){for(var b=0,c=[],e=0|a.length/4;0<e--;){var f=(d[a.charCodeAt(b)]<<18)+(d[a.charCodeAt(b+1)]<<12)+(d[a.charCodeAt(b+2)]<<6)+d[a.charCodeAt(b+3)];c.push(255&f>>16),c.push(255&f>>8),c.push(255&f),b+=4}return c&&("="==a.charAt(b-2)?(c.pop(),c.pop()):"="==a.charAt(b-1)&&c.pop()),c},f={};f.encode=function(a){for(var b=[],c=0;c<a.length;++c)b.push(a.charCodeAt(c));return b},f.decode=function(){for(var b=0;b<s.length;++b)a[b]=String.fromCharCode(a[b]);return a.join("")},BASE64.decodeArray=function(a){var b=e(a);return new Uint8Array(b)},BASE64.encodeASCII=function(a){var b=f.encode(a);return c(b)},BASE64.decodeASCII=function(a){var b=e(a);return f.decode(b)},BASE64.encode=function(a){var b=UTF8.encode(a);return c(b)},BASE64.decode=function(a){var b=e(a);return UTF8.decode(b)}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),void 0===btoa)var btoa=BASE64.encode;if(void 0===atob)var atob=BASE64.decode;MediaPlayer=function(a){"use strict";var b,c,d,e,f,g,h,i,j,k,l,m="1.3.0",n=a,o=null,p=!1,q=!1,r=!0,s=!1,t=MediaPlayer.dependencies.BufferController.BUFFER_SIZE_REQUIRED,u=function(){return!!e&&!!f},v=function(){if(!p)throw"MediaPlayer not initialized!";if(!this.capabilities.supportsMediaSource())return void this.errHandler.capabilityError("mediasource");if(!e||!f)throw"Missing view or source.";q=!0,g=b.getObject("streamController"),g.subscribe(MediaPlayer.dependencies.StreamController.eventList.ENAME_STREAMS_COMPOSED,i),c.subscribe(MediaPlayer.dependencies.ManifestLoader.eventList.ENAME_MANIFEST_LOADED,g),c.subscribe(MediaPlayer.dependencies.ManifestLoader.eventList.ENAME_MANIFEST_LOADED,i),g.initialize(),g.setVideoModel(l),g.setAutoPlay(r),g.setProtectionData(o),g.load(f),b.mapValue("scheduleWhilePaused",s),b.mapOutlet("scheduleWhilePaused","stream"),b.mapOutlet("scheduleWhilePaused","scheduleController"),b.mapValue("bufferMax",t),b.mapOutlet("bufferMax","bufferController"),h.initialize()},w=function(){u()&&v.call(this)},x=function(){var a=k.getReadOnlyMetricsFor("video")||k.getReadOnlyMetricsFor("audio");return j.getCurrentDVRInfo(a)},y=function(){return x.call(this).manifestInfo.DVRWindowSize},z=function(a){var b=x.call(this),c=b.range.start+a;return c>b.range.end&&(c=b.range.end),c},A=function(a){l.getElement().currentTime=this.getDVRSeekOffset(a)},B=function(){var a=x.call(this);return null===a?0:this.duration()-(a.range.end-a.time)},C=function(){var a,b=x.call(this);return null===b?0:(a=b.range.end-b.range.start,a<b.manifestInfo.DVRWindowSize?a:b.manifestInfo.DVRWindowSize)},D=function(){var a,b,c=x.call(this);return null===c?0:(a=c.manifestInfo.availableFrom.getTime()/1e3,b=this.time()+(a+c.range.start))},E=function(){var a,b,c=x.call(this);return null===c?0:(a=c.manifestInfo.availableFrom.getTime()/1e3,b=a+c.range.start+this.duration())},F=function(a,b,c){var d=new Date(1e3*a),e=d.toLocaleDateString(b),f=d.toLocaleTimeString(b,{hour12:c});return f+" "+e},G=function(a){a=Math.max(a,0);var b=Math.floor(a/3600),c=Math.floor(a%3600/60),d=Math.floor(a%3600%60);return(0===b?"":10>b?"0"+b.toString()+":":b.toString()+":")+(10>c?"0"+c.toString():c.toString())+":"+(10>d?"0"+d.toString():d.toString())},H=function(a,b,c){b&&void 0!==a&&null!==a&&(c?h.setRules(a,b):h.addRules(a,b))},I=function(){q&&g&&(g.unsubscribe(MediaPlayer.dependencies.StreamController.eventList.ENAME_STREAMS_COMPOSED,i),c.unsubscribe(MediaPlayer.dependencies.ManifestLoader.eventList.ENAME_MANIFEST_LOADED,g),c.unsubscribe(MediaPlayer.dependencies.ManifestLoader.eventList.ENAME_MANIFEST_LOADED,i),g.reset(),d.reset(),h.reset(),g=null,q=!1)};return b=new dijon.System,b.mapValue("system",b),b.mapOutlet("system"),b.injectInto(n),{notifier:void 0,debug:void 0,eventBus:void 0,capabilities:void 0,adapter:void 0,errHandler:void 0,uriQueryFragModel:void 0,videoElementExt:void 0,setup:function(){j=b.getObject("metricsExt"),c=b.getObject("manifestLoader"),i=b.getObject("manifestUpdater"),d=b.getObject("abrController"),h=b.getObject("rulesController"),k=b.getObject("metricsModel")},addEventListener:function(a,b,c){this.eventBus.addEventListener(a,b,c)},removeEventListener:function(a,b,c){this.eventBus.removeEventListener(a,b,c)},getVersion:function(){return m},startup:function(){p||(b.injectInto(this),p=!0)},getDebug:function(){return this.debug},getVideoModel:function(){return l},setAutoPlay:function(a){r=a},getAutoPlay:function(){return r},setScheduleWhilePaused:function(a){s=a},getScheduleWhilePaused:function(){return s},setBufferMax:function(a){t=a},getBufferMax:function(){return t},getMetricsExt:function(){return j},getMetricsFor:function(a){var b=k.getReadOnlyMetricsFor(a);return b},getQualityFor:function(a){return d.getQualityFor(a,g.getActiveStreamInfo())},setQualityFor:function(a,b){d.setPlaybackQuality(a,g.getActiveStreamInfo(),b)},getAutoSwitchQuality:function(){return d.getAutoSwitchBitrate()},setAutoSwitchQuality:function(a){d.setAutoSwitchBitrate(a)},setSchedulingRules:function(a){H.call(this,h.SCHEDULING_RULE,a,!0)},addSchedulingRules:function(a){H.call(this,h.SCHEDULING_RULE,a,!1)},setABRRules:function(a){H.call(this,h.ABR_RULE,a,!0)},addABRRules:function(a){H.call(this,h.ABR_RULE,a,!1)},attachView:function(a){if(!p)throw"MediaPlayer not initialized!";e=a,l=null,e&&(l=b.getObject("videoModel"),l.setElement(e)),I.call(this),u.call(this)&&w.call(this)},attachSource:function(a){if(!p)throw"MediaPlayer not initialized!";this.uriQueryFragModel.reset(),f=this.uriQueryFragModel.parseURI(a),I.call(this),u.call(this)&&w.call(this)},attachProtectionData:function(a){o=a},reset:function(){this.attachSource(null),this.attachView(null)},play:v,isReady:u,seek:A,time:B,duration:C,timeAsUTC:D,durationAsUTC:E,getDVRWindowSize:y,getDVRSeekOffset:z,formatUTC:F,convertToTimeCode:G}},MediaPlayer.prototype={constructor:MediaPlayer},MediaPlayer.dependencies={},MediaPlayer.dependencies.protection={},MediaPlayer.utils={},MediaPlayer.models={},MediaPlayer.vo={},MediaPlayer.vo.metrics={},MediaPlayer.vo.protection={},MediaPlayer.rules={},MediaPlayer.di={},MediaPlayer.di.Context=function(){"use strict";var a=function(){var a=document.createElement("video");if(MediaPlayer.models.ProtectionModel_3Feb2014.detect(a))this.system.mapClass("protectionModel",MediaPlayer.models.ProtectionModel_3Feb2014);else if(MediaPlayer.models.ProtectionModel_01b.detect(a))this.system.mapClass("protectionModel",MediaPlayer.models.ProtectionModel_01b);else{var b=this.system.getObject("debug");b.log("No supported version of EME detected on this user agent!"),b.log("Attempts to play encrypted content will fail!")}};return{system:void 0,setup:function(){this.system.autoMapOutlets=!0,this.system.mapSingleton("debug",MediaPlayer.utils.Debug),this.system.mapSingleton("eventBus",MediaPlayer.utils.EventBus),this.system.mapSingleton("capabilities",MediaPlayer.utils.Capabilities),this.system.mapSingleton("textTrackExtensions",MediaPlayer.utils.TextTrackExtensions),this.system.mapSingleton("vttParser",MediaPlayer.utils.VTTParser),this.system.mapSingleton("ttmlParser",MediaPlayer.utils.TTMLParser),this.system.mapClass("videoModel",MediaPlayer.models.VideoModel),this.system.mapSingleton("manifestModel",MediaPlayer.models.ManifestModel),this.system.mapSingleton("metricsModel",MediaPlayer.models.MetricsModel),this.system.mapSingleton("uriQueryFragModel",MediaPlayer.models.URIQueryAndFragmentModel),this.system.mapSingleton("ksPlayReady",MediaPlayer.dependencies.protection.KeySystem_PlayReady),this.system.mapSingleton("ksWidevine",MediaPlayer.dependencies.protection.KeySystem_Widevine),this.system.mapSingleton("ksClearKey",MediaPlayer.dependencies.protection.KeySystem_ClearKey),this.system.mapSingleton("requestModifierExt",MediaPlayer.dependencies.RequestModifierExtensions),this.system.mapSingleton("textSourceBuffer",MediaPlayer.dependencies.TextSourceBuffer),this.system.mapSingleton("mediaSourceExt",MediaPlayer.dependencies.MediaSourceExtensions),this.system.mapSingleton("sourceBufferExt",MediaPlayer.dependencies.SourceBufferExtensions),this.system.mapSingleton("abrController",MediaPlayer.dependencies.AbrController),this.system.mapSingleton("errHandler",MediaPlayer.dependencies.ErrorHandler),this.system.mapSingleton("videoExt",MediaPlayer.dependencies.VideoModelExtensions),this.system.mapSingleton("protectionExt",MediaPlayer.dependencies.ProtectionExtensions),this.system.mapClass("protectionController",MediaPlayer.dependencies.ProtectionController),this.system.mapClass("playbackController",MediaPlayer.dependencies.PlaybackController),a.call(this),this.system.mapSingleton("liveEdgeFinder",MediaPlayer.dependencies.LiveEdgeFinder),this.system.mapClass("metrics",MediaPlayer.models.MetricsList),this.system.mapClass("downloadRatioRule",MediaPlayer.rules.DownloadRatioRule),this.system.mapClass("insufficientBufferRule",MediaPlayer.rules.InsufficientBufferRule),this.system.mapClass("limitSwitchesRule",MediaPlayer.rules.LimitSwitchesRule),this.system.mapClass("bufferOccupancyRule",MediaPlayer.rules.BufferOccupancyRule),this.system.mapClass("throughputRule",MediaPlayer.rules.ThroughputRule),this.system.mapSingleton("abrRulesCollection",MediaPlayer.rules.ABRRulesCollection),this.system.mapSingleton("rulesController",MediaPlayer.rules.RulesController),this.system.mapClass("bufferLevelRule",MediaPlayer.rules.BufferLevelRule),this.system.mapClass("pendingRequestsRule",MediaPlayer.rules.PendingRequestsRule),this.system.mapClass("playbackTimeRule",MediaPlayer.rules.PlaybackTimeRule),this.system.mapClass("sameTimeRequestRule",MediaPlayer.rules.SameTimeRequestRule),this.system.mapSingleton("scheduleRulesCollection",MediaPlayer.rules.ScheduleRulesCollection),this.system.mapClass("liveEdgeBinarySearchRule",MediaPlayer.rules.LiveEdgeBinarySearchRule),this.system.mapClass("liveEdgeWithTimeSynchronizationRule",MediaPlayer.rules.LiveEdgeWithTimeSynchronizationRule),this.system.mapSingleton("synchronizationRulesCollection",MediaPlayer.rules.SynchronizationRulesCollection),this.system.mapClass("streamProcessor",MediaPlayer.dependencies.StreamProcessor),this.system.mapClass("eventController",MediaPlayer.dependencies.EventController),this.system.mapClass("textController",MediaPlayer.dependencies.TextController),this.system.mapClass("bufferController",MediaPlayer.dependencies.BufferController),this.system.mapSingleton("manifestLoader",MediaPlayer.dependencies.ManifestLoader),this.system.mapSingleton("manifestUpdater",MediaPlayer.dependencies.ManifestUpdater),this.system.mapClass("fragmentController",MediaPlayer.dependencies.FragmentController),this.system.mapClass("fragmentLoader",MediaPlayer.dependencies.FragmentLoader),this.system.mapClass("fragmentModel",MediaPlayer.dependencies.FragmentModel),this.system.mapSingleton("streamController",MediaPlayer.dependencies.StreamController),this.system.mapClass("stream",MediaPlayer.dependencies.Stream),this.system.mapClass("scheduleController",MediaPlayer.dependencies.ScheduleController),this.system.mapSingleton("timeSyncController",MediaPlayer.dependencies.TimeSyncController),this.system.mapSingleton("notifier",MediaPlayer.dependencies.Notifier)}}},Dash=function(){"use strict";return{modules:{},dependencies:{},vo:{},di:{}}}(),Dash.di.DashContext=function(){"use strict";return{system:void 0,setup:function(){Dash.di.DashContext.prototype.setup.call(this),this.system.mapClass("parser",Dash.dependencies.DashParser),this.system.mapClass("indexHandler",Dash.dependencies.DashHandler),this.system.mapSingleton("baseURLExt",Dash.dependencies.BaseURLExtensions),this.system.mapClass("fragmentExt",Dash.dependencies.FragmentExtensions),this.system.mapClass("trackController",Dash.dependencies.RepresentationController),this.system.mapSingleton("manifestExt",Dash.dependencies.DashManifestExtensions),this.system.mapSingleton("metricsExt",Dash.dependencies.DashMetricsExtensions),this.system.mapSingleton("timelineConverter",Dash.dependencies.TimelineConverter),this.system.mapSingleton("adapter",Dash.dependencies.DashAdapter)}}},Dash.di.DashContext.prototype=new MediaPlayer.di.Context,Dash.di.DashContext.prototype.constructor=Dash.di.DashContext,Dash.dependencies.DashAdapter=function(){"use strict";var a=[],b={},c=function(a,b){return b.getRepresentationForQuality(a.quality)},d=function(a){return b[a.streamInfo.id][a.index]},e=function(b){var c,d=a.length,e=0;for(e;d>e;e+=1)if(c=a[e],b.id===c.id)return c;return null},f=function(a){var b=new MediaPlayer.vo.TrackInfo,c=a.adaptation.period.mpd.manifest.Period_asArray[a.adaptation.period.index].AdaptationSet_asArray[a.adaptation.index],d=this.manifestExt.getRepresentationFor(a.index,c);return b.id=a.id,b.quality=a.index,b.bandwidth=this.manifestExt.getBandwidth(d),b.DVRWindow=a.segmentAvailabilityRange,b.fragmentDuration=a.segmentDuration||(a.segments&&a.segments.length>0?a.segments[0].duration:0/0),b.MSETimeOffset=a.MSETimeOffset,b.useCalculatedLiveEdgeTime=a.useCalculatedLiveEdgeTime,b.mediaInfo=g.call(this,a.adaptation),b},g=function(a){var b=new MediaPlayer.vo.MediaInfo,c=this,d=a.period.mpd.manifest.Period_asArray[a.period.index].AdaptationSet_asArray[a.index];return b.id=a.id,b.index=a.index,b.type=a.type,b.streamInfo=h.call(this,a.period),b.trackCount=this.manifestExt.getRepresentationCount(d),b.lang=this.manifestExt.getLanguageForAdaptation(d),b.codec=this.manifestExt.getCodec(d),b.mimeType=this.manifestExt.getMimeType(d),b.contentProtection=this.manifestExt.getContentProtectionData(d),b.contentProtection&&b.contentProtection.forEach(function(a){a.KID=c.manifestExt.getKID(a)}),b.isText=this.manifestExt.getIsTextTrack(b.mimeType),b},h=function(a){var b=new MediaPlayer.vo.StreamInfo,c=1;
15
+ return b.id=a.id,b.index=a.index,b.start=a.start,b.duration=a.duration,b.manifestInfo=i.call(this,a.mpd),b.isLast=Math.abs(b.start+b.duration-b.manifestInfo.duration)<c,b},i=function(a){var b=new MediaPlayer.vo.ManifestInfo,c=this.manifestModel.getValue();return b.DVRWindowSize=a.timeShiftBufferDepth,b.loadedTime=a.manifest.loadedTime,b.availableFrom=a.availabilityStartTime,b.minBufferTime=a.manifest.minBufferTime,b.maxFragmentDuration=a.maxSegmentDuration,b.duration=this.manifestExt.getDuration(c),b.isDynamic=this.manifestExt.getIsDynamic(c),b},j=function(a,c,d){var f,h=e(c),i=h.id,j=this.manifestExt.getAdaptationForType(a,c.index,d);return j?(f=this.manifestExt.getIndexForAdaptation(j,a,c.index),b[i]=b[i]||this.manifestExt.getAdaptationsForPeriod(a,h),g.call(this,b[i][f])):null},k=function(c){var d,e,f,g=[];if(!c)return null;for(d=this.manifestExt.getMpd(c),a=this.manifestExt.getRegularPeriods(c,d),b={},e=a.length,f=0;e>f;f+=1)g.push(h.call(this,a[f]));return g},l=function(a){var b=this.manifestExt.getMpd(a);return i.call(this,b)},m=function(a,b){var c=a.trackController.getRepresentationForQuality(b);return a.indexHandler.getInitRequest(c)},n=function(a,b){var d=c(b,a.trackController);return a.indexHandler.getNextSegmentRequest(d)},o=function(a,b,d,e){var f=c(b,a.trackController);return a.indexHandler.getSegmentRequestForTime(f,d,e)},p=function(a,b,d){var e=c(b,a.trackController),f=a.indexHandler.generateSegmentRequestForTime(e,d);return f},q=function(a){return a.indexHandler.getCurrentTime()},r=function(a,b){return a.indexHandler.setCurrentTime(b)},s=function(a){var b,c,f=e(a.getStreamInfo()),g=a.getMediaInfo(),h=d(g),i=this.manifestModel.getValue(),j=a.getType();b=g.id,c=b?this.manifestExt.getAdaptationForId(b,i,f.index):this.manifestExt.getAdaptationForIndex(g.index,i,f.index),a.setMediaInfo(g),a.trackController.updateData(c,h,j)},t=function(a,b){var c=a.getRepresentationForQuality(b);return c?f.call(this,c):null},u=function(a){var b=a.getCurrentRepresentation();return b?f.call(this,b):null},v=function(a,b,c){var d=new Dash.vo.Event,e=a[0],f=a[1],g=a[2],h=a[3],i=a[4],j=a[5],k=a[6],l=c*g+h;return b[e]?(d.eventStream=b[e],d.eventStream.value=f,d.eventStream.timescale=g,d.duration=i,d.id=j,d.presentationTime=l,d.messageData=k,d.presentationTimeDelta=h,d):null},w=function(a,b){var f=this.manifestModel.getValue(),g=[];return a instanceof MediaPlayer.vo.StreamInfo?g=this.manifestExt.getEventsForPeriod(f,e(a)):a instanceof MediaPlayer.vo.MediaInfo?g=this.manifestExt.getEventStreamForAdaptationSet(f,d(a)):a instanceof MediaPlayer.vo.TrackInfo&&(g=this.manifestExt.getEventStreamForRepresentation(f,c(a,b.trackController))),g};return{system:void 0,manifestExt:void 0,manifestModel:void 0,timelineConverter:void 0,metricsList:{TCP_CONNECTION:"TcpConnection",HTTP_REQUEST:"HttpRequest",HTTP_REQUEST_TRACE:"HttpRequestTrace",TRACK_SWITCH:"RepresentationSwitch",BUFFER_LEVEL:"BufferLevel",BUFFER_STATE:"BufferState",DVR_INFO:"DVRInfo",DROPPED_FRAMES:"DroppedFrames",SCHEDULING_INFO:"SchedulingInfo",MANIFEST_UPDATE:"ManifestUpdate",MANIFEST_UPDATE_STREAM_INFO:"ManifestUpdatePeriodInfo",MANIFEST_UPDATE_TRACK_INFO:"ManifestUpdateRepresentationInfo",PLAY_LIST:"PlayList",PLAY_LIST_TRACE:"PlayListTrace"},convertDataToTrack:f,convertDataToMedia:g,convertDataToStream:h,getDataForTrack:c,getDataForMedia:d,getDataForStream:e,getStreamsInfo:k,getManifestInfo:l,getMediaInfoForType:j,getCurrentTrackInfo:u,getTrackInfoForQuality:t,updateData:s,getInitRequest:m,getNextFragmentRequest:n,getFragmentRequestForTime:o,generateFragmentRequestForTime:p,getIndexHandlerTime:q,setIndexHandlerTime:r,getEventsFor:w,getEvent:v,reset:function(){a=[],b={}}}},Dash.dependencies.DashAdapter.prototype={constructor:Dash.dependencies.DashAdapter},Dash.create=function(a,b,c){if(void 0!==typeof a&&"VIDEO"==a.nodeName){var d,e=a.id||a.name||"video element";return c=c||new Dash.di.DashContext,b=b||[].slice.call(a.querySelectorAll("source")).filter(function(a){return a.type==Dash.supportedManifestMimeTypes.mimeType})[0],d=new MediaPlayer(c),d.startup(),d.attachView(a),d.setAutoPlay(a.autoplay),d.attachSource(b.src),d.getDebug().log("Converted "+e+" to dash.js player and added content: "+b.src),d}},Dash.createAll=function(a,b,c){var d=[];a=a||".dashjs-player",b=b||document,c=c||new Dash.di.DashContext;for(var e=b.querySelectorAll(a),f=0;f<e.length;f++){var g=Dash.create(e[f],void 0,c);d.push(g)}return d},Dash.supportedManifestMimeTypes={mimeType:"application/dash+xml"},Dash.dependencies.DashHandler=function(){"use strict";var a,b,c,d=-1,e=0,f=new RegExp("^(?:(?:[a-z]+:)?/)?/","i"),g=function(a,b){for(;a.length<b;)a="0"+a;return a},h=function(a,b,c){for(var d,e,f,h,i=0,j=0,k=b.length,l="%0",m=l.length;;){if(i=a.indexOf("$"+b),0>i)return a;if(j=a.indexOf("$",i+k),0>j)return a;if(d=a.indexOf(l,i+k),d>i&&j>d)switch(e=a.charAt(j-1),f=parseInt(a.substring(d+m,j-1),10),e){case"d":case"i":case"u":h=g(c.toString(),f);break;case"x":h=g(c.toString(16),f);break;case"X":h=g(c.toString(16),f).toUpperCase();break;case"o":h=g(c.toString(8),f);break;default:return this.debug.log("Unsupported/invalid IEEE 1003.1 format identifier string in URL"),a}else h=c;a=a.substring(0,i)+h+a.substring(j+1)}},i=function(a){return a.split("$$").join("$")},j=function(a,b){if(null===b||-1===a.indexOf("$RepresentationID$"))return a;var c=b.toString();return a.split("$RepresentationID$").join(c)},k=function(a,b){return a.representation.startNumber+b},l=function(a,b){var c,d=b.adaptation.period.mpd.manifest.Period_asArray[b.adaptation.period.index].AdaptationSet_asArray[b.adaptation.index].Representation_asArray[b.index].BaseURL;return c=a===d?a:f.test(a)?a:d+a},m=function(a,c){var d,e,f=this,g=new MediaPlayer.vo.FragmentRequest;return d=a.adaptation.period,g.mediaType=c,g.type="Initialization Segment",g.url=l(a.initialization,a),g.range=a.range,e=d.start,g.availabilityStartTime=f.timelineConverter.calcAvailabilityStartTimeFromPresentationTime(e,a.adaptation.period.mpd,b),g.availabilityEndTime=f.timelineConverter.calcAvailabilityEndTimeFromPresentationTime(e+d.duration,d.mpd,b),g.quality=a.index,g},n=function(a){var b,d=this;return a?b=m.call(d,a,c):null},o=function(a){var c,e,f,g=a.adaptation.period,h=!1;return b?h=!1:0>d?h=!1:d<a.availableSegmentsNumber?(e=B(d,a),e&&(f=e.presentationStartTime-g.start,c=a.adaptation.period.duration,this.debug.log(a.segmentInfoType+": "+f+" / "+c),h=f>=c)):h=!0,h},p=function(a,c){var d,e,f,g,h=this;return e=a.segmentDuration,f=a.adaptation.period.start+c*e,g=f+e,d=new Dash.vo.Segment,d.representation=a,d.duration=e,d.presentationStartTime=f,d.mediaStartTime=h.timelineConverter.calcMediaTimeFromPresentationTime(d.presentationStartTime,a),d.availabilityStartTime=h.timelineConverter.calcAvailabilityStartTimeFromPresentationTime(d.presentationStartTime,a.adaptation.period.mpd,b),d.availabilityEndTime=h.timelineConverter.calcAvailabilityEndTimeFromPresentationTime(g,a.adaptation.period.mpd,b),d.wallStartTime=h.timelineConverter.calcWallTimeForSegment(d,b),d.replacementNumber=k(d,c),d.availabilityIdx=c,d},q=function(b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q=this,r=b.adaptation.period.mpd.manifest.Period_asArray[b.adaptation.period.index].AdaptationSet_asArray[b.adaptation.index].Representation_asArray[b.index].SegmentTemplate,s=r.SegmentTimeline,v=b.availableSegmentsNumber>0,w=10,x=[],y=0,z=0,A=-1,B=function(a){return u.call(q,b,y,a.d,p,r.media,a.mediaRange,A)};for(p=b.timescale,c=s.S_asArray,k=t.call(q,b),k?(n=k.start,o=k.end):m=q.timelineConverter.calcMediaTimeFromPresentationTime(a||0,b),e=0,f=c.length;f>e;e+=1)if(d=c[e],h=0,d.hasOwnProperty("r")&&(h=d.r),d.hasOwnProperty("t")&&(y=d.t,z=y/p),0>h&&(j=c[e+1],j&&j.hasOwnProperty("t")?i=j.t/p:(i=q.timelineConverter.calcMediaTimeFromPresentationTime(b.segmentAvailabilityRange.end,b),b.segmentDuration=d.d/p),h=Math.ceil((i-z)/(d.d/p))-1),l){if(v)break;A+=h+1}else for(g=0;h>=g;g+=1){if(A+=1,k){if(A>o){if(l=!0,v)break;continue}A>=n&&x.push(B.call(q,d))}else{if(x.length>w){if(l=!0,v)break;continue}z>=m-d.d/p&&x.push(B.call(q,d))}y+=d.d,z=y/p}return v||(b.availableSegmentsNumber=A+1),x},r=function(a){var b,c,d,e,f,g=[],i=this,j=a.adaptation.period.mpd.manifest.Period_asArray[a.adaptation.period.index].AdaptationSet_asArray[a.adaptation.index].Representation_asArray[a.index].SegmentTemplate,k=a.segmentDuration,l=a.segmentAvailabilityRange,m=null,n=null;for(f=a.startNumber,b=s.call(i,a),d=b.start,e=b.end,c=d;e>=c;c+=1)m=p.call(i,a,c),m.replacementTime=(f+c-1)*a.segmentDuration,n=j.media,n=h(n,"Number",m.replacementNumber),n=h(n,"Time",m.replacementTime),m.media=n,g.push(m),m=null;return a.availableSegmentsNumber=Math.ceil((l.end-l.start)/k),g},s=function(c){var e,f,g,h=this,i=c.segmentDuration,j=c.adaptation.period.mpd.manifest.minBufferTime,k=c.segmentAvailabilityRange,l={start:h.timelineConverter.calcPeriodRelativeTimeFromMpdRelativeTime(c,k.start),end:h.timelineConverter.calcPeriodRelativeTimeFromMpdRelativeTime(c,k.end)},m=0/0,n=null,o=c.segments,p=2*i,q=Math.max(2*j,10*i);return l||(l=h.timelineConverter.calcSegmentAvailabilityRange(c,b)),b&&!h.timelineConverter.isTimeSyncCompleted()?(e=Math.floor(l.start/i),f=Math.floor(l.end/i),g={start:e,end:f}):(o?(n=B(d,c),m=n?h.timelineConverter.calcPeriodRelativeTimeFromMpdRelativeTime(c,n.presentationStartTime):d>0?d*i:h.timelineConverter.calcPeriodRelativeTimeFromMpdRelativeTime(c,a||o[0].presentationStartTime)):m=d>0?d*i:b?l.end:l.start,e=Math.floor(Math.max(m-p,l.start)/i),f=Math.floor(Math.min(e+q/i,l.end/i)),g={start:e,end:f})},t=function(){var c,e,f,g=2,h=10,i=0,j=Number.POSITIVE_INFINITY;return b&&!this.timelineConverter.isTimeSyncCompleted()?f={start:i,end:j}:!b&&a||0>d?null:(c=Math.max(d-g,i),e=Math.min(d+h,j),f={start:c,end:e})},u=function(a,c,d,e,f,g,i){var j,l,m,n=this,o=c/e,p=Math.min(d/e,a.adaptation.period.mpd.maxSegmentDuration);return j=n.timelineConverter.calcPresentationTimeFromMediaTime(o,a),l=j+p,m=new Dash.vo.Segment,m.representation=a,m.duration=p,m.mediaStartTime=o,m.presentationStartTime=j,m.availabilityStartTime=a.adaptation.period.mpd.manifest.loadedTime,m.availabilityEndTime=n.timelineConverter.calcAvailabilityEndTimeFromPresentationTime(l,a.adaptation.period.mpd,b),m.wallStartTime=n.timelineConverter.calcWallTimeForSegment(m,b),m.replacementTime=c,m.replacementNumber=k(m,i),f=h(f,"Number",m.replacementNumber),f=h(f,"Time",m.replacementTime),m.media=f,m.mediaRange=g,m.availabilityIdx=i,m},v=function(a){var b,c,d,e,f,g,h,i=this,j=[],k=a.adaptation.period.mpd.manifest.Period_asArray[a.adaptation.period.index].AdaptationSet_asArray[a.adaptation.index].Representation_asArray[a.index].SegmentList,l=a.adaptation.period.mpd.manifest.Period_asArray[a.adaptation.period.index].AdaptationSet_asArray[a.adaptation.index].Representation_asArray[a.index].BaseURL,m=k.SegmentURL_asArray.length;for(h=a.startNumber,e=s.call(i,a),f=Math.max(e.start,0),g=Math.min(e.end,k.SegmentURL_asArray.length-1),b=f;g>=b;b+=1)d=k.SegmentURL_asArray[b],c=p.call(i,a,b),c.replacementTime=(h+b-1)*a.segmentDuration,c.media=d.media?d.media:l,c.mediaRange=d.mediaRange,c.index=d.index,c.indexRange=d.indexRange,j.push(c),c=null;return a.availableSegmentsNumber=m,j},w=function(a){var b,c=this,d=a.segmentInfoType;return"SegmentBase"!==d&&"BaseURL"!==d&&C.call(c,a)?("SegmentTimeline"===d?b=q.call(c,a):"SegmentTemplate"===d?b=r.call(c,a):"SegmentList"===d&&(b=v.call(c,a)),x.call(c,a,b)):b=a.segments,b},x=function(a,c){var d,e,f,g;a.segments=c,d=c.length-1,b&&isNaN(this.timelineConverter.getExpectedLiveEdge())&&(g=c[d],e=g.presentationStartTime+g.duration,f=this.metricsModel.getMetricsFor("stream"),this.timelineConverter.setExpectedLiveEdge(e),this.metricsModel.updateManifestUpdateInfo(this.metricsExt.getCurrentManifestUpdate(f),{presentationStartTime:e}))},y=function(a){var b=this;if(!a)throw new Error("no representation");return a.segments=null,w.call(b,a),a},z=function(a,e){var f,g=this,h=a.initialization,i="BaseURL"!==a.segmentInfoType&&"SegmentBase"!==a.segmentInfoType;return a.segmentAvailabilityRange=null,a.segmentAvailabilityRange=g.timelineConverter.calcSegmentAvailabilityRange(a,b),a.segmentAvailabilityRange.end<a.segmentAvailabilityRange.start&&!a.useCalculatedLiveEdgeTime?(f=new MediaPlayer.vo.Error(Dash.dependencies.DashHandler.SEGMENTS_UNAVAILABLE_ERROR_CODE,"no segments are available yet",{availabilityDelay:Math.abs(a.segmentAvailabilityRange.end)}),void g.notify(Dash.dependencies.DashHandler.eventList.ENAME_REPRESENTATION_UPDATED,{representation:a},f)):(e||(d=-1),y.call(g,a),h||g.baseURLExt.loadInitialization(a),i||g.baseURLExt.loadSegments(a,c,a.indexRange),void(h&&i&&g.notify(Dash.dependencies.DashHandler.eventList.ENAME_REPRESENTATION_UPDATED,{representation:a})))},A=function(a,b,c){var d,e,f,g,h,i=b.segments,j=i?i.length:null,k=-1;if(i&&j>0)for(h=0;j>h;h+=1)if(e=i[h],f=e.presentationStartTime,g=e.duration,d=void 0===c||null===c?g/2:c,a+d>=f&&f+g>a-d){k=e.availabilityIdx;break}return k},B=function(a,b){if(!b||!b.segments)return null;var c,d,e=b.segments.length;for(d=0;e>d;d+=1)if(c=b.segments[d],c.availabilityIdx===a)return c;return null},C=function(a){var b,c,e=!1,f=a.segments;return f&&0!==f.length?(c=f[0].availabilityIdx,b=f[f.length-1].availabilityIdx,e=c>d||d>b):e=!0,e},D=function(a){if(null===a||void 0===a)return null;var b,d=new MediaPlayer.vo.FragmentRequest,e=a.representation,f=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].bandwidth;return b=l(a.media,e),b=h(b,"Number",a.replacementNumber),b=h(b,"Time",a.replacementTime),b=h(b,"Bandwidth",f),b=j(b,e.id),b=i(b),d.mediaType=c,d.type="Media Segment",d.url=b,d.range=a.mediaRange,d.startTime=a.presentationStartTime,d.duration=a.duration,d.timescale=e.timescale,d.availabilityStartTime=a.availabilityStartTime,d.availabilityEndTime=a.availabilityEndTime,d.wallStartTime=a.wallStartTime,d.quality=e.index,d.index=a.availabilityIdx,d},E=function(b,e,f){var g,h,i,j=d,k=f?f.keepIdx:!1,l=f?f.timeThreshold:null,m=this;return b?(a=e,m.debug.log("Getting the request for time: "+e),d=A.call(m,e,b,l),w.call(m,b),0>d&&(d=A.call(m,e,b,l)),m.debug.log("Index for time "+e+" is "+d),i=o.call(m,b),i?(g=new MediaPlayer.vo.FragmentRequest,g.action=g.ACTION_COMPLETE,g.index=d,g.mediaType=c,m.debug.log("Signal complete."),m.debug.log(g)):(h=B(d,b),g=D.call(m,h)),k&&(d=j),g):null},F=function(a,b){var c=(a.segmentAvailabilityRange.end-a.segmentAvailabilityRange.start)/2;return a.segments=null,a.segmentAvailabilityRange={start:b-c,end:b+c},E.call(this,a,b,{keepIdx:!1})},G=function(b){var e,f,g,h,i=this;if(!b)return null;if(-1===d)throw"You must call getSegmentRequestForTime first.";return a=null,d+=1,h=d,g=o.call(i,b),g?(e=new MediaPlayer.vo.FragmentRequest,e.action=e.ACTION_COMPLETE,e.index=h,e.mediaType=c,i.debug.log("Signal complete.")):(w.call(i,b),f=B(h,b),e=D.call(i,f)),e},H=function(a){var b=a.data.representation;b.segments&&this.notify(Dash.dependencies.DashHandler.eventList.ENAME_REPRESENTATION_UPDATED,{representation:b})},I=function(a){if(!a.error&&c===a.data.mediaType){var b,d,e,f,g=this,h=a.data.segments,i=a.data.representation,j=[],k=0;for(b=0,d=h.length;d>b;b+=1)e=h[b],f=u.call(g,i,e.startTime,e.duration,e.timescale,e.media,e.mediaRange,k),j.push(f),f=null,k+=1;i.segmentAvailabilityRange={start:j[0].presentationStartTime,end:j[d-1].presentationStartTime},i.availableSegmentsNumber=d,x.call(g,i,j),i.initialization&&this.notify(Dash.dependencies.DashHandler.eventList.ENAME_REPRESENTATION_UPDATED,{representation:i})}};return{debug:void 0,baseURLExt:void 0,timelineConverter:void 0,metricsModel:void 0,metricsExt:void 0,notify:void 0,subscribe:void 0,unsubscribe:void 0,setup:function(){this[Dash.dependencies.BaseURLExtensions.eventList.ENAME_INITIALIZATION_LOADED]=H,this[Dash.dependencies.BaseURLExtensions.eventList.ENAME_SEGMENTS_LOADED]=I},initialize:function(a){this.subscribe(Dash.dependencies.DashHandler.eventList.ENAME_REPRESENTATION_UPDATED,a.trackController),c=a.getType(),b=a.isDynamic(),this.streamProcessor=a},getType:function(){return c},setType:function(a){c=a},getIsDynamic:function(){return b},setIsDynamic:function(a){b=a},setCurrentTime:function(a){e=a},getCurrentTime:function(){return e},reset:function(){e=0,a=void 0,d=-1,this.unsubscribe(Dash.dependencies.DashHandler.eventList.ENAME_REPRESENTATION_UPDATED,this.streamProcessor.trackController)},getInitRequest:n,getSegmentRequestForTime:E,getNextSegmentRequest:G,generateSegmentRequestForTime:F,updateRepresentation:z}},Dash.dependencies.DashHandler.prototype={constructor:Dash.dependencies.DashHandler},Dash.dependencies.DashHandler.SEGMENTS_UNAVAILABLE_ERROR_CODE=1,Dash.dependencies.DashHandler.eventList={ENAME_REPRESENTATION_UPDATED:"representationUpdated"},Dash.dependencies.DashParser=function(){"use strict";var a=31536e3,b=2592e3,c=86400,d=3600,e=60,f=60,g=1e3,h=/^P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,i=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+-])([0-9]{2})([0-9]{2}))?/,j=/^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$/,k=[{type:"duration",test:function(a){for(var b=["minBufferTime","mediaPresentationDuration","minimumUpdatePeriod","timeShiftBufferDepth","maxSegmentDuration","maxSubsegmentDuration","suggestedPresentationDelay","start","starttime","duration"],c=b.length,d=0;c>d;d++)if(a.nodeName===b[d])return h.test(a.value);return!1},converter:function(f){var g=h.exec(f);return parseFloat(g[2]||0)*a+parseFloat(g[4]||0)*b+parseFloat(g[6]||0)*c+parseFloat(g[8]||0)*d+parseFloat(g[10]||0)*e+parseFloat(g[12]||0)}},{type:"datetime",test:function(a){return i.test(a.value)},converter:function(a){var b,c=i.exec(a);if(b=Date.UTC(parseInt(c[1],10),parseInt(c[2],10)-1,parseInt(c[3],10),parseInt(c[4],10),parseInt(c[5],10),c[6]&&parseInt(c[6],10)||0,c[7]&&parseFloat(c[7])*g||0),c[9]&&c[10]){var d=parseInt(c[9],10)*f+parseInt(c[10],10);b+=("+"===c[8]?-1:1)*d*e*g}return new Date(b)}},{type:"numeric",test:function(a){return j.test(a.value)},converter:function(a){return parseFloat(a)}}],l=function(){var a,b,c,d;return d=[{name:"profiles",merge:!1},{name:"width",merge:!1},{name:"height",merge:!1},{name:"sar",merge:!1},{name:"frameRate",merge:!1},{name:"audioSamplingRate",merge:!1},{name:"mimeType",merge:!1},{name:"segmentProfiles",merge:!1},{name:"codecs",merge:!1},{name:"maximumSAPPeriod",merge:!1},{name:"startsWithSap",merge:!1},{name:"maxPlayoutRate",merge:!1},{name:"codingDependency",merge:!1},{name:"scanType",merge:!1},{name:"FramePacking",merge:!0},{name:"AudioChannelConfiguration",merge:!0},{name:"ContentProtection",merge:!0}],a={},a.name="AdaptationSet",a.isRoot=!1,a.isArray=!0,a.parent=null,a.children=[],a.properties=d,b={},b.name="Representation",b.isRoot=!1,b.isArray=!0,b.parent=a,b.children=[],b.properties=d,a.children.push(b),c={},c.name="SubRepresentation",c.isRoot=!1,c.isArray=!0,c.parent=b,c.children=[],c.properties=d,b.children.push(c),a},m=function(){var a,b,c,d;return d=[{name:"SegmentBase",merge:!0},{name:"SegmentTemplate",merge:!0},{name:"SegmentList",merge:!0}],a={},a.name="Period",a.isRoot=!1,a.isArray=!0,a.parent=null,a.children=[],a.properties=d,b={},b.name="AdaptationSet",b.isRoot=!1,b.isArray=!0,b.parent=a,b.children=[],b.properties=d,a.children.push(b),c={},c.name="Representation",c.isRoot=!1,c.isArray=!0,c.parent=b,c.children=[],c.properties=d,b.children.push(c),a},n=function(){var a,b,c,d,e;return e=[{name:"BaseURL",merge:!0,mergeFunction:function(a,b){var c;return c=0===b.indexOf("http://")?b:a+b}}],a={},a.name="mpd",a.isRoot=!0,a.isArray=!0,a.parent=null,a.children=[],a.properties=e,b={},b.name="Period",b.isRoot=!1,b.isArray=!0,b.parent=null,b.children=[],b.properties=e,a.children.push(b),c={},c.name="AdaptationSet",c.isRoot=!1,c.isArray=!0,c.parent=b,c.children=[],c.properties=e,b.children.push(c),d={},d.name="Representation",d.isRoot=!1,d.isArray=!0,d.parent=c,d.children=[],d.properties=e,c.children.push(d),a},o=function(){var a=[];return a.push(l()),a.push(m()),a.push(n()),a},p=function(a,b){var c,d=new X2JS(k,"",!0),e=new ObjectIron(o()),f=new Date,g=null,h=null;try{c=d.xml_str2json(a),g=new Date,c.hasOwnProperty("BaseURL")?(c.BaseURL=c.BaseURL_asArray[0],0!==c.BaseURL.toString().indexOf("http")&&(c.BaseURL=b+c.BaseURL)):c.BaseURL=b,c.hasOwnProperty("Location")&&(c.Location=c.Location_asArray[0]),e.run(c),h=new Date,this.debug.log("Parsing complete: ( xml2json: "+(g.getTime()-f.getTime())+"ms, objectiron: "+(h.getTime()-g.getTime())+"ms, total: "+(h.getTime()-f.getTime())/1e3+"s)")}catch(i){return this.errHandler.manifestError("parsing the manifest failed","parse",a),null}return c};return{debug:void 0,errHandler:void 0,parse:p}},Dash.dependencies.DashParser.prototype={constructor:Dash.dependencies.DashParser},Dash.dependencies.TimelineConverter=function(){"use strict";var a=0,b=!1,c=0/0,d=function(b,c,d,e){var f=0/0;return f=e?d&&c.timeShiftBufferDepth!=Number.POSITIVE_INFINITY?new Date(c.availabilityStartTime.getTime()+1e3*(b+c.timeShiftBufferDepth)):c.availabilityEndTime:d?new Date(c.availabilityStartTime.getTime()+1e3*(b-a)):c.availabilityStartTime},e=function(a,b,c){return d.call(this,a,b,c)},f=function(a,b,c){return d.call(this,a,b,c,!0)},g=function(b,c){return(b.getTime()-c.mpd.availabilityStartTime.getTime()+1e3*a)/1e3},h=function(a,b){var c=b.adaptation.period.start,d=b.presentationTimeOffset;return a+(c-d)},i=function(a,b){var c=b.adaptation.period.start,d=b.presentationTimeOffset;return a-c+d},j=function(a,b){var c,d,e;return b&&(c=a.representation.adaptation.period.mpd.suggestedPresentationDelay,d=a.presentationStartTime+c,e=new Date(a.availabilityStartTime.getTime()+1e3*d)),e},k=function(a,c){var d,e,f=a.adaptation.period.start,h=f+a.adaptation.period.duration,i={start:f,end:h};return c?!b&&a.segmentAvailabilityRange?a.segmentAvailabilityRange:(d=a.adaptation.period.mpd.checkTime,e=g(new Date((new Date).getTime()),a.adaptation.period),f=Math.max(e-a.adaptation.period.mpd.timeShiftBufferDepth,0),h=isNaN(d)?e:Math.min(d,e),i={start:f,end:h}):i},l=function(a,b){var c=a.adaptation.period.start;return b-c},m=function(a,b){var c=a.adaptation.period.start;return b+c},n=function(d){b||d.error||(a=d.data.liveEdge-(c+d.data.searchTime),b=!0)},o=function(c){b||c.error||(a=c.data.offset/1e3,b=!0)},p=function(a){var b=a.presentationTimeOffset,c=a.adaptation.period.start;return c-b},q=function(){a=0,b=!1,c=0/0};return{notifier:void 0,uriQueryFragModel:void 0,setup:function(){this[MediaPlayer.dependencies.LiveEdgeFinder.eventList.ENAME_LIVE_EDGE_SEARCH_COMPLETED]=n,this[MediaPlayer.dependencies.TimeSyncController.eventList.ENAME_TIME_SYNCHRONIZATION_COMPLETED]=o},calcAvailabilityStartTimeFromPresentationTime:e,calcAvailabilityEndTimeFromPresentationTime:f,calcPresentationTimeFromWallTime:g,calcPresentationTimeFromMediaTime:h,calcPeriodRelativeTimeFromMpdRelativeTime:l,calcMpdRelativeTimeFromPeriodRelativeTime:m,calcMediaTimeFromPresentationTime:i,calcSegmentAvailabilityRange:k,calcWallTimeForSegment:j,calcMSETimeOffset:p,reset:q,isTimeSyncCompleted:function(){return b},getClientTimeOffset:function(){return a},getExpectedLiveEdge:function(){return c},setExpectedLiveEdge:function(a){c=a}}},Dash.dependencies.TimelineConverter.prototype={constructor:Dash.dependencies.TimelineConverter},Dash.dependencies.RepresentationController=function(){"use strict";var a,b=null,c=-1,d=!0,e=[],f=function(c,f,h){var j=this;if(d=!0,j.notify(Dash.dependencies.RepresentationController.eventList.ENAME_DATA_UPDATE_STARTED),e=k.call(j,f),a=i.call(j,j.abrController.getQualityFor(h,j.streamProcessor.getStreamInfo())),b=c,"video"!==h&&"audio"!==h)return j.notify(Dash.dependencies.RepresentationController.eventList.ENAME_DATA_UPDATE_COMPLETED,{data:b,currentRepresentation:a}),void g.call(j);for(var l=0;l<e.length;l+=1)j.indexHandler.updateRepresentation(e[l],!0)},g=function(){var a=new Date,b=this.getCurrentRepresentation(),c=this.streamProcessor.playbackController.getTime();this.metricsModel.addTrackSwitch(b.adaptation.type,a,c,b.id)},h=function(){var b=this.streamProcessor,c=this.timelineConverter.calcSegmentAvailabilityRange(a,b.isDynamic());this.metricsModel.addDVRInfo(b.getType(),b.playbackController.getTime(),b.getStreamInfo().manifestInfo,c)},i=function(a){return e[a]},j=function(){for(var a=0,b=e.length;b>a;a+=1)if(null===e[a].segmentAvailabilityRange||null===e[a].initialization)return!1;return!0},k=function(a){var d,e=this,f=e.manifestModel.getValue();return c=e.manifestExt.getIndexForAdaptation(b,f,a.period.index),d=e.manifestExt.getRepresentationsForAdaptation(f,a)},l=function(a){for(var b,c=this,d=0,f=e.length;f>d;d+=1)b=e[d],b.segmentAvailabilityRange=c.timelineConverter.calcSegmentAvailabilityRange(b,a)},m=function(b){var c=this,f=1e3*(b+3*a.segmentDuration),g=function(){if(!this.isUpdating()){d=!0,c.notify(Dash.dependencies.RepresentationController.eventList.ENAME_DATA_UPDATE_STARTED);for(var a=0;a<e.length;a+=1)c.indexHandler.updateRepresentation(e[a],!0)}};d=!1,setTimeout(g.bind(this),f)},n=function(c){if(this.isUpdating()){var e,f,i=this,k=c.data.representation,l=i.metricsModel.getMetricsFor("stream"),n=i.metricsExt.getCurrentManifestUpdate(l),o=!1;if(c.error&&c.error.code===Dash.dependencies.DashHandler.SEGMENTS_UNAVAILABLE_ERROR_CODE)return h.call(this),m.call(this,c.error.data.availabilityDelay),f=new MediaPlayer.vo.Error(Dash.dependencies.RepresentationController.SEGMENTS_UPDATE_FAILED_ERROR_CODE,"Segments update failed",null),void this.notify(Dash.dependencies.RepresentationController.eventList.ENAME_DATA_UPDATE_COMPLETED,{data:b,currentRepresentation:a},f);for(var p=0;p<n.trackInfo.length;p+=1)if(e=n.trackInfo[p],e.index===k.index&&e.mediaType===i.streamProcessor.getType()){o=!0;break}o||i.metricsModel.addManifestUpdateTrackInfo(n,k.id,k.index,k.adaptation.period.index,i.streamProcessor.getType(),k.presentationTimeOffset,k.startNumber,k.segmentInfoType),j()&&(d=!1,i.metricsModel.updateManifestUpdateInfo(n,{latency:a.segmentAvailabilityRange.end-i.streamProcessor.playbackController.getTime()}),this.notify(Dash.dependencies.RepresentationController.eventList.ENAME_DATA_UPDATE_COMPLETED,{data:b,currentRepresentation:a}),g.call(i))}},o=function(a){l.call(this,a.data.isDynamic)},p=function(b){if(!b.error){l.call(this,!0),this.indexHandler.updateRepresentation(a,!1);var c=this.manifestModel.getValue();a.adaptation.period.mpd.checkTime=this.manifestExt.getCheckTime(c,a.adaptation.period)}},q=function(){h.call(this)},r=function(b){var c=this;b.data.mediaType===c.streamProcessor.getType()&&c.streamProcessor.getStreamInfo().id===b.data.streamInfo.id&&(a=c.getRepresentationForQuality(b.data.newQuality),g.call(c))};return{system:void 0,debug:void 0,manifestExt:void 0,manifestModel:void 0,metricsModel:void 0,metricsExt:void 0,abrController:void 0,timelineConverter:void 0,notify:void 0,subscribe:void 0,unsubscribe:void 0,setup:function(){this[MediaPlayer.dependencies.AbrController.eventList.ENAME_QUALITY_CHANGED]=r,this[Dash.dependencies.DashHandler.eventList.ENAME_REPRESENTATION_UPDATED]=n,this[MediaPlayer.dependencies.PlaybackController.eventList.ENAME_WALLCLOCK_TIME_UPDATED]=o,this[MediaPlayer.dependencies.LiveEdgeFinder.eventList.ENAME_LIVE_EDGE_SEARCH_COMPLETED]=p,this[MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_UPDATED]=q},initialize:function(a){this.streamProcessor=a,this.indexHandler=a.indexHandler},getData:function(){return b},getDataIndex:function(){return c},isUpdating:function(){return d},updateData:f,getRepresentationForQuality:i,getCurrentRepresentation:function(){return a}}},Dash.dependencies.RepresentationController.prototype={constructor:Dash.dependencies.RepresentationController},Dash.dependencies.RepresentationController.SEGMENTS_UPDATE_FAILED_ERROR_CODE=1,Dash.dependencies.RepresentationController.eventList={ENAME_DATA_UPDATE_COMPLETED:"dataUpdateCompleted",ENAME_DATA_UPDATE_STARTED:"dataUpdateStarted"},Dash.dependencies.BaseURLExtensions=function(){"use strict";var a=function(a,b){for(var c,d,e,f,g,h,i,j,k,l,m=new DataView(a),n={},o=0;"sidx"!==j&&o<m.byteLength;){for(k=m.getUint32(o),o+=4,j="",f=0;4>f;f+=1)l=m.getInt8(o),j+=String.fromCharCode(l),o+=1;"moof"!==j&&"traf"!==j&&"sidx"!==j?o+=k-8:"sidx"===j&&(o-=8)}if(e=m.getUint32(o,!1)+o,e>a.byteLength)throw"sidx terminates after array buffer";for(n.version=m.getUint8(o+8),o+=12,n.timescale=m.getUint32(o+4,!1),o+=8,0===n.version?(n.earliest_presentation_time=m.getUint32(o,!1),n.first_offset=m.getUint32(o+4,!1),o+=8):(n.earliest_presentation_time=utils.Math.to64BitNumber(m.getUint32(o+4,!1),m.getUint32(o,!1)),n.first_offset=(m.getUint32(o+8,!1)<<32)+m.getUint32(o+12,!1),o+=16),n.first_offset+=e+(b||0),n.reference_count=m.getUint16(o+2,!1),o+=4,n.references=[],c=n.first_offset,d=n.earliest_presentation_time,f=0;f<n.reference_count;f+=1)h=m.getUint32(o,!1),g=h>>>31,h=2147483647&h,i=m.getUint32(o+4,!1),o+=12,n.references.push({size:h,type:g,offset:c,duration:i,time:d,timescale:n.timescale}),c+=h,d+=i;if(o!==e)throw"Error: final pos "+o+" differs from SIDX end "+e;return n},b=function(b,c,d){var e,f,g,h,i,j,k,l;for(e=a.call(this,b,d),f=e.references,g=[],i=0,j=f.length;j>i;i+=1)h=new Dash.vo.Segment,h.duration=f[i].duration,h.media=c,h.startTime=f[i].time,h.timescale=f[i].timescale,k=f[i].offset,l=f[i].offset+f[i].size-1,h.mediaRange=k+"-"+l,g.push(h);return this.debug.log("Parsed SIDX box: "+g.length+" segments."),g},c=function(a,b,d){var e,f,g,h,i,j,k,l,m,n=new DataView(a),o=0,p="",q=0,r=!1,s=this;for(s.debug.log("Searching for initialization.");"moov"!==p&&o<n.byteLength;){for(q=n.getUint32(o),o+=4,p="",j=0;4>j;j+=1)k=n.getInt8(o),p+=String.fromCharCode(k),o+=1;"ftyp"===p&&(e=o-8),"moov"===p&&(f=o-8),"moov"!==p&&(o+=q-8)}i=n.byteLength-o,"moov"!==p?(s.debug.log("Loading more bytes to find initialization."),b.range.start=0,b.range.end=b.bytesLoaded+b.bytesToLoad,l=new XMLHttpRequest,l.onloadend=function(){r||d.call(s,null,new Error("Error loading initialization."))},l.onload=function(){r=!0,b.bytesLoaded=b.range.end,c.call(s,l.response,function(a){d.call(s,a)})},l.onerror=function(){d.call(s,null,new Error("Error loading initialization."))},l.open("GET",s.requestModifierExt.modifyRequestURL(b.url)),l.responseType="arraybuffer",l.setRequestHeader("Range","bytes="+b.range.start+"-"+b.range.end),l=s.requestModifierExt.modifyRequestHeader(l),l.send(null)):(g=void 0===e?f:e,h=f+q-1,m=g+"-"+h,s.debug.log("Found the initialization. Range: "+m),d.call(s,m))},d=function(a){var b=new XMLHttpRequest,d=!0,e=this,f=a.adaptation.period.mpd.manifest.Period_asArray[a.adaptation.period.index].AdaptationSet_asArray[a.adaptation.index].Representation_asArray[a.index].BaseURL,g={url:f,range:{},searching:!1,bytesLoaded:0,bytesToLoad:1500,request:b};e.debug.log("Start searching for initialization."),g.range.start=0,g.range.end=g.bytesToLoad,b.onload=function(){b.status<200||b.status>299||(d=!1,g.bytesLoaded=g.range.end,c.call(e,b.response,g,function(b){a.range=b,a.initialization=f,e.notify(Dash.dependencies.BaseURLExtensions.eventList.ENAME_INITIALIZATION_LOADED,{representation:a})}))},b.onloadend=b.onerror=function(){d&&(d=!1,e.errHandler.downloadError("initialization",g.url,b),e.notify(Dash.dependencies.BaseURLExtensions.eventList.ENAME_INITIALIZATION_LOADED,{representation:a}))},b.open("GET",e.requestModifierExt.modifyRequestURL(g.url)),b.responseType="arraybuffer",b.setRequestHeader("Range","bytes="+g.range.start+"-"+g.range.end),b=e.requestModifierExt.modifyRequestHeader(b),b.send(null),e.debug.log("Perform init search: "+g.url)},e=function(a,c,d,g){var h,i,j,k,l,m,n,o,p,q=new DataView(a),r=new XMLHttpRequest,s=0,t="",u=0,v=!0,w=!1,x=this;for(x.debug.log("Searching for SIDX box."),x.debug.log(c.bytesLoaded+" bytes loaded.");"sidx"!==t&&s<q.byteLength;){for(u=q.getUint32(s),s+=4,t="",m=0;4>m;m+=1)n=q.getInt8(s),t+=String.fromCharCode(n),s+=1;"sidx"!==t&&(s+=u-8)}if(i=q.byteLength-s,"sidx"!==t)g.call(x);else if(u-8>i)x.debug.log("Found SIDX but we don't have all of it."),c.range.start=0,c.range.end=c.bytesLoaded+(u-i),r.onload=function(){r.status<200||r.status>299||(v=!1,c.bytesLoaded=c.range.end,e.call(x,r.response,c,d,g))
16
+ },r.onloadend=r.onerror=function(){v&&(v=!1,x.errHandler.downloadError("SIDX",c.url,r),g.call(x))},r.open("GET",x.requestModifierExt.modifyRequestURL(c.url)),r.responseType="arraybuffer",r.setRequestHeader("Range","bytes="+c.range.start+"-"+c.range.end),r=x.requestModifierExt.modifyRequestHeader(r),r.send(null);else if(c.range.start=s-8,c.range.end=c.range.start+u,x.debug.log("Found the SIDX box. Start: "+c.range.start+" | End: "+c.range.end),j=new ArrayBuffer(c.range.end-c.range.start),l=new Uint8Array(j),k=new Uint8Array(a,c.range.start,c.range.end-c.range.start),l.set(k),o=this.parseSIDX.call(this,j,c.range.start),p=o.references,null!==p&&void 0!==p&&p.length>0&&(w=1===p[0].type),w){x.debug.log("Initiate multiple SIDX load.");var y,z,A,B,C,D=[],E=0,F=function(a){a?(D=D.concat(a),E+=1,E>=z&&g.call(x,D)):g.call(x)};for(y=0,z=p.length;z>y;y+=1)A=p[y].offset,B=p[y].offset+p[y].size-1,C=A+"-"+B,f.call(x,d,null,C,F)}else x.debug.log("Parsing segments from SIDX."),h=b.call(x,j,c.url,c.range.start),g.call(x,h)},f=function(a,c,d,f){var g,h,i=new XMLHttpRequest,j=a.adaptation.period.mpd.manifest.Period_asArray[a.adaptation.period.index].AdaptationSet_asArray[a.adaptation.index].Representation_asArray[a.index].BaseURL,k=!0,l=this,m={url:j,range:{},searching:!1,bytesLoaded:0,bytesToLoad:1500,request:i};null===d?(l.debug.log("No known range for SIDX request."),m.searching=!0,m.range.start=0,m.range.end=m.bytesToLoad):(h=d.split("-"),m.range.start=parseFloat(h[0]),m.range.end=parseFloat(h[1])),i.onload=function(){i.status<200||i.status>299||(k=!1,m.searching?(m.bytesLoaded=m.range.end,e.call(l,i.response,m,a,function(b){b&&f.call(l,b,a,c)})):(g=b.call(l,i.response,m.url,m.range.start),f.call(l,g,a,c)))},i.onloadend=i.onerror=function(){k&&(k=!1,l.errHandler.downloadError("SIDX",m.url,i),f.call(l,null,a,c))},i.open("GET",l.requestModifierExt.modifyRequestURL(m.url)),i.responseType="arraybuffer",i.setRequestHeader("Range","bytes="+m.range.start+"-"+m.range.end),i=l.requestModifierExt.modifyRequestHeader(i),i.send(null),l.debug.log("Perform SIDX load: "+m.url)},g=function(a,b,c){var d=this;a?d.notify(Dash.dependencies.BaseURLExtensions.eventList.ENAME_SEGMENTS_LOADED,{segments:a,representation:b,mediaType:c}):d.notify(Dash.dependencies.BaseURLExtensions.eventList.ENAME_SEGMENTS_LOADED,{segments:null,representation:b,mediaType:c},new MediaPlayer.vo.Error(null,"error loading segments",null))};return{debug:void 0,errHandler:void 0,requestModifierExt:void 0,notify:void 0,subscribe:void 0,unsubscribe:void 0,loadSegments:function(a,b,c){f.call(this,a,b,c,g.bind(this))},loadInitialization:d,parseSegments:b,parseSIDX:a,findSIDX:e}},Dash.dependencies.BaseURLExtensions.prototype={constructor:Dash.dependencies.BaseURLExtensions},Dash.dependencies.BaseURLExtensions.eventList={ENAME_INITIALIZATION_LOADED:"initializationLoaded",ENAME_SEGMENTS_LOADED:"segmentsLoaded"},Dash.dependencies.DashManifestExtensions=function(){"use strict";this.timelineConverter=void 0},Dash.dependencies.DashManifestExtensions.prototype={constructor:Dash.dependencies.DashManifestExtensions,getIsTypeOf:function(a,b){"use strict";var c,d,e,f=a.ContentComponent_asArray,g=new RegExp("text"!==b?b:"(vtt|ttml)"),h=!1,i=!1;if(f)for(c=0,d=f.length;d>c;c+=1)f[c].contentType===b&&(h=!0,i=!0);if(a.hasOwnProperty("mimeType")&&(h=g.test(a.mimeType),i=!0),!i)for(c=0,d=a.Representation_asArray.length;!i&&d>c;)e=a.Representation_asArray[c],e.hasOwnProperty("mimeType")&&(h=g.test(e.mimeType),i=!0),c+=1;return h},getIsAudio:function(a){"use strict";return this.getIsTypeOf(a,"audio")},getIsVideo:function(a){"use strict";return this.getIsTypeOf(a,"video")},getIsText:function(a){"use strict";return this.getIsTypeOf(a,"text")},getIsTextTrack:function(a){return"text/vtt"===a||"application/ttml+xml"===a},getLanguageForAdaptation:function(a){var b="";return a.hasOwnProperty("lang")&&(b=a.lang),b},getIsMain:function(){"use strict";return!1},processAdaptation:function(a){"use strict";return void 0!==a.Representation_asArray&&null!==a.Representation_asArray&&a.Representation_asArray.sort(function(a,b){return a.bandwidth-b.bandwidth}),a},getAdaptationForId:function(a,b,c){"use strict";var d,e,f=b.Period_asArray[c].AdaptationSet_asArray;for(d=0,e=f.length;e>d;d+=1)if(f[d].hasOwnProperty("id")&&f[d].id===a)return f[d];return null},getAdaptationForIndex:function(a,b,c){"use strict";var d=b.Period_asArray[c].AdaptationSet_asArray;return d[a]},getIndexForAdaptation:function(a,b,c){"use strict";var d,e,f=b.Period_asArray[c].AdaptationSet_asArray;for(d=0,e=f.length;e>d;d+=1)if(f[d]===a)return d;return-1},getAdaptationsForType:function(a,b,c){"use strict";var d,e,f=this,g=a.Period_asArray[b].AdaptationSet_asArray,h=[];for(d=0,e=g.length;e>d;d+=1)this.getIsTypeOf(g[d],c)&&h.push(f.processAdaptation(g[d]));return h},getAdaptationForType:function(a,b,c){"use strict";var d,e,f,g=this;if(f=this.getAdaptationsForType(a,b,c),!f||0===f.length)return null;for(d=0,e=f.length;e>d;d+=1)if(g.getIsMain(f[d]))return f[d];return f[0]},getCodec:function(a){"use strict";var b=a.Representation_asArray[0],c=b.mimeType+';codecs="'+b.codecs+'"';return c},getMimeType:function(a){"use strict";return a.Representation_asArray[0].mimeType},getKID:function(a){"use strict";return a&&a.hasOwnProperty("cenc:default_KID")?a["cenc:default_KID"]:null},getContentProtectionData:function(a){"use strict";return a&&a.hasOwnProperty("ContentProtection_asArray")&&0!==a.ContentProtection_asArray.length?a.ContentProtection_asArray:null},getIsDynamic:function(a){"use strict";var b=!1,c="dynamic";return a.hasOwnProperty("type")&&(b=a.type===c),b},getIsDVR:function(a){"use strict";var b,c,d=this.getIsDynamic(a);return b=!isNaN(a.timeShiftBufferDepth),c=d&&b},getIsOnDemand:function(a){"use strict";var b=!1;return a.profiles&&a.profiles.length>0&&(b=-1!==a.profiles.indexOf("urn:mpeg:dash:profile:isoff-on-demand:2011")),b},getDuration:function(a){var b;return b=a.hasOwnProperty("mediaPresentationDuration")?a.mediaPresentationDuration:Number.POSITIVE_INFINITY},getBandwidth:function(a){"use strict";return a.bandwidth},getRefreshDelay:function(a){"use strict";var b=0/0,c=2;return a.hasOwnProperty("minimumUpdatePeriod")&&(b=Math.max(parseFloat(a.minimumUpdatePeriod),c)),b},getRepresentationCount:function(a){"use strict";return a.Representation_asArray.length},getRepresentationFor:function(a,b){"use strict";return b.Representation_asArray[a]},getRepresentationsForAdaptation:function(a,b){for(var c,d,e,f,g,h=this,i=h.processAdaptation(a.Period_asArray[b.period.index].AdaptationSet_asArray[b.index]),j=[],k=0;k<i.Representation_asArray.length;k+=1)f=i.Representation_asArray[k],c=new Dash.vo.Representation,c.index=k,c.adaptation=b,f.hasOwnProperty("id")&&(c.id=f.id),f.hasOwnProperty("SegmentBase")?(e=f.SegmentBase,c.segmentInfoType="SegmentBase"):f.hasOwnProperty("SegmentList")?(e=f.SegmentList,c.segmentInfoType="SegmentList",c.useCalculatedLiveEdgeTime=!0):f.hasOwnProperty("SegmentTemplate")?(e=f.SegmentTemplate,e.hasOwnProperty("SegmentTimeline")?(c.segmentInfoType="SegmentTimeline",g=e.SegmentTimeline.S_asArray[e.SegmentTimeline.S_asArray.length-1],(!g.hasOwnProperty("r")||g.r>=0)&&(c.useCalculatedLiveEdgeTime=!0)):c.segmentInfoType="SegmentTemplate",e.hasOwnProperty("initialization")&&(c.initialization=e.initialization.split("$Bandwidth$").join(f.bandwidth).split("$RepresentationID$").join(f.id))):(e=f.BaseURL,c.segmentInfoType="BaseURL"),e.hasOwnProperty("Initialization")?(d=e.Initialization,d.hasOwnProperty("sourceURL")?c.initialization=d.sourceURL:d.hasOwnProperty("range")&&(c.initialization=f.BaseURL,c.range=d.range)):f.hasOwnProperty("mimeType")&&h.getIsTextTrack(f.mimeType)&&(c.initialization=f.BaseURL,c.range=0),e.hasOwnProperty("timescale")&&(c.timescale=e.timescale),e.hasOwnProperty("duration")&&(c.segmentDuration=e.duration/c.timescale),e.hasOwnProperty("startNumber")&&(c.startNumber=e.startNumber),e.hasOwnProperty("indexRange")&&(c.indexRange=e.indexRange),e.hasOwnProperty("presentationTimeOffset")&&(c.presentationTimeOffset=e.presentationTimeOffset/c.timescale),c.MSETimeOffset=h.timelineConverter.calcMSETimeOffset(c),j.push(c);return j},getAdaptationsForPeriod:function(a,b){for(var c,d,e=a.Period_asArray[b.index],f=[],g=0;g<e.AdaptationSet_asArray.length;g+=1)d=e.AdaptationSet_asArray[g],c=new Dash.vo.AdaptationSet,d.hasOwnProperty("id")&&(c.id=d.id),c.index=g,c.period=b,c.type=this.getIsAudio(d)?"audio":this.getIsVideo(d)?"video":"text",f.push(c);return f},getRegularPeriods:function(a,b){var c,d,e=this,f=[],g=e.getIsDynamic(a),h=null,i=null,j=null,k=null;for(c=0,d=a.Period_asArray.length;d>c;c+=1)i=a.Period_asArray[c],i.hasOwnProperty("start")?(k=new Dash.vo.Period,k.start=i.start):null!==h&&i.hasOwnProperty("duration")&&null!==j?(k=new Dash.vo.Period,k.start=j.start+j.duration,k.duration=i.duration):0!==c||g||(k=new Dash.vo.Period,k.start=0),null!==j&&isNaN(j.duration)&&(j.duration=k.start-j.start),null!==k&&i.hasOwnProperty("id")&&(k.id=i.id),null!==k&&i.hasOwnProperty("duration")&&(k.duration=i.duration),null!==k&&(k.index=c,k.mpd=b,f.push(k),h=i,j=k),i=null,k=null;return 0===f.length?f:(b.checkTime=e.getCheckTime(a,f[0]),null!==j&&isNaN(j.duration)&&(j.duration=e.getEndTimeForLastPeriod(b)-j.start),f)},getMpd:function(a){var b=new Dash.vo.Mpd;return b.manifest=a,b.availabilityStartTime=new Date(a.hasOwnProperty("availabilityStartTime")?a.availabilityStartTime.getTime():a.loadedTime.getTime()),a.hasOwnProperty("availabilityEndTime")&&(b.availabilityEndTime=new Date(a.availabilityEndTime.getTime())),a.hasOwnProperty("suggestedPresentationDelay")&&(b.suggestedPresentationDelay=a.suggestedPresentationDelay),a.hasOwnProperty("timeShiftBufferDepth")&&(b.timeShiftBufferDepth=a.timeShiftBufferDepth),a.hasOwnProperty("maxSegmentDuration")&&(b.maxSegmentDuration=a.maxSegmentDuration),b},getFetchTime:function(a,b){var c=this.timelineConverter.calcPresentationTimeFromWallTime(a.loadedTime,b);return c},getCheckTime:function(a,b){var c,d=this,e=0/0;return a.hasOwnProperty("minimumUpdatePeriod")&&(c=d.getFetchTime(a,b),e=c+a.minimumUpdatePeriod),e},getEndTimeForLastPeriod:function(a){var b;if(a.manifest.mediaPresentationDuration)b=a.manifest.mediaPresentationDuration;else{if(isNaN(a.checkTime))throw new Error("Must have @mediaPresentationDuration or @minimumUpdatePeriod on MPD or an explicit @duration on the last period.");b=a.checkTime}return b},getEventsForPeriod:function(a,b){var c=a.Period_asArray,d=c[b.index].EventStream_asArray,e=[];if(d)for(var f=0;f<d.length;f+=1){var g=new Dash.vo.EventStream;if(g.period=b,g.timescale=1,!d[f].hasOwnProperty("schemeIdUri"))throw"Invalid EventStream. SchemeIdUri has to be set";g.schemeIdUri=d[f].schemeIdUri,d[f].hasOwnProperty("timescale")&&(g.timescale=d[f].timescale),d[f].hasOwnProperty("value")&&(g.value=d[f].value);for(var h=0;h<d[f].Event_asArray.length;h+=1){var i=new Dash.vo.Event;i.presentationTime=0,i.eventStream=g,d[f].Event_asArray[h].hasOwnProperty("presentationTime")&&(i.presentationTime=d[f].Event_asArray[h].presentationTime),d[f].Event_asArray[h].hasOwnProperty("duration")&&(i.duration=d[f].Event_asArray[h].duration),d[f].Event_asArray[h].hasOwnProperty("id")&&(i.id=d[f].Event_asArray[h].id),e.push(i)}}return e},getEventStreamForAdaptationSet:function(a,b){var c=[],d=a.Period_asArray[b.period.index].AdaptationSet_asArray[b.index].InbandEventStream_asArray;if(d)for(var e=0;e<d.length;e+=1){var f=new Dash.vo.EventStream;if(f.timescale=1,!d[e].hasOwnProperty("schemeIdUri"))throw"Invalid EventStream. SchemeIdUri has to be set";f.schemeIdUri=d[e].schemeIdUri,d[e].hasOwnProperty("timescale")&&(f.timescale=d[e].timescale),d[e].hasOwnProperty("value")&&(f.value=d[e].value),c.push(f)}return c},getEventStreamForRepresentation:function(a,b){var c=[],d=a.Period_asArray[b.adaptation.period.index].AdaptationSet_asArray[b.adaptation.index].Representation_asArray[b.index].InbandEventStream_asArray;if(d)for(var e=0;e<d.length;e++){var f=new Dash.vo.EventStream;if(f.timescale=1,f.representation=b,!d[e].hasOwnProperty("schemeIdUri"))throw"Invalid EventStream. SchemeIdUri has to be set";f.schemeIdUri=d[e].schemeIdUri,d[e].hasOwnProperty("timescale")&&(f.timescale=d[e].timescale),d[e].hasOwnProperty("value")&&(f.value=d[e].value),c.push(f)}return c},getUTCTimingSources:function(a){"use strict";var b=this,c=b.getIsDynamic(a),d=a.hasOwnProperty("availabilityStartTime"),e=a.UTCTiming_asArray,f=[];return(c||d)&&e&&e.forEach(function(a){var b=new Dash.vo.UTCTiming;a.hasOwnProperty("schemeIdUri")&&(b.schemeIdUri=a.schemeIdUri,a.hasOwnProperty("value")&&(b.value=a.value.toString(),f.push(b)))}),f}},Dash.dependencies.DashMetricsExtensions=function(){"use strict";var a=function(a,b){var c,d,e,f,g,h,i,j;for(h=0;h<a.length;h+=1)for(c=a[h],e=c.AdaptationSet_asArray,i=0;i<e.length;i+=1)for(d=e[i],g=d.Representation_asArray,j=0;j<g.length;j+=1)if(f=g[j],b===f.id)return j;return-1},b=function(a,b){var c,d,e,f,g,h,i,j;for(h=0;h<a.length;h+=1)for(c=a[h],e=c.AdaptationSet_asArray,i=0;i<e.length;i+=1)for(d=e[i],g=d.Representation_asArray,j=0;j<g.length;j+=1)if(f=g[j],b===f.id)return f;return null},c=function(a,b){return this.manifestExt.getIsTypeOf(a,b)},d=function(a,b){var d,e,f,g,h,i;for(h=0;h<a.length;h+=1)for(d=a[h],f=d.AdaptationSet_asArray,i=0;i<f.length;i+=1)if(e=f[i],g=e.Representation_asArray,c.call(this,e,b))return g.length;return-1},e=function(a){var c,d=this,e=d.manifestModel.getValue(),f=e.Period_asArray;return c=b.call(d,f,a),null===c?null:c.bandwidth},f=function(b){var c,d=this,e=d.manifestModel.getValue(),f=e.Period_asArray;return c=a.call(d,f,b)},g=function(a){var b,c=this,e=c.manifestModel.getValue(),f=e.Period_asArray;return b=d.call(this,f,a)},h=function(a){if(null===a)return null;var b,c,d,e=a.RepSwitchList;return null===e||e.length<=0?null:(b=e.length,c=b-1,d=e[c])},i=function(a){if(null===a)return null;var b,c,d,e=a.BufferLevel;return null===e||e.length<=0?null:(b=e.length,c=b-1,d=e[c])},j=function(a){if(null===a)return null;var b,c,d=a.PlayList;return null===d||d.length<=0?null:(b=d[d.length-1].trace,null===b||b.length<=0?null:c=b[b.length-1].playbackspeed)},k=function(a){if(null===a)return null;var b,c,d=a.HttpList,e=null;if(null===d||d.length<=0)return null;for(b=d.length,c=b-1;c>0;){if(d[c].responsecode){e=d[c];break}c-=1}return e},l=function(a){return null===a?[]:a.HttpList?a.HttpList:[]},m=function(a){if(null===a)return null;var b,c,d,e=a.DroppedFrames;return null===e||e.length<=0?null:(b=e.length,c=b-1,d=e[c])},n=function(a){if(null===a)return null;var b,c,d,e=a.SchedulingInfo;return null===e||e.length<=0?null:(b=e.length,c=b-1,d=e[c])},o=function(a){if(null===a)return null;var b,c,d,e=a.ManifestUpdate;return null===e||e.length<=0?null:(b=e.length,c=b-1,d=e[c])},p=function(a){if(null===a)return null;var b,c=a.DVRInfo,d=null;return null===c||c.length<=0?null:(b=c.length-1,d=c[b])},q=function(a,b){if(null===a)return null;var c,d=l(a),e=d[d.length-1];return"MPD"===e.type&&(c=s(e.responseHeaders,b)),void 0===c[b]?null:c[b]},r=function(a,b){if(null===a)return null;var c,d=k(a);return null===d||null===d.responseHeaders?null:(c=s(d.responseHeaders,b),void 0===c[b]?null:c[b])},s=function(a){var b={};if(!a)return b;for(var c=a.split("\r\n"),d=0,e=c.length;e>d;d++){var f=c[d],g=f.indexOf(": ");g>0&&(b[f.substring(0,g)]=f.substring(g+2))}return b};return{manifestModel:void 0,manifestExt:void 0,getBandwidthForRepresentation:e,getIndexForRepresentation:f,getMaxIndexForBufferType:g,getCurrentRepresentationSwitch:h,getCurrentBufferLevel:i,getCurrentPlaybackRate:j,getCurrentHttpRequest:k,getHttpRequests:l,getCurrentDroppedFrames:m,getCurrentSchedulingInfo:n,getCurrentDVRInfo:p,getCurrentManifestUpdate:o,getLatestFragmentRequestHeaderValueByID:r,getLatestMPDRequestHeaderValueByID:q}},Dash.dependencies.DashMetricsExtensions.prototype={constructor:Dash.dependencies.DashMetricsExtensions},Dash.dependencies.FragmentExtensions=function(){"use strict";var a=function(a){for(var b,c,d,e,f,g,h=new DataView(a),i=0;"tfdt"!==e&&i<h.byteLength;){for(d=h.getUint32(i),i+=4,e="",f=0;4>f;f+=1)g=h.getInt8(i),e+=String.fromCharCode(g),i+=1;"moof"!==e&&"traf"!==e&&"tfdt"!==e&&(i+=d-8)}if(i===h.byteLength)throw"Error finding live offset.";return c=h.getUint8(i),this.debug.log("position: "+i),0===c?(i+=4,b=h.getUint32(i,!1)):(i+=d-16,b=utils.Math.to64BitNumber(h.getUint32(i+4,!1),h.getUint32(i,!1))),{version:c,base_media_decode_time:b}},b=function(a){for(var b,c,d,e,f,g,h,i=new DataView(a),j=0;"sidx"!==f&&j<i.byteLength;){for(g=i.getUint32(j),j+=4,f="",e=0;4>e;e+=1)h=i.getInt8(j),f+=String.fromCharCode(h),j+=1;"moof"!==f&&"traf"!==f&&"sidx"!==f?j+=g-8:"sidx"===f&&(j-=8)}return b=i.getUint8(j+8),j+=12,c=i.getUint32(j+4,!1),j+=8,d=0===b?i.getUint32(j,!1):utils.Math.to64BitNumber(i.getUint32(j+4,!1),i.getUint32(j,!1)),{earliestPresentationTime:d,timescale:c}},c=function(b){var c,d=this,e=new XMLHttpRequest,f=b,g=!1,h="Error loading fragment: "+f,i=new MediaPlayer.vo.Error(null,h,null);e.onloadend=function(){g||(h="Error loading fragment: "+f,d.notify(Dash.dependencies.FragmentExtensions.eventList.ENAME_FRAGMENT_LOADING_COMPLETED,{fragment:null},i))},e.onload=function(){g=!0,c=a(e.response),d.notify(Dash.dependencies.FragmentExtensions.eventList.ENAME_FRAGMENT_LOADING_COMPLETED,{fragment:c})},e.onerror=function(){h="Error loading fragment: "+f,d.notify(Dash.dependencies.FragmentExtensions.eventList.ENAME_FRAGMENT_LOADING_COMPLETED,{fragment:null},i)},e.responseType="arraybuffer",e.open("GET",f),e.send(null)};return{debug:void 0,notify:void 0,subscribe:void 0,unsubscribe:void 0,loadFragment:c,parseTFDT:a,parseSIDX:b}},Dash.dependencies.FragmentExtensions.prototype={constructor:Dash.dependencies.FragmentExtensions},Dash.dependencies.FragmentExtensions.eventList={ENAME_FRAGMENT_LOADING_COMPLETED:"fragmentLoadingCompleted"},Dash.vo.AdaptationSet=function(){"use strict";this.period=null,this.index=-1,this.type=null},Dash.vo.AdaptationSet.prototype={constructor:Dash.vo.AdaptationSet},Dash.vo.Event=function(){"use strict";this.duration=0/0,this.presentationTime=0/0,this.id=0/0,this.messageData="",this.eventStream=null,this.presentationTimeDelta=0/0},Dash.vo.Event.prototype={constructor:Dash.vo.Event},Dash.vo.EventStream=function(){"use strict";this.adaptionSet=null,this.representation=null,this.period=null,this.timescale=1,this.value="",this.schemeIdUri=""},Dash.vo.EventStream.prototype={constructor:Dash.vo.EventStream},Dash.vo.Mpd=function(){"use strict";this.manifest=null,this.suggestedPresentationDelay=0,this.availabilityStartTime=null,this.availabilityEndTime=Number.POSITIVE_INFINITY,this.timeShiftBufferDepth=Number.POSITIVE_INFINITY,this.maxSegmentDuration=Number.POSITIVE_INFINITY,this.checkTime=0/0,this.clientServerTimeShift=0,this.isClientServerTimeSyncCompleted=!1},Dash.vo.Mpd.prototype={constructor:Dash.vo.Mpd},Dash.vo.Period=function(){"use strict";this.id=null,this.index=-1,this.duration=0/0,this.start=0/0,this.mpd=null},Dash.vo.Period.prototype={constructor:Dash.vo.Period},Dash.vo.Representation=function(){"use strict";this.id=null,this.index=-1,this.adaptation=null,this.segmentInfoType=null,this.initialization=null,this.segmentDuration=0/0,this.timescale=1,this.startNumber=1,this.indexRange=null,this.range=null,this.presentationTimeOffset=0,this.MSETimeOffset=0/0,this.segmentAvailabilityRange=null,this.availableSegmentsNumber=0},Dash.vo.Representation.prototype={constructor:Dash.vo.Representation},Dash.vo.Segment=function(){"use strict";this.indexRange=null,this.index=null,this.mediaRange=null,this.media=null,this.duration=0/0,this.replacementTime=null,this.replacementNumber=0/0,this.mediaStartTime=0/0,this.presentationStartTime=0/0,this.availabilityStartTime=0/0,this.availabilityEndTime=0/0,this.availabilityIdx=0/0,this.wallStartTime=0/0,this.representation=null},Dash.vo.Segment.prototype={constructor:Dash.vo.Segment},Dash.vo.UTCTiming=function(){"use strict";this.schemeIdUri="",this.value=""},Dash.vo.UTCTiming.prototype={constructor:Dash.vo.UTCTiming},MediaPlayer.dependencies.ErrorHandler=function(){"use strict";return{eventBus:void 0,capabilityError:function(a){this.eventBus.dispatchEvent({type:"error",error:"capability",event:a})},downloadError:function(a,b,c){this.eventBus.dispatchEvent({type:"error",error:"download",event:{id:a,url:b,request:c}})},manifestError:function(a,b,c){this.eventBus.dispatchEvent({type:"error",error:"manifestError",event:{message:a,id:b,manifest:c}})},closedCaptionsError:function(a,b,c){this.eventBus.dispatchEvent({type:"error",error:"cc",event:{message:a,id:b,cc:c}})},mediaSourceError:function(a){this.eventBus.dispatchEvent({type:"error",error:"mediasource",event:a})},mediaKeySessionError:function(a){this.eventBus.dispatchEvent({type:"error",error:"key_session",event:a})},mediaKeyMessageError:function(a){this.eventBus.dispatchEvent({type:"error",error:"key_message",event:a})},mediaKeySystemSelectionError:function(a){this.eventBus.dispatchEvent({type:"error",error:"key_system_selection",event:a})}}},MediaPlayer.dependencies.ErrorHandler.prototype={constructor:MediaPlayer.dependencies.ErrorHandler},MediaPlayer.dependencies.FragmentLoader=function(){"use strict";var a=3,b=500,c=[],d=function(a,e){var f=new XMLHttpRequest,g=null,h=!0,i=!0,j=null,k=this;c.push(f),a.requestStartDate=new Date,g=k.metricsModel.addHttpRequest(a.mediaType,null,a.type,a.url,null,a.range,a.requestStartDate,null,null,null,null,a.duration,null),k.metricsModel.appendHttpTrace(g,a.requestStartDate,a.requestStartDate.getTime()-a.requestStartDate.getTime(),[0]),j=a.requestStartDate,f.open("GET",k.requestModifierExt.modifyRequestURL(a.url),!0),f.responseType="arraybuffer",f=k.requestModifierExt.modifyRequestHeader(f),a.range&&f.setRequestHeader("Range","bytes="+a.range),f.onprogress=function(b){var c=new Date;h&&(h=!1,(!b.lengthComputable||b.lengthComputable&&b.total!=b.loaded)&&(a.firstByteDate=c,g.tresponse=c)),k.metricsModel.appendHttpTrace(g,c,c.getTime()-j.getTime(),[f.response?f.response.byteLength:0]),j=c},f.onload=function(){if(!(f.status<200||f.status>299)){i=!1;var b,c,d=new Date,e=f.response;a.firstByteDate||(a.firstByteDate=a.requestStartDate),a.requestEndDate=d,b=a.firstByteDate.getTime()-a.requestStartDate.getTime(),c=a.requestEndDate.getTime()-a.firstByteDate.getTime(),k.debug.log("loaded "+a.mediaType+":"+a.type+":"+a.startTime+" ("+f.status+", "+b+"ms, "+c+"ms)"),g.tresponse=a.firstByteDate,g.tfinish=a.requestEndDate,g.responsecode=f.status,g.responseHeaders=f.getAllResponseHeaders(),k.metricsModel.appendHttpTrace(g,d,d.getTime()-j.getTime(),[e?e.byteLength:0]),j=d,k.notify(MediaPlayer.dependencies.FragmentLoader.eventList.ENAME_LOADING_COMPLETED,{request:a,response:e})}},f.onloadend=f.onerror=function(){if(-1!==c.indexOf(f)&&(c.splice(c.indexOf(f),1),i)){i=!1;var h,l,m=new Date,n=f.response;a.firstByteDate||(a.firstByteDate=a.requestStartDate),a.requestEndDate=m,h=a.firstByteDate.getTime()-a.requestStartDate.getTime(),l=a.requestEndDate.getTime()-a.firstByteDate.getTime(),k.debug.log("failed "+a.mediaType+":"+a.type+":"+a.startTime+" ("+f.status+", "+h+"ms, "+l+"ms)"),g.tresponse=a.firstByteDate,g.tfinish=a.requestEndDate,g.responsecode=f.status,k.metricsModel.appendHttpTrace(g,m,m.getTime()-j.getTime(),[n?n.byteLength:0]),j=m,e>0?(k.debug.log("Failed loading fragment: "+a.mediaType+":"+a.type+":"+a.startTime+", retry in "+b+"ms attempts: "+e),e--,setTimeout(function(){d.call(k,a,e)},b)):(k.debug.log("Failed loading fragment: "+a.mediaType+":"+a.type+":"+a.startTime+" no retry attempts left"),k.errHandler.downloadError("content",a.url,f),k.notify(MediaPlayer.dependencies.FragmentLoader.eventList.ENAME_LOADING_COMPLETED,{request:a,bytes:null},new MediaPlayer.vo.Error(null,"failed loading fragment",null)))}},f.send()},e=function(a){var b=this,c=new XMLHttpRequest,d=!1;c.open("HEAD",a.url,!0),c.onload=function(){c.status<200||c.status>299||(d=!0,b.notify(MediaPlayer.dependencies.FragmentLoader.eventList.ENAME_CHECK_FOR_EXISTENCE_COMPLETED,{request:a,exists:!0}))},c.onloadend=c.onerror=function(){d||b.notify(MediaPlayer.dependencies.FragmentLoader.eventList.ENAME_CHECK_FOR_EXISTENCE_COMPLETED,{request:a,exists:!1})},c.send()};return{metricsModel:void 0,errHandler:void 0,debug:void 0,requestModifierExt:void 0,notify:void 0,subscribe:void 0,unsubscribe:void 0,load:function(b){b?d.call(this,b,a):this.notify(MediaPlayer.dependencies.FragmentLoader.eventList.ENAME_LOADING_COMPLETED,{request:b,bytes:null},new MediaPlayer.vo.Error(null,"request is null",null))},checkForExistence:function(a){return a?void e.call(this,a):void this.notify(MediaPlayer.dependencies.FragmentLoader.eventList.ENAME_CHECK_FOR_EXISTENCE_COMPLETED,{request:a,exists:!1})},abort:function(){var a,b,d=c.length;for(a=0;d>a;a+=1)b=c[a],c[a]=null,b.abort(),b=null;c=[]}}},MediaPlayer.dependencies.FragmentLoader.prototype={constructor:MediaPlayer.dependencies.FragmentLoader},MediaPlayer.dependencies.FragmentLoader.eventList={ENAME_LOADING_COMPLETED:"loadingCompleted",ENAME_CHECK_FOR_EXISTENCE_COMPLETED:"checkForExistenceCompleted"},MediaPlayer.dependencies.LiveEdgeFinder=function(){"use strict";var a,b=!1,c=0/0,d=MediaPlayer.rules.SynchronizationRulesCollection.prototype.BEST_GUESS_RULES,e=function(a){var b=a.value,d=((new Date).getTime()-c)/1e3;this.notify(MediaPlayer.dependencies.LiveEdgeFinder.eventList.ENAME_LIVE_EDGE_SEARCH_COMPLETED,{liveEdge:b,searchTime:d},null===b?new MediaPlayer.vo.Error(MediaPlayer.dependencies.LiveEdgeFinder.LIVE_EDGE_NOT_FOUND_ERROR_CODE,"live edge has not been found",null):null)},f=function(f){var g=this;!g.streamProcessor.isDynamic()||b||f.error||(a=g.synchronizationRulesCollection.getRules(d),b=!0,c=(new Date).getTime(),g.rulesController.applyRules(a,g.streamProcessor,e.bind(g),null,function(a,b){return b}))},g=function(a){d=a.error?MediaPlayer.rules.SynchronizationRulesCollection.prototype.BEST_GUESS_RULES:MediaPlayer.rules.SynchronizationRulesCollection.prototype.TIME_SYNCHRONIZED_RULES};return{system:void 0,synchronizationRulesCollection:void 0,rulesController:void 0,notify:void 0,subscribe:void 0,unsubscribe:void 0,setup:function(){this[MediaPlayer.dependencies.Stream.eventList.ENAME_STREAM_UPDATED]=f,this[MediaPlayer.dependencies.TimeSyncController.eventList.ENAME_TIME_SYNCHRONIZATION_COMPLETED]=g},initialize:function(a){this.streamProcessor=a,this.fragmentLoader=a.fragmentLoader},abortSearch:function(){b=!1,c=0/0}}},MediaPlayer.dependencies.LiveEdgeFinder.prototype={constructor:MediaPlayer.dependencies.LiveEdgeFinder},MediaPlayer.dependencies.LiveEdgeFinder.eventList={ENAME_LIVE_EDGE_SEARCH_COMPLETED:"liveEdgeFound"},MediaPlayer.dependencies.LiveEdgeFinder.LIVE_EDGE_NOT_FOUND_ERROR_CODE=1,MediaPlayer.dependencies.ManifestLoader=function(){"use strict";var a=3,b=500,c=function(a){var b=null;return-1!==a.indexOf("/")&&(-1!==a.indexOf("?")&&(a=a.substring(0,a.indexOf("?"))),b=a.substring(0,a.lastIndexOf("/")+1)),b},d=function(a,e){var f,g=c(a),h=new XMLHttpRequest,i=new Date,j=null,k=!0,l=null,m=null,n=this;l=function(){h.status<200||h.status>299||(k=!1,j=new Date,n.metricsModel.addHttpRequest("stream",null,"MPD",a,null,null,i,j,null,h.status,null,null,h.getAllResponseHeaders()),f=n.parser.parse(h.responseText,g),f?(f.url=a,f.loadedTime=j,n.metricsModel.addManifestUpdate("stream",f.type,i,j,f.availabilityStartTime),n.notify(MediaPlayer.dependencies.ManifestLoader.eventList.ENAME_MANIFEST_LOADED,{manifest:f})):n.notify(MediaPlayer.dependencies.ManifestLoader.eventList.ENAME_MANIFEST_LOADED,{manifest:null},new MediaPlayer.vo.Error(null,"Failed loading manifest: "+a,null)))},m=function(){k&&(k=!1,n.metricsModel.addHttpRequest("stream",null,"MPD",a,null,null,i,new Date,h.status,null,null,h.getAllResponseHeaders()),e>0?(n.debug.log("Failed loading manifest: "+a+", retry in "+b+"ms attempts: "+e),e--,setTimeout(function(){d.call(n,a,e)},b)):(n.debug.log("Failed loading manifest: "+a+" no retry attempts left"),n.errHandler.downloadError("manifest",a,h),n.notify(MediaPlayer.dependencies.ManifestLoader.eventList.ENAME_MANIFEST_LOADED,null,new Error("Failed loading manifest: "+a+" no retry attempts left"))))};try{h.onload=l,h.onloadend=m,h.onerror=m,h.open("GET",n.requestModifierExt.modifyRequestURL(a),!0),h.send()}catch(o){h.onerror()}};return{debug:void 0,parser:void 0,errHandler:void 0,metricsModel:void 0,requestModifierExt:void 0,notify:void 0,subscribe:void 0,unsubscribe:void 0,load:function(b){d.call(this,b,a)}}},MediaPlayer.dependencies.ManifestLoader.prototype={constructor:MediaPlayer.dependencies.ManifestLoader},MediaPlayer.dependencies.ManifestLoader.eventList={ENAME_MANIFEST_LOADED:"manifestLoaded"},MediaPlayer.dependencies.ManifestUpdater=function(){"use strict";var a=0/0,b=null,c=!1,d=!1,e=function(){null!==b&&(clearInterval(b),b=null)},f=function(){e.call(this),isNaN(a)||(this.debug.log("Refresh manifest in "+a+" seconds."),b=setTimeout(h.bind(this),Math.min(1e3*a,Math.pow(2,31)-1),this))},g=function(){var b,c,d=this,e=d.manifestModel.getValue();void 0!==e&&null!==e&&(b=d.manifestExt.getRefreshDelay(e),c=((new Date).getTime()-e.loadedTime.getTime())/1e3,a=Math.max(b-c,0),f.call(d))},h=function(){var a,b,c=this;d||(d=!0,a=c.manifestModel.getValue(),b=a.url,a.hasOwnProperty("Location")&&(b=a.Location),c.manifestLoader.load(b))},i=function(a){a.error||(this.manifestModel.setValue(a.data.manifest),this.debug.log("Manifest has been refreshed."),c||g.call(this))},j=function(){this.start()},k=function(){this.stop()},l=function(){d=!1};return{debug:void 0,system:void 0,manifestModel:void 0,manifestExt:void 0,manifestLoader:void 0,setup:function(){this[MediaPlayer.dependencies.StreamController.eventList.ENAME_STREAMS_COMPOSED]=l,this[MediaPlayer.dependencies.ManifestLoader.eventList.ENAME_MANIFEST_LOADED]=i,this[MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_STARTED]=j,this[MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_PAUSED]=k},start:function(){c=!1,g.call(this)},stop:function(){c=!0,e.call(this)}}},MediaPlayer.dependencies.ManifestUpdater.prototype={constructor:MediaPlayer.dependencies.ManifestUpdater},MediaPlayer.dependencies.Notifier=function(){"use strict";var a,b=0,c=function(){return this.id||(b+=1,this.id="_id_"+b),this.id};return{system:void 0,setup:function(){a=this.system,a.mapValue("notify",this.notify),a.mapValue("subscribe",this.subscribe),a.mapValue("unsubscribe",this.unsubscribe)},notify:function(){var b=arguments[0]+c.call(this),d=new MediaPlayer.vo.Event;d.sender=this,d.type=arguments[0],d.data=arguments[1],d.error=arguments[2],d.timestamp=(new Date).getTime(),a.notify.call(a,b,d)},subscribe:function(b,d,e,f){if(!e&&d[b]&&(e=d[b]=d[b].bind(d)),!d)throw"observer object cannot be null or undefined";if(!e)throw"event handler cannot be null or undefined";b+=c.call(this),a.mapHandler(b,void 0,e,f)},unsubscribe:function(b,d,e){e=e||d[b],b+=c.call(this),a.unmapHandler(b,void 0,e)}}},MediaPlayer.dependencies.Notifier.prototype={constructor:MediaPlayer.dependencies.Notifier},MediaPlayer.dependencies.Stream=function(){"use strict";var a,b,c={},d=[],e=!0,f=!1,g=!1,h=!1,i=null,j=[],k=!0,l=null,m={},n=null,o=function(){f&&this.playbackController.start()},p=function(){this.playbackController.pause()},q=function(a){f&&(this.debug.log("Do seek: "+a),this.playbackController.seek(a))},r=function(a){try{var b=c.video,d=this.protectionExt.autoSelectKeySystem(this.protectionModel,b,a.data.initData);if(this.keySystem&&this.keySystem!==this.protectionModel.keySystem)throw new Error("DRM: Changing key systems within a single Period is not allowed!");this.keySystem||(this.keySystem=this.protectionModel.keySystem,this.protectionModel.keySystem.subscribe(MediaPlayer.dependencies.protection.KeySystem.eventList.ENAME_LICENSE_REQUEST_COMPLETE,this)),this.debug.log("DRM: Key required for - "+b.codec),this.protectionController.createKeySession(d,b.codec)}catch(e){this.errHandler.mediaKeySessionError(e.message),this.debug.log(e.message),this.reset()}},s=function(){this.debug.log("DRM: Key added.")
17
+ },t=function(a){a.error?(p.call(this),this.debug.log(a.error),this.errHandler.mediaKeyMessageError(a.error)):(this.debug.log("DRM: License request successful. Session ID = "+a.data.requestData.sessionID),this.protectionController.updateKeySession(a.data.requestData,a.data.message))},u=function(a){var b,c=a.data.sessionToken,d=c.sessionID?c.sessionID:"NONE";b="DRM: MediaKeyError - sessionId: "+d+". "+a.data.error,this.debug.log(b),this.errHandler.mediaKeySessionError(b)},v=function(a){this.debug.log("DRM: Session created. SessionID = "+a.data.sessionID)},w=function(a){this.debug.log("DRM: Session loaded. SessionID = "+a.data.sessionID)},x=function(a){this.debug.log("DRM: Session unloaded. SessionID = "+a.data.sessionID)},y=function(a){this.debug.log("DRM: Session closed. SessionID = "+a.data.sessionID)},z=function(a,b){var c,d=this,e=function(f){d.debug.log("MediaSource is open!"),d.debug.log(f),window.URL.revokeObjectURL(c),a.removeEventListener("sourceopen",e),a.removeEventListener("webkitsourceopen",e),b(a)};a.addEventListener("sourceopen",e,!1),a.addEventListener("webkitsourceopen",e,!1),c=d.mediaSourceExt.attachMediaSource(a,d.videoModel)},A=function(){var e,g=this,k=d.length,l=0;for(l;k>l;l+=1)e=d[l],e.reset(h),e=null;n&&n.reset(),d=[],b&&g.mediaSourceExt.detachMediaSource(g.videoModel),f=!1,i=null,j=[],c={},b=null,a=null},B=function(a,e){var f,g,h,i=this,j=function(a){return a.codec},k=i.adapter.getMediaInfoForType(e,l,a);if("text"===a&&(j=function(a){return f=a.mimeType}),null!==k){var m,o=j.call(i,k),p=null;if(o===f)try{p=i.sourceBufferExt.createSourceBuffer(b,k)}catch(q){i.errHandler.mediaSourceError("Error creating "+a+" source buffer.")}else if(g=o,i.debug.log(a+" codec: "+g),c[a]=k,m=k.contentProtection,m&&!i.capabilities.supportsEncryptedMedia())i.errHandler.capabilityError("encryptedmedia");else if(i.capabilities.supportsCodec(i.videoModel.getElement(),g))try{p=i.sourceBufferExt.createSourceBuffer(b,k)}catch(q){i.errHandler.mediaSourceError("Error creating "+a+" source buffer.")}else{var r=a+"Codec ("+g+") is not supported.";i.errHandler.manifestError(r,"codec",e),i.debug.log(r)}null===p?i.debug.log("No buffer was created, skipping "+a+" data."):(h=i.system.getObject("streamProcessor"),d.push(h),h.initialize(f||a,p,i.videoModel,i.fragmentController,i.playbackController,b,i,n),h.setMediaInfo(k),i.adapter.updateData(h))}else i.debug.log("No "+a+" data.")},C=function(){var b,c=this;n=c.system.getObject("eventController"),n.initialize(c.videoModel),b=c.adapter.getEventsFor(l),n.addInlineEvents(b),B.call(c,"video",a),B.call(c,"audio",a),B.call(c,"text",a)},D=function(){var a,c,d=this;a=l.manifestInfo.duration,c=d.mediaSourceExt.setDuration(b,a),d.debug.log("Duration successfully set to: "+c),f=!0,G.call(d)},E=function(){this.debug.log("element loaded!"),g=!0,F.call(this)},F=function(){f&&g&&0===l.index&&(n.start(),e&&o.call(this))},G=function(){var a=this,b=d.length,c=!!m.audio||!!m.video,e=c?new MediaPlayer.vo.Error(MediaPlayer.dependencies.Stream.DATA_UPDATE_FAILED_ERROR_CODE,"Data update failed",null):null,g=0;if(f){for(g;b>g;g+=1)if(d[g].isUpdating())return;k=!1,a.notify(MediaPlayer.dependencies.Stream.eventList.ENAME_STREAM_UPDATED,null,e)}},H=function(a){var b=a.data.error.code,c="";if(-1!==b){switch(b){case 1:c="MEDIA_ERR_ABORTED";break;case 2:c="MEDIA_ERR_NETWORK";break;case 3:c="MEDIA_ERR_DECODE";break;case 4:c="MEDIA_ERR_SRC_NOT_SUPPORTED";break;case 5:c="MEDIA_ERR_ENCRYPTED"}h=!0,this.debug.log("Video Element Error: "+c),this.debug.log(a.error),this.errHandler.mediaSourceError(c),this.reset()}},I=function(c){var e,f=this,g=function(c){if(b=c,C.call(f),0===d.length){var e="No streams to play.";f.errHandler.manifestError(e,"nostreams",a),f.debug.log(e)}else f.liveEdgeFinder.initialize(d[0]),f.liveEdgeFinder.subscribe(MediaPlayer.dependencies.LiveEdgeFinder.eventList.ENAME_LIVE_EDGE_SEARCH_COMPLETED,f.playbackController),D.call(f),F.call(f)};a=c,e=f.mediaSourceExt.createMediaSource(),z.call(f,e,g)},J=function(){var a=L(),c=a.length,d=0;for(d;c>d;d+=1)if(!a[d].isBufferingCompleted())return;b&&l.isLast&&this.mediaSourceExt.signalEndOfStream(b)},K=function(a){var b=a.sender.streamProcessor.getType();m[b]=a.error,G.call(this)},L=function(){var a,b,c=[],e=0,f=d.length;for(e;f>e;e+=1)b=d[e],a=b.getType(),("audio"===a||"video"===a)&&c.push(b);return c},M=function(b){var c,e,f,g=this,h=d.length,i=0;for(k=!0,a=g.manifestModel.getValue(),l=b,g.debug.log("Manifest updated... set new data on buffers."),n&&(e=g.adapter.getEventsFor(l),n.addInlineEvents(e)),i;h>i;i+=1)f=d[i],c=g.adapter.getMediaInfoForType(a,l,f.getType()),f.setMediaInfo(c),this.adapter.updateData(f)};return{system:void 0,manifestModel:void 0,mediaSourceExt:void 0,sourceBufferExt:void 0,adapter:void 0,fragmentController:void 0,playbackController:void 0,protectionExt:void 0,capabilities:void 0,debug:void 0,errHandler:void 0,liveEdgeFinder:void 0,abrController:void 0,notify:void 0,subscribe:void 0,unsubscribe:void 0,eventList:{ENAME_STREAM_UPDATED:"streamUpdated"},setup:function(){this[MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFERING_COMPLETED]=J,this[Dash.dependencies.RepresentationController.eventList.ENAME_DATA_UPDATE_COMPLETED]=K,this[MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_ERROR]=H,this[MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_METADATA_LOADED]=E,this[MediaPlayer.dependencies.protection.KeySystem.eventList.ENAME_LICENSE_REQUEST_COMPLETE]=t.bind(this),this[MediaPlayer.models.ProtectionModel.eventList.ENAME_NEED_KEY]=r.bind(this),this[MediaPlayer.models.ProtectionModel.eventList.ENAME_KEY_ADDED]=s.bind(this),this[MediaPlayer.models.ProtectionModel.eventList.ENAME_KEY_ERROR]=u.bind(this),this[MediaPlayer.models.ProtectionModel.eventList.ENAME_KEY_SESSION_CREATED]=v.bind(this),this[MediaPlayer.models.ProtectionModel.eventList.ENAME_KEY_SESSION_LOADED]=w.bind(this),this[MediaPlayer.models.ProtectionModel.eventList.ENAME_KEY_SESSION_UNLOADED]=x.bind(this),this[MediaPlayer.models.ProtectionModel.eventList.ENAME_KEY_SESSION_CLOSED]=y.bind(this)},load:function(a){I.call(this,a)},setVideoModel:function(a){this.videoModel=a},initProtection:function(){this.capabilities.supportsEncryptedMedia()&&(this.protectionModel=this.system.getObject("protectionModel"),this.protectionModel.init(this.getVideoModel()),this.protectionModel.setMediaElement(this.videoModel.getElement()),this.protectionController=this.system.getObject("protectionController"),this.protectionController.init(this.protectionModel),this.protectionModel.subscribe(MediaPlayer.models.ProtectionModel.eventList.ENAME_NEED_KEY,this),this.protectionModel.subscribe(MediaPlayer.models.ProtectionModel.eventList.ENAME_KEY_ADDED,this),this.protectionModel.subscribe(MediaPlayer.models.ProtectionModel.eventList.ENAME_KEY_ERROR,this),this.protectionModel.subscribe(MediaPlayer.models.ProtectionModel.eventList.ENAME_KEY_SESSION_CREATED,this),this.protectionModel.subscribe(MediaPlayer.models.ProtectionModel.eventList.ENAME_KEY_SESSION_LOADED,this),this.protectionModel.subscribe(MediaPlayer.models.ProtectionModel.eventList.ENAME_KEY_SESSION_UNLOADED,this),this.protectionModel.subscribe(MediaPlayer.models.ProtectionModel.eventList.ENAME_KEY_SESSION_CLOSED,this))},getVideoModel:function(){return this.videoModel},setAutoPlay:function(a){e=a},getAutoPlay:function(){return e},reset:function(){p.call(this),this.protectionModel&&(this.protectionModel.unsubscribe(MediaPlayer.models.ProtectionModel.eventList.ENAME_NEED_KEY,this),this.protectionModel.unsubscribe(MediaPlayer.models.ProtectionModel.eventList.ENAME_KEY_ADDED,this),this.protectionModel.unsubscribe(MediaPlayer.models.ProtectionModel.eventList.ENAME_KEY_ERROR,this),this.protectionModel.unsubscribe(MediaPlayer.models.ProtectionModel.eventList.ENAME_KEY_SESSION_CREATED,this),this.protectionModel.unsubscribe(MediaPlayer.models.ProtectionModel.eventList.ENAME_KEY_SESSION_LOADED,this),this.protectionModel.unsubscribe(MediaPlayer.models.ProtectionModel.eventList.ENAME_KEY_SESSION_UNLOADED,this),this.protectionModel.unsubscribe(MediaPlayer.models.ProtectionModel.eventList.ENAME_KEY_SESSION_CLOSED,this),this.keySystem&&(this.keySystem.unsubscribe(MediaPlayer.dependencies.protection.KeySystem.eventList.ENAME_LICENSE_REQUEST_COMPLETE,this),this.keySystem=void 0),this.protectionController.teardown(),this.protectionModel.teardown(),this.protectionController=void 0,this.protectionModel=void 0),A.call(this),this.fragmentController=void 0,this.playbackController.unsubscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_ERROR,this),this.playbackController.unsubscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_METADATA_LOADED,this),this.playbackController.reset(),this.liveEdgeFinder.abortSearch(),this.liveEdgeFinder.unsubscribe(MediaPlayer.dependencies.LiveEdgeFinder.eventList.ENAME_LIVE_EDGE_SEARCH_COMPLETED,this.playbackController),g=!1,m={}},getDuration:function(){return l.duration},getStartTime:function(){return l.start},getStreamIndex:function(){return l.index},getId:function(){return l.id},setStreamInfo:function(a){l=a},getStreamInfo:function(){return l},startEventController:function(){n.start()},resetEventController:function(){n.reset()},setPlaybackController:function(a){this.playbackController=a,a.initialize(l,this.videoModel)},getPlaybackController:function(){return this.playbackController},isUpdating:function(){return k},updateData:M,play:o,seek:q,pause:p}},MediaPlayer.dependencies.Stream.prototype={constructor:MediaPlayer.dependencies.Stream},MediaPlayer.dependencies.Stream.DATA_UPDATE_FAILED_ERROR_CODE=1,MediaPlayer.dependencies.Stream.eventList={ENAME_STREAM_UPDATED:"streamUpdated"},MediaPlayer.dependencies.StreamProcessor=function(){"use strict";var a,b,c,d,e,f=function(a){var b=this,c="video"===a||"audio"===a?"bufferController":"textController";return b.system.getObject(c)};return{system:void 0,indexHandler:void 0,liveEdgeFinder:void 0,timelineConverter:void 0,eventList:void 0,abrController:void 0,baseURLExt:void 0,adapter:void 0,initialize:function(c,g,h,i,j,k,l,m){var n,o=this,p=o.system.getObject("trackController"),q=o.system.getObject("scheduleController"),r=o.liveEdgeFinder,s=o.abrController,t=o.indexHandler,u=o.baseURLExt,v=this.system.getObject("fragmentLoader"),w=f.call(o,c);b=l,d=c,e=m,a=b.getStreamInfo().manifestInfo.isDynamic,o.bufferController=w,o.playbackController=j,o.scheduleController=q,o.trackController=p,o.videoModel=h,o.fragmentController=i,o.fragmentLoader=v,p.subscribe(Dash.dependencies.RepresentationController.eventList.ENAME_DATA_UPDATE_COMPLETED,w),i.subscribe(MediaPlayer.dependencies.FragmentController.eventList.ENAME_INIT_FRAGMENT_LOADED,w),"video"===d||"audio"===d?(s.subscribe(MediaPlayer.dependencies.AbrController.eventList.ENAME_QUALITY_CHANGED,w),s.subscribe(MediaPlayer.dependencies.AbrController.eventList.ENAME_QUALITY_CHANGED,p),s.subscribe(MediaPlayer.dependencies.AbrController.eventList.ENAME_QUALITY_CHANGED,q),r.subscribe(MediaPlayer.dependencies.LiveEdgeFinder.eventList.ENAME_LIVE_EDGE_SEARCH_COMPLETED,this.timelineConverter),r.subscribe(MediaPlayer.dependencies.LiveEdgeFinder.eventList.ENAME_LIVE_EDGE_SEARCH_COMPLETED,p),r.subscribe(MediaPlayer.dependencies.LiveEdgeFinder.eventList.ENAME_LIVE_EDGE_SEARCH_COMPLETED,q),p.subscribe(Dash.dependencies.RepresentationController.eventList.ENAME_DATA_UPDATE_STARTED,q),p.subscribe(Dash.dependencies.RepresentationController.eventList.ENAME_DATA_UPDATE_COMPLETED,q),p.subscribe(Dash.dependencies.RepresentationController.eventList.ENAME_DATA_UPDATE_COMPLETED,s),p.subscribe(Dash.dependencies.RepresentationController.eventList.ENAME_DATA_UPDATE_COMPLETED,b),j.streamProcessor||(j.streamProcessor=o,p.subscribe(Dash.dependencies.RepresentationController.eventList.ENAME_DATA_UPDATE_COMPLETED,j)),i.subscribe(MediaPlayer.dependencies.FragmentController.eventList.ENAME_MEDIA_FRAGMENT_LOADED,w),i.subscribe(MediaPlayer.dependencies.FragmentController.eventList.ENAME_MEDIA_FRAGMENT_LOADING_START,q),i.subscribe(MediaPlayer.dependencies.FragmentController.eventList.ENAME_STREAM_COMPLETED,q),i.subscribe(MediaPlayer.dependencies.FragmentController.eventList.ENAME_STREAM_COMPLETED,w),i.subscribe(MediaPlayer.dependencies.FragmentController.eventList.ENAME_STREAM_COMPLETED,q.scheduleRulesCollection.bufferLevelRule),w.subscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_STATE_CHANGED,h),w.subscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_CLEARED,q),w.subscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_BYTES_APPENDED,q),w.subscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_UPDATED,q),w.subscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_UPDATED,p),w.subscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_STATE_CHANGED,q),w.subscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_INIT_REQUESTED,q),w.subscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFERING_COMPLETED,b),w.subscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_QUOTA_EXCEEDED,q),w.subscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_OUTRUN,q.scheduleRulesCollection.bufferLevelRule),w.subscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_BALANCED,q.scheduleRulesCollection.bufferLevelRule),w.subscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_BYTES_APPENDED,j),j.subscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_PROGRESS,w),j.subscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_TIME_UPDATED,w),j.subscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_RATE_CHANGED,w),j.subscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_RATE_CHANGED,q),j.subscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_SEEKING,w),j.subscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_SEEKING,q),j.subscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_STARTED,q),j.subscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_SEEKING,q.scheduleRulesCollection.playbackTimeRule),a&&j.subscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_WALLCLOCK_TIME_UPDATED,p),j.subscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_WALLCLOCK_TIME_UPDATED,w),j.subscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_WALLCLOCK_TIME_UPDATED,q),u.subscribe(Dash.dependencies.BaseURLExtensions.eventList.ENAME_INITIALIZATION_LOADED,t),u.subscribe(Dash.dependencies.BaseURLExtensions.eventList.ENAME_SEGMENTS_LOADED,t)):w.subscribe(MediaPlayer.dependencies.TextController.eventList.ENAME_CLOSED_CAPTIONING_REQUESTED,q),t.initialize(this),w.initialize(d,g,k,o),q.initialize(d,this),n=this.getFragmentModel(),n.setLoader(v),n.subscribe(MediaPlayer.dependencies.FragmentModel.eventList.ENAME_FRAGMENT_LOADING_STARTED,i),n.subscribe(MediaPlayer.dependencies.FragmentModel.eventList.ENAME_FRAGMENT_LOADING_COMPLETED,i),n.subscribe(MediaPlayer.dependencies.FragmentModel.eventList.ENAME_STREAM_COMPLETED,i),n.subscribe(MediaPlayer.dependencies.FragmentModel.eventList.ENAME_FRAGMENT_LOADING_COMPLETED,q),v.subscribe(MediaPlayer.dependencies.FragmentLoader.eventList.ENAME_LOADING_COMPLETED,n),("video"===d||"audio"===d)&&(w.subscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_OUTRUN,n),w.subscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_BALANCED,n),w.subscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_BYTES_REJECTED,n)),p.initialize(this)},isUpdating:function(){return this.trackController.isUpdating()},getType:function(){return d},getFragmentLoader:function(){return this.fragmentLoader},getFragmentModel:function(){return this.scheduleController.getFragmentModel()},getPlaybackController:function(){return this.playbackController},getStreamInfo:function(){return b.getStreamInfo()},setMediaInfo:function(a){c=a},getMediaInfo:function(){return c},getScheduleController:function(){return this.scheduleController},getEventController:function(){return e},start:function(){this.scheduleController.start()},stop:function(){this.scheduleController.stop()},getCurrentTrack:function(){return this.adapter.getCurrentTrackInfo(this.trackController)},getTrackForQuality:function(a){return this.adapter.getTrackInfoForQuality(this.trackController,a)},isBufferingCompleted:function(){return this.bufferController.isBufferingCompleted()},isDynamic:function(){return a},reset:function(a){var c=this,d=c.bufferController,e=c.trackController,f=c.scheduleController,g=c.liveEdgeFinder,h=c.fragmentController,i=c.abrController,j=c.playbackController,k=this.indexHandler,l=this.baseURLExt,m=this.getFragmentModel(),n=this.fragmentLoader,o=c.videoModel;i.unsubscribe(MediaPlayer.dependencies.AbrController.eventList.ENAME_QUALITY_CHANGED,d),i.unsubscribe(MediaPlayer.dependencies.AbrController.eventList.ENAME_QUALITY_CHANGED,e),i.unsubscribe(MediaPlayer.dependencies.AbrController.eventList.ENAME_QUALITY_CHANGED,f),g.unsubscribe(MediaPlayer.dependencies.LiveEdgeFinder.eventList.ENAME_LIVE_EDGE_SEARCH_COMPLETED,this.timelineConverter),g.unsubscribe(MediaPlayer.dependencies.LiveEdgeFinder.eventList.ENAME_LIVE_EDGE_SEARCH_COMPLETED,f),g.unsubscribe(MediaPlayer.dependencies.LiveEdgeFinder.eventList.ENAME_LIVE_EDGE_SEARCH_COMPLETED,e),e.unsubscribe(Dash.dependencies.RepresentationController.eventList.ENAME_DATA_UPDATE_STARTED,f),e.unsubscribe(Dash.dependencies.RepresentationController.eventList.ENAME_DATA_UPDATE_COMPLETED,d),e.unsubscribe(Dash.dependencies.RepresentationController.eventList.ENAME_DATA_UPDATE_COMPLETED,f),e.unsubscribe(Dash.dependencies.RepresentationController.eventList.ENAME_DATA_UPDATE_COMPLETED,i),e.unsubscribe(Dash.dependencies.RepresentationController.eventList.ENAME_DATA_UPDATE_COMPLETED,b),e.unsubscribe(Dash.dependencies.RepresentationController.eventList.ENAME_DATA_UPDATE_COMPLETED,j),h.unsubscribe(MediaPlayer.dependencies.FragmentController.eventList.ENAME_INIT_FRAGMENT_LOADED,d),h.unsubscribe(MediaPlayer.dependencies.FragmentController.eventList.ENAME_MEDIA_FRAGMENT_LOADED,d),h.unsubscribe(MediaPlayer.dependencies.FragmentController.eventList.ENAME_MEDIA_FRAGMENT_LOADING_START,f),h.unsubscribe(MediaPlayer.dependencies.FragmentController.eventList.ENAME_STREAM_COMPLETED,f),h.unsubscribe(MediaPlayer.dependencies.FragmentController.eventList.ENAME_STREAM_COMPLETED,d),h.unsubscribe(MediaPlayer.dependencies.FragmentController.eventList.ENAME_STREAM_COMPLETED,f.scheduleRulesCollection.bufferLevelRule),d.unsubscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_STATE_CHANGED,o),d.unsubscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_CLEARED,f),d.unsubscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_BYTES_APPENDED,f),d.unsubscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_UPDATED,f),d.unsubscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_UPDATED,e),d.unsubscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_STATE_CHANGED,f),d.unsubscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_INIT_REQUESTED,f),d.unsubscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFERING_COMPLETED,b),d.unsubscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_CLOSED_CAPTIONING_REQUESTED,f),d.unsubscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_OUTRUN,f.scheduleRulesCollection.bufferLevelRule),d.unsubscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_BALANCED,f.scheduleRulesCollection.bufferLevelRule),d.unsubscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_BYTES_APPENDED,j),j.unsubscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_PROGRESS,d),j.unsubscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_TIME_UPDATED,d),j.unsubscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_RATE_CHANGED,d),j.unsubscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_RATE_CHANGED,f),j.unsubscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_SEEKING,d),j.unsubscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_SEEKING,f),j.unsubscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_STARTED,f),j.unsubscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_WALLCLOCK_TIME_UPDATED,e),j.unsubscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_WALLCLOCK_TIME_UPDATED,d),j.unsubscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_WALLCLOCK_TIME_UPDATED,f),j.unsubscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_SEEKING,f.scheduleRulesCollection.playbackTimeRule),l.unsubscribe(Dash.dependencies.BaseURLExtensions.eventList.ENAME_INITIALIZATION_LOADED,k),l.unsubscribe(Dash.dependencies.BaseURLExtensions.eventList.ENAME_SEGMENTS_LOADED,k),d.unsubscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_OUTRUN,m),d.unsubscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_BALANCED,m),d.unsubscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_BYTES_REJECTED,m),m.unsubscribe(MediaPlayer.dependencies.FragmentModel.eventList.ENAME_FRAGMENT_LOADING_STARTED,h),m.unsubscribe(MediaPlayer.dependencies.FragmentModel.eventList.ENAME_FRAGMENT_LOADING_COMPLETED,h),m.unsubscribe(MediaPlayer.dependencies.FragmentModel.eventList.ENAME_STREAM_COMPLETED,h),m.unsubscribe(MediaPlayer.dependencies.FragmentModel.eventList.ENAME_FRAGMENT_LOADING_COMPLETED,f),n.unsubscribe(MediaPlayer.dependencies.FragmentLoader.eventList.ENAME_LOADING_COMPLETED,m),h.resetModel(m),k.reset(),this.bufferController.reset(a),this.scheduleController.reset(),this.bufferController=null,this.scheduleController=null,this.trackController=null,this.videoModel=null,this.fragmentController=null}}},MediaPlayer.dependencies.StreamProcessor.prototype={constructor:MediaPlayer.dependencies.StreamProcessor},MediaPlayer.utils.TTMLParser=function(){"use strict";var a,b=3600,c=60,d=/^(0[0-9]|1[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])((\.[0-9][0-9][0-9])|(:[0-9][0-9]))$/,e=function(e){var f,g,h,i=d.test(e);if(!i)return 0/0;if(f=e.split(":"),g=parseFloat(f[0])*b+parseFloat(f[1])*c+parseFloat(f[2]),f[3]){if(h=a.tt.frameRate,!h||isNaN(h))return 0/0;g+=parseFloat(f[3])/h}return g},f=function(){var b=!1,c=a.hasOwnProperty("tt"),d=c?a.tt.hasOwnProperty("head"):!1,e=d?a.tt.head.hasOwnProperty("layout"):!1,f=d?a.tt.head.hasOwnProperty("styling"):!1,g=c?a.tt.hasOwnProperty("body"):!1,h=d?a.tt.head.hasOwnProperty("profile"):!1;return c&&d&&e&&f&&g&&(b=!0),b&&(b=h&&"http://www.w3.org/ns/ttml/profile/sdp-us"===a.tt.head.profile.use),b},g=function(a,b){var c=Object.keys(a).filter(function(c){return"xmlns"===c.split(":")[0]&&a[c]===b}).map(function(a){return a.split(":")[1]});return 1!=c.length?null:c[0]},h=function(b){var c,d,h,i,j,k,l,m=[],n=new X2JS([],"",!1);if(a=n.xml_str2json(b),!f())throw c="TTML document has incorrect structure";if(k=g(a.tt,"http://www.w3.org/ns/ttml#parameter"),a.tt.hasOwnProperty(k+":frameRate")&&(a.tt.frameRate=parseInt(a.tt[k+":frameRate"],10)),d=a.tt.body.div_asArray[0].p_asArray,!d||0===d.length)throw c="TTML document does not contain any cues";for(l=0;l<d.length;l+=1){if(h=d[l],i=e(h.begin),j=e(h.end),isNaN(i)||isNaN(j))throw c="TTML document has incorrect timing value";m.push({start:i,end:j,data:h.__text})}return m};return{parse:h}},MediaPlayer.dependencies.TextSourceBuffer=function(){var a,b;return{system:void 0,eventBus:void 0,errHandler:void 0,initialize:function(c,d){b=c,this.videoModel=d.videoModel,a=d.streamProcessor.getCurrentTrack().mediaInfo},append:function(b){var c,d,e,f=this,g=String.fromCharCode.apply(null,new Uint16Array(b));try{c=f.getParser().parse(g),d=a.id,e=a.lang,f.getTextTrackExtensions().addTextTrack(f.videoModel.getElement(),c,d,e,!0),f.eventBus.dispatchEvent({type:"updateend"})}catch(h){f.errHandler.closedCaptionsError(h,"parse",g)}},abort:function(){this.getTextTrackExtensions().deleteCues(this.videoModel.getElement())},getParser:function(){var a;return"text/vtt"===b?a=this.system.getObject("vttParser"):"application/ttml+xml"===b&&(a=this.system.getObject("ttmlParser")),a},getTextTrackExtensions:function(){return this.system.getObject("textTrackExtensions")},addEventListener:function(a,b,c){this.eventBus.addEventListener(a,b,c)},removeEventListener:function(a,b,c){this.eventBus.removeEventListener(a,b,c)}}},MediaPlayer.dependencies.TextSourceBuffer.prototype={constructor:MediaPlayer.dependencies.TextSourceBuffer},MediaPlayer.dependencies.TimeSyncController=function(){"use strict";var a=5e3,b=0,c=!1,d=!1,e=function(a){c=a},f=function(){return c},g=function(a){d=a},h=function(a){b=a},i=function(){return b},j=function(a){var b,c,d=60,e=60,f=1e3,g=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+\-])([0-9]{2})([0-9]{2}))?/,h=g.exec(a);return b=Date.UTC(parseInt(h[1],10),parseInt(h[2],10)-1,parseInt(h[3],10),parseInt(h[4],10),parseInt(h[5],10),h[6]&&(parseInt(h[6],10)||0),h[7]&&parseFloat(h[7])*f||0),h[9]&&h[10]&&(c=parseInt(h[9],10)*e+parseInt(h[10],10),b+=("+"===h[8]?-1:1)*c*d*f),new Date(b).getTime()},k=function(a){var b=Date.parse(a);return isNaN(b)&&(b=j(a)),b},l=function(a){return Date.parse(a)},m=function(a){return Date.parse(a)},n=function(a,b,c){c()},o=function(a,b,c){var d=k(a);return isNaN(d)?void c():void b(d)},p=function(b,c,d,e,f){var g,h,i=!1,j=new XMLHttpRequest,k=f?"HEAD":"GET",l=c.match(/\S+/g);c=l.shift(),g=function(){i||(i=!0,l.length?p(b,l.join(" "),d,e,f):e())},h=function(){var a,c;200===j.status&&(a=f?j.getResponseHeader("Date"):j.response,c=b(a),isNaN(c)||(d(c),i=!0))},j.open(k,c),j.timeout=a||0,j.onload=h,j.onloadend=g,j.send()},q=function(a,b,c){p.call(this,m,a,b,c,!0)},r={"urn:mpeg:dash:utc:http-head:2014":q,"urn:mpeg:dash:utc:http-xsdate:2014":p.bind(null,k),"urn:mpeg:dash:utc:http-iso:2014":p.bind(null,l),"urn:mpeg:dash:utc:direct:2014":o,"urn:mpeg:dash:utc:http-head:2012":q,"urn:mpeg:dash:utc:http-xsdate:2012":p.bind(null,k),"urn:mpeg:dash:utc:http-iso:2012":p.bind(null,l),"urn:mpeg:dash:utc:direct:2012":o,"urn:mpeg:dash:utc:http-ntp:2014":n,"urn:mpeg:dash:utc:ntp:2014":n,"urn:mpeg:dash:utc:sntp:2014":n},s=function(a,b){var c=this,d=b||0,f=a[d],g=function(a,b){var d=!a||!b;e(!1),c.notify(MediaPlayer.dependencies.TimeSyncController.eventList.ENAME_TIME_SYNCHRONIZATION_COMPLETED,{time:a,offset:b},d?new MediaPlayer.vo.Error(MediaPlayer.dependencies.TimeSyncController.TIME_SYNC_FAILED_ERROR_CODE):null)};e(!0),f?r.hasOwnProperty(f.schemeIdUri)?r[f.schemeIdUri](f.value,function(a){var b=(new Date).getTime(),d=a-b;h(d),c.debug.log("Local time: "+new Date(b)),c.debug.log("Server time: "+new Date(a)),c.debug.log("Difference (ms): "+d),g.call(c,a,d)},function(){s.call(c,a,d+1)}):s.call(c,a,d+1):(h(0),g.call(c))};return{debug:void 0,notify:void 0,subscribe:void 0,unsubscribe:void 0,getOffsetToDeviceTimeMs:function(){return i()},initialize:function(a){f()||(s.call(this,a),g(!0))},reset:function(){g(!1),e(!1)}}},MediaPlayer.dependencies.TimeSyncController.prototype={constructor:MediaPlayer.dependencies.TimeSyncController},MediaPlayer.dependencies.TimeSyncController.eventList={ENAME_TIME_SYNCHRONIZATION_COMPLETED:"timeSynchronizationComplete"},MediaPlayer.dependencies.TimeSyncController.TIME_SYNC_FAILED_ERROR_CODE=1,MediaPlayer.utils.VTTParser=function(){"use strict";var a=function(a){var b=a.split(":"),c=b.length-1;return a=60*parseInt(b[c-1],10)+parseFloat(b[c],10),2===c&&(a+=3600*parseInt(b[0],10)),a};return{parse:function(b){var c,d=/(?:\r\n|\r|\n)/gm,e=/-->/,f=/(^[\s]+|[\s]+$)/g,g=[];b=b.split(d),c=b.length;for(var h=0;c>h;h++){var i=b[h];if(i.length>0&&"WEBVTT"!==i&&i.match(e)){var j=i.split(e),k=b[h+1];g.push({start:a(j[0].replace(f,"")),end:a(j[1].replace(f,"")),data:k})}}return g}}},MediaPlayer.dependencies.AbrController=function(){"use strict";var a=!0,b={},c={},d={},e=function(a,b){var d;return c[b]=c[b]||{},c[b].hasOwnProperty(a)||(c[b][a]=0),d=c[b][a]},f=function(a,b,d){c[b]=c[b]||{},c[b][a]=d},g=function(a,b){var c;return d[b]=d[b]||{},d[b].hasOwnProperty(a)||(d[b][a]=0),c=d[b][a]},h=function(a,b,c){d[b]=d[b]||{},d[b][a]=c},i=function(a,c,d){b[c]=b[c]||{},b[c][a]=d},j=function(a,c){var d;return b[c]=b[c]||{},b[c].hasOwnProperty(a)||(b[c][a]=0),d=b[c][a]},k=function(a){if(!a.error){var b,c=this,d=this.adapter.convertDataToTrack(a.data.currentRepresentation).mediaInfo,e=d.type,f=d.streamInfo.id;b=d.trackCount-1,j(e,f)!==b&&(i(e,f,b),c.notify(MediaPlayer.dependencies.AbrController.eventList.ENAME_TOP_QUALITY_INDEX_CHANGED,{mediaType:e,streamInfo:d.streamInfo,maxIndex:b}))}};return{debug:void 0,adapter:void 0,abrRulesCollection:void 0,rulesController:void 0,notify:void 0,subscribe:void 0,unsubscribe:void 0,setup:function(){this[Dash.dependencies.RepresentationController.eventList.ENAME_DATA_UPDATE_COMPLETED]=k},getAutoSwitchBitrate:function(){return a},setAutoSwitchBitrate:function(b){a=b},getPlaybackQuality:function(b){var c,d,i,k,l=this,m=b.getType(),n=b.getStreamInfo().id,o=function(a){var g=j(m,n);c=a.value,k=a.confidence,0>c&&(c=0),c>g&&(c=g),d=e(m,n),c!==d&&(f(m,n,c),h(m,n,k),l.notify(MediaPlayer.dependencies.AbrController.eventList.ENAME_QUALITY_CHANGED,{mediaType:m,streamInfo:b.getStreamInfo(),oldQuality:d,newQuality:c}))};c=e(m,n),k=g(m,n),a&&(i=l.abrRulesCollection.getRules(MediaPlayer.rules.ABRRulesCollection.prototype.QUALITY_SWITCH_RULES),l.rulesController.applyRules(i,b,o.bind(l),c,function(a,b){return a=a===MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE?0:a,Math.max(a,b)}))},setPlaybackQuality:function(a,c,d){var g=c.id,h=e(a,g),i=null!==d&&!isNaN(d)&&d%1===0;if(!i)throw"argument is not an integer";d!==h&&d>=0&&b[g].hasOwnProperty(a)&&d<=b[g][a]&&(f(a,c.id,d),this.notify(MediaPlayer.dependencies.AbrController.eventList.ENAME_QUALITY_CHANGED,{mediaType:a,streamInfo:c,oldQuality:h,newQuality:d}))},getQualityFor:function(a,b){return e(a,b.id)},getConfidenceFor:function(a,b){return g(a,b.id)},isPlayingAtTopQuality:function(a){var b,c=this,d=a.id,e=c.getQualityFor("audio",a),f=c.getQualityFor("video",a);return b=e===j("audio",d)&&f===j("video",d)},reset:function(){a=!0,b={},c={},d={}}}},MediaPlayer.dependencies.AbrController.prototype={constructor:MediaPlayer.dependencies.AbrController},MediaPlayer.dependencies.AbrController.eventList={ENAME_QUALITY_CHANGED:"qualityChanged",ENAME_TOP_QUALITY_INDEX_CHANGED:"topQualityIndexChanged"},MediaPlayer.dependencies.BufferController=function(){"use strict";var a,b,c,d,e=.5,f=[],g=0,h=-1,i=!1,j=0,k=0,l=Number.POSITIVE_INFINITY,m=-1,n=-1,o=null,p=null,q=!1,r=!1,s=[],t=!1,u=function(){var a=this.streamProcessor.getFragmentModel().getLoadingRequests();return h>g&&(v(s,h)||v(a,h))?!1:h!==g},v=function(a,b){var c=0,d=a.length;for(c;d>c;c+=1)if(a[c].quality===b)return!0;return!1},w=function(a,b){var c=function(a,c){return a[b]<c[b]?-1:a[b]>c[b]?1:0};a.sort(c)},x=function(a){var c=this;a.data.fragmentModel===c.streamProcessor.getFragmentModel()&&(c.debug.log("Initialization finished loading: "+b),f[a.data.quality]=a.data.bytes,a.data.quality===g&&u.call(c)&&Z.call(c))},y=function(a){if(a.data.fragmentModel===this.streamProcessor.getFragmentModel()){var b,c=a.data.bytes,d=a.data.quality,e=a.data.index,f=this.streamProcessor.getFragmentModel().getExecutedRequestForQualityAndIndex(d,e),g=this.streamProcessor.getTrackForQuality(d),h=this.adapter.getEventsFor(g.mediaInfo,this.streamProcessor),i=this.adapter.getEventsFor(g,this.streamProcessor);(h.length>0||i.length>0)&&(b=C.call(this,c,f,h,i),this.streamProcessor.getEventController().addInbandEvents(b)),c=D.call(this,c),s.push({bytes:c,quality:d,index:e}),w(s,"index"),Q.call(this)
18
+ }},z=function(a,b,c){r=!0,d={quality:b,index:c};var e=this,f=isNaN(c);return b!==g&&f||b!==h&&!f?void S.call(e,b,c):void e.sourceBufferExt.append(o,a)},A=function(c){if(o===c.data.buffer){this.isBufferingCompleted()&&this.streamProcessor.getStreamInfo().isLast&&this.mediaSourceExt.signalEndOfStream(a);var e,f=this;if(c.error)return c.error.code===MediaPlayer.dependencies.SourceBufferExtensions.QUOTA_EXCEEDED_ERROR_CODE&&(s.unshift({bytes:c.data.bytes,quality:d.quality,index:d.index}),l=.8*J.call(f),f.notify(MediaPlayer.dependencies.BufferController.eventList.ENAME_QUOTA_EXCEEDED,{criticalBufferLevel:l}),H.call(f)),void(r=!1);if(B.call(f),G.call(f)||(f.notify(MediaPlayer.dependencies.BufferController.eventList.ENAME_QUOTA_EXCEEDED,{criticalBufferLevel:l}),H.call(f)),e=f.sourceBufferExt.getAllRanges(o),e&&e.length>0){var g,h;for(g=0,h=e.length;h>g;g+=1)f.debug.log("Buffered "+b+" Range: "+e.start(g)+" - "+e.end(g))}R.call(f,d.quality,d.index),f.notify(MediaPlayer.dependencies.BufferController.eventList.ENAME_BYTES_APPENDED,{quality:d.quality,index:d.index,bufferedRanges:e})}},B=function(){var a=this,b=a.playbackController.getTime();return j=a.sourceBufferExt.getBufferLength(o,b),a.notify(MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_UPDATED,{bufferLevel:j}),E.call(a),L.call(a),e>j&&N.call(a,!1),!0},C=function(a,b,c,d){var e,f,g,h,i=[],j=0,k=Math.pow(256,2),l=Math.pow(256,3),m=Math.max(isNaN(b.startTime)?0:b.startTime,0),n=[];t=!1,h=c.concat(d);for(var o=0;o<h.length;o++)n[h[o].schemeIdUri]=h[o];for(;j<a.length&&(e=String.fromCharCode(a[j+4],a[j+5],a[j+6],a[j+7]),f=a[j]*l+a[j+1]*k+256*a[j+2]+1*a[j+3],"moov"!=e&&"moof"!=e);){if("emsg"==e){t=!0;for(var p=["","",0,0,0,0,""],q=0,r=j+12;f+j>r;)0===q||1==q||6==q?(0!==a[r]?p[q]+=String.fromCharCode(a[r]):q+=1,r+=1):(p[q]=a[r]*l+a[r+1]*k+256*a[r+2]+1*a[r+3],r+=4,q+=1);g=this.adapter.getEvent(p,n,m),g&&i.push(g)}j+=f}return i},D=function(a){if(!t)return a;for(var b,c,d=a.length,e=0,f=0,g=Math.pow(256,2),h=Math.pow(256,3),i=new Uint8Array(a.length);d>e;){if(b=String.fromCharCode(a[e+4],a[e+5],a[e+6],a[e+7]),c=a[e]*h+a[e+1]*g+256*a[e+2]+1*a[e+3],"emsg"!=b)for(var j=e;e+c>j;j++)i[f]=a[j],f+=1;e+=c}return i.subarray(0,f)},E=function(){var a=F.call(this),b=2*c,d=j-a;d>=b&&!q?(q=!0,this.notify(MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_OUTRUN)):b/2>d&&q&&(this.notify(MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_BALANCED),q=!1,Q.call(this))},F=function(){var a=this.metricsModel.getReadOnlyMetricsFor("video"),b=this.metricsExt.getCurrentBufferLevel(a),c=this.metricsModel.getReadOnlyMetricsFor("audio"),d=this.metricsExt.getCurrentBufferLevel(c),e=null;return e=null===b||null===d?null!==d?d.level:null!==b?b.level:null:Math.min(d.level,b.level)},G=function(){var a=this,b=J.call(a);return l>b},H=function(){var b,c,d,e,f,g=this;o&&(b=g.playbackController.getTime(),f=g.fragmentController.getExecutedRequestForTime(g.streamProcessor.getFragmentModel(),b),d=f&&!isNaN(f.startTime)?f.startTime:Math.floor(b),e=g.sourceBufferExt.getBufferRange(o,b),null===e&&o.buffered.length>0&&(d=o.buffered.end(o.buffered.length-1)),c=o.buffered.start(0),g.sourceBufferExt.remove(o,c,d,a))},I=function(a){o===a.data.buffer&&(B.call(this),this.notify(MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_CLEARED,{from:a.data.from,to:a.data.to,hasEnoughSpaceToAppend:G.call(this)}),G.call(this)||setTimeout(H.bind(this),1e3*c))},J=function(){var a,b,c=this,d=c.sourceBufferExt.getAllRanges(o),e=0;if(!d)return e;for(b=0,a=d.length;a>b;b+=1)e+=d.end(b)-d.start(b);return e},K=function(){var a=m===n-1;a&&!i&&(i=!0,this.notify(MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFERING_COMPLETED))},L=function(){var a=this.playbackController.getTimeToStreamEnd();e>j&&a>c||c>=a&&!i?N.call(this,!1):N.call(this,!0)},M=function(){return p?MediaPlayer.dependencies.BufferController.BUFFER_LOADED:MediaPlayer.dependencies.BufferController.BUFFER_EMPTY},N=function(a){if(p!==a){p=a;var c=M();this.metricsModel.addBufferState(b,c,k),this.eventBus.dispatchEvent({type:c,data:{bufferType:b}}),this.notify(MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_STATE_CHANGED,{hasSufficientBuffer:a}),this.debug.log(p?"Got enough "+b+" buffer to start.":"Waiting for more "+b+" buffer before starting playback.")}},O=function(a){o.timestampOffset!==a&&(o.timestampOffset=a)},P=function(){var a=this,c=this.streamProcessor.getScheduleController().getFragmentToLoadCount(),d=this.streamProcessor.getCurrentTrack().fragmentDuration;B.call(a),k=c>0?c*d+j:k,this.metricsModel.addBufferState(b,M(),k),Q.call(a)},Q=function(){u.call(this)?Z.call(this):V.call(this)},R=function(a,b){r=!1,isNaN(b)?T.call(this,a):U.call(this,b),Q.call(this)},S=function(a,b){r=!1,this.notify(MediaPlayer.dependencies.BufferController.eventList.ENAME_BYTES_REJECTED,{quality:a,index:b}),Q.call(this)},T=function(a){h=a},U=function(a){m=Math.max(a,m),K.call(this)},V=function(){var a;0===s.length||q||r||u.call(this)||!G.call(this)||(a=s.shift(),z.call(this,a.bytes,a.quality,a.index))},W=function(a){if(!a.error){var b,d=this;O.call(d,a.data.currentRepresentation.MSETimeOffset),b=d.streamProcessor.getStreamInfo().manifestInfo.minBufferTime,c!==b&&(d.setMinBufferTime(b),d.notify(MediaPlayer.dependencies.BufferController.eventList.ENAME_MIN_BUFFER_TIME_UPDATED,{minBufferTime:b}))}},X=function(a){var b=this;a.data.fragmentModel===b.streamProcessor.getFragmentModel()&&(n=a.data.request.index,K.call(b))},Y=function(a){if(b===a.data.mediaType&&this.streamProcessor.getStreamInfo().id===a.data.streamInfo.id){var c=this,d=a.data.newQuality;g!==d&&(O.call(c,c.streamProcessor.getTrackForQuality(d).MSETimeOffset),g=d,u.call(c)&&Z.call(c))}},Z=function(){var a=this;if(f[g]){if(r)return;z.call(a,f[g],g)}else a.notify(MediaPlayer.dependencies.BufferController.eventList.ENAME_INIT_REQUESTED,{requiredQuality:g})},$=function(){Q.call(this)},_=function(){L.call(this)};return{manifestModel:void 0,sourceBufferExt:void 0,eventBus:void 0,bufferMax:void 0,mediaSourceExt:void 0,metricsModel:void 0,metricsExt:void 0,adapter:void 0,scheduleRulesCollection:void 0,debug:void 0,system:void 0,notify:void 0,subscribe:void 0,unsubscribe:void 0,setup:function(){this[Dash.dependencies.RepresentationController.eventList.ENAME_DATA_UPDATE_COMPLETED]=W,this[MediaPlayer.dependencies.FragmentController.eventList.ENAME_INIT_FRAGMENT_LOADED]=x,this[MediaPlayer.dependencies.FragmentController.eventList.ENAME_MEDIA_FRAGMENT_LOADED]=y,this[MediaPlayer.dependencies.FragmentController.eventList.ENAME_STREAM_COMPLETED]=X,this[MediaPlayer.dependencies.AbrController.eventList.ENAME_QUALITY_CHANGED]=Y,this[MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_PROGRESS]=P,this[MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_SEEKING]=P,this[MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_TIME_UPDATED]=P,this[MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_RATE_CHANGED]=_,this[MediaPlayer.dependencies.PlaybackController.eventList.ENAME_WALLCLOCK_TIME_UPDATED]=$,A=A.bind(this),I=I.bind(this),this.sourceBufferExt.subscribe(MediaPlayer.dependencies.SourceBufferExtensions.eventList.ENAME_SOURCEBUFFER_APPEND_COMPLETED,this,A),this.sourceBufferExt.subscribe(MediaPlayer.dependencies.SourceBufferExtensions.eventList.ENAME_SOURCEBUFFER_REMOVE_COMPLETED,this,I)},initialize:function(a,c,d,e){var f=this;b=a,f.setMediaSource(d),f.setBuffer(c),f.streamProcessor=e,f.fragmentController=e.fragmentController,f.scheduleController=e.scheduleController,f.playbackController=e.playbackController},getStreamProcessor:function(){return this.streamProcessor},setStreamProcessor:function(a){this.streamProcessor=a},getBuffer:function(){return o},setBuffer:function(a){o=a},getBufferLevel:function(){return j},getMinBufferTime:function(){return c},setMinBufferTime:function(a){c=a},getCriticalBufferLevel:function(){return l},setMediaSource:function(b){a=b},isBufferingCompleted:function(){return i},reset:function(b){var e=this;f=[],l=Number.POSITIVE_INFINITY,p=null,c=null,h=-1,g=0,e.sourceBufferExt.unsubscribe(MediaPlayer.dependencies.SourceBufferExtensions.eventList.ENAME_SOURCEBUFFER_APPEND_COMPLETED,e,A),e.sourceBufferExt.unsubscribe(MediaPlayer.dependencies.SourceBufferExtensions.eventList.ENAME_SOURCEBUFFER_REMOVE_COMPLETED,e,I),d=null,q=!1,r=!1,s=[],b||(e.sourceBufferExt.abort(a,o),e.sourceBufferExt.removeSourceBuffer(a,o)),o=null}}},MediaPlayer.dependencies.BufferController.BUFFER_SIZE_REQUIRED="required",MediaPlayer.dependencies.BufferController.BUFFER_SIZE_MIN="min",MediaPlayer.dependencies.BufferController.BUFFER_SIZE_INFINITY="infinity",MediaPlayer.dependencies.BufferController.DEFAULT_MIN_BUFFER_TIME=12,MediaPlayer.dependencies.BufferController.LOW_BUFFER_THRESHOLD=4,MediaPlayer.dependencies.BufferController.BUFFER_TIME_AT_TOP_QUALITY=30,MediaPlayer.dependencies.BufferController.BUFFER_TIME_AT_TOP_QUALITY_LONG_FORM=300,MediaPlayer.dependencies.BufferController.LONG_FORM_CONTENT_DURATION_THRESHOLD=600,MediaPlayer.dependencies.BufferController.RICH_BUFFER_THRESHOLD=20,MediaPlayer.dependencies.BufferController.BUFFER_LOADED="bufferLoaded",MediaPlayer.dependencies.BufferController.BUFFER_EMPTY="bufferStalled",MediaPlayer.dependencies.BufferController.prototype={constructor:MediaPlayer.dependencies.BufferController},MediaPlayer.dependencies.BufferController.eventList={ENAME_BUFFER_LEVEL_STATE_CHANGED:"bufferLevelStateChanged",ENAME_BUFFER_LEVEL_UPDATED:"bufferLevelUpdated",ENAME_QUOTA_EXCEEDED:"quotaExceeded",ENAME_BYTES_APPENDED:"bytesAppended",ENAME_BYTES_REJECTED:"bytesRejected",ENAME_BUFFERING_COMPLETED:"bufferingCompleted",ENAME_BUFFER_CLEARED:"bufferCleared",ENAME_INIT_REQUESTED:"initRequested",ENAME_BUFFER_LEVEL_OUTRUN:"bufferLevelOutrun",ENAME_BUFFER_LEVEL_BALANCED:"bufferLevelBalanced",ENAME_MIN_BUFFER_TIME_UPDATED:"minBufferTimeUpdated"},MediaPlayer.dependencies.EventController=function(){"use strict";var a=[],b=[],c=[],d=null,e=100,f=e/1e3,g="urn:mpeg:dash:event:2012",h=1,i=function(){null!==d&&(clearInterval(d),d=null),a=null,b=null,c=null},j=function(){null!==d&&(clearInterval(d),d=null)},k=function(){var a=this;a.debug.log("Start Event Controller"),isNaN(e)||(d=setInterval(n.bind(this),e))},l=function(b){var c=this;a=[],b&&b.length>0&&(a=b),c.debug.log("Added "+b.length+" inline events")},m=function(a){for(var c=this,d=0;d<a.length;d++){var e=a[d];b[e.id]=e,c.debug.log("Add inband event with id "+e.id)}},n=function(){o.call(this,b),o.call(this,a),p.call(this)},o=function(a){var b,d=this,e=this.videoModel.getCurrentTime();if(a)for(var i=0;i<a.length;i++){var j=a[i];void 0!==j&&(b=j.presentationTime/j.eventStream.timescale,(0===b||e>=b&&b+f>e)&&(d.debug.log("Start Event at "+e),j.duration>0&&c.push(j),j.eventStream.schemeIdUri==g&&j.eventStream.value==h&&q.call(this),a.splice(i,1)))}},p=function(){var a=this;if(c)for(var b=this.videoModel.getCurrentTime(),d=0;d<c.length;d++){var e=c[d];null!==e&&(e.duration+e.presentationTime)/e.eventStream.timescale<b&&(a.debug.log("Remove Event at time "+b),e=null,c.splice(d,1))}},q=function(){var a=this,b=a.manifestModel.getValue(),c=b.url;b.hasOwnProperty("Location")&&(c=b.Location),a.debug.log("Refresh manifest @ "+c),a.manifestLoader.load(c)};return{manifestModel:void 0,manifestLoader:void 0,debug:void 0,system:void 0,errHandler:void 0,videoModel:void 0,addInlineEvents:l,addInbandEvents:m,reset:i,clear:j,start:k,getVideoModel:function(){return this.videoModel},setVideoModel:function(a){this.videoModel=a},initialize:function(a){this.setVideoModel(a)}}},MediaPlayer.dependencies.EventController.prototype={constructor:MediaPlayer.dependencies.EventController},MediaPlayer.dependencies.FragmentController=function(){"use strict";var a=[],b=!1,c=function(b){for(var c=a.length,d=0;c>d;d++)if(a[d].getContext()==b)return a[d];return null},d=function(b,c){var d=this,e=a[0].getContext().streamProcessor,f=e.getStreamInfo().id,g=d.scheduleRulesCollection.getRules(MediaPlayer.rules.ScheduleRulesCollection.prototype.FRAGMENTS_TO_EXECUTE_RULES);-1!==g.indexOf(this.scheduleRulesCollection.sameTimeRequestRule)&&this.scheduleRulesCollection.sameTimeRequestRule.setFragmentModels(a,f),d.rulesController.applyRules(g,e,c,b,function(a,b){return b})},e=function(a){var b=this,c=a.data.request;b.isInitializationRequest(c)?b.notify(MediaPlayer.dependencies.FragmentController.eventList.ENAME_INIT_FRAGMENT_LOADING_START,{request:c,fragmentModel:a.sender}):b.notify(MediaPlayer.dependencies.FragmentController.eventList.ENAME_MEDIA_FRAGMENT_LOADING_START,{request:c,fragmentModel:a.sender})},f=function(a){var b=this,c=a.data.request,d=b.process(a.data.response);return null===d?void b.debug.log("No "+c.mediaType+" bytes to push."):(b.isInitializationRequest(c)?b.notify(MediaPlayer.dependencies.FragmentController.eventList.ENAME_INIT_FRAGMENT_LOADED,{bytes:d,quality:c.quality,fragmentModel:a.sender}):b.notify(MediaPlayer.dependencies.FragmentController.eventList.ENAME_MEDIA_FRAGMENT_LOADED,{bytes:d,quality:c.quality,index:c.index,fragmentModel:a.sender}),void j.call(this))},g=function(a){this.notify(MediaPlayer.dependencies.FragmentController.eventList.ENAME_STREAM_COMPLETED,{request:a.data.request,fragmentModel:a.sender})},h=function(){j.call(this)},i=function(c){var d,e,f,g,h,i=c.value;for(g=0;g<i.length;g+=1)if(e=i[g])for(h=0;h<a.length;h+=1)f=a[h],d=f.getContext().streamProcessor.getType(),e.mediaType===d&&(e instanceof MediaPlayer.vo.FragmentRequest||(e=f.getPendingRequestForTime(e.startTime)),f.executeRequest(e));b=!1},j=function(a){b||(b=!0,d.call(this,a,i.bind(this)))};return{system:void 0,debug:void 0,scheduleRulesCollection:void 0,rulesController:void 0,fragmentLoader:void 0,notify:void 0,subscribe:void 0,unsubscribe:void 0,setup:function(){this[MediaPlayer.dependencies.FragmentModel.eventList.ENAME_FRAGMENT_LOADING_STARTED]=e,this[MediaPlayer.dependencies.FragmentModel.eventList.ENAME_FRAGMENT_LOADING_COMPLETED]=f,this[MediaPlayer.dependencies.FragmentModel.eventList.ENAME_STREAM_COMPLETED]=g,this[MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_BALANCED]=h},process:function(a){var b=null;return null!==a&&void 0!==a&&a.byteLength>0&&(b=new Uint8Array(a)),b},getModel:function(b){if(!b)return null;var d=c(b);return d||(d=this.system.getObject("fragmentModel"),d.setContext(b),a.push(d)),d},detachModel:function(b){var c=a.indexOf(b);c>-1&&a.splice(c,1)},isFragmentLoadedOrPending:function(a,b){var d,e=c(a);return e?d=e.isFragmentLoadedOrPending(b):!1},getPendingRequests:function(a){var b=c(a);return b?b.getPendingRequests():null},getLoadingRequests:function(a){var b=c(a);return b?b.getLoadingRequests():null},isInitializationRequest:function(a){return a&&a.type&&-1!==a.type.toLowerCase().indexOf("initialization")},getLoadingTime:function(a){var b=c(a);return b?b.getLoadingTime():null},getExecutedRequestForTime:function(a,b){return a?a.getExecutedRequestForTime(b):null},removeExecutedRequest:function(a,b){a&&a.removeExecutedRequest(b)},removeExecutedRequestsBeforeTime:function(a,b){a&&a.removeExecutedRequestsBeforeTime(b)},cancelPendingRequestsForModel:function(a){a&&a.cancelPendingRequests()},abortRequestsForModel:function(a){a&&a.abortRequests(),j.call(this)},prepareFragmentForLoading:function(a,b){var d=c(a);d&&b&&d.addRequest(b)&&j.call(this,b)},executePendingRequests:function(){j.call(this)},resetModel:function(a){this.abortRequestsForModel(a),this.cancelPendingRequestsForModel(a)}}},MediaPlayer.dependencies.FragmentController.prototype={constructor:MediaPlayer.dependencies.FragmentController},MediaPlayer.dependencies.FragmentController.eventList={ENAME_STREAM_COMPLETED:"streamCompleted",ENAME_INIT_FRAGMENT_LOADING_START:"initFragmentLoadingStart",ENAME_MEDIA_FRAGMENT_LOADING_START:"mediaFragmentLoadingStart",ENAME_INIT_FRAGMENT_LOADED:"initFragmentLoaded",ENAME_MEDIA_FRAGMENT_LOADED:"mediaFragmentLoaded"},MediaPlayer.dependencies.PlaybackController=function(){"use strict";var a,b,c,d,e=1e3,f=0,g=0/0,h=null,i=null,j=function(a){var b,c=parseInt(this.uriQueryFragModel.getURIFragmentData.s);return d?(!isNaN(c)&&c>1262304e3&&(b=c-a.manifestInfo.availableFrom.getTime()/1e3,(b>g||b<g-a.manifestInfo.DVRWindowSize)&&(b=null)),b=b||g):b=!isNaN(c)&&c<a.duration&&c>=0?c:a.start,b},k=function(b){var d,e=this,f=e.metricsModel.getMetricsFor(c.mediaInfo.type),g=e.metricsExt.getCurrentDVRInfo(f),h=g?g.range:null;return h?b>=h.start&&b<=h.end?b:d=Math.max(h.end-2*a.manifestInfo.minBufferTime,h.start):0/0},l=function(){if(null===h){var a=this,b=function(){C.call(a)};h=setInterval(b,e)}},m=function(){clearInterval(h),h=null},n=function(){var b=j.call(this,a);this.debug.log("Starting playback at offset: "+b),this.seek(b)},o=function(){if(!this.isPaused()&&d){var a=this.getTime(),b=k.call(this,a),c=!isNaN(b)&&b!==a;c&&this.seek(b)}},p=function(b){b.error||(c=this.adapter.convertDataToTrack(b.data.currentRepresentation),a=c.mediaInfo.streamInfo,d=b.sender.streamProcessor.isDynamic(),o.call(this))},q=function(a){a.error||0===b.getElement().readyState||n.call(this)},r=function(){b&&(b.unlisten("play",s),b.unlisten("pause",t),b.unlisten("error",B),b.unlisten("seeking",u),b.unlisten("seeked",v),b.unlisten("timeupdate",w),b.unlisten("progress",x),b.unlisten("ratechange",y),b.unlisten("loadedmetadata",z),b.unlisten("ended",A))},s=function(){o.call(this),l.call(this),this.notify(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_STARTED,{startTime:this.getTime()})},t=function(){this.notify(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_PAUSED)},u=function(){l.call(this),this.notify(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_SEEKING,{seekTime:this.getTime()})},v=function(){this.notify(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_SEEKED)},w=function(){var a=this.getTime();a!==f&&(f=a,this.notify(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_TIME_UPDATED,{timeToEnd:this.getTimeToStreamEnd()}))},x=function(){var c,d,e,f=b.getElement().buffered;f.length&&(c=f.length-1,d=f.end(c),e=j.call(this,a)+a.duration-d),this.notify(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_PROGRESS,{bufferedRanges:b.getElement().buffered,remainingUnbufferedDuration:e})},y=function(){this.notify(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_RATE_CHANGED)},z=function(){this.debug.log("Got loadmetadata event."),(!d||this.timelineConverter.isTimeSyncCompleted())&&n.call(this),this.notify(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_METADATA_LOADED),l.call(this)},A=function(){this.debug.log("Got ended event."),m.call(this)},B=function(a){this.notify(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_ERROR,{error:a.srcElement.error})},C=function(){this.notify(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_WALLCLOCK_TIME_UPDATED,{isDynamic:d,time:new Date})},D=function(b){var d,e,f=b.data.bufferedRanges,g=i,h=j.call(this,a);f&&f.length&&(d=f.start(0),i=null===i?d:Math.max(i,d),g!==i&&(e=this.adapter.getFragmentRequestForTime(b.sender.streamProcessor,c,h,{keepIdx:!1}),e&&e.index===b.data.index&&this.seek(i)))},E=function(a){b=a,b.listen("play",s),b.listen("pause",t),b.listen("error",B),b.listen("seeking",u),b.listen("seeked",v),b.listen("timeupdate",w),b.listen("progress",x),b.listen("ratechange",y),b.listen("loadedmetadata",z),b.listen("ended",A)};return{debug:void 0,timelineConverter:void 0,uriQueryFragModel:void 0,metricsModel:void 0,metricsExt:void 0,notify:void 0,subscribe:void 0,unsubscribe:void 0,adapter:void 0,setup:function(){this[Dash.dependencies.RepresentationController.eventList.ENAME_DATA_UPDATE_COMPLETED]=p,this[MediaPlayer.dependencies.LiveEdgeFinder.eventList.ENAME_LIVE_EDGE_SEARCH_COMPLETED]=q,this[MediaPlayer.dependencies.BufferController.eventList.ENAME_BYTES_APPENDED]=D,s=s.bind(this),t=t.bind(this),B=B.bind(this),u=u.bind(this),v=v.bind(this),w=w.bind(this),x=x.bind(this),y=y.bind(this),z=z.bind(this),A=A.bind(this)},initialize:function(c,d){a=c,b!==d&&(r.call(this),E.call(this,d))},getTimeToStreamEnd:function(){var c=b.getCurrentTime();return j.call(this,a)+a.duration-c},getStreamId:function(){return a.id},getStreamDuration:function(){return a.duration},getTime:function(){return b.getCurrentTime()},getPlaybackRate:function(){return b.getPlaybackRate()},setLiveStartTime:function(a){g=a},getLiveStartTime:function(){return g},start:function(){b.play()},isPaused:function(){return b.isPaused()},pause:function(){b&&b.pause()},isSeeking:function(){return b.getElement().seeking},seek:function(a){a!==this.getTime()&&b.setCurrentTime(a)},reset:function(){m.call(this),r.call(this),b=null,a=null,f=0,g=0/0,i=null}}},MediaPlayer.dependencies.PlaybackController.prototype={constructor:MediaPlayer.dependencies.PlaybackController},MediaPlayer.dependencies.PlaybackController.eventList={ENAME_PLAYBACK_STARTED:"playbackStarted",ENAME_PLAYBACK_STOPPED:"playbackStopped",ENAME_PLAYBACK_PAUSED:"playbackPaused",ENAME_PLAYBACK_SEEKING:"playbackSeeking",ENAME_PLAYBACK_SEEKED:"playbackSeeked",ENAME_PLAYBACK_TIME_UPDATED:"playbackTimeUpdated",ENAME_PLAYBACK_PROGRESS:"playbackProgress",ENAME_PLAYBACK_RATE_CHANGED:"playbackRateChanged",ENAME_PLAYBACK_METADATA_LOADED:"playbackMetaDataLoaded",ENAME_PLAYBACK_ERROR:"playbackError",ENAME_WALLCLOCK_TIME_UPDATED:"wallclockTimeUpdated"},MediaPlayer.dependencies.ProtectionController=function(){"use strict";var a=null,b=function(a){if(a.error)this.debug.log(a.error);else{var b=a.data;this.protectionModel.keySystem.doLicenseRequest(b.message,b.defaultURL,b.sessionToken)}};return{system:void 0,debug:void 0,protectionExt:void 0,setup:function(){this[MediaPlayer.models.ProtectionModel.eventList.ENAME_KEY_MESSAGE]=b.bind(this)},init:function(b){this.protectionModel=b,a=this.protectionExt.getKeySystems(),this.protectionModel.subscribe(MediaPlayer.models.ProtectionModel.eventList.ENAME_KEY_MESSAGE,this)},teardown:function(){this.protectionModel.unsubscribe(MediaPlayer.models.ProtectionModel.eventList.ENAME_KEY_MESSAGE,this)},selectKeySystem:function(a,b){this.protectionExt.autoSelectKeySystem(a,b)},createKeySession:function(a,b){this.protectionModel.createKeySession(a,b,"cenc")},updateKeySession:function(a,b){this.protectionModel.updateKeySession(a,b)}}},MediaPlayer.dependencies.ProtectionController.prototype={constructor:MediaPlayer.dependencies.ProtectionController},MediaPlayer.dependencies.ScheduleController=function(){"use strict";var a,b,c,d,e,f=0,g=!0,h=null,i=0,j=!1,k=null,l=null,m=!0,n=function(a,b){var c=0,d=null;m===!1&&(d=l.start,c=a.getTime()-d.getTime(),l.duration=c,l.stopreason=b,m=!0)},o=function(){b&&(j=!1,g&&(g=!1),this.debug.log("ScheduleController "+a+" start."),x.call(this))},p=function(){g&&(s.call(this,e.quality),L.call(this,MediaPlayer.vo.metrics.PlayList.INITIAL_PLAY_START_REASON)),o.call(this)},q=function(b){j||(j=!0,this.debug.log("ScheduleController "+a+" stop."),b&&this.fragmentController.cancelPendingRequestsForModel(c),n(new Date,MediaPlayer.vo.metrics.PlayList.Trace.USER_REQUEST_STOP_REASON))},r=function(a){var b=this,c=b.scheduleRulesCollection.getRules(MediaPlayer.rules.ScheduleRulesCollection.prototype.NEXT_FRAGMENT_RULES);b.rulesController.applyRules(c,b.streamProcessor,a,null,function(a,b){return b})},s=function(a){var b,c=this;return b=c.adapter.getInitRequest(c.streamProcessor,a),null!==b&&c.fragmentController.prepareFragmentForLoading(c,b),b},t=function(a){var b=this,c=b.scheduleRulesCollection.getRules(MediaPlayer.rules.ScheduleRulesCollection.prototype.FRAGMENTS_TO_SCHEDULE_RULES);b.rulesController.applyRules(c,b.streamProcessor,a,f,function(a,b){return a=a===MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE?0:a,Math.max(a,b)})},u=function(a){var b,c,d,f=a.length,g=.1;for(d=0;f>d;d+=1)b=a[d],c=b.startTime+b.duration/2+g,b=this.adapter.getFragmentRequestForTime(this.streamProcessor,e,c,{timeThreshold:0}),this.fragmentController.prepareFragmentForLoading(this,b)},v=function(a){var b=this;return f=a.value,0>=f?void b.fragmentController.executePendingRequests():void r.call(b,w.bind(b))},w=function(a){var b=a.value;null===b||b instanceof MediaPlayer.vo.FragmentRequest||(b=this.adapter.getFragmentRequestForTime(this.streamProcessor,e,b.startTime)),b?(f--,this.fragmentController.prepareFragmentForLoading(this,b)):this.fragmentController.executePendingRequests()},x=function(){var a=(new Date).getTime(),b=h?a-h>this.fragmentController.getLoadingTime(this):!0,c=1e3;a-i>c&&(i=a,this.abrController.getPlaybackQuality(this.streamProcessor)),!b||j||this.playbackController.isPaused()&&(!this.scheduleWhilePaused||d)||(h=a,t.call(this,v.bind(this)))},y=function(){var b=this;null!==a&&""!==a&&b.metricsModel.clearCurrentMetricsForType(a)},z=function(a){a.error||(e=this.adapter.convertDataToTrack(a.data.currentRepresentation),d||(b=!0),b&&p.call(this))},A=function(b){b.data.fragmentModel===this.streamProcessor.getFragmentModel()&&(this.debug.log(a+" Stream is complete."),n(new Date,MediaPlayer.vo.metrics.PlayList.Trace.END_OF_CONTENT_STOP_REASON))},B=function(a){var b=this;a.data.fragmentModel===b.streamProcessor.getFragmentModel()&&x.call(b)},C=function(a){a.error&&q.call(this)},D=function(){M.call(this)},E=function(){q.call(this,!1)},F=function(a){s.call(this,a.data.requiredQuality)},G=function(a){this.fragmentController.removeExecutedRequestsBeforeTime(c,a.data.to),a.data.hasEnoughSpaceToAppend&&o.call(this)},H=function(b){var c=this;b.data.hasSufficientBuffer||c.playbackController.isSeeking()||(c.debug.log("Stalling "+a+" Buffer: "+a),n(new Date,MediaPlayer.vo.metrics.PlayList.Trace.REBUFFERING_REASON))},I=function(b){var c=this;c.metricsModel.addBufferLevel(a,new Date,b.data.bufferLevel),x.call(this)},J=function(){q.call(this,!1)},K=function(b){if(a===b.data.mediaType&&this.streamProcessor.getStreamInfo().id===b.data.streamInfo.id){var d,f=this;if(d=c.cancelPendingRequests(b.data.oldQuality),e=f.streamProcessor.getTrackForQuality(b.data.newQuality),null===e||void 0===e)throw"Unexpected error!";u.call(f,d),n(new Date,MediaPlayer.vo.metrics.PlayList.Trace.REPRESENTATION_SWITCH_STOP_REASON)}},L=function(b){var c=new Date,d=this.playbackController.getTime();n(c,MediaPlayer.vo.metrics.PlayList.Trace.USER_REQUEST_STOP_REASON),k=this.metricsModel.addPlayList(a,c,d,b)},M=function(){var a=this,b=a.playbackController.getTime(),c=a.playbackController.getPlaybackRate(),d=new Date;m===!0&&e&&k&&(m=!1,l=a.metricsModel.appendPlayListTrace(k,e.id,null,d,b,null,c,null))},N=function(a){var b=this,d=s.call(b,a.data.CCIndex);c.executeRequest(d)},O=function(){o.call(this)},P=function(b){g||this.fragmentController.cancelPendingRequestsForModel(c);var d=this.metricsModel.getMetricsFor("stream"),f=this.metricsExt.getCurrentManifestUpdate(d);this.debug.log("ScheduleController "+a+" seek: "+b.data.seekTime),L.call(this,MediaPlayer.vo.metrics.PlayList.SEEK_START_REASON),this.metricsModel.updateManifestUpdateInfo(f,{latency:e.DVRWindow.end-this.playbackController.getTime()})},Q=function(){M.call(this)},R=function(){x.call(this)},S=function(a){if(!a.error){var c,d,f=this,g=a.data.liveEdge,h=e.mediaInfo.streamInfo.manifestInfo,i=g-Math.min(2*h.minBufferTime,h.DVRWindowSize/2),j=f.metricsModel.getMetricsFor("stream"),k=f.metricsExt.getCurrentManifestUpdate(j),l=f.playbackController.getLiveStartTime();c=f.adapter.getFragmentRequestForTime(f.streamProcessor,e,i),d=c.startTime,(isNaN(l)||d>l)&&f.playbackController.setLiveStartTime(d),f.metricsModel.updateManifestUpdateInfo(k,{currentTime:d,presentationStartTime:g,latency:g-d,clientTimeOffset:f.timelineConverter.getClientTimeOffset()}),b=!0,p.call(f)}};return{debug:void 0,system:void 0,metricsModel:void 0,metricsExt:void 0,scheduleWhilePaused:void 0,timelineConverter:void 0,abrController:void 0,adapter:void 0,scheduleRulesCollection:void 0,rulesController:void 0,setup:function(){this[MediaPlayer.dependencies.LiveEdgeFinder.eventList.ENAME_LIVE_EDGE_SEARCH_COMPLETED]=S,this[MediaPlayer.dependencies.AbrController.eventList.ENAME_QUALITY_CHANGED]=K,this[Dash.dependencies.RepresentationController.eventList.ENAME_DATA_UPDATE_STARTED]=E,this[Dash.dependencies.RepresentationController.eventList.ENAME_DATA_UPDATE_COMPLETED]=z,this[MediaPlayer.dependencies.FragmentController.eventList.ENAME_MEDIA_FRAGMENT_LOADING_START]=B,this[MediaPlayer.dependencies.FragmentModel.eventList.ENAME_FRAGMENT_LOADING_COMPLETED]=C,this[MediaPlayer.dependencies.FragmentController.eventList.ENAME_STREAM_COMPLETED]=A,this[MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_CLEARED]=G,this[MediaPlayer.dependencies.BufferController.eventList.ENAME_BYTES_APPENDED]=D,this[MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_STATE_CHANGED]=H,this[MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_UPDATED]=I,this[MediaPlayer.dependencies.BufferController.eventList.ENAME_INIT_REQUESTED]=F,this[MediaPlayer.dependencies.BufferController.eventList.ENAME_QUOTA_EXCEEDED]=J,this[MediaPlayer.dependencies.TextController.eventList.ENAME_CLOSED_CAPTIONING_REQUESTED]=N,this[MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_STARTED]=O,this[MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_SEEKING]=P,this[MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_RATE_CHANGED]=Q,this[MediaPlayer.dependencies.PlaybackController.eventList.ENAME_WALLCLOCK_TIME_UPDATED]=R},initialize:function(b,e){var f=this;a=b,f.streamProcessor=e,f.playbackController=e.playbackController,f.fragmentController=e.fragmentController,f.liveEdgeFinder=e.liveEdgeFinder,f.bufferController=e.bufferController,d=e.isDynamic(),c=this.fragmentController.getModel(this),f.scheduleRulesCollection.bufferLevelRule&&f.scheduleRulesCollection.bufferLevelRule.setScheduleController(f),f.scheduleRulesCollection.pendingRequestsRule&&f.scheduleRulesCollection.pendingRequestsRule.setScheduleController(f),f.scheduleRulesCollection.playbackTimeRule&&f.scheduleRulesCollection.playbackTimeRule.setScheduleController(f)},getFragmentModel:function(){return c},getFragmentToLoadCount:function(){return f},reset:function(){var a=this;q.call(a,!0),a.bufferController.unsubscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_OUTRUN,a.scheduleRulesCollection.bufferLevelRule),a.bufferController.unsubscribe(MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_BALANCED,a.scheduleRulesCollection.bufferLevelRule),a.fragmentController.abortRequestsForModel(c),a.fragmentController.detachModel(c),y.call(a),f=0},start:o,stop:q}},MediaPlayer.dependencies.ScheduleController.prototype={constructor:MediaPlayer.dependencies.ScheduleController},MediaPlayer.dependencies.StreamController=function(){"use strict";var a,b=[],c=6,d=.2,e=!0,f=!1,g=function(){a.play()},h=function(){a.pause()},i=function(b){a.seek(b)},j=function(a,b){var c=a.getElement(),d=b.getElement();d.parentNode||c.parentNode.insertBefore(d,c),c.style.width="0px",d.style.width="100%",m(c,d)},k=function(a){var b=a.getPlaybackController();b.subscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_STARTED,this.manifestUpdater),b.subscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_PAUSED,this.manifestUpdater),b.subscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_SEEKING,this),b.subscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_TIME_UPDATED,this),b.subscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_PROGRESS,this)},l=function(a){var b=this,c=a.getPlaybackController();setTimeout(function(){c.unsubscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_STARTED,b.manifestUpdater),c.unsubscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_PAUSED,b.manifestUpdater),c.unsubscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_SEEKING,b),c.unsubscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_TIME_UPDATED,b),c.unsubscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_PROGRESS,b)
19
+ },1)},m=function(a,b){["controls","loop","muted","volume"].forEach(function(c){b[c]=a[c]})},n=function(a){!a.data.remainingUnbufferedDuration||a.data.remainingUnbufferedDuration>=c||q()},o=function(b){var c=this,e=c.videoExt.getPlaybackQuality(a.getVideoModel().getElement());e&&c.metricsModel.addDroppedFrames("video",e),r()&&(a.getVideoModel().getElement().seeking||b.data.timeToEnd<d&&v.call(this,a,r()))},p=function(b){var c=s(b.data.seekTime);c&&c!==a&&v.call(this,a,c,b.data.seekTime)},q=function(){var a=r();a&&a.seek(a.getStartTime())},r=function(){var c=a.getStreamIndex()+1;return c<b.length?b[c]:null},s=function(a){var c=0,d=null,e=b.length;e>0&&(c+=b[0].getStartTime());for(var f=0;e>f;f++)if(d=b[f],c+=d.getDuration(),c>a)return d;return null},t=function(){var a=this.system.getObject("videoModel"),b=document.createElement("video");return a.setElement(b),a},u=function(a){a.parentNode&&a.parentNode.removeChild(a)},v=function(b,c,d){!f&&b&&c&&b!==c&&(f=!0,b.pause(),a=c,j.call(this,b.getVideoModel(),c.getVideoModel()),l.call(this,b),k.call(this,c),i(d?b.getPlaybackController().getTime():c.getStartTime()),g(),b.resetEventController(),a.startEventController(),f=!1)},w=function(){var c,d,f,g,h,i,j,l,m=this,n=m.manifestModel.getValue(),o=m.metricsModel.getMetricsFor("stream"),p=m.metricsExt.getCurrentManifestUpdate(o),q=a?a.getVideoModel():m.getVideoModel();if(n){j=m.adapter.getStreamsInfo(n);try{if(0===j.length)throw new Error("There are no streams");for(m.metricsModel.updateManifestUpdateInfo(p,{currentTime:q.getCurrentTime(),buffered:q.getElement().buffered,presentationStartTime:j[0].start,clientTimeOffset:m.timelineConverter.getClientTimeOffset()}),h=0,f=j.length;f>h;h+=1){for(d=j[h],i=0,g=b.length;g>i;i+=1)b[i].getId()===d.id&&(l=b[i],l.updateData(d));l||(l=m.system.getObject("stream"),c=m.system.getObject("playbackController"),l.setStreamInfo(d),l.setVideoModel(0===h?m.videoModel:t.call(m)),l.setPlaybackController(c),c.subscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_ERROR,l),c.subscribe(MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_METADATA_LOADED,l),l.initProtection(),l.setAutoPlay(e),l.load(n),l.subscribe(MediaPlayer.dependencies.Stream.eventList.ENAME_STREAM_UPDATED,m),b.push(l)),m.metricsModel.addManifestUpdateStreamInfo(p,d.id,d.index,d.start,d.duration),l=null}a||(a=b[0],k.call(m,a),a.subscribe(MediaPlayer.dependencies.Stream.eventList.ENAME_STREAM_UPDATED,this.liveEdgeFinder))}catch(r){m.errHandler.manifestError(r.message,"nostreamscomposed",m.manifestModel.getValue()),m.reset()}}},x=function(){var a=this,c=b.length,d=0;for(d;c>d;d+=1)if(b[d].isUpdating())return;a.notify(MediaPlayer.dependencies.StreamController.eventList.ENAME_STREAMS_COMPOSED)},y=function(){w.call(this)},z=function(a){a.error?this.reset():(this.manifestModel.setValue(a.data.manifest),this.debug.log("Manifest has loaded."),this.timeSyncController.initialize(this.manifestExt.getUTCTimingSources(a.data.manifest)))};return{system:void 0,videoModel:void 0,manifestLoader:void 0,manifestUpdater:void 0,manifestModel:void 0,manifestExt:void 0,adapter:void 0,debug:void 0,metricsModel:void 0,metricsExt:void 0,videoExt:void 0,liveEdgeFinder:void 0,timelineConverter:void 0,protectionExt:void 0,timeSyncController:void 0,errHandler:void 0,notify:void 0,subscribe:void 0,unsubscribe:void 0,setup:function(){this[MediaPlayer.dependencies.ManifestLoader.eventList.ENAME_MANIFEST_LOADED]=z,this[MediaPlayer.dependencies.Stream.eventList.ENAME_STREAM_UPDATED]=x,this[MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_SEEKING]=p,this[MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_PROGRESS]=n,this[MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_TIME_UPDATED]=o,this[MediaPlayer.dependencies.TimeSyncController.eventList.ENAME_TIME_SYNCHRONIZATION_COMPLETED]=y},setAutoPlay:function(a){e=a},getAutoPlay:function(){return e},setProtectionData:function(a){this.protectionExt.init(a)},getVideoModel:function(){return this.videoModel},setVideoModel:function(a){this.videoModel=a},getActiveStreamInfo:function(){return a?a.getStreamInfo():null},initialize:function(){this.timeSyncController.subscribe(MediaPlayer.dependencies.TimeSyncController.eventList.ENAME_TIME_SYNCHRONIZATION_COMPLETED,this.timelineConverter),this.timeSyncController.subscribe(MediaPlayer.dependencies.TimeSyncController.eventList.ENAME_TIME_SYNCHRONIZATION_COMPLETED,this.liveEdgeFinder),this.timeSyncController.subscribe(MediaPlayer.dependencies.TimeSyncController.eventList.ENAME_TIME_SYNCHRONIZATION_COMPLETED,this)},load:function(a){this.manifestLoader.load(a)},reset:function(){a&&(l.call(this,a),a.getVideoModel()!==this.getVideoModel()&&j.call(this,a.getVideoModel(),this.getVideoModel())),this.timeSyncController.unsubscribe(MediaPlayer.dependencies.TimeSyncController.eventList.ENAME_TIME_SYNCHRONIZATION_COMPLETED,this.timelineConverter),this.timeSyncController.unsubscribe(MediaPlayer.dependencies.TimeSyncController.eventList.ENAME_TIME_SYNCHRONIZATION_COMPLETED,this.liveEdgeFinder),this.timeSyncController.unsubscribe(MediaPlayer.dependencies.TimeSyncController.eventList.ENAME_TIME_SYNCHRONIZATION_COMPLETED,this),this.timeSyncController.reset();for(var c=0,d=b.length;d>c;c++){var e=b[c];e.unsubscribe(MediaPlayer.dependencies.Stream.eventList.ENAME_STREAM_UPDATED,this),e.reset(),e.getVideoModel()!==this.getVideoModel()&&u(e.getVideoModel().getElement())}b=[],this.manifestUpdater.stop(),this.metricsModel.clearAllCurrentMetrics(),this.manifestModel.setValue(null),this.timelineConverter.reset(),this.adapter.reset(),f=!1,a=null},play:g,seek:i,pause:h}},MediaPlayer.dependencies.StreamController.prototype={constructor:MediaPlayer.dependencies.StreamController},MediaPlayer.dependencies.StreamController.eventList={ENAME_STREAMS_COMPOSED:"streamsComposed"},MediaPlayer.dependencies.TextController=function(){var a,b,c,d=!1,e=function(){d||(b.hasOwnProperty("initialize")&&b.initialize(c,this),d=!0),this.notify(MediaPlayer.dependencies.TextController.eventList.ENAME_CLOSED_CAPTIONING_REQUESTED,{CCIndex:0})},f=function(a){var c=this;a.data.fragmentModel===c.streamProcessor.getFragmentModel()&&null!==a.data.bytes&&c.sourceBufferExt.append(b,a.data.bytes,c.videoModel)};return{sourceBufferExt:void 0,debug:void 0,system:void 0,notify:void 0,subscribe:void 0,unsubscribe:void 0,setup:function(){this[Dash.dependencies.RepresentationController.eventList.ENAME_DATA_UPDATE_COMPLETED]=e,this[MediaPlayer.dependencies.FragmentController.eventList.ENAME_INIT_FRAGMENT_LOADED]=f},initialize:function(a,b,d,e){var f=this;c=a,f.setBuffer(b),f.setMediaSource(d),f.videoModel=e.videoModel,f.trackController=e.trackController,f.streamProcessor=e},getBuffer:function(){return b},setBuffer:function(a){b=a},setMediaSource:function(b){a=b},reset:function(c){c||(this.sourceBufferExt.abort(a,b),this.sourceBufferExt.removeSourceBuffer(a,b))}}},MediaPlayer.dependencies.TextController.prototype={constructor:MediaPlayer.dependencies.TextController},MediaPlayer.dependencies.TextController.eventList={ENAME_CLOSED_CAPTIONING_REQUESTED:"closedCaptioningRequested"},MediaPlayer.dependencies.MediaSourceExtensions=function(){"use strict"},MediaPlayer.dependencies.MediaSourceExtensions.prototype={constructor:MediaPlayer.dependencies.MediaSourceExtensions,createMediaSource:function(){"use strict";var a="WebKitMediaSource"in window,b="MediaSource"in window;return b?new MediaSource:a?new WebKitMediaSource:null},attachMediaSource:function(a,b){"use strict";var c=window.URL.createObjectURL(a);return b.setSource(c),c},detachMediaSource:function(a){"use strict";a.setSource("")},setDuration:function(a,b){"use strict";return a.duration=b,a.duration},signalEndOfStream:function(a){"use strict";var b=a.sourceBuffers,c=b.length,d=0;if("open"===a.readyState){for(d;c>d;d+=1)if(b[d].updating)return;a.endOfStream()}}},MediaPlayer.dependencies.ProtectionExtensions=function(){"use strict";var a,b=[];return{system:void 0,debug:void 0,setup:function(){var c;c=this.system.getObject("ksPlayReady"),b.push(c),c=this.system.getObject("ksWidevine"),b.push(c),c=this.system.getObject("ksClearKey"),b.push(c),a=c},init:function(a){for(var c=(function(b){var c=null;return a&&(c=b in a?a[b]:null),c}),d=0;d<b.length;d++){var e=b[d];e.init(c(e.systemString))}},getKeySystems:function(){return b},isClearKey:function(b){return b===a},autoSelectKeySystem:function(a,c,d){var e,f,g,h,i=null;for(e=0;e<b.length;++e)for(f=0;f<c.contentProtection.length;++f)if(g=c.contentProtection[f],a.isSupported(b[e],c.codec)&&g.schemeIdUri.toLowerCase()===b[e].schemeIdURI){if(h=b[e].getInitData(g),!h)continue;i=b[e],a.selectKeySystem(i);break}if(!i&&(g=MediaPlayer.dependencies.protection.CommonEncryption.findCencContentProtection(c.contentProtection))){this.debug.log("CommonEncryption detected in MPD. Searching initData for supported key systems...");var j=MediaPlayer.dependencies.protection.CommonEncryption.parsePSSHList(d);for(e=0;e<b.length;++e)if(b[e].uuid in j&&a.isSupported(b[e],c.codec)){i=b[e],h=j[b[e].uuid],a.selectKeySystem(i);break}}if(!i)throw new Error("DRM: The protection system for this content is not supported.");return this.debug.log("Selected key system -- "+i.systemString),h}}},MediaPlayer.dependencies.ProtectionExtensions.prototype={constructor:MediaPlayer.dependencies.ProtectionExtensions},MediaPlayer.dependencies.RequestModifierExtensions=function(){"use strict";return{modifyRequestURL:function(a){return a},modifyRequestHeader:function(a){return a}}},MediaPlayer.dependencies.SourceBufferExtensions=function(){"use strict";this.system=void 0,this.errHandler=void 0,this.notify=void 0,this.subscribe=void 0,this.unsubscribe=void 0},MediaPlayer.dependencies.SourceBufferExtensions.prototype={constructor:MediaPlayer.dependencies.SourceBufferExtensions,createSourceBuffer:function(a,b){"use strict";var c=this,d=b.codec,e=null;try{e=a.addSourceBuffer(d)}catch(f){if(!b.isText)throw f;e=c.system.getObject("textSourceBuffer")}return e},removeSourceBuffer:function(a,b){"use strict";try{a.removeSourceBuffer(b)}catch(c){}},getBufferRange:function(a,b,c){"use strict";var d,e,f=null,g=0,h=0,i=null,j=null,k=0,l=c||.15;try{f=a.buffered}catch(m){return null}if(null!==f){for(e=0,d=f.length;d>e;e+=1)if(g=f.start(e),h=f.end(e),null===i)k=Math.abs(g-b),b>=g&&h>b?(i=g,j=h):l>=k&&(i=g,j=h);else{if(k=g-j,!(l>=k))break;j=h}if(null!==i)return{start:i,end:j}}return null},getAllRanges:function(a){var b=null;try{return b=a.buffered}catch(c){return null}},getBufferLength:function(a,b,c){"use strict";var d,e,f=this;return d=f.getBufferRange(a,b,c),e=null===d?0:d.end-b},waitForUpdateEnd:function(a,b){"use strict";var c,d=50,e=function(){a.updating||(clearInterval(c),b(!0))},f=function(){a.updating||(a.removeEventListener("updateend",f,!1),b(!0))};if(!a.updating)return void b(!0);if("function"==typeof a.addEventListener)try{a.addEventListener("updateend",f,!1)}catch(g){c=setInterval(e,d)}else c=setInterval(e,d)},append:function(a,b){var c=this,d="append"in a?"append":"appendBuffer"in a?"appendBuffer":null;if(d)try{c.waitForUpdateEnd(a,function(){a[d](b),c.waitForUpdateEnd(a,function(){c.notify(MediaPlayer.dependencies.SourceBufferExtensions.eventList.ENAME_SOURCEBUFFER_APPEND_COMPLETED,{buffer:a,bytes:b})})})}catch(e){c.notify(MediaPlayer.dependencies.SourceBufferExtensions.eventList.ENAME_SOURCEBUFFER_APPEND_COMPLETED,{buffer:a,bytes:b},new MediaPlayer.vo.Error(e.code,e.message,null))}},remove:function(a,b,c,d){var e=this;try{b>=0&&c>b&&"ended"!==d.readyState&&a.remove(b,c),this.waitForUpdateEnd(a,function(){e.notify(MediaPlayer.dependencies.SourceBufferExtensions.eventList.ENAME_SOURCEBUFFER_REMOVE_COMPLETED,{buffer:a,from:b,to:c})})}catch(f){e.notify(MediaPlayer.dependencies.SourceBufferExtensions.eventList.ENAME_SOURCEBUFFER_REMOVE_COMPLETED,{buffer:a,from:b,to:c},new MediaPlayer.vo.Error(f.code,f.message,null))}},abort:function(a,b){"use strict";try{"open"===a.readyState&&b.abort()}catch(c){}}},MediaPlayer.dependencies.SourceBufferExtensions.QUOTA_EXCEEDED_ERROR_CODE=22,MediaPlayer.dependencies.SourceBufferExtensions.eventList={ENAME_SOURCEBUFFER_REMOVE_COMPLETED:"sourceBufferRemoveCompleted",ENAME_SOURCEBUFFER_APPEND_COMPLETED:"sourceBufferAppendCompleted"},MediaPlayer.utils.TextTrackExtensions=function(){"use strict";var a;return{setup:function(){a=window.VTTCue||window.TextTrackCue},addTextTrack:function(b,c,d,e,f){var g=b.addTextTrack("captions",d,e);g["default"]=f,g.mode="showing";for(var h in c){var i=c[h];g.addCue(new a(i.start,i.end,i.data))}return g},deleteCues:function(a){for(var b=0,c=!1;!c;){if(null!==a.textTracks[b].cues){c=!0;break}b++}var d=a.textTracks[b],e=d.cues,f=e.length-1;for(b=f;b>=0;b--)d.removeCue(e[b]);d.mode="disabled",d["default"]=!1}}},MediaPlayer.dependencies.VideoModelExtensions=function(){"use strict";return{getPlaybackQuality:function(a){var b="webkitDroppedFrameCount"in a,c="getVideoPlaybackQuality"in a,d=null;return c?d=a.getVideoPlaybackQuality():b&&(d={droppedVideoFrames:a.webkitDroppedFrameCount,creationTime:new Date}),d}}},MediaPlayer.dependencies.VideoModelExtensions.prototype={constructor:MediaPlayer.dependencies.VideoModelExtensions},MediaPlayer.dependencies.FragmentModel=function(){"use strict";var a,b=[],c=[],d=[],e=[],f=!1,g=function(a){var b=this;b.notify(MediaPlayer.dependencies.FragmentModel.eventList.ENAME_FRAGMENT_LOADING_STARTED,{request:a}),b.fragmentLoader.load(a)},h=function(a){var c=b.indexOf(a);-1!==c&&b.splice(c,1)},i=function(a,b){var c,d=a.length-1,e=.001,f=0/0,g=0/0,h=null;for(c=d;c>=0;c-=1)if(h=a[c],f=h.startTime,g=f+h.duration,!isNaN(f)&&!isNaN(g)&&b+e>=f&&g>b||isNaN(f)&&isNaN(b))return h;return null},j=function(a,b){if(a){var c=a.mediaType,d=new Date,e=a.type,f=a.startTime,g=a.availabilityStartTime,h=a.duration,i=a.quality,j=a.range;this.metricsModel.addSchedulingInfo(c,d,e,f,g,h,i,j,b)}},k=function(a){var c=a.data.request,e=a.data.response,f=a.error;d.splice(d.indexOf(c),1),e&&!f&&b.push(c),j.call(this,c,f?MediaPlayer.vo.metrics.SchedulingInfo.FAILED_STATE:MediaPlayer.vo.metrics.SchedulingInfo.EXECUTED_STATE),this.notify(MediaPlayer.dependencies.FragmentModel.eventList.ENAME_FRAGMENT_LOADING_COMPLETED,{request:c,response:e},f)},l=function(a){var b=this.getExecutedRequestForQualityAndIndex(a.data.quality,a.data.index);b&&(this.removeExecutedRequest(b),isNaN(a.data.index)||(e.push(b),j.call(this,b,MediaPlayer.vo.metrics.SchedulingInfo.REJECTED_STATE)))},m=function(){f=!0},n=function(){f=!1};return{system:void 0,debug:void 0,metricsModel:void 0,notify:void 0,subscribe:void 0,unsubscribe:void 0,setup:function(){this[MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_OUTRUN]=m,this[MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_BALANCED]=n,this[MediaPlayer.dependencies.BufferController.eventList.ENAME_BYTES_REJECTED]=l,this[MediaPlayer.dependencies.FragmentLoader.eventList.ENAME_LOADING_COMPLETED]=k},setLoader:function(a){this.fragmentLoader=a},setContext:function(b){a=b},getContext:function(){return a},getIsPostponed:function(){return f},addRequest:function(a){return!a||this.isFragmentLoadedOrPending(a)?!1:(c.push(a),j.call(this,a,MediaPlayer.vo.metrics.SchedulingInfo.PENDING_STATE),!0)},isFragmentLoadedOrPending:function(a){var e=function(a,b){return"complete"===a.action&&a.action===b.action},f=function(a,b){return a.url===b.url&&a.startTime===b.startTime},g=function(a,b){return isNaN(a.index)&&isNaN(b.index)&&a.quality===b.quality},h=function(b){var c,d,h=!1,i=b.length;for(d=0;i>d;d+=1)if(c=b[d],f(a,c)||g(a,c)||e(a,c)){h=!0;break}return h};return h(c)||h(d)||h(b)},getPendingRequests:function(){return c},getLoadingRequests:function(){return d},getExecutedRequests:function(){return b},getRejectedRequests:function(){return e},getLoadingTime:function(){var a,c,d=0;for(c=b.length-1;c>=0;c-=1)if(a=b[c],a.requestEndDate instanceof Date&&a.firstByteDate instanceof Date){d=a.requestEndDate.getTime()-a.firstByteDate.getTime();break}return d},getExecutedRequestForTime:function(a){return i(b,a)},getPendingRequestForTime:function(a){return i(c,a)},getLoadingRequestForTime:function(a){return i(d,a)},getExecutedRequestForQualityAndIndex:function(a,c){var d,e=b.length-1,f=null;for(d=e;d>=0;d-=1)if(f=b[d],f.quality===a&&f.index===c)return f;return null},removeExecutedRequest:function(a){h.call(this,a)},removeExecutedRequestsBeforeTime:function(a){var c,d=b.length-1,e=0/0,f=null;for(c=d;c>=0;c-=1)f=b[c],e=f.startTime,!isNaN(e)&&a>e&&h.call(this,f)},cancelPendingRequests:function(a){var b=this,d=c,e=d;return c=[],void 0!==a&&(c=d.filter(function(b){return b.quality===a?!1:(e.splice(e.indexOf(b),1),!0)})),e.forEach(function(a){j.call(b,a,MediaPlayer.vo.metrics.SchedulingInfo.CANCELED_STATE)}),e},abortRequests:function(){this.fragmentLoader.abort();for(var a=0,b=d.length;b>a;a+=1)this.removeExecutedRequest(d[a]);d=[]},executeRequest:function(a){var e=this,f=c.indexOf(a);if(a&&-1!==f)switch(c.splice(f,1),a.action){case"complete":b.push(a),j.call(e,a,MediaPlayer.vo.metrics.SchedulingInfo.EXECUTED_STATE),e.notify(MediaPlayer.dependencies.FragmentModel.eventList.ENAME_STREAM_COMPLETED,{request:a});break;case"download":d.push(a),j.call(e,a,MediaPlayer.vo.metrics.SchedulingInfo.LOADING_STATE),g.call(e,a);break;default:this.debug.log("Unknown request action.")}}}},MediaPlayer.dependencies.FragmentModel.prototype={constructor:MediaPlayer.dependencies.FragmentModel},MediaPlayer.dependencies.FragmentModel.eventList={ENAME_STREAM_COMPLETED:"streamCompleted",ENAME_FRAGMENT_LOADING_STARTED:"fragmentLoadingStarted",ENAME_FRAGMENT_LOADING_COMPLETED:"fragmentLoadingCompleted"},MediaPlayer.models.ManifestModel=function(){"use strict";var a;return{system:void 0,eventBus:void 0,notify:void 0,subscribe:void 0,unsubscribe:void 0,getValue:function(){return a},setValue:function(b){a=b,this.eventBus.dispatchEvent({type:"manifestLoaded",data:b}),this.notify(MediaPlayer.models.ManifestModel.eventList.ENAME_MANIFEST_UPDATED,{manifest:b})}}},MediaPlayer.models.ManifestModel.prototype={constructor:MediaPlayer.models.ManifestModel},MediaPlayer.models.ManifestModel.eventList={ENAME_MANIFEST_UPDATED:"manifestUpdated"},MediaPlayer.models.MetricsModel=function(){"use strict";return{system:void 0,eventBus:void 0,adapter:void 0,streamMetrics:{},metricsChanged:function(){this.eventBus.dispatchEvent({type:"metricsChanged",data:{}})},metricChanged:function(a){this.eventBus.dispatchEvent({type:"metricChanged",data:{stream:a}}),this.metricsChanged()},metricUpdated:function(a,b,c){this.eventBus.dispatchEvent({type:"metricUpdated",data:{stream:a,metric:b,value:c}}),this.metricChanged(a)},metricAdded:function(a,b,c){this.eventBus.dispatchEvent({type:"metricAdded",data:{stream:a,metric:b,value:c}}),this.metricChanged(a)},clearCurrentMetricsForType:function(a){delete this.streamMetrics[a],this.metricChanged(a)},clearAllCurrentMetrics:function(){var a=this;this.streamMetrics={},this.metricsChanged.call(a)},getReadOnlyMetricsFor:function(a){return this.streamMetrics.hasOwnProperty(a)?this.streamMetrics[a]:null},getMetricsFor:function(a){var b;return this.streamMetrics.hasOwnProperty(a)?b=this.streamMetrics[a]:(b=this.system.getObject("metrics"),this.streamMetrics[a]=b),b},addTcpConnection:function(a,b,c,d,e,f){var g=new MediaPlayer.vo.metrics.TCPConnection;return g.tcpid=b,g.dest=c,g.topen=d,g.tclose=e,g.tconnect=f,this.getMetricsFor(a).TcpList.push(g),this.metricAdded(a,this.adapter.metricsList.TCP_CONNECTION,g),g},addHttpRequest:function(a,b,c,d,e,f,g,h,i,j,k,l,m){var n=new MediaPlayer.vo.metrics.HTTPRequest;return n.stream=a,n.tcpid=b,n.type=c,n.url=d,n.actualurl=e,n.range=f,n.trequest=g,n.tresponse=h,n.tfinish=i,n.responsecode=j,n.interval=k,n.mediaduration=l,n.responseHeaders=m,this.getMetricsFor(a).HttpList.push(n),this.metricAdded(a,this.adapter.metricsList.HTTP_REQUEST,n),n},appendHttpTrace:function(a,b,c,d){var e=new MediaPlayer.vo.metrics.HTTPRequest.Trace;return e.s=b,e.d=c,e.b=d,a.trace.push(e),this.metricUpdated(a.stream,this.adapter.metricsList.HTTP_REQUEST_TRACE,a),e},addTrackSwitch:function(a,b,c,d,e){var f=new MediaPlayer.vo.metrics.TrackSwitch;return f.t=b,f.mt=c,f.to=d,f.lto=e,this.getMetricsFor(a).RepSwitchList.push(f),this.metricAdded(a,this.adapter.metricsList.TRACK_SWITCH,f),f},addBufferLevel:function(a,b,c){var d=new MediaPlayer.vo.metrics.BufferLevel;return d.t=b,d.level=c,this.getMetricsFor(a).BufferLevel.push(d),this.metricAdded(a,this.adapter.metricsList.BUFFER_LEVEL,d),d},addBufferState:function(a,b,c){var d=new MediaPlayer.vo.metrics.BufferState;return d.target=c,d.state=b,this.getMetricsFor(a).BufferState.push(d),this.metricAdded(a,this.adapter.metricsList.BUFFER_STATE,d),d},addDVRInfo:function(a,b,c,d){var e=new MediaPlayer.vo.metrics.DVRInfo;return e.time=b,e.range=d,e.manifestInfo=c,this.getMetricsFor(a).DVRInfo.push(e),this.metricAdded(a,this.adapter.metricsList.DVR_INFO,e),e},addDroppedFrames:function(a,b){var c=new MediaPlayer.vo.metrics.DroppedFrames,d=this.getMetricsFor(a).DroppedFrames;return c.time=b.creationTime,c.droppedFrames=b.droppedVideoFrames,d.length>0&&d[d.length-1]==c?d[d.length-1]:(d.push(c),this.metricAdded(a,this.adapter.metricsList.DROPPED_FRAMES,c),c)},addSchedulingInfo:function(a,b,c,d,e,f,g,h,i){var j=new MediaPlayer.vo.metrics.SchedulingInfo;return j.mediaType=a,j.t=b,j.type=c,j.startTime=d,j.availabilityStartTime=e,j.duration=f,j.quality=g,j.range=h,j.state=i,this.getMetricsFor(a).SchedulingInfo.push(j),this.metricAdded(a,this.adapter.metricsList.SCHEDULING_INFO,j),j},addManifestUpdate:function(a,b,c,d,e,f,g,h,i,j){var k=new MediaPlayer.vo.metrics.ManifestUpdate,l=this.getMetricsFor("stream");return k.mediaType=a,k.type=b,k.requestTime=c,k.fetchTime=d,k.availabilityStartTime=e,k.presentationStartTime=f,k.clientTimeOffset=g,k.currentTime=h,k.buffered=i,k.latency=j,l.ManifestUpdate.push(k),this.metricAdded(a,this.adapter.metricsList.MANIFEST_UPDATE,k),k},updateManifestUpdateInfo:function(a,b){for(var c in b)a[c]=b[c];this.metricUpdated(a.mediaType,this.adapter.metricsList.MANIFEST_UPDATE,a)},addManifestUpdateStreamInfo:function(a,b,c,d,e){var f=new MediaPlayer.vo.metrics.ManifestUpdate.StreamInfo;return f.id=b,f.index=c,f.start=d,f.duration=e,a.streamInfo.push(f),this.metricUpdated(a.mediaType,this.adapter.metricsList.MANIFEST_UPDATE_STREAM_INFO,a),f},addManifestUpdateTrackInfo:function(a,b,c,d,e,f,g,h){var i=new MediaPlayer.vo.metrics.ManifestUpdate.TrackInfo;return i.id=b,i.index=c,i.streamIndex=d,i.mediaType=e,i.startNumber=g,i.fragmentInfoType=h,i.presentationTimeOffset=f,a.trackInfo.push(i),this.metricUpdated(a.mediaType,this.adapter.metricsList.MANIFEST_UPDATE_TRACK_INFO,a),i},addPlayList:function(a,b,c,d){var e=new MediaPlayer.vo.metrics.PlayList;return e.stream=a,e.start=b,e.mstart=c,e.starttype=d,this.getMetricsFor(a).PlayList.push(e),this.metricAdded(a,this.adapter.metricsList.PLAY_LIST,e),e},appendPlayListTrace:function(a,b,c,d,e,f,g,h){var i=new MediaPlayer.vo.metrics.PlayList.Trace;return i.representationid=b,i.subreplevel=c,i.start=d,i.mstart=e,i.duration=f,i.playbackspeed=g,i.stopreason=h,a.trace.push(i),this.metricUpdated(a.stream,this.adapter.metricsList.PLAY_LIST_TRACE,a),i}}},MediaPlayer.models.MetricsModel.prototype={constructor:MediaPlayer.models.MetricsModel},MediaPlayer.models.ProtectionModel={},MediaPlayer.models.ProtectionModel.eventList={ENAME_NEED_KEY:"needkey",ENAME_KEY_MESSAGE:"keyMessage",ENAME_KEY_ADDED:"keyAdded",ENAME_KEY_ERROR:"keyError",ENAME_KEY_SESSION_CREATED:"keySessionCreated",ENAME_KEY_SESSION_LOADED:"keySessionLoaded",ENAME_KEY_SESSION_UNLOADED:"keySessionUnloaded",ENAME_KEY_SESSION_CLOSED:"keySessionClosed"},MediaPlayer.models.ProtectionModel_01b=function(){var a,b=null,c=null,d=[],e=[],f=function(){var b=this;return{handleEvent:function(f){var g=null;switch(f.type){case c.needkey:b.notify(MediaPlayer.models.ProtectionModel.eventList.ENAME_NEED_KEY,new MediaPlayer.vo.protection.NeedKey(f.initData));break;case c.keyerror:if(g=h(e,f.sessionId),g||(g=h(d,f.sessionId)),g){var i="";switch(f.errorCode.code){case 1:i+="MEDIA_KEYERR_UNKNOWN - An unspecified error occurred. This value is used for errors that don't match any of the other codes.";break;case 2:i+="MEDIA_KEYERR_CLIENT - The Key System could not be installed or updated.";break;case 3:i+="MEDIA_KEYERR_SERVICE - The message passed into update indicated an error from the license service.";break;case 4:i+="MEDIA_KEYERR_OUTPUT - There is no available output device with the required characteristics for the content protection system.";break;case 5:i+="MEDIA_KEYERR_HARDWARECHANGE - A hardware configuration change caused a content protection error.";break;case 6:i+="MEDIA_KEYERR_DOMAIN - An error occurred in a multi-device domain licensing configuration. The most common error is a failure to join the domain."}i+=" System Code = "+f.systemCode,b.notify(MediaPlayer.models.ProtectionModel.eventList.ENAME_KEY_ERROR,new MediaPlayer.vo.protection.KeyError(g,i))}else b.debug.log("No session token found for key error");break;case c.keyadded:g=h(e,f.sessionId),g||(g=h(d,f.sessionId)),g?b.notify(MediaPlayer.models.ProtectionModel.eventList.ENAME_KEY_ADDED,g):b.debug.log("No session token found for key added");break;case c.keymessage:a=null!==f.sessionId&&void 0!==f.sessionId,a?(g=h(e,f.sessionId),g||(g=d.shift(),e.push(g),g.sessionID=f.sessionId)):(g=d.shift(),e.push(g),0!==d.length&&b.errHandler.mediaKeyMessageError("Multiple key sessions were creates with a user-agent that does not support sessionIDs!! Unpredictable behavior ahead!")),g?(g.keyMessage=f.message,b.notify(MediaPlayer.models.ProtectionModel.eventList.ENAME_KEY_MESSAGE,new MediaPlayer.vo.protection.KeyMessage(g,f.message,f.defaultURL))):b.debug.log("No session token found for key message")}}}},g=null,h=function(a,b){if(b&&a){for(var c=a.length,d=0;c>d;d++)if(a[d].sessionID==b)return a[d];return null}return null},i=function(){b.removeEventListener(c.keyerror,g),b.removeEventListener(c.needkey,g),b.removeEventListener(c.keymessage,g),b.removeEventListener(c.keyadded,g)};return{system:void 0,debug:void 0,errHandler:void 0,notify:void 0,subscribe:void 0,unsubscribe:void 0,protectionExt:void 0,keySystem:null,setup:function(){g=f.call(this)},init:function(){var a=document.createElement("video");c=MediaPlayer.models.ProtectionModel_01b.detect(a)},teardown:function(){b&&i();for(var a=0;a<e.length;a++)this.closeKeySession(e[a])},isSupported:function(a,c){return""!==b.canPlayType(c,a.systemString)},selectKeySystem:function(a){this.keySystem=a},setMediaElement:function(a){b&&i(),b=a,b.addEventListener(c.keyerror,g),b.addEventListener(c.needkey,g),b.addEventListener(c.keymessage,g),b.addEventListener(c.keyadded,g)},createKeySession:function(f){if(!this.keySystem)throw new Error("Can not create sessions until you have selected a key system");if(a||0===e.length){var g={prototype:(new MediaPlayer.models.SessionToken).prototype,sessionID:null,initData:f};return d.push(g),b[c.generateKeyRequest](this.keySystem.systemString,f),g}throw new Error("Multiple sessions not allowed!")},updateKeySession:function(a,d){var e=a.sessionID;if(this.protectionExt.isClearKey(this.keySystem))for(var f=0;f<d.keyPairs.length;f++)b[c.addKey](this.keySystem.systemString,d.keyPairs[f].key,d.keyPairs[f].keyID,e);else b[c.addKey](this.keySystem.systemString,d,a.initData,e)},closeKeySession:function(a){b[c.cancelKeyRequest](this.keySystem.systemString,a.sessionID)},setServerCertificate:function(){}}},MediaPlayer.models.ProtectionModel_01b.prototype={constructor:MediaPlayer.models.ProtectionModel_01b},MediaPlayer.models.ProtectionModel_01b.APIs=[{generateKeyRequest:"generateKeyRequest",addKey:"addKey",cancelKeyRequest:"cancelKeyRequest",needkey:"needkey",keyerror:"keyerror",keyadded:"keyadded",keymessage:"keymessage"},{generateKeyRequest:"webkitGenerateKeyRequest",addKey:"webkitAddKey",cancelKeyRequest:"webkitCancelKeyRequest",needkey:"webkitneedkey",keyerror:"webkitkeyerror",keyadded:"webkitkeyadded",keymessage:"webkitkeymessage"}],MediaPlayer.models.ProtectionModel_01b.detect=function(a){for(var b=MediaPlayer.models.ProtectionModel_01b.APIs,c=0;c<b.length;c++){var d=b[c];if("function"==typeof a[d.generateKeyRequest]&&"function"==typeof a[d.addKey]&&"function"==typeof a[d.cancelKeyRequest])return d}return null},MediaPlayer.models.ProtectionModel_3Feb2014=function(){var a=null,b=null,c=null,d=[],e=function(){var a=this;return{handleEvent:function(b){switch(b.type){case c.needkey:a.notify(MediaPlayer.models.ProtectionModel.eventList.ENAME_NEED_KEY,new MediaPlayer.vo.protection.NeedKey(b.initData))}}}},f=null,g=function(a,b){var d=this;return{prototype:(new MediaPlayer.models.SessionToken).prototype,session:a,sessionID:a.sessionId,initData:b,handleEvent:function(a){switch(a.type){case c.error:var b="KeyError";d.notify(MediaPlayer.models.ProtectionModel.eventList.ENAME_KEY_ERROR,new MediaPlayer.vo.protection.KeyError(this,b));break;case c.message:d.notify(MediaPlayer.models.ProtectionModel.eventList.ENAME_KEY_MESSAGE,new MediaPlayer.vo.protection.KeyMessage(this,a.message,a.destinationURL));break;case c.ready:d.notify(MediaPlayer.models.ProtectionModel.eventList.ENAME_KEY_ADDED,this);break;case c.close:d.notify(MediaPlayer.models.ProtectionModel.eventList.ENAME_KEY_SESSION_CLOSED,this)}}}};return{system:void 0,notify:void 0,subscribe:void 0,unsubscribe:void 0,protectionExt:void 0,keySystem:null,setup:function(){f=e.call(this)},init:function(){var a=document.createElement("video");c=MediaPlayer.models.ProtectionModel_3Feb2014.detect(a)},teardown:function(){a&&a.removeEventListener(c.needkey,f);for(var b=0;b<d.length;b++)this.closeKeySession(d[b])},isSupported:function(a,b){return window[c.MediaKeys].isTypeSupported(a.systemString,b)},selectKeySystem:function(d){this.keySystem=d,b=new window[c.MediaKeys](this.keySystem.systemString),a&&a[c.setMediaKeys](b)},setMediaElement:function(d){a&&a.removeEventListener(c.needkey,f().bind(this)),a=d,a.addEventListener(c.needkey,f),b&&a[c.setMediaKeys](b)},createKeySession:function(a,e){if(!this.keySystem||!b)throw new Error("Can not create sessions until you have selected a key system");var f=b.createSession(e,a),h=g.call(this,f,a);return f.addEventListener(c.error,h),f.addEventListener(c.message,h),f.addEventListener(c.ready,h),f.addEventListener(c.close,h),d.push(h),h},updateKeySession:function(a,b){var c=a.session;c.update(this.protectionExt.isClearKey(this.keySystem)?b.toJWKString():b)},closeKeySession:function(a){var b=a.session;b.removeEventListener(c.error,a),b.removeEventListener(c.message,a),b.removeEventListener(c.ready,a),b.removeEventListener(c.close,a);for(var e=0;e<d.length;e++)if(d[e]===a){d.splice(e,1);break}b[c.release]()}}},MediaPlayer.models.ProtectionModel_3Feb2014.APIs=[{setMediaKeys:"setMediaKeys",MediaKeys:"MediaKeys",release:"close",needkey:"needkey",error:"keyerror",message:"keymessage",ready:"keyadded",close:"keyclose"},{setMediaKeys:"msSetMediaKeys",MediaKeys:"MSMediaKeys",release:"close",needkey:"msneedkey",error:"mskeyerror",message:"mskeymessage",ready:"mskeyadded",close:"mskeyclose"}],MediaPlayer.models.ProtectionModel_3Feb2014.detect=function(a){for(var b=MediaPlayer.models.ProtectionModel_3Feb2014.APIs,c=0;c<b.length;c++){var d=b[c];if("function"==typeof a[d.setMediaKeys]&&"function"==typeof window[d.MediaKeys])return d}return null},MediaPlayer.models.ProtectionModel_3Feb2014.prototype={constructor:MediaPlayer.models.ProtectionModel_3Feb2014},MediaPlayer.models.URIQueryAndFragmentModel=function(){"use strict";var a=new MediaPlayer.vo.URIFragmentData,b=[],c=function(c){function d(a,b,c,d){var e=d[0].split(/[=]/);return d.push({key:e[0],value:e[1]}),d.shift(),d}function e(a,c,d){return c>0&&(j&&0===b.length?b=d[c].split(/[&]/):k&&(g=d[c].split(/[&]/))),d}if(!c)return null;var f,g=[],h=new RegExp(/[?]/),i=new RegExp(/[#]/),j=h.test(c),k=i.test(c);return f=c.split(/[?#]/).map(e),b.length>0&&(b=b.reduce(d,null)),g.length>0&&(g=g.reduce(d,null),g.forEach(function(b){a[b.key]=b.value
20
+ })),c};return{parseURI:c,getURIFragmentData:function(){return a},getURIQueryData:function(){return b},reset:function(){a=new MediaPlayer.vo.URIFragmentData,b=[]}}},MediaPlayer.models.URIQueryAndFragmentModel.prototype={constructor:MediaPlayer.models.URIQueryAndFragmentModel},MediaPlayer.models.VideoModel=function(){"use strict";var a,b=[],c=function(){return b.length>0},d=function(c){null!==c&&(a.playbackRate=0,b[c]!==!0&&(b.push(c),b[c]=!0))},e=function(d){if(null!==d){b[d]=!1;var e=b.indexOf(d);-1!==e&&b.splice(e,1),c()===!1&&(a.playbackRate=1)}},f=function(a,b){b?d(a):e(a)},g=function(a){var b=a.sender.streamProcessor.getType();f.call(this,b,!a.data.hasSufficientBuffer)};return{system:void 0,setup:function(){this.bufferLevelStateChanged=g},play:function(){a.play()},pause:function(){a.pause()},isPaused:function(){return a.paused},getPlaybackRate:function(){return a.playbackRate},setPlaybackRate:function(b){a.playbackRate=b},getCurrentTime:function(){return a.currentTime},setCurrentTime:function(b){a.currentTime!=b&&(a.currentTime=b)},listen:function(b,c){a.addEventListener(b,c,!1)},unlisten:function(b,c){a.removeEventListener(b,c,!1)},getElement:function(){return a},setElement:function(b){a=b},setSource:function(b){a.src=b}}},MediaPlayer.models.VideoModel.prototype={constructor:MediaPlayer.models.VideoModel},MediaPlayer.dependencies.protection.CommonEncryption={findCencContentProtection:function(a){for(var b=null,c=0;c<a.length;++c){var d=a[c];"urn:mpeg:dash:mp4protection:2011"===d.schemeIdUri.toLowerCase()&&"cenc"===d.value.toLowerCase()&&(b=d)}return b},getPSSHData:function(a){return new Uint8Array(a.buffer.slice(32))},parsePSSHList:function(a){if(null===a)return[];for(var b=new DataView(a.buffer),c=!1,d={},e=0;!c;){var f,g,h,i,j,k=e;if(e>=b.buffer.byteLength)break;if(f=b.getUint32(e),g=e+f,e+=4,1886614376===b.getUint32(e))if(e+=4,h=b.getUint8(e),0===h){e+=1,e+=3,i="";var l,m;for(l=0;4>l;l++)m=b.getUint8(e+l).toString(16),i+=1===m.length?"0"+m:m;for(e+=4,i+="-",l=0;2>l;l++)m=b.getUint8(e+l).toString(16),i+=1===m.length?"0"+m:m;for(e+=2,i+="-",l=0;2>l;l++)m=b.getUint8(e+l).toString(16),i+=1===m.length?"0"+m:m;for(e+=2,i+="-",l=0;2>l;l++)m=b.getUint8(e+l).toString(16),i+=1===m.length?"0"+m:m;for(e+=2,i+="-",l=0;6>l;l++)m=b.getUint8(e+l).toString(16),i+=1===m.length?"0"+m:m;e+=6,i=i.toLowerCase(),j=b.getUint32(e),e+=4,d[i]=new Uint8Array(b.buffer.slice(k,g)),e=g}else e=g;else e=g}return d}},MediaPlayer.dependencies.protection.KeySystem={eventList:{ENAME_LICENSE_REQUEST_COMPLETE:"licenseRequestComplete"}},MediaPlayer.dependencies.protection.KeySystem_Access=function(){"use strict"},MediaPlayer.dependencies.protection.KeySystem_Access.prototype={constructor:MediaPlayer.dependencies.protection.KeySystem_Access},MediaPlayer.dependencies.protection.KeySystem_ClearKey=function(){"use strict";var a,b="webkit-org.w3.clearkey",c="10000000-0000-0000-0000-000000000000",d=function(a,b){var c,d,e=MediaPlayer.dependencies.protection.CommonEncryption.getPSSHData(a),f=new DataView(e.buffer),g=0,h=[];if(d=f.getUint8(g),g+=1,0===d){var i="",j="",k=f.getUint16(g);for(g+=2,c=0;k>c;c++)j+=String.fromCharCode(f.getUint8(g+c));i=atob(j),i=i.replace(/&amp;/,"&");var l=new XMLHttpRequest;l.onload=function(){if(200==l.status){for(l.response.hasOwnProperty("keys")||this.notify(MediaPlayer.dependencies.protection.KeySystem.eventList.ENAME_LICENSE_REQUEST_COMPLETE,null,new Error("DRM: ClearKey Remote update, Illegal response JSON")),c=0;c<l.reponse.keys.length;c++){var a=l.response.keys[c],d=atob(a.kid),e=atob(a.k);h.push(new MediaPlayer.vo.protection.KeyPair(d,e))}var f=new MediaPlayer.vo.protection.LicenseRequestComplete(new MediaPlayer.vo.protection.ClearKeyKeySet(h),b);this.notify(MediaPlayer.dependencies.protection.KeySystem.eventList.ENAME_LICENSE_REQUEST_COMPLETE,f)}else this.notify(MediaPlayer.dependencies.protection.KeySystem.eventList.ENAME_LICENSE_REQUEST_COMPLETE,null,new Error('DRM: ClearKey Remote update, XHR aborted. status is "'+l.statusText+'" ('+l.status+"), readyState is "+l.readyState))},l.onabort=function(){this.notify(MediaPlayer.dependencies.protection.KeySystem.eventList.ENAME_LICENSE_REQUEST_COMPLETE,null,new Error('DRM: ClearKey update, XHR aborted. status is "'+l.statusText+'" ('+l.status+"), readyState is "+l.readyState))},l.onerror=function(){this.notify(MediaPlayer.dependencies.protection.KeySystem.eventList.ENAME_LICENSE_REQUEST_COMPLETE,null,new Error('DRM: ClearKey update, XHR error. status is "'+l.statusText+'" ('+l.status+"), readyState is "+l.readyState))},l.open("GET",i),l.responseType="json",l.send()}else if(1===d){var m=f.getUint8(g);for(g+=1,c=0;m>c;c++){var n,o;n=new Uint8Array(e.buffer.slice(g,g+16)),g+=16,o=new Uint8Array(e.buffer.slice(g,g+16)),g+=16,h.push(new MediaPlayer.vo.protection.KeyPair(n,o))}var p=new MediaPlayer.vo.protection.LicenseRequestComplete(new MediaPlayer.vo.protection.ClearKeyKeySet(h),b);this.notify(MediaPlayer.dependencies.protection.KeySystem.eventList.ENAME_LICENSE_REQUEST_COMPLETE,p)}else this.notify(MediaPlayer.dependencies.protection.KeySystem.eventList.ENAME_LICENSE_REQUEST_COMPLETE,null,new Error("DRM: Illegal ClearKey type: "+d))};return{schemeIdURI:void 0,systemString:b,uuid:c,notify:void 0,subscribe:void 0,unsubscribe:void 0,init:function(b){this.schemeIdURI="urn:uuid:"+c,a=b},doLicenseRequest:function(a,b,c){d.call(this,a,c)},getInitData:function(){return null},initDataEquals:function(a,b){return a.length===b.length&&btoa(a.buffer)===btoa(b.buffer)?!0:!1}}},MediaPlayer.dependencies.protection.KeySystem_ClearKey.prototype={constructor:MediaPlayer.dependencies.protection.KeySystem_ClearKey},MediaPlayer.dependencies.protection.KeySystem_PlayReady=function(){"use strict";var a,b="com.microsoft.playready",c="9a04f079-9840-4286-ab92-e65be0885f95",d=function(b,c,d){var e,f,g,h,i,j,k=null,l={},m=new DOMParser,n=this;if(j=new Uint16Array(b.buffer),i=String.fromCharCode.apply(null,j),h=m.parseFromString(i,"application/xml"),h.getElementsByTagName("Challenge")[0]){var o=h.getElementsByTagName("Challenge")[0].childNodes[0].nodeValue;o&&(k=BASE64.decode(o))}else n.notify(MediaPlayer.dependencies.protection.KeySystem.eventList.ENAME_LICENSE_REQUEST_COMPLETE,null,new MediaPlayer.vo.Error(null,"DRM: playready update, can not find Challenge in keyMessage",null));var p=h.getElementsByTagName("name"),q=h.getElementsByTagName("value");p.length!=q.length&&n.notify(MediaPlayer.dependencies.protection.KeySystem.eventList.ENAME_LICENSE_REQUEST_COMPLETE,null,new MediaPlayer.vo.Error(null,"DRM: playready update, invalid header name/value pair in keyMessage",null));for(var r=0;r<p.length;r++)l[p[r].childNodes[0].nodeValue]=q[r].childNodes[0].nodeValue;a&&a.bearerToken&&l.push({name:"Authorization",value:a.bearerToken});var s=new XMLHttpRequest;if(s.onload=function(){if(200==s.status){var a=new MediaPlayer.vo.protection.LicenseRequestComplete(new Uint8Array(s.response),d);n.notify(MediaPlayer.dependencies.protection.KeySystem.eventList.ENAME_LICENSE_REQUEST_COMPLETE,a)}else n.notify(MediaPlayer.dependencies.protection.KeySystem.eventList.ENAME_LICENSE_REQUEST_COMPLETE,null,new MediaPlayer.vo.Error(null,'DRM: playready update, XHR status is "'+s.statusText+'" ('+s.status+"), expected to be 200. readyState is "+s.readyState,null))},s.onabort=function(){n.notify(MediaPlayer.dependencies.protection.KeySystem.eventList.ENAME_LICENSE_REQUEST_COMPLETE,null,new MediaPlayer.vo.Error(null,'DRM: playready update, XHR aborted. status is "'+s.statusText+'" ('+s.status+"), readyState is "+s.readyState,null))},s.onerror=function(){n.notify(MediaPlayer.dependencies.protection.KeySystem.eventList.ENAME_LICENSE_REQUEST_COMPLETE,null,new MediaPlayer.vo.Error(null,'DRM: playready update, XHR error. status is "'+s.statusText+'" ('+s.status+"), readyState is "+s.readyState,null))},s.open("POST",a&&a.laURL&&""!==a.laURL?a.laURL:c),s.responseType="arraybuffer",g=a?a.httpRequestHeaders:null)for(f in g)l[f]=g[f];for(e in l)"authorization"===e.toLowerCase()&&(s.withCredentials=!0),s.setRequestHeader(e,l[e]);s.send(k)},e=function(a){var b=0,c=0,d=0,e=new Uint8Array([112,115,115,104,0,0,0,0]),f=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]),g=null,h=null,i=null,j=null;if("pro"in a)g=BASE64.decodeArray(a.pro.__text);else{if(!("prheader"in a))return null;g=BASE64.decodeArray(a.prheader.__text)}return c=g.length,d=4+e.length+f.length+4+c,h=new ArrayBuffer(d),i=new Uint8Array(h),j=new DataView(h),j.setUint32(b,d),b+=4,i.set(e,b),b+=e.length,i.set(f,b),b+=f.length,j.setUint32(b,c),b+=4,i.set(g,b),b+=c,i},f=function(){return!1};return{schemeIdURI:"urn:uuid:"+c,systemString:b,uuid:c,notify:void 0,subscribe:void 0,unsubscribe:void 0,init:function(b){a=b},doLicenseRequest:d,getInitData:e,initDataEquals:f}},MediaPlayer.dependencies.protection.KeySystem_PlayReady.prototype={constructor:MediaPlayer.dependencies.protection.KeySystem_PlayReady},MediaPlayer.dependencies.protection.KeySystem_Widevine=function(){"use strict";var a,b="com.widevine.alpha",c="edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",d=function(b,c,d){var e,f,g,h,i=new XMLHttpRequest,j={},k=this;if(h=a&&a.laURL&&""!==a.laURL?a.laURL:c){if(i.open("POST",h,!0),i.responseType="arraybuffer",i.onload=function(){if(200==this.status){var a=new MediaPlayer.vo.protection.LicenseRequestComplete(new Uint8Array(this.response),d);k.notify(MediaPlayer.dependencies.protection.KeySystem.eventList.ENAME_LICENSE_REQUEST_COMPLETE,a)}else k.notify(MediaPlayer.dependencies.protection.KeySystem.eventList.ENAME_LICENSE_REQUEST_COMPLETE,null,new Error('DRM: widevine update, XHR status is "'+i.statusText+'" ('+i.status+"), expected to be 200. readyState is "+i.readyState)+". Response is "+(this.response?String.fromCharCode.apply(null,new Uint8Array(this.response)):"NONE"))},i.onabort=function(){k.notify(MediaPlayer.dependencies.protection.KeySystem.eventList.ENAME_LICENSE_REQUEST_COMPLETE,null,new Error('DRM: widevine update, XHR aborted. status is "'+i.statusText+'" ('+i.status+"), readyState is "+i.readyState))},i.onerror=function(){k.notify(MediaPlayer.dependencies.protection.KeySystem.eventList.ENAME_LICENSE_REQUEST_COMPLETE,null,new Error('DRM: widevine update, XHR error. status is "'+i.statusText+'" ('+i.status+"), readyState is "+i.readyState))},f=a?a.httpRequestHeaders:null)for(e in f)j[e]=f[e];for(g in j)"authorization"===g.toLowerCase()&&(i.withCredentials=!0),i.setRequestHeader(g,j[g]);i.send(b)}else k.notify(MediaPlayer.dependencies.protection.KeySystem.eventList.ENAME_LICENSE_REQUEST_COMPLETE,null,new Error("DRM: No valid Widevine Proxy Server URL specified!"))},e=function(){return null},f=function(){return!1};return{schemeIdURI:"urn:uuid:"+c,systemString:b,uuid:c,notify:void 0,subscribe:void 0,unsubscribe:void 0,init:function(b){a=b},doLicenseRequest:d,getInitData:e,initDataEquals:f}},MediaPlayer.dependencies.protection.KeySystem_Widevine.prototype={constructor:MediaPlayer.dependencies.protection.KeySystem_Widevine},MediaPlayer.rules.ABRRulesCollection=function(){"use strict";var a=[];return{downloadRatioRule:void 0,insufficientBufferRule:void 0,limitSwitchesRule:void 0,bufferOccupancyRule:void 0,throughputRule:void 0,getRules:function(b){switch(b){case MediaPlayer.rules.ABRRulesCollection.prototype.QUALITY_SWITCH_RULES:return a;default:return null}},setup:function(){a.push(this.insufficientBufferRule),a.push(this.throughputRule),a.push(this.bufferOccupancyRule),a.push(this.limitSwitchesRule)}}},MediaPlayer.rules.ABRRulesCollection.prototype={constructor:MediaPlayer.rules.ABRRulesCollection,QUALITY_SWITCH_RULES:"qualitySwitchRules"},MediaPlayer.rules.BufferOccupancyRule=function(){"use strict";return{debug:void 0,metricsModel:void 0,execute:function(a,b){var c=this,d=a.getMediaInfo(),e=d.type,f=this.metricsModel.getReadOnlyMetricsFor(e),g=f.BufferLevel.length>0?f.BufferLevel[f.BufferLevel.length-1]:null,h=f.BufferState.length>0?f.BufferState[f.BufferState.length-1]:null,i=!1,j=d.trackCount-1,k=new MediaPlayer.rules.SwitchRequest(MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE,MediaPlayer.rules.SwitchRequest.prototype.WEAK);null!==g&&null!==h&&g.level>h.target&&(i=g.level-h.target>MediaPlayer.dependencies.BufferController.RICH_BUFFER_THRESHOLD,i&&d.trackCount>1&&(k=new MediaPlayer.rules.SwitchRequest(j,MediaPlayer.rules.SwitchRequest.prototype.STRONG))),k.value!==MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE&&c.debug.log("BufferOccupancyRule requesting switch to index: ",k.value,"type: ",e," Priority: ",k.priority===MediaPlayer.rules.SwitchRequest.prototype.DEFAULT?"Default":k.priority===MediaPlayer.rules.SwitchRequest.prototype.STRONG?"Strong":"Weak"),b(k)}}},MediaPlayer.rules.BufferOccupancyRule.prototype={constructor:MediaPlayer.rules.BufferOccupancyRule},MediaPlayer.rules.DownloadRatioRule=function(){"use strict";var a=1,b=[],c=20,d=3,e=1.4,f=function(a,b,c){return a.getTrackForQuality(b).bandwidth/a.getTrackForQuality(c).bandwidth},g=function(a){var d=0,e=b.length;if(a=a>e?e:a,e>0){for(var f=e-a,g=0,h=f;e>h;h++)g+=b[h];d=g/a}return b.length>c&&b.shift(),d};return{debug:void 0,metricsExt:void 0,metricsModel:void 0,execute:function(a,c){var h,i,j,k,l,m,n,o=this,p=a.getMediaInfo(),q=p.type,r=a.getCurrentValue(),s=a.getStreamProcessor(),t=s.isDynamic(),u=o.metricsModel.getReadOnlyMetricsFor(q),v=o.metricsExt.getCurrentHttpRequest(u),w=u.BufferLevel[u.BufferLevel.length-1]||null,x=null;if(!u||null===v||null===v.mediaduration||void 0===v.mediaduration||v.mediaduration<=0||isNaN(v.mediaduration))return void c(new MediaPlayer.rules.SwitchRequest);if(i=(v.tfinish.getTime()-v.trequest.getTime())/1e3,h=(v.tfinish.getTime()-v.tresponse.getTime())/1e3,0>=i)return void c(new MediaPlayer.rules.SwitchRequest);if(l=v.mediaduration/i,k=v.mediaduration/h,1/0!==k&&b.push(k),j=g(d),isNaN(j)||isNaN(k)||isNaN(l))return void c(new MediaPlayer.rules.SwitchRequest);if(1>j){if(r>0)for(n=r-1;n>0;n--)if(m=f.call(o,s,n,r),j>m*e){x=new MediaPlayer.rules.SwitchRequest(n,MediaPlayer.rules.SwitchRequest.prototype.STRONG);break}}else if(null!==w&&w.level>=w.target||t&&null!==w&&w.level>=MediaPlayer.dependencies.BufferController.DEFAULT_STARTUP_BUFFER_TIME){var y=p.trackCount-1;if(y>r)for(n=y;n>0;n--)if(m=f.call(o,s,n,r),j>m){r!==n&&(x=new MediaPlayer.rules.SwitchRequest(n,MediaPlayer.rules.SwitchRequest.prototype.DEFAULT));break}}null===x&&(x=new MediaPlayer.rules.SwitchRequest(MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE,MediaPlayer.rules.SwitchRequest.prototype.DEFAULT)),x.value!==MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE&&o.debug.log("DownloadRatioRule requesting switch to index: ",x.value,"type: ",q," priority: ",x.priority===MediaPlayer.rules.SwitchRequest.prototype.DEFAULT?"default":x.priority===MediaPlayer.rules.SwitchRequest.prototype.STRONG?"strong":"weak"),c(x)},reset:function(){a=1,b=[]}}},MediaPlayer.rules.DownloadRatioRule.prototype={constructor:MediaPlayer.rules.DownloadRatioRule},MediaPlayer.rules.InsufficientBufferRule=function(){"use strict";var a={},b=function(b,c){a[b]=a[b]||{},a[b].state=c,c===MediaPlayer.dependencies.BufferController.BUFFER_LOADED&&(a[b].stepDownFactor=1,a[b].lastDryBufferHitRecorded=!1)};return{debug:void 0,metricsModel:void 0,execute:function(c,d){var e,f,g=this,h=c.getMediaInfo().type,i=c.getCurrentValue(),j=c.getMediaInfo(),k=g.metricsModel.getReadOnlyMetricsFor(h),l=c.getStreamInfo(),m=l.duration,n=c.getStreamProcessor().getPlaybackController().getTime(),o=c.getStreamProcessor(),p=o.isDynamic(),q=new MediaPlayer.rules.SwitchRequest(MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE,MediaPlayer.rules.SwitchRequest.prototype.WEAK),r=k.BufferLevel.length>0?k.BufferLevel[k.BufferLevel.length-1]:null,s=k.BufferState.length>0?k.BufferState[k.BufferState.length-1]:null;return 1===j.trackCount||null===k.PlayList||void 0===k.PlayList||0===k.PlayList.length||null===s?void d(q):(e=k.PlayList[k.PlayList.length-1],null===e||void 0===e||0===e.trace.length?void d(q):(f=e.trace[Math.max(e.trace.length-2,0)],null===f||void 0===f?void d(q):(b(h,s.state),null===f.stopreason||f.stopreason!==MediaPlayer.vo.metrics.PlayList.Trace.REBUFFERING_REASON||a[h].lastDryBufferHitRecorded?!p&&a[h].state===MediaPlayer.dependencies.BufferController.BUFFER_LOADED&&f.stopreason!==MediaPlayer.vo.metrics.PlayList.Trace.REBUFFERING_REASON&&null!==r&&r.level<2*MediaPlayer.dependencies.BufferController.LOW_BUFFER_THRESHOLD&&r.level>MediaPlayer.dependencies.BufferController.LOW_BUFFER_THRESHOLD&&n<m-2*MediaPlayer.dependencies.BufferController.LOW_BUFFER_THRESHOLD&&(q=new MediaPlayer.rules.SwitchRequest(Math.max(i-a[h].stepDownFactor,0),MediaPlayer.rules.SwitchRequest.prototype.STRONG),a[h].stepDownFactor++):(a[h].lastDryBufferHitRecorded=!0,q=new MediaPlayer.rules.SwitchRequest(0,MediaPlayer.rules.SwitchRequest.prototype.STRONG)),q.value!==MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE&&g.debug.log("InsufficientBufferRule requesting switch to index: ",q.value,"type: ",h," Priority: ",q.priority===MediaPlayer.rules.SwitchRequest.prototype.DEFAULT?"Default":q.priority===MediaPlayer.rules.SwitchRequest.prototype.STRONG?"Strong":"Weak"),void d(q))))},reset:function(){a={}}}},MediaPlayer.rules.InsufficientBufferRule.prototype={constructor:MediaPlayer.rules.InsufficientBufferRule},MediaPlayer.rules.LimitSwitchesRule=function(){"use strict";var a=0,b=2e3;return{debug:void 0,metricsModel:void 0,execute:function(c,d){var e,f=c.getCurrentValue(),g=(new Date).getTime();return e=g-a,b>e?void d(new MediaPlayer.rules.SwitchRequest(f,MediaPlayer.rules.SwitchRequest.prototype.DEFAULT)):(a=g,void d(new MediaPlayer.rules.SwitchRequest(MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE,MediaPlayer.rules.SwitchRequest.prototype.WEAK)))}}},MediaPlayer.rules.LimitSwitchesRule.prototype={constructor:MediaPlayer.rules.LimitSwitchesRule},MediaPlayer.rules.ThroughputRule=function(){"use strict";var a=[],b=2,c=3,d=function(b,c){a[b]=a[b]||[],1/0!==c&&c!==a[b][a[b].length-1]&&a[b].push(c)},e=function(d,e){var f=0,g=e?b:c,h=a[d],i=h.length;if(g=g>i?i:g,i>0){for(var j=i-g,k=0,l=j;i>l;l++)k+=h[l];f=k/g}return h.length>g&&h.shift(),f};return{debug:void 0,metricsExt:void 0,metricsModel:void 0,manifestExt:void 0,manifestModel:void 0,execute:function(a,b){var c,f,g,h=this,i=a.getMediaInfo(),j=i.type,k=this.manifestModel.getValue(),l=h.metricsModel.getReadOnlyMetricsFor(j),m=a.getStreamProcessor().isDynamic(),n=h.metricsExt.getCurrentHttpRequest(l),o=l.BufferState.length>0?l.BufferState[l.BufferState.length-1]:null,p=l.BufferLevel.length>0?l.BufferLevel[l.BufferLevel.length-1]:null,q=new MediaPlayer.rules.SwitchRequest(MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE,MediaPlayer.rules.SwitchRequest.prototype.WEAK);if(!l||null===n||n.type!==MediaPlayer.vo.metrics.HTTPRequest.MEDIA_SEGMENT_TYPE||null===o||null===p)return void b(new MediaPlayer.rules.SwitchRequest);c=(n.tfinish.getTime()-n.tresponse.getTime())/1e3,g=Math.round(8*n.trace[n.trace.length-1].b/c),d(j,g),f=Math.round(e(j,m));var r=this.manifestExt.getAdaptationForType(k,0,j),s=i.trackCount-1;if(o.state===MediaPlayer.dependencies.BufferController.BUFFER_LOADED&&(p.level>=2*MediaPlayer.dependencies.BufferController.LOW_BUFFER_THRESHOLD||m))for(var t=s;t>0;t--){var u=this.manifestExt.getRepresentationFor(t,r).bandwidth;if(f>=u){var v=MediaPlayer.rules.SwitchRequest.prototype.DEFAULT;q=new MediaPlayer.rules.SwitchRequest(t,v);break}}q.value!==MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE&&h.debug.log("ThroughputRule requesting switch to index: ",q.value,"type: ",j," Priority: ",q.priority===MediaPlayer.rules.SwitchRequest.prototype.DEFAULT?"Default":q.priority===MediaPlayer.rules.SwitchRequest.prototype.STRONG?"Strong":"Weak","Average throughput",Math.round(f/1024),"kbps"),b(q)},reset:function(){a=[]}}},MediaPlayer.rules.ThroughputRule.prototype={constructor:MediaPlayer.rules.ThroughputRule},MediaPlayer.rules.RulesContext=function(a,b){"use strict";var c=a.getCurrentTrack(),d=a;return{getStreamInfo:function(){return c.mediaInfo.streamInfo},getMediaInfo:function(){return c.mediaInfo},getTrackInfo:function(){return c},getCurrentValue:function(){return b},getManifestInfo:function(){return c.mediaInfo.streamInfo.manifestInfo},getStreamProcessor:function(){return d}}},MediaPlayer.rules.RulesContext.prototype={constructor:MediaPlayer.rules.RulesContext},MediaPlayer.rules.RulesController=function(){"use strict";var a={},b=["execute"],c=function(a){return a===this.SCHEDULING_RULE||a===this.ABR_RULE},d=function(a){var c=b.length,d=0;for(d;c>d;d+=1)if(!a.hasOwnProperty(b[d]))return!1;return!0},e=function(a,b){return new MediaPlayer.rules.RulesContext(a,b)},f=function(a){var b=a.execute.bind(a);return a.execute=function(c,d){var e=function(b){d.call(a,new MediaPlayer.rules.SwitchRequest(b.value,b.priority))};b(c,e)},"function"!=typeof a.reset&&(a.reset=function(){}),a},g=function(a,b,c){var e,g,h,i,j,k;for(g in b)if(i=b[g],j=i.length)for(k=0;j>k;k+=1)e=i[k],d.call(this,e)&&(e=f.call(this,e),h=a.getRules(g),c&&(c=!1,h.length=0),this.system.injectInto(e),h.push(e))};return{system:void 0,debug:void 0,SCHEDULING_RULE:0,ABR_RULE:1,SYNC_RULE:2,initialize:function(){a[this.ABR_RULE]=this.system.getObject("abrRulesCollection"),a[this.SCHEDULING_RULE]=this.system.getObject("scheduleRulesCollection"),a[this.SYNC_RULE]=this.system.getObject("synchronizationRulesCollection")},setRules:function(b,d){c.call(this,b)&&d&&g.call(this,a[b],d,!0)},addRules:function(b,d){c.call(this,b)&&d&&g.call(this,a[b],d,!1)},applyRules:function(a,b,c,f,g){var h,i,j=a.length,k=j,l={},m=e.call(this,b,f),n=function(a){var b,d;a.value!==MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE&&(l[a.priority]=g(l[a.priority],a.value)),--j||(l[MediaPlayer.rules.SwitchRequest.prototype.WEAK]!==MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE&&(d=MediaPlayer.rules.SwitchRequest.prototype.WEAK,b=l[MediaPlayer.rules.SwitchRequest.prototype.WEAK]),l[MediaPlayer.rules.SwitchRequest.prototype.DEFAULT]!==MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE&&(d=MediaPlayer.rules.SwitchRequest.prototype.DEFAULT,b=l[MediaPlayer.rules.SwitchRequest.prototype.DEFAULT]),l[MediaPlayer.rules.SwitchRequest.prototype.STRONG]!==MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE&&(d=MediaPlayer.rules.SwitchRequest.prototype.STRONG,b=l[MediaPlayer.rules.SwitchRequest.prototype.STRONG]),d!=MediaPlayer.rules.SwitchRequest.prototype.STRONG&&d!=MediaPlayer.rules.SwitchRequest.prototype.WEAK&&(d=MediaPlayer.rules.SwitchRequest.prototype.DEFAULT),c({value:void 0!==b?b:f,confidence:d}))};for(l[MediaPlayer.rules.SwitchRequest.prototype.STRONG]=MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE,l[MediaPlayer.rules.SwitchRequest.prototype.WEAK]=MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE,l[MediaPlayer.rules.SwitchRequest.prototype.DEFAULT]=MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE,i=0;k>i;i+=1)h=a[i],d.call(this,h)?h.execute(m,n):j--},reset:function(){var b,c,d=a[this.ABR_RULE],e=a[this.SCHEDULING_RULE],f=a[this.SYNC_RULE],g=(d.getRules(MediaPlayer.rules.ABRRulesCollection.prototype.QUALITY_SWITCH_RULES)||[]).concat(e.getRules(MediaPlayer.rules.ScheduleRulesCollection.prototype.NEXT_FRAGMENT_RULES)||[]).concat(e.getRules(MediaPlayer.rules.ScheduleRulesCollection.prototype.FRAGMENTS_TO_SCHEDULE_RULES)||[]).concat(e.getRules(MediaPlayer.rules.ScheduleRulesCollection.prototype.FRAGMENTS_TO_EXECUTE_RULES)||[]).concat(f.getRules(MediaPlayer.rules.SynchronizationRulesCollection.prototype.TIME_SYNCHRONIZED_RULES)||[]).concat(f.getRules(MediaPlayer.rules.SynchronizationRulesCollection.prototype.BEST_GUESS_RULES)||[]),h=g.length;for(c=0;h>c;c+=1)b=g[c],"function"==typeof b.reset&&b.reset();a={}}}},MediaPlayer.rules.RulesController.prototype={constructor:MediaPlayer.rules.RulesController},MediaPlayer.rules.BufferLevelRule=function(){"use strict";var a={},b={},c={},d=function(a){var b=this.metricsExt.getCurrentHttpRequest(a);return null!==b?(b.tresponse.getTime()-b.trequest.getTime())/1e3:0},e=function(a,b){var c;return c=isNaN(b)||MediaPlayer.dependencies.BufferController.DEFAULT_MIN_BUFFER_TIME<b&&b>a?Math.max(MediaPlayer.dependencies.BufferController.DEFAULT_MIN_BUFFER_TIME,a):a>=b?Math.min(b,MediaPlayer.dependencies.BufferController.DEFAULT_MIN_BUFFER_TIME):Math.min(b,a)},f=function(a,b,c){var f=this,g=c.bufferController.getCriticalBufferLevel(),h=f.metricsModel.getReadOnlyMetricsFor("video"),i=f.metricsModel.getReadOnlyMetricsFor("audio"),j=e.call(this,c.bufferController.getMinBufferTime(),b),k=j,l=c.bufferController.bufferMax,m=0;return l===MediaPlayer.dependencies.BufferController.BUFFER_SIZE_MIN?m=j:l===MediaPlayer.dependencies.BufferController.BUFFER_SIZE_INFINITY?m=b:l===MediaPlayer.dependencies.BufferController.BUFFER_SIZE_REQUIRED&&(!a&&f.abrController.isPlayingAtTopQuality(c.streamProcessor.getStreamInfo())&&(k=MediaPlayer.dependencies.BufferController.BUFFER_TIME_AT_TOP_QUALITY),m=k+Math.max(d.call(f,h),d.call(f,i))),m=Math.min(m,g)},g=function(a,c){return b[a]&&b[a][c]},h=function(b,c){return a[b]&&a[b][c]},i=function(a){var c=a.data.fragmentModel.getContext().streamProcessor.getStreamInfo().id;b[c]=b[c]||{},b[c][a.data.request.mediaType]=!0},j=function(b){var c=b.sender.streamProcessor.getStreamInfo().id;a[c]=a[c]||{},a[c][b.sender.streamProcessor.getType()]=!0},k=function(b){var c=b.sender.streamProcessor.getStreamInfo().id;a[c]=a[c]||{},a[c][b.sender.streamProcessor.getType()]=!1};return{metricsExt:void 0,metricsModel:void 0,abrController:void 0,setup:function(){this[MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_OUTRUN]=j,this[MediaPlayer.dependencies.BufferController.eventList.ENAME_BUFFER_LEVEL_BALANCED]=k,this[MediaPlayer.dependencies.FragmentController.eventList.ENAME_STREAM_COMPLETED]=i},setScheduleController:function(a){var b=a.streamProcessor.getStreamInfo().id;c[b]=c[b]||{},c[b][a.streamProcessor.getType()]=a},execute:function(a,b){var d=a.getStreamInfo(),e=d.id,i=a.getMediaInfo().type;if(h(e,i))return void b(new MediaPlayer.rules.SwitchRequest(0,MediaPlayer.rules.SwitchRequest.prototype.STRONG));var j,k=this.metricsModel.getReadOnlyMetricsFor(i),l=this.metricsExt.getCurrentBufferLevel(k)?this.metricsExt.getCurrentBufferLevel(k).level:0,m=c[e][i],n=m.streamProcessor.getCurrentTrack(),o=m.streamProcessor.isDynamic(),p=this.metricsExt.getCurrentPlaybackRate(k),q=d.duration,r=l/Math.max(p,1),s=n.fragmentDuration,t=m.playbackController.getTime(),u=o?Number.POSITIVE_INFINITY:q-t,v=Math.min(f.call(this,o,q,m),u),w=Math.max(v-r,0);j=Math.ceil(w/s),r>=u&&!g(e,i)&&(j=j||1),b(new MediaPlayer.rules.SwitchRequest(j,MediaPlayer.rules.SwitchRequest.prototype.DEFAULT))},reset:function(){a={},b={},c={}}}},MediaPlayer.rules.BufferLevelRule.prototype={constructor:MediaPlayer.rules.BufferLevelRule},MediaPlayer.rules.PendingRequestsRule=function(){"use strict";var a=3,b={};return{metricsExt:void 0,setScheduleController:function(a){var c=a.streamProcessor.getStreamInfo().id;b[c]=b[c]||{},b[c][a.streamProcessor.getType()]=a},execute:function(c,d){var e=c.getMediaInfo().type,f=c.getStreamInfo().id,g=c.getCurrentValue(),h=b[f][e],i=h.getFragmentModel(),j=i.getPendingRequests(),k=i.getLoadingRequests(),l=i.getRejectedRequests(),m=l.length,n=j.length+k.length,o=Math.max(g-n,0);return m>0?void d(new MediaPlayer.rules.SwitchRequest(m,MediaPlayer.rules.SwitchRequest.prototype.DEFAULT)):n>a?void d(new MediaPlayer.rules.SwitchRequest(0,MediaPlayer.rules.SwitchRequest.prototype.DEFAULT)):0===g?void d(new MediaPlayer.rules.SwitchRequest(o,MediaPlayer.rules.SwitchRequest.prototype.NO_CHANGE)):void d(new MediaPlayer.rules.SwitchRequest(o,MediaPlayer.rules.SwitchRequest.prototype.DEFAULT))},reset:function(){b={}}}},MediaPlayer.rules.PendingRequestsRule.prototype={constructor:MediaPlayer.rules.PendingRequestsRule},MediaPlayer.rules.PlaybackTimeRule=function(){"use strict";var a={},b={},c=function(b){var c=b.sender.getStreamId(),d=b.data.seekTime;a[c]=a[c]||{},a[c].audio=d,a[c].video=d};return{adapter:void 0,sourceBufferExt:void 0,setup:function(){this[MediaPlayer.dependencies.PlaybackController.eventList.ENAME_PLAYBACK_SEEKING]=c},setScheduleController:function(a){var c=a.streamProcessor.getStreamInfo().id;b[c]=b[c]||{},b[c][a.streamProcessor.getType()]=a},execute:function(c,d){var e,f,g,h=c.getMediaInfo().type,i=c.getStreamInfo().id,j=b[i][h],k=.1,l=b[i][h].streamProcessor,m=l.getCurrentTrack(),n=a[i]?a[i][h]:null,o=void 0!==n&&null!==n,p=o?MediaPlayer.rules.SwitchRequest.prototype.STRONG:MediaPlayer.rules.SwitchRequest.prototype.DEFAULT,q=j.getFragmentModel().getRejectedRequests().shift(),r=!!q&&!o,s=this.adapter.getIndexHandlerTime(l),t=l.playbackController.getTime(),u=q?q.startTime+q.duration:null,v=!o&&q&&(u>t&&q.startTime<=s||isNaN(s));if(f=o?n:v?q.startTime:s,isNaN(f))return void d(new MediaPlayer.rules.SwitchRequest(null,p));for(a[i]&&(a[i][h]=null),e=this.sourceBufferExt.getBufferRange(l.bufferController.getBuffer(),f),null!==e&&(f=e.end),g=this.adapter.getFragmentRequestForTime(l,m,f,{keepIdx:r}),v&&g&&g.index!==q.index&&(g=this.adapter.getFragmentRequestForTime(l,m,q.startTime+q.duration/2+k,{keepIdx:r}));g&&l.fragmentController.isFragmentLoadedOrPending(j,g);){if("complete"===g.action){g=null,this.adapter.setIndexHandlerTime(l,0/0);break}g=this.adapter.getNextFragmentRequest(l,m)}g&&!v&&this.adapter.setIndexHandlerTime(l,g.startTime+g.duration),d(new MediaPlayer.rules.SwitchRequest(g,p))},reset:function(){a={},b={}}}},MediaPlayer.rules.PlaybackTimeRule.prototype={constructor:MediaPlayer.rules.PlaybackTimeRule},MediaPlayer.rules.SameTimeRequestRule=function(){"use strict";var a=4,b=function(a,b){var c,e,f,g,h,i=0,j=a.length;for(i;j>i;i+=1)for(f=a[i].getPendingRequests(),d.call(this,f,"index"),g=0,h=f.length;h>g;g++){if(c=f[g],isNaN(c.startTime)&&"complete"!==c.action){e=c;break}c.startTime>b&&(!e||c.startTime<e.startTime)&&(e=c)}return e||c},c=function(a,b){var c,d,e=a.length,f=null;for(d=0;e>d;d+=1)c=a[d].getPendingRequestForTime(b),c&&(!f||c.startTime>f.startTime)&&(f=c);return f},d=function(a,b){var c=function(a,c){return a[b]<c[b]||isNaN(a[b])&&"complete"!==a.action?-1:a[b]>c[b]?1:0};a.sort(c)};return{setFragmentModels:function(a,b){this.fragmentModels=this.fragmentModels||{},this.fragmentModels[b]=a},execute:function(d,e){var f,g,h,i,j,k,l,m,n,o=d.getStreamInfo().id,p=d.getCurrentValue(),q=MediaPlayer.rules.SwitchRequest.prototype.DEFAULT,r=this.fragmentModels[o],s=new Date,t=null,u=r?r.length:null,v=!1,w=[];if(!r||!u)return void e(new MediaPlayer.rules.SwitchRequest([],q));if(k=r[0].getContext().playbackController.getTime(),l=c(r,k),j=l||b(r,k)||p,!j)return void e(new MediaPlayer.rules.SwitchRequest([],q));for(i=0;u>i;i+=1)if(g=r[i],f=g.getContext().streamProcessor.getType(),("video"===f||"audio"===f)&&(m=g.getPendingRequests(),n=g.getLoadingRequests().length,!g.getIsPostponed()||isNaN(j.startTime))){if(n>a)return void e(new MediaPlayer.rules.SwitchRequest([],q));if(t=t||(j===l?k:j.startTime),-1===m.indexOf(j)){if(h=g.getPendingRequestForTime(t),h||0!==j.index||(h=m.filter(function(a){return a.index===j.index})[0]),h)w.push(h);else if(h=g.getLoadingRequestForTime(t)||g.getExecutedRequestForTime(t),!h){v=!0;break}}else w.push(j)}return w=w.filter(function(a){return"complete"===a.action||s.getTime()>=a.availabilityStartTime.getTime()}),v?void e(new MediaPlayer.rules.SwitchRequest([],q)):void e(new MediaPlayer.rules.SwitchRequest(w,q))}}},MediaPlayer.rules.SameTimeRequestRule.prototype={constructor:MediaPlayer.rules.SameTimeRequestRule},MediaPlayer.rules.ScheduleRulesCollection=function(){"use strict";var a=[],b=[],c=[];return{bufferLevelRule:void 0,pendingRequestsRule:void 0,playbackTimeRule:void 0,sameTimeRequestRule:void 0,getRules:function(d){switch(d){case MediaPlayer.rules.ScheduleRulesCollection.prototype.FRAGMENTS_TO_SCHEDULE_RULES:return a;case MediaPlayer.rules.ScheduleRulesCollection.prototype.NEXT_FRAGMENT_RULES:return c;case MediaPlayer.rules.ScheduleRulesCollection.prototype.FRAGMENTS_TO_EXECUTE_RULES:return b;default:return null
21
+ }},setup:function(){a.push(this.bufferLevelRule),a.push(this.pendingRequestsRule),c.push(this.playbackTimeRule),b.push(this.sameTimeRequestRule)}}},MediaPlayer.rules.ScheduleRulesCollection.prototype={constructor:MediaPlayer.rules.ScheduleRulesCollection,FRAGMENTS_TO_SCHEDULE_RULES:"fragmentsToScheduleRules",NEXT_FRAGMENT_RULES:"nextFragmentRules",FRAGMENTS_TO_EXECUTE_RULES:"fragmentsToExecuteRules"},MediaPlayer.rules.SwitchRequest=function(a,b){"use strict";this.value=a,this.priority=b,void 0===this.value&&(this.value=999),void 0===this.priority&&(this.priority=.5)},MediaPlayer.rules.SwitchRequest.prototype={constructor:MediaPlayer.rules.SwitchRequest,NO_CHANGE:999,DEFAULT:.5,STRONG:1,WEAK:0},MediaPlayer.rules.LiveEdgeBinarySearchRule=function(){"use strict";var a,b,c,d=43200,e=0/0,f=null,g=0/0,h=null,i=!1,j=0/0,k=MediaPlayer.rules.SwitchRequest.prototype.DEFAULT,l=function(a,d,e,f){var g,i=this;if(null===f)g=i.adapter.generateFragmentRequestForTime(c,h,a),l.call(i,a,d,e,g);else{var j=function(c){b.unsubscribe(MediaPlayer.dependencies.FragmentLoader.eventList.ENAME_CHECK_FOR_EXISTENCE_COMPLETED,i,j),c.data.exists?d.call(i,c.data.request,a):e.call(i,c.data.request,a)};b.subscribe(MediaPlayer.dependencies.FragmentLoader.eventList.ENAME_CHECK_FOR_EXISTENCE_COMPLETED,i,j),b.checkForExistence(f)}},m=function(b,d){var j,p,q;return i?void o.call(this,!1,d):(q=d-e,j=q>0?e-q:e+Math.abs(q)+g,void(j<f.start&&j>f.end?a(new MediaPlayer.rules.SwitchRequest(null,k)):(p=this.adapter.getFragmentRequestForTime(c,h,j),l.call(this,j,n,m,p))))},n=function(b,d){var m,n,p=b.startTime,q=this;if(!i){if(!h.fragmentDuration)return void a(new MediaPlayer.rules.SwitchRequest(p,k));if(i=!0,f.end=p+2*g,d===e)return n=d+j,m=q.adapter.getFragmentRequestForTime(c,h,n),void l.call(q,n,function(){o.call(q,!0,n)},function(){a(new MediaPlayer.rules.SwitchRequest(n,k))},m)}o.call(this,!0,d)},o=function(b,d){var e,g,i;b?f.start=d:f.end=d,e=Math.floor(f.end-f.start)<=j,e?a(new MediaPlayer.rules.SwitchRequest(b?d:d-j,k)):(i=(f.start+f.end)/2,g=this.adapter.getFragmentRequestForTime(c,h,i),l.call(this,i,n,m,g))};return{metricsExt:void 0,adapter:void 0,timelineConverter:void 0,execute:function(i,o){var p,q,r=this;if(a=o,c=i.getStreamProcessor(),b=c.getFragmentLoader(),h=i.getTrackInfo(),j=h.fragmentDuration,q=h.DVRWindow,e=q.end,h.useCalculatedLiveEdgeTime){var s=r.timelineConverter.getExpectedLiveEdge();return r.timelineConverter.setExpectedLiveEdge(e),void a(new MediaPlayer.rules.SwitchRequest(s,k))}f={start:Math.max(0,e-d),end:e+d},g=Math.floor((q.end-q.start)/2),p=r.adapter.getFragmentRequestForTime(c,h,e),l.call(r,e,n,m,p)},reset:function(){e=0/0,f=null,g=0/0,h=null,i=!1,j=0/0,c=null,b=null}}},MediaPlayer.rules.LiveEdgeBinarySearchRule.prototype={constructor:MediaPlayer.rules.LiveEdgeBinarySearchRule},MediaPlayer.rules.LiveEdgeWithTimeSynchronizationRule=function(){"use strict";return{execute:function(a,b){b(new MediaPlayer.rules.SwitchRequest(a.getTrackInfo().DVRWindow.end,MediaPlayer.rules.SwitchRequest.prototype.DEFAULT))}}},MediaPlayer.rules.LiveEdgeWithTimeSynchronizationRule.prototype={constructor:MediaPlayer.rules.LiveEdgeWithTimeSynchronizationRule},MediaPlayer.rules.SynchronizationRulesCollection=function(){"use strict";var a=[],b=[];return{liveEdgeBinarySearchRule:void 0,liveEdgeWithTimeSynchronizationRule:void 0,getRules:function(c){switch(c){case MediaPlayer.rules.SynchronizationRulesCollection.prototype.TIME_SYNCHRONIZED_RULES:return a;case MediaPlayer.rules.SynchronizationRulesCollection.prototype.BEST_GUESS_RULES:return b;default:return null}},setup:function(){a.push(this.liveEdgeWithTimeSynchronizationRule),b.push(this.liveEdgeBinarySearchRule)}}},MediaPlayer.rules.SynchronizationRulesCollection.prototype={constructor:MediaPlayer.rules.SynchronizationRulesCollection,TIME_SYNCHRONIZED_RULES:"withAccurateTimeSourceRules",BEST_GUESS_RULES:"bestGuestRules"},MediaPlayer.utils.Capabilities=function(){"use strict"},MediaPlayer.utils.Capabilities.prototype={constructor:MediaPlayer.utils.Capabilities,system:void 0,debug:void 0,supportsMediaSource:function(){"use strict";var a="WebKitMediaSource"in window,b="MediaSource"in window;return a||b},supportsEncryptedMedia:function(){return this.system.hasMapping("protectionModel")},supportsCodec:function(a,b){"use strict";if(!(a instanceof HTMLMediaElement))throw"element must be of type HTMLMediaElement.";var c=a.canPlayType(b);return"probably"===c||"maybe"===c}},MediaPlayer.utils.Debug=function(){"use strict";var a=!0,b=!1,c=(new Date).getTime();return{eventBus:void 0,setLogTimestampVisible:function(a){b=a},setLogToBrowserConsole:function(b){a=b},getLogToBrowserConsole:function(){return a},log:function(){var d=null,e=null;b&&(d=(new Date).getTime(),e="["+(d-c)+"] ");var f=arguments[0];arguments.length>1&&(f="",Array.apply(null,arguments).forEach(function(a){f+=" "+a})),a&&console.log((b?e:"")+f),this.eventBus.dispatchEvent({type:"log",message:f})}}},MediaPlayer.utils.EventBus=function(){"use strict";var a,b=function(b,c){var d=(c?"1":"0")+b;return d in a||(a[d]=[]),a[d]},c=function(){a={}};return c(),{addEventListener:function(a,c,d){var e=b(a,d),f=e.indexOf(c);-1===f&&e.push(c)},removeEventListener:function(a,c,d){var e=b(a,d),f=e.indexOf(c);-1!==f&&e.splice(f,1)},dispatchEvent:function(a){for(var c=b(a.type,!1).slice(),d=0;d<c.length;d++)c[d].call(this,a);return!a.defaultPrevented}}},MediaPlayer.vo.Error=function(a,b,c){"use strict";this.code=a||null,this.message=b||null,this.data=c||null},MediaPlayer.vo.Error.prototype={constructor:MediaPlayer.vo.Error},MediaPlayer.vo.Event=function(){"use strict";this.type=null,this.sender=null,this.data=null,this.error=null,this.timestamp=0/0},MediaPlayer.vo.Event.prototype={constructor:MediaPlayer.vo.Event},MediaPlayer.vo.FragmentRequest=function(){"use strict";this.action="download",this.startTime=0/0,this.mediaType=null,this.type=null,this.duration=0/0,this.timescale=0/0,this.range=null,this.url=null,this.requestStartDate=null,this.firstByteDate=null,this.requestEndDate=null,this.quality=0/0,this.index=0/0,this.availabilityStartTime=null,this.availabilityEndTime=null,this.wallStartTime=null},MediaPlayer.vo.FragmentRequest.prototype={constructor:MediaPlayer.vo.FragmentRequest,ACTION_DOWNLOAD:"download",ACTION_COMPLETE:"complete"},MediaPlayer.vo.ManifestInfo=function(){"use strict";this.DVRWindowSize=0/0,this.loadedTime=null,this.availableFrom=null,this.minBufferTime=0/0,this.duration=0/0,this.isDynamic=!1,this.maxFragmentDuration=null},MediaPlayer.vo.ManifestInfo.prototype={constructor:MediaPlayer.vo.ManifestInfo},MediaPlayer.vo.MediaInfo=function(){"use strict";this.id=null,this.index=null,this.type=null,this.streamInfo=null,this.trackCount=0,this.lang=null,this.codec=null,this.mimeType=null,this.contentProtection=null,this.isText=!1,this.KID=null},MediaPlayer.vo.MediaInfo.prototype={constructor:MediaPlayer.vo.MediaInfo},MediaPlayer.models.MetricsList=function(){"use strict";return{TcpList:[],HttpList:[],RepSwitchList:[],BufferLevel:[],BufferState:[],PlayList:[],DroppedFrames:[],SchedulingInfo:[],DVRInfo:[],ManifestUpdate:[]}},MediaPlayer.models.MetricsList.prototype={constructor:MediaPlayer.models.MetricsList},MediaPlayer.vo.StreamInfo=function(){"use strict";this.id=null,this.index=null,this.start=0/0,this.duration=0/0,this.manifestInfo=null,this.isLast=!0},MediaPlayer.vo.StreamInfo.prototype={constructor:MediaPlayer.vo.StreamInfo},MediaPlayer.vo.TrackInfo=function(){"use strict";this.id=null,this.quality=null,this.DVRWindow=null,this.fragmentDuration=null,this.mediaInfo=null,this.MSETimeOffset=null},MediaPlayer.vo.TrackInfo.prototype={constructor:MediaPlayer.vo.TrackInfo},MediaPlayer.vo.URIFragmentData=function(){"use strict";this.t=null,this.xywh=null,this.track=null,this.id=null,this.s=null},MediaPlayer.vo.URIFragmentData.prototype={constructor:MediaPlayer.vo.URIFragmentData},MediaPlayer.vo.metrics.BufferLevel=function(){"use strict";this.t=null,this.level=null},MediaPlayer.vo.metrics.BufferLevel.prototype={constructor:MediaPlayer.vo.metrics.BufferLevel},MediaPlayer.vo.metrics.BufferState=function(){"use strict";this.target=null,this.state=MediaPlayer.dependencies.BufferController.BUFFER_EMPTY},MediaPlayer.vo.metrics.BufferState.prototype={constructor:MediaPlayer.vo.metrics.BufferState},MediaPlayer.vo.metrics.DVRInfo=function(){"use strict";this.time=null,this.range=null,this.manifestInfo=null},MediaPlayer.vo.metrics.DVRInfo.prototype={constructor:MediaPlayer.vo.metrics.DVRInfo},MediaPlayer.vo.metrics.DroppedFrames=function(){"use strict";this.time=null,this.droppedFrames=null},MediaPlayer.vo.metrics.DroppedFrames.prototype={constructor:MediaPlayer.vo.metrics.DroppedFrames},MediaPlayer.vo.metrics.HTTPRequest=function(){"use strict";this.stream=null,this.tcpid=null,this.type=null,this.url=null,this.actualurl=null,this.range=null,this.trequest=null,this.tresponse=null,this.tfinish=null,this.responsecode=null,this.interval=null,this.mediaduration=null,this.responseHeaders=null,this.trace=[]},MediaPlayer.vo.metrics.HTTPRequest.prototype={constructor:MediaPlayer.vo.metrics.HTTPRequest},MediaPlayer.vo.metrics.HTTPRequest.Trace=function(){"use strict";this.s=null,this.d=null,this.b=[]},MediaPlayer.vo.metrics.HTTPRequest.Trace.prototype={constructor:MediaPlayer.vo.metrics.HTTPRequest.Trace},MediaPlayer.vo.metrics.HTTPRequest.MEDIA_SEGMENT_TYPE="Media Segment",MediaPlayer.vo.metrics.HTTPRequest.MPD_TYPE="MPD",MediaPlayer.vo.metrics.ManifestUpdate=function(){"use strict";this.mediaType=null,this.type=null,this.requestTime=null,this.fetchTime=null,this.availabilityStartTime=null,this.presentationStartTime=0,this.clientTimeOffset=0,this.currentTime=null,this.buffered=null,this.latency=0,this.streamInfo=[],this.trackInfo=[]},MediaPlayer.vo.metrics.ManifestUpdate.StreamInfo=function(){"use strict";this.id=null,this.index=null,this.start=null,this.duration=null},MediaPlayer.vo.metrics.ManifestUpdate.TrackInfo=function(){"use strict";this.id=null,this.index=null,this.mediaType=null,this.streamIndex=null,this.presentationTimeOffset=null,this.startNumber=null,this.fragmentInfoType=null},MediaPlayer.vo.metrics.ManifestUpdate.prototype={constructor:MediaPlayer.vo.metrics.ManifestUpdate},MediaPlayer.vo.metrics.ManifestUpdate.StreamInfo.prototype={constructor:MediaPlayer.vo.metrics.ManifestUpdate.StreamInfo},MediaPlayer.vo.metrics.ManifestUpdate.TrackInfo.prototype={constructor:MediaPlayer.vo.metrics.ManifestUpdate.TrackInfo},MediaPlayer.vo.metrics.PlayList=function(){"use strict";this.stream=null,this.start=null,this.mstart=null,this.starttype=null,this.trace=[]},MediaPlayer.vo.metrics.PlayList.Trace=function(){"use strict";this.representationid=null,this.subreplevel=null,this.start=null,this.mstart=null,this.duration=null,this.playbackspeed=null,this.stopreason=null},MediaPlayer.vo.metrics.PlayList.prototype={constructor:MediaPlayer.vo.metrics.PlayList},MediaPlayer.vo.metrics.PlayList.INITIAL_PLAY_START_REASON="initial_start",MediaPlayer.vo.metrics.PlayList.SEEK_START_REASON="seek",MediaPlayer.vo.metrics.PlayList.Trace.prototype={constructor:MediaPlayer.vo.metrics.PlayList.Trace()},MediaPlayer.vo.metrics.PlayList.Trace.USER_REQUEST_STOP_REASON="user_request",MediaPlayer.vo.metrics.PlayList.Trace.REPRESENTATION_SWITCH_STOP_REASON="representation_switch",MediaPlayer.vo.metrics.PlayList.Trace.END_OF_CONTENT_STOP_REASON="end_of_content",MediaPlayer.vo.metrics.PlayList.Trace.REBUFFERING_REASON="rebuffering",MediaPlayer.vo.metrics.TrackSwitch=function(){"use strict";this.t=null,this.mt=null,this.to=null,this.lto=null},MediaPlayer.vo.metrics.TrackSwitch.prototype={constructor:MediaPlayer.vo.metrics.TrackSwitch},MediaPlayer.vo.metrics.SchedulingInfo=function(){"use strict";this.mediaType=null,this.t=null,this.type=null,this.startTime=null,this.availabilityStartTime=null,this.duration=null,this.quality=null,this.range=null,this.state=null},MediaPlayer.vo.metrics.SchedulingInfo.prototype={constructor:MediaPlayer.vo.metrics.SchedulingInfo},MediaPlayer.vo.metrics.SchedulingInfo.PENDING_STATE="pending",MediaPlayer.vo.metrics.SchedulingInfo.LOADING_STATE="loading",MediaPlayer.vo.metrics.SchedulingInfo.EXECUTED_STATE="executed",MediaPlayer.vo.metrics.SchedulingInfo.REJECTED_STATE="rejected",MediaPlayer.vo.metrics.SchedulingInfo.CANCELED_STATE="canceled",MediaPlayer.vo.metrics.SchedulingInfo.FAILED_STATE="failed",MediaPlayer.vo.metrics.TCPConnection=function(){"use strict";this.tcpid=null,this.dest=null,this.topen=null,this.tclose=null,this.tconnect=null},MediaPlayer.vo.metrics.TCPConnection.prototype={constructor:MediaPlayer.vo.metrics.TCPConnection},MediaPlayer.vo.protection.ClearKeyKeySet=function(a,b){if(b&&"persistent"!==b&&"temporary"!==b)throw new Error("Invalid ClearKey key set type! Must be one of 'persistent' or 'temporary'");this.keyPairs=a,this.type=b,this.toJWKString=function(){var a,b=this.keyPairs.length,c={};for(c.keys=[],a=0;b>a;a++){var d={kty:"oct",alg:"A128KW"};d.k=btoa(String.fromCharCode.apply(null,this.keyPairs[a].key)).replace(/=/g,""),d.kid=btoa(String.fromCharCode.apply(null,this.keyPairs[a].keyID)).replace(/=/g,""),c.keys.push(d)}return this.type&&(c.type=this.type),JSON.stringify(c)}},MediaPlayer.vo.protection.ClearKeyKeySet.prototype={constructor:MediaPlayer.vo.protection.ClearKeyKeySet},MediaPlayer.vo.protection.KeyError=function(a,b){"use strict";this.sessionToken=a,this.error=b},MediaPlayer.vo.protection.KeyError.prototype={constructor:MediaPlayer.vo.protection.KeyError},MediaPlayer.vo.protection.KeyMessage=function(a,b,c){"use strict";this.sessionToken=a,this.message=b,this.defaultURL=c},MediaPlayer.vo.protection.KeyMessage.prototype={constructor:MediaPlayer.vo.protection.KeyMessage},MediaPlayer.vo.protection.KeyPair=function(a,b){"use strict";if(!a||16!==a.length)throw new Error("Illegal key ID length! Must be 16 bytes (128 bits)");if(!b||16!==b.length)throw new Error("Illegal key length! Must be 16 bytes (128 bits)");this.keyID=a,this.key=b},MediaPlayer.vo.protection.KeyPair.prototype={constructor:MediaPlayer.vo.protection.KeyPair},MediaPlayer.vo.protection.LicenseRequestComplete=function(a,b){"use strict";this.message=a,this.requestData=b},MediaPlayer.vo.protection.LicenseRequestComplete.prototype={constructor:MediaPlayer.vo.protection.LicenseRequestComplete},MediaPlayer.vo.protection.NeedKey=function(a,b){this.initData=a,this.initDataType=b},MediaPlayer.vo.protection.NeedKey.prototype={constructor:MediaPlayer.vo.protection.NeedKey},MediaPlayer.vo.protection.ProtectionData=function(a,b,c){this.laURL=a,this.httpRequestHeaders=b,this.bearerToken=c},MediaPlayer.vo.protection.ProtectionData.prototype={constructor:MediaPlayer.vo.protection.ProtectionData},MediaPlayer.models.SessionToken=function(){"use strict"},MediaPlayer.models.SessionToken.prototype={sessionID:null,initData:null};
22
+
23
+
24
+
25
+
26
  /*
27
  FV Flowplayer additions!
28
  */
32
  flowplayer.conf.native_fullscreen = true;
33
  }
34
  }
35
+ if( typeof(fv_flowplayer_translations) != "undefined" ) {
36
+ flowplayer.defaults.errors = fv_flowplayer_translations;
37
+ }
38
 
39
  if( typeof(fv_flowplayer_admin_input) != "undefined" && fv_flowplayer_admin_input ) {
40
  jQuery(document).keyup(function(e) {
77
  var comment_text = jQuery('#wpfp_support_'+hash).val();
78
  var comment_words = comment_text.split(/\s/);
79
  if( comment_words.length == 0 || comment_text.match(/Enter your comment/) ) {
80
+ jQuery('#wpfp_support_'+hash).before('<p class="fv_flowplayer_submit_error" style="display:none; "><strong>'+fv_flowplayer_translations.what_is_wrong+'</strong></p>');
81
  jQuery('.fv_flowplayer_submit_error').fadeIn();
82
  return false;
83
  }
84
 
85
  if( comment_words.length < 7 ) {
86
+ jQuery('#wpfp_support_'+hash).before('<p class="fv_flowplayer_submit_error" style="display:none; "><strong>'+fv_flowplayer_translations.full_sentence+'</strong>:</p>');
87
  jQuery('.fv_flowplayer_submit_error').fadeIn();
88
  return false;
89
  }
228
  var fv_fp_date = new Date();
229
  if( error.code == 4 && fv_fp_date.getTime() > (fv_fp_utime + parseInt(time)) ) {
230
  jQuery(e.target).find('.fp-message').delay(500).queue( function(n) {
231
+ jQuery(this).html(fv_flowplayer_translations.video_expired); n();
232
  } );
233
  }
234
  } );
282
  flowplayer(function (api, root) {
283
  api.bind("error", function (e,api, error) {
284
  if( error.code == 10 ) {
285
+ jQuery(e.target).find('.fp-message').html(fv_flowplayer_translations.unsupported_format);
286
  }
287
  });
288
  });
333
  }
334
  } );
335
  if( fv_fp_mobile ) {
336
+ jQuery('#wpfp_'+id).after('<p class="fv-flowplayer-mobile-switch">'+fv_flowplayer_translations.mobile_browser_detected_1+'<a href="'+document.URL+'?fv_flowplayer_mobile=no">'+fv_flowplayer_translations.mobile_browser_detected_2+'</a>'+fv_flowplayer_translations.mobile_browser_detected_3+'</p>');
337
  }
338
  }
339
  }
389
  }
390
 
391
  if( typeof(flowplayer.conf.safety_resize) != "undefined" && flowplayer.conf.safety_resize ) {
392
+ jQuery(document).ready(function() { setTimeout( function() { fv_flowplayer_safety_resize(); }, 10 ); } );
393
  }
394
 
395
  jQuery(document).ready( function() {
430
 
431
  jQuery( function() { jQuery('.flowplayer').unbind('contextmenu'); } );
432
 
433
+ jQuery(document).ready( function() {
434
+ if( typeof(fv_flowplayer_playlists) != "undefined" ) for( var i in fv_flowplayer_playlists ) jQuery('#'+i).flowplayer( { playlist: fv_flowplayer_playlists[i] });
435
+ });
 
 
436
 
437
  var fv_fp_date = new Date();
438
  var fv_fp_utime = fv_fp_date.getTime();
487
 
488
 
489
  jQuery('.flowplayer').bind("ready", function (e, api, video) {
490
+ var root = e.currentTarget;
491
  setTimeout( function () {
492
+ jQuery('.fvp-share-bar',root).appendTo(jQuery('.fvp-share-bar',root).parent().find('.fp-ui'));
493
+ jQuery('.fvp-share-bar',root).show();
494
  }, 100 );
495
  });
496
 
601
  var player = jQuery(e.currentTarget);
602
  if( player.data('live') ){
603
  var live_check = setTimeout( function() {
604
+ player.find('.fp-ui').append('<div class="fp-message">'+fv_flowplayer_translations.live_stream_failed+'</div>');
605
  player.addClass('is-error');
606
  }, 10000 );
607
  jQuery(e.currentTarget).data('live_check', live_check);
611
  }).bind("error", function (e,api,data) {
612
  var player = jQuery(e.currentTarget);
613
  if( player.data('live') ){
614
+ player.find('.fp-message').html(fv_flowplayer_translations.live_stream_failed_2);
615
  }
616
  });
617
  });
624
  }, 1000 );
625
  });
626
  });
627
+ }
628
+
629
+ jQuery('.flowplayer').on('ready', function(e,api) {
630
+ if( /BB10/.test(navigator.userAgent) ){
631
+ api.fullscreen();
632
+ }
633
+ });
634
+
635
+
636
+ /*
637
+ * Google Analytics improvements
638
+ */
639
+ var fv_ga_load = false;
640
+ jQuery('.flowplayer').each( function() {
641
+ if( jQuery(this).data('analytics') ){
642
+ fv_ga_load = true;
643
+ }
644
+ });
645
+ if ( fv_ga_load && typeof _gat == 'undefined') jQuery.getScript("//google-analytics.com/ga.js");
646
+
647
+ var fv_ga_events = [ 'start', 'first quartile', 'second quartile', 'third quartile', 'complete' ];
648
+
649
+ function fv_track(e,api,data) {
650
+ if( typeof(api) != "object" || typeof(api.conf) != "object" ) return;
651
+
652
+ if (typeof _gat != 'undefined') {
653
+ var id = api.conf.analytics,
654
+ video = api.video,
655
+ dur = video.duration,
656
+ root = jQuery(e.target),
657
+ i = 0;
658
+
659
+ if( !id ) return;
660
+
661
+ var tracker = _gat._getTracker(id);
662
+ if( typeof(tracker._setAllowLinker) == "undefined" ) {
663
+ return;
664
+ }
665
+
666
+ var name = root.data("fv_title");
667
+ if( !name ) name = root.attr("title");
668
+ if( !name && typeof(video.src) != "undefined" ) name = video.src.split("/").slice(-1)[0].replace(/\.(\w{3,4})(\?.*)?$/i, '');
669
+
670
+ if( dur ) {
671
+ if( data > 19 * dur/20 ) i = 4;
672
+ else if( data > 3 * dur/4 ) i = 3;
673
+ else if( data > dur/2 ) i = 2;
674
+ else if( data > dur/4 ) i = 1;
675
+ }
676
+
677
+ if( root.data('fv_track_'+fv_ga_events[i]) ) return;
678
+
679
+ for( var j in fv_ga_events ) { // make sure user triggered the previous quartiles before tracking
680
+ if(j == i) break;
681
+ if( !root.data('fv_track_'+fv_ga_events[j]) ) return;
682
+ }
683
+
684
+ root.data('fv_track_'+fv_ga_events[i], true);
685
+
686
+ if( /fv_ga_debug/.test(window.location.href) ) console.log('FV GA: '+e.type+' - '+ "Video "+fv_ga_events[i]+" " + api.engine + "/" + video.type + " '" + name + "'")
687
+
688
+ tracker._setAllowLinker(true);
689
+ tracker._trackEvent( "Video "+fv_ga_events[i], api.engine + "/" + video.type, name, 1 );
690
+ }
691
+
692
+ }
693
+
694
+ jQuery(window).on('progress', fv_track); // we use these ugly hooks as flowplayer() won't work with our playlists, something to figure out!
695
+ jQuery(window).on('finish ready ', function(e,api) {
696
+ if( typeof(api) != "object" || typeof(api.conf) != "object" ){
697
+ return;
698
+ }
699
+
700
+ var root = jQuery(e.target);
701
+ //if( typeof(aFVPlayersSwitching[root.attr('id')]) != "undefined" ) { // todo: problem that it won't work on video replay or playlist
702
+ //return;
703
+ //}
704
+ for( var j in fv_ga_events ) {
705
+ root.removeData('fv_track_'+fv_ga_events[j]);
706
+ }
707
+ });
708
+
709
+
710
+ /*
711
+ * Speed control
712
+ */
713
+ jQuery(window).on('ready.flowplayer', function(e,api) {
714
+ speedindex = 2;
715
+
716
+ if( /android/.test(navigator.userAgent.toLowerCase()) || typeof(api) == "undefined" || api.engine == "flash" || api.engine == 'fvyoutube' || !flowplayer.support.inlineVideo ) {
717
+ jQuery(".speed-buttons", e.target).remove();
718
+ }
719
+
720
+
721
+ });
722
+
723
+ jQuery(document).on('click', '.fv-player-speed a', false, function(e) {
724
+ var buttonindex = jQuery( 'a',jQuery(this).parents('ul') ).index(this);
725
+ var api = jQuery(this).parents('.flowplayer').data('flowplayer');
726
+
727
+ if( buttonindex == 0 ) {
728
+ speedindex--;
729
+ } else if( buttonindex == -1 ) {
730
+ speedindex = 2;
731
+ } else if( buttonindex == 1 ) {
732
+ speedindex++;
733
+ }
734
+
735
+ if( speedindex > 4 ) speedindex = 4;
736
+ if( speedindex < 0 ) speedindex = 0;
737
+
738
+ //console.log('speedindex '+speedindex+' is '+api.conf.speeds[speedindex]+' since '+buttonindex+' was clicked');
739
+
740
+ if (flowplayer.support.seekable) {
741
+ api.speed(api.conf.speeds[speedindex]);
742
+ } else {
743
+ // workaround for iPad and friends
744
+ api.pause(function (e, api) {
745
+ api.speed(api.conf.speeds[speedindex], function (e, api) {
746
+ api.resume();
747
+ });
748
+ });
749
+ }
750
+
751
+ });
752
+
753
+
754
+
755
+
756
+ if( flowplayer.support.video && flowplayer.conf.engine !== "flash" && typeof window.MediaSource === "function" ) {
757
+ //console.log('I do support MPEG DASH');
758
+ jQuery('video').each( function() {
759
+ var bFound = false;
760
+ jQuery('source',this).each( function() {
761
+ if( jQuery(this).attr('type') == 'application/dash+xml' ) bFound = true
762
+ else if( bFound) jQuery(this).remove();
763
+ });
764
+ });
765
+ } else {
766
+ //console.log('I don\'t support MPEG DASH');
767
+ }
768
+
769
+
770
+
771
+
772
+ (function ($) {
773
+ flowplayer.engine.dash = function(player, root) {
774
+ var mediaPlayer,
775
+ videoTag,
776
+ context = new Dash.di.DashContext();
777
+
778
+ player.bind("pause", function (e, api) {
779
+ // work around dash.js reseting playbackRate to 1 after pause
780
+ var speed = api.currentSpeed;
781
+
782
+ if (speed != 1) {
783
+ api.one("progress.dashresume", function () {
784
+ videoTag.playbackRate = speed;
785
+ });
786
+ }
787
+ });
788
+
789
+ return {
790
+ pick: function(sources) {
791
+ if (!window.MediaSource) return;
792
+ var sources = $.grep(sources, function(src) {
793
+ return src.type === 'application/dash+xml';
794
+ });
795
+ if (!sources.length) return;
796
+ return sources[0];
797
+ },
798
+ load: function(video) {
799
+ root.find('video').remove();
800
+ videoTag = document.createElement('video');
801
+ videoTag.addEventListener('play', function() {
802
+ root.trigger('resume', [player]);
803
+ });
804
+ videoTag.addEventListener('pause', function() {
805
+ root.trigger('pause', [player]);
806
+ });
807
+ videoTag.addEventListener('timeupdate', function() {
808
+ root.trigger('progress', [player, videoTag.currentTime]);
809
+ });
810
+ videoTag.addEventListener('loadedmetadata', function() {
811
+ video.duration = video.seekable = videoTag.duration;
812
+ root.trigger('ready', [player, video]);
813
+ });
814
+ videoTag.addEventListener('seeked', function() {
815
+ root.trigger('seek', [player, videoTag.currentTime]);
816
+ });
817
+ videoTag.addEventListener('progress', function() {
818
+ try {
819
+ var buffered = videoTag.buffered,
820
+ buffer = buffered.end(0), // first loaded buffer
821
+ ct = videoTag.currentTime,
822
+ buffend = 0;
823
+
824
+ // buffered.end(null) will not always return the current buffer
825
+ // so we cycle through the time ranges to obtain it
826
+ if (ct) {
827
+ for (i = 1; i < buffered.length; i++) {
828
+ buffend = buffered.end(i);
829
+
830
+ if (buffend >= ct && buffered.start(i) <= ct) {
831
+ buffer = buffend;
832
+ }
833
+ }
834
+ }
835
+ video.buffer = buffer;
836
+ } catch (ignored) {}
837
+ root.trigger('buffer', [player]);
838
+ });
839
+ videoTag.addEventListener('ended', function() {
840
+ root.trigger('finish', [player]);
841
+ });
842
+ videoTag.addEventListener('volumechange', function() {
843
+ root.trigger('volume', [player, videoTag.volume]);
844
+ });
845
+
846
+
847
+ videoTag.className = 'fp-engine dash-engine';
848
+ root.prepend(videoTag);
849
+
850
+ mediaPlayer = new MediaPlayer(context);
851
+ mediaPlayer.setAutoPlay(player.conf.autoplay || player.conf.splash);
852
+ mediaPlayer.startup();
853
+ mediaPlayer.attachView(videoTag);
854
+ mediaPlayer.attachSource(video.src);
855
+ },
856
+ resume: function() {
857
+ if (player.finished) {
858
+ videoTag.currentTime = 0;
859
+ }
860
+ videoTag.play();
861
+ },
862
+ pause: function() {
863
+ videoTag.pause();
864
+ },
865
+ seek: function(time) {
866
+ if (player.paused) {
867
+ var muted = !!player.muted;
868
+
869
+ $(videoTag).one("seeked.dashpaused", function () {
870
+ player.pause()
871
+ player.mute(muted);
872
+ });
873
+
874
+ player.mute(true);
875
+ videoTag.play();
876
+ }
877
+ if (mediaPlayer !== undefined) {
878
+ mediaPlayer.seek(time);
879
+ } else {
880
+ videoTag.currentTime = time;
881
+ }
882
+ },
883
+ volume: function(level) {
884
+ if (videoTag !== undefined) {
885
+ videoTag.volume = level;
886
+ }
887
+ },
888
+ speed: function(val) {
889
+ videoTag.playbackRate = val;
890
+ root.trigger('speed', [player, val]);
891
+ },
892
+ unload: function() {
893
+ if (mediaPlayer !== undefined) {
894
+ mediaPlayer.reset();
895
+ }
896
+ $(videoTag).remove();
897
+ root.trigger("unload", [player]);
898
+ }
899
+
900
+ };
901
+ };
902
+ }(jQuery));
js/jquery.colorbox-min.js CHANGED
@@ -3,4 +3,4 @@
3
  (c) 2013 Jack Moore - jacklmoore.com/colorbox
4
  license: http://www.opensource.org/licenses/mit-license.php
5
  */
6
- (function(t,e,i){function o(i,o,n){var r=e.createElement(i);return o&&(r.id=te+o),n&&(r.style.cssText=n),t(r)}function n(){return i.innerHeight?i.innerHeight:t(i).height()}function r(t){var e=H.length,i=(j+t)%e;return 0>i?e+i:i}function h(t,e){return Math.round((/%/.test(t)?("x"===e?E.width():n())/100:1)*parseInt(t,10))}function l(t,e){return t.photo||t.photoRegex.test(e)}function s(t,e){return t.retinaUrl&&i.devicePixelRatio>1?e.replace(t.photoRegex,t.retinaSuffix):e}function a(t){"contains"in x[0]&&!x[0].contains(t.target)&&(t.stopPropagation(),x.focus())}function d(){var e,i=t.data(A,Z);null==i?(_=t.extend({},Y),console&&console.log&&console.log("Error: cboxElement missing settings object")):_=t.extend({},i);for(e in _)t.isFunction(_[e])&&"on"!==e.slice(0,2)&&(_[e]=_[e].call(A));_.rel=_.rel||A.rel||t(A).data("rel")||"nofollow",_.href=_.href||t(A).attr("href"),_.title=_.title||A.title,"string"==typeof _.href&&(_.href=t.trim(_.href))}function c(i,o){t(e).trigger(i),se.trigger(i),t.isFunction(o)&&o.call(A)}function u(){var t,e,i,o,n,r=te+"Slideshow_",h="click."+te;_.slideshow&&H[1]?(e=function(){clearTimeout(t)},i=function(){(_.loop||H[j+1])&&(t=setTimeout(J.next,_.slideshowSpeed))},o=function(){M.html(_.slideshowStop).unbind(h).one(h,n),se.bind(ne,i).bind(oe,e).bind(re,n),x.removeClass(r+"off").addClass(r+"on")},n=function(){e(),se.unbind(ne,i).unbind(oe,e).unbind(re,n),M.html(_.slideshowStart).unbind(h).one(h,function(){J.next(),o()}),x.removeClass(r+"on").addClass(r+"off")},_.slideshowAuto?o():n()):x.removeClass(r+"off "+r+"on")}function f(i){G||(A=i,d(),H=t(A),j=0,"nofollow"!==_.rel&&(H=t("."+ee).filter(function(){var e,i=t.data(this,Z);return i&&(e=t(this).data("rel")||i.rel||this.rel),e===_.rel}),j=H.index(A),-1===j&&(H=H.add(A),j=H.length-1)),g.css({opacity:parseFloat(_.opacity),cursor:_.overlayClose?"pointer":"auto",visibility:"visible"}).show(),V&&x.add(g).removeClass(V),_.className&&x.add(g).addClass(_.className),V=_.className,K.html(_.close).show(),$||($=q=!0,x.css({visibility:"hidden",display:"block"}),W=o(ae,"LoadedContent","width:0; height:0; overflow:hidden").appendTo(v),D=b.height()+k.height()+v.outerHeight(!0)-v.height(),B=C.width()+T.width()+v.outerWidth(!0)-v.width(),N=W.outerHeight(!0),z=W.outerWidth(!0),_.w=h(_.initialWidth,"x"),_.h=h(_.initialHeight,"y"),J.position(),u(),c(ie,_.onOpen),O.add(F).hide(),x.focus(),e.addEventListener&&(e.addEventListener("focus",a,!0),se.one(he,function(){e.removeEventListener("focus",a,!0)})),_.returnFocus&&se.one(he,function(){t(A).focus()})),w())}function p(){!x&&e.body&&(X=!1,E=t(i),x=o(ae).attr({id:Z,"class":t.support.opacity===!1?te+"IE":"",role:"dialog",tabindex:"-1"}).hide(),g=o(ae,"Overlay").hide(),S=o(ae,"LoadingOverlay").add(o(ae,"LoadingGraphic")),y=o(ae,"Wrapper"),v=o(ae,"Content").append(F=o(ae,"Title"),I=o(ae,"Current"),P=t('<button type="button"/>').attr({id:te+"Previous"}),R=t('<button type="button"/>').attr({id:te+"Next"}),M=o("button","Slideshow"),S,K=t('<button type="button"/>').attr({id:te+"Close"})),y.append(o(ae).append(o(ae,"TopLeft"),b=o(ae,"TopCenter"),o(ae,"TopRight")),o(ae,!1,"clear:left").append(C=o(ae,"MiddleLeft"),v,T=o(ae,"MiddleRight")),o(ae,!1,"clear:left").append(o(ae,"BottomLeft"),k=o(ae,"BottomCenter"),o(ae,"BottomRight"))).find("div div").css({"float":"left"}),L=o(ae,!1,"position:absolute; width:9999px; visibility:hidden; display:none"),O=R.add(P).add(I).add(M),t(e.body).append(g,x.append(y,L)))}function m(){function i(t){t.which>1||t.shiftKey||t.altKey||t.metaKey||t.control||(t.preventDefault(),f(this))}return x?(X||(X=!0,R.click(function(){J.next()}),P.click(function(){J.prev()}),K.click(function(){J.close()}),g.click(function(){_.overlayClose&&J.close()}),t(e).bind("keydown."+te,function(t){var e=t.keyCode;$&&_.escKey&&27===e&&(t.preventDefault(),J.close()),$&&_.arrowKey&&H[1]&&!t.altKey&&(37===e?(t.preventDefault(),P.click()):39===e&&(t.preventDefault(),R.click()))}),t.isFunction(t.fn.on)?t(e).on("click."+te,"."+ee,i):t("."+ee).live("click."+te,i)),!0):!1}function w(){var e,n,r,a=J.prep,u=++de;q=!0,U=!1,A=H[j],d(),c(le),c(oe,_.onLoad),_.h=_.height?h(_.height,"y")-N-D:_.innerHeight&&h(_.innerHeight,"y"),_.w=_.width?h(_.width,"x")-z-B:_.innerWidth&&h(_.innerWidth,"x"),_.mw=_.w,_.mh=_.h,_.maxWidth&&(_.mw=h(_.maxWidth,"x")-z-B,_.mw=_.w&&_.w<_.mw?_.w:_.mw),_.maxHeight&&(_.mh=h(_.maxHeight,"y")-N-D,_.mh=_.h&&_.h<_.mh?_.h:_.mh),e=_.href,Q=setTimeout(function(){S.show()},100),_.inline?(r=o(ae).hide().insertBefore(t(e)[0]),se.one(le,function(){r.replaceWith(W.children())}),a(t(e))):_.iframe?a(" "):_.html?a(_.html):l(_,e)?(e=s(_,e),t(U=new Image).addClass(te+"Photo").bind("error",function(){_.title=!1,a(o(ae,"Error").html(_.imgError))}).one("load",function(){var e;u===de&&(U.alt=t(A).attr("alt")||t(A).attr("data-alt")||"",_.retinaImage&&i.devicePixelRatio>1&&(U.height=U.height/i.devicePixelRatio,U.width=U.width/i.devicePixelRatio),_.scalePhotos&&(n=function(){U.height-=U.height*e,U.width-=U.width*e},_.mw&&U.width>_.mw&&(e=(U.width-_.mw)/U.width,n()),_.mh&&U.height>_.mh&&(e=(U.height-_.mh)/U.height,n())),_.h&&(U.style.marginTop=Math.max(_.mh-U.height,0)/2+"px"),H[1]&&(_.loop||H[j+1])&&(U.style.cursor="pointer",U.onclick=function(){J.next()}),U.style.width=U.width+"px",U.style.height=U.height+"px",setTimeout(function(){a(U)},1))}),setTimeout(function(){U.src=e},1)):e&&L.load(e,_.data,function(e,i){u===de&&a("error"===i?o(ae,"Error").html(_.xhrError):t(this).contents())})}var g,x,y,v,b,C,T,k,H,E,W,L,S,F,I,M,R,P,K,O,_,D,B,N,z,A,j,U,$,q,G,Q,J,V,X,Y={transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,inline:!1,html:!1,iframe:!1,fastIframe:!0,photo:!1,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,className:!1,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",open:!1,returnFocus:!0,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp)((#|\?).*)?$/i,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0},Z="colorbox",te="cbox",ee=te+"Element",ie=te+"_open",oe=te+"_load",ne=te+"_complete",re=te+"_cleanup",he=te+"_closed",le=te+"_purge",se=t("<a/>"),ae="div",de=0;t.colorbox||(t(p),J=t.fn[Z]=t[Z]=function(e,i){var o=this;if(e=e||{},p(),m()){if(t.isFunction(o))o=t("<a/>"),e.open=!0;else if(!o[0])return o;i&&(e.onComplete=i),o.each(function(){t.data(this,Z,t.extend({},t.data(this,Z)||Y,e))}).addClass(ee),(t.isFunction(e.open)&&e.open.call(o)||e.open)&&f(o[0])}return o},J.position=function(t,e){function i(t){b[0].style.width=k[0].style.width=v[0].style.width=parseInt(t.style.width,10)-B+"px",v[0].style.height=C[0].style.height=T[0].style.height=parseInt(t.style.height,10)-D+"px"}var o,r,l,s=0,a=0,d=x.offset();E.unbind("resize."+te),x.css({top:-9e4,left:-9e4}),r=E.scrollTop(),l=E.scrollLeft(),_.fixed?(d.top-=r,d.left-=l,x.css({position:"fixed"})):(s=r,a=l,x.css({position:"absolute"})),a+=_.right!==!1?Math.max(E.width()-_.w-z-B-h(_.right,"x"),0):_.left!==!1?h(_.left,"x"):Math.round(Math.max(E.width()-_.w-z-B,0)/2),s+=_.bottom!==!1?Math.max(n()-_.h-N-D-h(_.bottom,"y"),0):_.top!==!1?h(_.top,"y"):Math.round(Math.max(n()-_.h-N-D,0)/2),x.css({top:d.top,left:d.left,visibility:"visible"}),t=x.width()===_.w+z&&x.height()===_.h+N?0:t||0,y[0].style.width=y[0].style.height="9999px",o={width:_.w+z+B,height:_.h+N+D,top:s,left:a},0===t&&x.css(o),x.dequeue().animate(o,{duration:t,complete:function(){i(this),q=!1,y[0].style.width=_.w+z+B+"px",y[0].style.height=_.h+N+D+"px",_.reposition&&setTimeout(function(){E.bind("resize."+te,J.position)},1),e&&e()},step:function(){i(this)}})},J.resize=function(t){$&&(t=t||{},t.width&&(_.w=h(t.width,"x")-z-B),t.innerWidth&&(_.w=h(t.innerWidth,"x")),W.css({width:_.w}),t.height&&(_.h=h(t.height,"y")-N-D),t.innerHeight&&(_.h=h(t.innerHeight,"y")),t.innerHeight||t.height||(W.css({height:"auto"}),_.h=W.height()),W.css({height:_.h}),J.position("none"===_.transition?0:_.speed))},J.prep=function(e){function i(){return _.w=_.w||W.width(),_.w=_.mw&&_.mw<_.w?_.mw:_.w,_.w}function n(){return _.h=_.h||W.height(),_.h=_.mh&&_.mh<_.h?_.mh:_.h,_.h}if($){var h,a="none"===_.transition?0:_.speed;W.empty().remove(),W=o(ae,"LoadedContent").append(e),W.hide().appendTo(L.show()).css({width:i(),overflow:_.scrolling?"auto":"hidden"}).css({height:n()}).prependTo(v),L.hide(),t(U).css({"float":"none"}),h=function(){function e(){t.support.opacity===!1&&x[0].style.removeAttribute("filter")}var i,n,h=H.length,d="frameBorder",u="allowTransparency";$&&(n=function(){clearTimeout(Q),S.hide(),c(ne,_.onComplete)},F.html(_.title).add(W).show(),h>1?("string"==typeof _.current&&I.html(_.current.replace("{current}",j+1).replace("{total}",h)).show(),R[_.loop||h-1>j?"show":"hide"]().html(_.next),P[_.loop||j?"show":"hide"]().html(_.previous),_.slideshow&&M.show(),_.preloading&&t.each([r(-1),r(1)],function(){var e,i,o=H[this],n=t.data(o,Z);n&&n.href?(e=n.href,t.isFunction(e)&&(e=e.call(o))):e=t(o).attr("href"),e&&l(n,e)&&(e=s(n,e),i=new Image,i.src=e)})):O.hide(),_.iframe?(i=o("iframe")[0],d in i&&(i[d]=0),u in i&&(i[u]="true"),_.scrolling||(i.scrolling="no"),t(i).attr({src:_.href,name:(new Date).getTime(),"class":te+"Iframe",allowFullScreen:!0,webkitAllowFullScreen:!0,mozallowfullscreen:!0}).one("load",n).appendTo(W),se.one(le,function(){i.src="//about:blank"}),_.fastIframe&&t(i).trigger("load")):n(),"fade"===_.transition?x.fadeTo(a,1,e):e())},"fade"===_.transition?x.fadeTo(a,0,function(){J.position(0,h)}):J.position(a,h)}},J.next=function(){!q&&H[1]&&(_.loop||H[j+1])&&(j=r(1),f(H[j]))},J.prev=function(){!q&&H[1]&&(_.loop||j)&&(j=r(-1),f(H[j]))},J.close=function(){$&&!G&&(G=!0,$=!1,c(re,_.onCleanup),E.unbind("."+te),g.fadeTo(_.fadeOut||0,0),x.stop().fadeTo(_.fadeOut||0,0,function(){x.add(g).css({opacity:1,cursor:"auto"}).hide(),c(le),W.empty().remove(),setTimeout(function(){G=!1,c(he,_.onClosed)},1)}))},J.remove=function(){x&&(x.stop(),t.colorbox.close(),x.stop().remove(),g.remove(),G=!1,x=null,t("."+ee).removeData(Z).removeClass(ee),t(e).unbind("click."+te))},J.element=function(){return t(A)},J.settings=Y)})(jQuery,document,window);
3
  (c) 2013 Jack Moore - jacklmoore.com/colorbox
4
  license: http://www.opensource.org/licenses/mit-license.php
5
  */
6
+ (function(t,e,i){function o(i,o,n){var r=e.createElement(i);return o&&(r.id=te+o),n&&(r.style.cssText=n),t(r)}function n(){return i.innerHeight?i.innerHeight:t(i).height()}function r(t){var e=H.length,i=(j+t)%e;return 0>i?e+i:i}function h(t,e){return Math.round((/%/.test(t)?("x"===e?E.width():n())/100:1)*parseInt(t,10))}function l(t,e){return t.photo||t.photoRegex.test(e)}function s(t,e){return t.retinaUrl&&i.devicePixelRatio>1?e.replace(t.photoRegex,t.retinaSuffix):e}function a(t){"contains"in x[0]&&!x[0].contains(t.target)&&(t.stopPropagation(),x.focus())}function d(){var e,i=t.data(A,Z);null==i?(_=t.extend({},Y),console&&console.log&&console.log("Error: cboxElement missing settings object")):_=t.extend({},i);for(e in _)t.isFunction(_[e])&&"on"!==e.slice(0,2)&&(_[e]=_[e].call(A));_.rel=_.rel||A.rel||t(A).data("rel")||"nofollow",_.href=_.href||t(A).attr("href"),_.title=_.title||A.title,"string"==typeof _.href&&(_.href=t.trim(_.href))}function c(i,o){t(e).trigger(i),se.trigger(i),t.isFunction(o)&&o.call(A)}function u(){var t,e,i,o,n,r=te+"Slideshow_",h="click."+te;_.slideshow&&H[1]?(e=function(){clearTimeout(t)},i=function(){(_.loop||H[j+1])&&(t=setTimeout(J.next,_.slideshowSpeed))},o=function(){M.html(_.slideshowStop).unbind(h).one(h,n),se.bind(ne,i).bind(oe,e).bind(re,n),x.removeClass(r+"off").addClass(r+"on")},n=function(){e(),se.unbind(ne,i).unbind(oe,e).unbind(re,n),M.html(_.slideshowStart).unbind(h).one(h,function(){J.next(),o()}),x.removeClass(r+"on").addClass(r+"off")},_.slideshowAuto?o():n()):x.removeClass(r+"off "+r+"on")}function f(i){G||(A=i,d(),H=t(A),j=0,"nofollow"!==_.rel&&(H=t("."+ee).filter(function(){var e,i=t.data(this,Z);return i&&(e=t(this).data("rel")||i.rel||this.rel),e===_.rel}),j=H.index(A),-1===j&&(H=H.add(A),j=H.length-1)),g.css({opacity:parseFloat(_.opacity),cursor:_.overlayClose?"pointer":"auto",visibility:"visible"}).show(),V&&x.add(g).removeClass(V),_.className&&x.add(g).addClass(_.className),V=_.className,K.html(_.close).show(),$||($=q=!0,x.css({visibility:"hidden",display:"block"}),W=o(ae,"LoadedContent","width:0; height:0; overflow:hidden").appendTo(v),D=b.height()+k.height()+v.outerHeight(!0)-v.height(),B=C.width()+T.width()+v.outerWidth(!0)-v.width(),N=W.outerHeight(!0),z=W.outerWidth(!0),_.w=h(_.initialWidth,"x"),_.h=h(_.initialHeight,"y"),J.position(),u(),c(ie,_.onOpen),O.add(F).hide(),x.focus(),e.addEventListener&&(e.addEventListener("focus",a,!0),se.one(he,function(){e.removeEventListener("focus",a,!0)})),_.returnFocus&&se.one(he,function(){t(A).focus()})),w())}function p(){!x&&e.body&&(X=!1,E=t(i),x=o(ae).attr({id:Z,"class":t.support.opacity===!1?te+"IE":"",role:"dialog",tabindex:"-1"}).hide(),g=o(ae,"Overlay").hide(),S=o(ae,"LoadingOverlay").add(o(ae,"LoadingGraphic")),y=o(ae,"Wrapper"),v=o(ae,"Content").append(F=o(ae,"Title"),I=o(ae,"Current"),P=t('<button type="button"/>').attr({id:te+"Previous"}),R=t('<button type="button"/>').attr({id:te+"Next"}),M=o("button","Slideshow"),S,K=t('<button type="button"/>').attr({id:te+"Close"})),y.append(o(ae).append(o(ae,"TopLeft"),b=o(ae,"TopCenter"),o(ae,"TopRight")),o(ae,!1,"clear:left").append(C=o(ae,"MiddleLeft"),v,T=o(ae,"MiddleRight")),o(ae,!1,"clear:left").append(o(ae,"BottomLeft"),k=o(ae,"BottomCenter"),o(ae,"BottomRight"))).find("div div").css({"float":"left"}),L=o(ae,!1,"position:absolute; width:9999px; visibility:hidden; display:none"),O=R.add(P).add(I).add(M),t(e.body).append(g,x.append(y,L)))}function m(){function i(t){t.which>1||t.shiftKey||t.altKey||t.metaKey||t.control||(t.preventDefault(),f(this))}return x?(X||(X=!0,R.click(function(){J.next()}),P.click(function(){J.prev()}),K.click(function(){J.close()}),g.click(function(){_.overlayClose&&J.close()}),t(e).bind("keydown."+te,function(t){var e=t.keyCode;$&&_.escKey&&27===e&&(t.preventDefault(),J.close()),$&&_.arrowKey&&H[1]&&!t.altKey&&(37===e?(t.preventDefault(),P.click()):39===e&&(t.preventDefault(),R.click()))}),t.isFunction(t.fn.on)?t(e).on("click."+te,"."+ee,i):t("."+ee).live("click."+te,i)),!0):!1}function w(){var e,n,r,a=J.prep,u=++de;q=!0,U=!1,A=H[j],d(),c(le),c(oe,_.onLoad),_.h=_.height?h(_.height,"y")-N-D:_.innerHeight&&h(_.innerHeight,"y"),_.w=_.width?h(_.width,"x")-z-B:_.innerWidth&&h(_.innerWidth,"x"),_.mw=_.w,_.mh=_.h,_.maxWidth&&(_.mw=h(_.maxWidth,"x")-z-B,_.mw=_.w&&_.w<_.mw?_.w:_.mw),_.maxHeight&&(_.mh=h(_.maxHeight,"y")-N-D,_.mh=_.h&&_.h<_.mh?_.h:_.mh),e=_.href,Q=setTimeout(function(){S.show()},100),_.inline?(r=o(ae).hide().insertBefore(t(e)[0]),se.one(le,function(){r.replaceWith(W.children())}),a(t(e))):_.iframe?a(" "):_.html?a(_.html):l(_,e)?(e=s(_,e),t(U=new Image).addClass(te+"Photo").bind("error",function(){_.title=!1,a(o(ae,"Error").html(_.imgError))}).one("fv_player_box_load",function(){var e;u===de&&(U.alt=t(A).attr("alt")||t(A).attr("data-alt")||"",_.retinaImage&&i.devicePixelRatio>1&&(U.height=U.height/i.devicePixelRatio,U.width=U.width/i.devicePixelRatio),_.scalePhotos&&(n=function(){U.height-=U.height*e,U.width-=U.width*e},_.mw&&U.width>_.mw&&(e=(U.width-_.mw)/U.width,n()),_.mh&&U.height>_.mh&&(e=(U.height-_.mh)/U.height,n())),_.h&&(U.style.marginTop=Math.max(_.mh-U.height,0)/2+"px"),H[1]&&(_.loop||H[j+1])&&(U.style.cursor="pointer",U.onclick=function(){J.next()}),U.style.width=U.width+"px",U.style.height=U.height+"px",setTimeout(function(){a(U)},1))}),setTimeout(function(){U.src=e},1)):e&&L.load(e,_.data,function(e,i){u===de&&a("error"===i?o(ae,"Error").html(_.xhrError):t(this).contents())})}var g,x,y,v,b,C,T,k,H,E,W,L,S,F,I,M,R,P,K,O,_,D,B,N,z,A,j,U,$,q,G,Q,J,V,X,Y={transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,inline:!1,html:!1,iframe:!1,fastIframe:!0,photo:!1,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,className:!1,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",open:!1,returnFocus:!0,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp)((#|\?).*)?$/i,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0},Z="fv_player_box",te="fv_player_box",ee=te+"Element",ie=te+"_open",oe=te+"_load",ne=te+"_complete",re=te+"_cleanup",he=te+"_closed",le=te+"_purge",se=t("<a/>"),ae="div",de=0;t.colorbox||(t(p),J=t.fn[Z]=t[Z]=function(e,i){var o=this;if(e=e||{},p(),m()){if(t.isFunction(o))o=t("<a/>"),e.open=!0;else if(!o[0])return o;i&&(e.onComplete=i),o.each(function(){t.data(this,Z,t.extend({},t.data(this,Z)||Y,e))}).addClass(ee),(t.isFunction(e.open)&&e.open.call(o)||e.open)&&f(o[0])}return o},J.position=function(t,e){function i(t){b[0].style.width=k[0].style.width=v[0].style.width=parseInt(t.style.width,10)-B+"px",v[0].style.height=C[0].style.height=T[0].style.height=parseInt(t.style.height,10)-D+"px"}var o,r,l,s=0,a=0,d=x.offset();E.unbind("resize."+te),x.css({top:-9e4,left:-9e4}),r=E.scrollTop(),l=E.scrollLeft(),_.fixed?(d.top-=r,d.left-=l,x.css({position:"fixed"})):(s=r,a=l,x.css({position:"absolute"})),a+=_.right!==!1?Math.max(E.width()-_.w-z-B-h(_.right,"x"),0):_.left!==!1?h(_.left,"x"):Math.round(Math.max(E.width()-_.w-z-B,0)/2),s+=_.bottom!==!1?Math.max(n()-_.h-N-D-h(_.bottom,"y"),0):_.top!==!1?h(_.top,"y"):Math.round(Math.max(n()-_.h-N-D,0)/2),x.css({top:d.top,left:d.left,visibility:"visible"}),t=x.width()===_.w+z&&x.height()===_.h+N?0:t||0,y[0].style.width=y[0].style.height="9999px",o={width:_.w+z+B,height:_.h+N+D,top:s,left:a},0===t&&x.css(o),x.dequeue().animate(o,{duration:t,complete:function(){i(this),q=!1,y[0].style.width=_.w+z+B+"px",y[0].style.height=_.h+N+D+"px",_.reposition&&setTimeout(function(){E.bind("resize."+te,J.position)},1),e&&e()},step:function(){i(this)}})},J.resize=function(t){$&&(t=t||{},t.width&&(_.w=h(t.width,"x")-z-B),t.innerWidth&&(_.w=h(t.innerWidth,"x")),W.css({width:_.w}),t.height&&(_.h=h(t.height,"y")-N-D),t.innerHeight&&(_.h=h(t.innerHeight,"y")),t.innerHeight||t.height||(W.css({height:"auto"}),_.h=W.height()),W.css({height:_.h}),J.position("none"===_.transition?0:_.speed))},J.prep=function(e){function i(){return _.w=_.w||W.width(),_.w=_.mw&&_.mw<_.w?_.mw:_.w,_.w}function n(){return _.h=_.h||W.height(),_.h=_.mh&&_.mh<_.h?_.mh:_.h,_.h}if($){var h,a="none"===_.transition?0:_.speed;W.empty().remove(),W=o(ae,"LoadedContent").append(e),W.hide().appendTo(L.show()).css({width:i(),overflow:_.scrolling?"auto":"hidden"}).css({height:n()}).prependTo(v),L.hide(),t(U).css({"float":"none"}),h=function(){function e(){t.support.opacity===!1&&x[0].style.removeAttribute("filter")}var i,n,h=H.length,d="frameBorder",u="allowTransparency";$&&(n=function(){clearTimeout(Q),S.hide(),c(ne,_.onComplete)},F.html(_.title).add(W).show(),h>1?("string"==typeof _.current&&I.html(_.current.replace("{current}",j+1).replace("{total}",h)).show(),R[_.loop||h-1>j?"show":"hide"]().html(_.next),P[_.loop||j?"show":"hide"]().html(_.previous),_.slideshow&&M.show(),_.preloading&&t.each([r(-1),r(1)],function(){var e,i,o=H[this],n=t.data(o,Z);n&&n.href?(e=n.href,t.isFunction(e)&&(e=e.call(o))):e=t(o).attr("href"),e&&l(n,e)&&(e=s(n,e),i=new Image,i.src=e)})):O.hide(),_.iframe?(i=o("iframe")[0],d in i&&(i[d]=0),u in i&&(i[u]="true"),_.scrolling||(i.scrolling="no"),t(i).attr({src:_.href,name:(new Date).getTime(),"class":te+"Iframe",allowFullScreen:!0,webkitAllowFullScreen:!0,mozallowfullscreen:!0}).one("fv_player_box_load",n).appendTo(W),se.one(le,function(){i.src="//about:blank"}),_.fastIframe&&t(i).trigger("fv_player_box_load")):n(),"fade"===_.transition?x.fadeTo(a,1,e):e())},"fade"===_.transition?x.fadeTo(a,0,function(){J.position(0,h)}):J.position(a,h)}},J.next=function(){!q&&H[1]&&(_.loop||H[j+1])&&(j=r(1),f(H[j]))},J.prev=function(){!q&&H[1]&&(_.loop||j)&&(j=r(-1),f(H[j]))},J.close=function(){$&&!G&&(G=!0,$=!1,c(re,_.onCleanup),E.unbind("."+te),g.fadeTo(_.fadeOut||0,0),x.stop().fadeTo(_.fadeOut||0,0,function(){x.add(g).css({opacity:1,cursor:"auto"}).hide(),c(le),W.empty().remove(),setTimeout(function(){G=!1,c(he,_.onClosed)},1)}))},J.remove=function(){x&&(x.stop(),t.colorbox.close(),x.stop().remove(),g.remove(),G=!1,x=null,t("."+ee).removeData(Z).removeClass(ee),t(e).unbind("click."+te))},J.element=function(){return t(A)},J.settings=Y)})(jQuery,document,window);
js/shortcode-editor.js CHANGED
@@ -3,19 +3,22 @@ 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",
9
- height:"600px",
10
- href: "#fv-wordpress-flowplayer-popup",
11
- inline: true,
12
- onComplete : fv_wp_flowplayer_edit,
13
- onClosed : fv_wp_flowplayer_on_close,
14
- onOpen: function(){
15
- jQuery("#colorbox").addClass("fv-flowplayer-shortcode-editor");
16
- jQuery("#cboxOverlay").addClass("fv-flowplayer-shortcode-editor");
17
- }
18
- } );
 
 
 
19
 
20
  jQuery(".fv-wordpress-flowplayer-button").click( function() {
21
  if( jQuery('#wp-content-wrap').hasClass('html-active') && typeof(FCKeditorAPI) != "object" ) {
@@ -213,7 +216,7 @@ function fv_flowplayer_playlist_add( sInput, sCaption ) {
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();
@@ -426,7 +429,7 @@ function fv_wp_flowplayer_edit() {
426
  function fv_wp_flowplayer_dialog_resize() {
427
  var iContentHeight = parseInt( jQuery('#fv-wordpress-flowplayer-popup').css('height') );
428
  if( iContentHeight < 150 ) iContentHeight = 150;
429
- jQuery('#fv-wordpress-flowplayer-popup').colorbox.resize({width:620, height:(iContentHeight+100)})
430
  }
431
 
432
 
@@ -507,7 +510,8 @@ function fv_wp_flowplayer_submit() {
507
  var aPlaylistItem = new Array();
508
  jQuery(this).find('input:visible').each( function() {
509
  if( jQuery(this).attr('name').match(/fv_wp_flowplayer_field_caption/) ) return;
510
- if( jQuery(this).hasClass('fv_wp_flowplayer_field_rtmp') ) return;
 
511
  if( jQuery(this).attr('value').trim().length > 0 ) {
512
  var value = jQuery(this).attr('value').trim()
513
  if( jQuery(this).hasClass('fv_wp_flowplayer_field_rtmp_path') ) value = "rtmp:"+value;
@@ -544,7 +548,7 @@ function fv_wp_flowplayer_submit() {
544
 
545
  fv_wp_fp_shortcode += ']';
546
 
547
- jQuery(".fv-wordpress-flowplayer-button").colorbox.close();
548
 
549
  fv_wp_flowplayer_insert( fv_wp_fp_shortcode );
550
  }
@@ -578,44 +582,77 @@ function fv_wp_flowplayer_add_rtmp() {
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 {
@@ -623,12 +660,12 @@ function fv_wp_flowplayer_shortcode_write_arg( sField, sArg, sKind, bCheckbox, a
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" ) {
@@ -660,4 +697,4 @@ function fv_wp_flowplayer_shortcode_write_arg( sField, sArg, sKind, bCheckbox, a
660
  fv_wp_fp_shortcode += ' '+sArg+'='+sOutput;
661
  }
662
  return sValue;
663
- }
3
  var FVFP_sStoreRTMP = 0;
4
 
5
  jQuery(document).ready(function($){
6
+ if( jQuery().fv_player_box ) {
7
+ $(document).on( 'click', '.fv-wordpress-flowplayer-button', function() {
8
+ $.fv_player_box( {
9
+ width:"620px",
10
+ height:"600px",
11
+ href: "#fv-wordpress-flowplayer-popup",
12
+ inline: true,
13
+ title: 'Add FV WP Flowplayer',
14
+ onComplete : fv_wp_flowplayer_edit,
15
+ onClosed : fv_wp_flowplayer_on_close,
16
+ onOpen: function(){
17
+ jQuery("#fv_player_box").addClass("fv-flowplayer-shortcode-editor");
18
+ jQuery("#cboxOverlay").addClass("fv-flowplayer-shortcode-editor");
19
+ }
20
+ } );
21
+ });
22
 
23
  jQuery(".fv-wordpress-flowplayer-button").click( function() {
24
  if( jQuery('#wp-content-wrap').hasClass('html-active') && typeof(FCKeditorAPI) != "object" ) {
216
 
217
  function fv_wp_flowplayer_edit() {
218
 
219
+ var dialog = jQuery('#fv_player_box.fv-flowplayer-shortcode-editor');
220
  dialog.removeAttr('tabindex');
221
 
222
  fv_wp_flowplayer_init();
429
  function fv_wp_flowplayer_dialog_resize() {
430
  var iContentHeight = parseInt( jQuery('#fv-wordpress-flowplayer-popup').css('height') );
431
  if( iContentHeight < 150 ) iContentHeight = 150;
432
+ jQuery('#fv-wordpress-flowplayer-popup').fv_player_box.resize({width:620, height:(iContentHeight+100)})
433
  }
434
 
435
 
510
  var aPlaylistItem = new Array();
511
  jQuery(this).find('input:visible').each( function() {
512
  if( jQuery(this).attr('name').match(/fv_wp_flowplayer_field_caption/) ) return;
513
+ if( jQuery(this).hasClass('fv_wp_flowplayer_field_rtmp') ) return;
514
+ if( jQuery(this).hasClass('extra-field') ) return;
515
  if( jQuery(this).attr('value').trim().length > 0 ) {
516
  var value = jQuery(this).attr('value').trim()
517
  if( jQuery(this).hasClass('fv_wp_flowplayer_field_rtmp_path') ) value = "rtmp:"+value;
548
 
549
  fv_wp_fp_shortcode += ']';
550
 
551
+ jQuery(".fv-wordpress-flowplayer-button").fv_player_box.close();
552
 
553
  fv_wp_flowplayer_insert( fv_wp_fp_shortcode );
554
  }
582
  fv_wp_flowplayer_dialog_resize();
583
  }
584
 
585
+ function fv_wp_flowplayer_shortcode_parse_arg( sShortcode, sArg, bHTML, sField ) {
586
+ if( sField ){
587
+ var regexStart = new RegExp(sArg+'\\\d?="(.*?)"',"g");
588
+ var regexOrder = new RegExp(sArg+'(\\\d+)');
589
+ var sStart = regexStart.exec(sShortcode);
590
+ var count = 0;
591
+ while( count < 100 && sStart != null ){
592
+ var iOrder = regexOrder.exec(sStart[0]);
593
+ iOrder = iOrder ? iOrder[1] : 0;
594
+ if( sStart[1] ) {
595
+ //document.getElementById("fv_wp_flowplayer_field_start").value = sStart.trim();
596
+ jQuery('[id='+sField+']').eq(iOrder).val( sStart[1].trim() );
597
+ }
598
+ sStart = regexStart.exec(sShortcode);
599
+ count++;
600
+ }
601
+ fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( regexStart, '' );
602
+
603
+ } else {
604
+ var sOutput;
605
 
606
+ var rDoubleQ = new RegExp(sArg+"=\"","g");
607
+ var rSingleQ = new RegExp(sArg+"='","g");
608
+ var rNoQ = new RegExp(sArg+"=[^\"']","g");
609
+
610
+ var rMatch = false;
611
+ if( sShortcode.match(rDoubleQ) ) {
612
+ //rMatch = new RegExp(sArg+'="(.*?[^\\\\/])"',"g");
613
+ rMatch = new RegExp(sArg+'="(.*?[^\\\\])"',"g");
614
+ } else if( sShortcode.match(rSingleQ) ) {
615
+ rMatch = new RegExp(sArg+"='([^']*?)'","g");
616
+ } else if( sShortcode.match(rNoQ) ) {
617
+ rMatch = new RegExp(sArg+"=([^\\]\\s,]+)","g");
618
+ }
619
+
620
+ if( !rMatch ){
621
+ return false;
622
+ }
623
+
624
+ var aOutput = rMatch.exec(sShortcode);
625
+ fv_wp_fp_shortcode_remains = fv_wp_fp_shortcode_remains.replace( rMatch, '' );
626
+
627
+ if( bHTML ) {
628
+ aOutput[1] = aOutput[1].replace(/\\"/g, '"').replace(/\\(\[|\])/g, '$1');
629
+ }
630
+ return aOutput;
631
 
 
 
 
 
 
632
  }
633
+ }
634
+
635
+ function fv_wp_flowplayer_shortcode_write_args( sField, sArg, sKind, bCheckbox, aValues ) {
636
+ jQuery('[id='+sField+']').each( function(k,v) {
637
+ k = (k==0) ? '' : k;
638
+ fv_wp_flowplayer_shortcode_write_arg(jQuery(this)[0],sArg+k, sKind, bCheckbox, aValues);
639
+ });
640
  }
641
 
642
  function fv_wp_flowplayer_shortcode_write_arg( sField, sArg, sKind, bCheckbox, aValues ) {
643
+ var element;
644
+ if ( typeof(sField) == "string" ) {
645
+ element = document.getElementById(sField);
646
+ } else {
647
+ element = sField;
648
+ }
649
+ if( typeof(element) == "undefined") {
650
  return false;
651
  }
652
 
653
  var sValue = false;
654
  if( bCheckbox ) {
655
+ if( element.checked ){
656
  if( aValues ) {
657
  sValue = aValues[0];
658
  } else {
660
  }
661
  }
662
  } else if( aValues ){
663
+ if( typeof(aValues[element.selectedIndex -1 ]) == "undefined" ) {
664
  return false;
665
  }
666
+ sValue = aValues[element.selectedIndex -1 ];
667
+ } else if( element.value != '' ) {
668
+ sValue = element.value.trim();
669
  var sOutput = false;
670
 
671
  if( sKind == "int" ) {
697
  fv_wp_fp_shortcode += ' '+sArg+'='+sOutput;
698
  }
699
  return sValue;
700
+ }
languages/fv_flowplayer-sk_SK.mo ADDED
Binary file
languages/fv_flowplayer-sk_SK.po ADDED
@@ -0,0 +1,410 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: FV Wordpress Flowplayer v2.3.13\n"
4
+ "POT-Creation-Date: 2015-05-22 16:08+0100\n"
5
+ "PO-Revision-Date: 2015-05-22 16:13+0100\n"
6
+ "Last-Translator: \n"
7
+ "Language-Team: \n"
8
+ "Language: sk_SK\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.7.6\n"
13
+ "X-Poedit-Basepath: .\n"
14
+ "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
15
+ "X-Poedit-KeywordsList: _e;_n;__\n"
16
+ "X-Poedit-SearchPath-0: ..\n"
17
+
18
+ #: ../controller/backend.php:250
19
+ #, php-format
20
+ msgid ""
21
+ "FV Wordpress Flowplayer has found old shortcodes in the content of your "
22
+ "posts. <a href=\"%1$s\">Run the conversion script.</a>"
23
+ msgstr ""
24
+
25
+ #: ../controller/backend.php:329
26
+ msgid "FV Player Video Checker"
27
+ msgstr ""
28
+
29
+ #: ../controller/backend.php:330
30
+ msgid ""
31
+ "<p>FV Player includes a free video checker which will check your videos for "
32
+ "any encoding errors and helps ensure smooth playback of all your videos. To "
33
+ "work its magic, our video checker must contact our server.</p><p>Would you "
34
+ "like to enable the video encoding checker?</p>"
35
+ msgstr ""
36
+
37
+ #: ../controller/backend.php:332
38
+ msgid "Allow"
39
+ msgstr "Povoliť"
40
+
41
+ #: ../controller/backend.php:333
42
+ msgid "Disable the video checker"
43
+ msgstr "Zakázať video kontrolu"
44
+
45
+ #: ../controller/backend.php:345
46
+ msgid "FV Flowplayer License Update"
47
+ msgstr "Aktualizovať FV Flowplayer licenciu"
48
+
49
+ #: ../controller/backend.php:346
50
+ msgid ""
51
+ "New version of FV Flowplayer core has been installed for your licensed "
52
+ "website. Please accept the automatic license key updating (connects to "
53
+ "Foliovision servers) or update the key manually by loggin into your "
54
+ "Foliovision account."
55
+ msgstr ""
56
+
57
+ #: ../controller/backend.php:348
58
+ msgid "Always auto-update"
59
+ msgstr "Stále automatický aktualizovať"
60
+
61
+ #: ../controller/backend.php:349
62
+ msgid "I'll update it manually"
63
+ msgstr "Aktualizujem to ručne"
64
+
65
+ #: ../controller/frontend.php:48
66
+ msgid "Video loading aborted"
67
+ msgstr "Načítanie videa prerušené"
68
+
69
+ #: ../controller/frontend.php:49
70
+ msgid "Network error"
71
+ msgstr "Chyba siete"
72
+
73
+ #: ../controller/frontend.php:50
74
+ msgid "Video not properly encoded"
75
+ msgstr "Video nie je správne nakódované"
76
+
77
+ #: ../controller/frontend.php:51
78
+ msgid "Video file not found"
79
+ msgstr "Súbor s videom nebol nájdený"
80
+
81
+ #: ../controller/frontend.php:52
82
+ msgid "Unsupported video"
83
+ msgstr "Nepodporované video"
84
+
85
+ #: ../controller/frontend.php:53
86
+ msgid "Skin not found"
87
+ msgstr "Skin nebol nájdený"
88
+
89
+ #: ../controller/frontend.php:54
90
+ msgid "SWF file not found"
91
+ msgstr "SWF súbor nebol nájdený"
92
+
93
+ #: ../controller/frontend.php:55
94
+ msgid "Subtitles not found"
95
+ msgstr "Titulky neboli nájdené"
96
+
97
+ #: ../controller/frontend.php:56
98
+ msgid "Invalid RTMP URL"
99
+ msgstr "Neplatná RTMP URL"
100
+
101
+ #: ../controller/frontend.php:57
102
+ msgid "Unsupported video format. Try installing Adobe Flash."
103
+ msgstr "Nepodporovaný video formát. Skúste nainštalovať Adobe Flash."
104
+
105
+ #: ../controller/frontend.php:58 ../models/flowplayer-frontend.php:169
106
+ msgid "Click to watch the video"
107
+ msgstr "Kliknite pre pozeranie videa"
108
+
109
+ #: ../controller/frontend.php:59 ../models/flowplayer-frontend.php:169
110
+ msgid "[This post contains video, click to play]"
111
+ msgstr "[Tento post obsahuje video, kliknite pre prehratie]"
112
+
113
+ #: ../controller/frontend.php:60
114
+ msgid ""
115
+ "<h2>Video file expired.<br />Please reload the page and play it again.</h2>"
116
+ msgstr ""
117
+ "<h2>Súbor s videom expiroval.<br />Pre prehratie videa prosím znova "
118
+ "načítajte stránku .</h2>"
119
+
120
+ #: ../controller/frontend.php:61
121
+ msgid ""
122
+ "<h2>Unsupported video format.<br />Please use a Flash compatible device.</h2>"
123
+ msgstr ""
124
+ "<h2>Nepodporovaný video formát.<br />Použite zariadenie podporujúce Flash "
125
+ "prosím.</h2>"
126
+
127
+ #: ../controller/frontend.php:62
128
+ msgid "Mobile browser detected, serving low bandwidth video."
129
+ msgstr "Mobilný telefón prehráva video so zníženou kvalitou."
130
+
131
+ #: ../controller/frontend.php:63
132
+ msgid "Click here"
133
+ msgstr "Kliknite sem"
134
+
135
+ #: ../controller/frontend.php:64
136
+ msgid "for full quality."
137
+ msgstr "pre plnú kvalitu."
138
+
139
+ #: ../controller/frontend.php:65 ../controller/frontend.php:66
140
+ msgid ""
141
+ "<h2>Live stream load failed.</h2><h3>Please try again later, perhaps the "
142
+ "stream is currently offline.</h3>"
143
+ msgstr ""
144
+ "<h2>Načítanie živého prenosu zlyhalo.</h2><h3>Prenos je pravdepodobne "
145
+ "dočasne pozastavený. Skúste to neskôr, prosím.</h3>"
146
+
147
+ #: ../controller/frontend.php:67
148
+ msgid "Please tell us what is wrong :"
149
+ msgstr "Prosím, povedzte nám čo je zlé :"
150
+
151
+ #: ../controller/frontend.php:68
152
+ msgid ""
153
+ "Please give us more information (a full sentence) so we can help you better"
154
+ msgstr ""
155
+ "Prosím, dajte nám viac informácií (celou vetou). Potom Vám budeme vedieť "
156
+ "ľahšie pomôcť "
157
+
158
+ #: ../controller/frontend.php:436
159
+ #, php-format
160
+ msgid "Posts by %s"
161
+ msgstr ""
162
+
163
+ #: ../models/checker.php:315
164
+ msgid "Every 5 minutes"
165
+ msgstr ""
166
+
167
+ #: ../view/admin.php:31
168
+ msgid "Default Ad Code"
169
+ msgstr "Predvoleny kod"
170
+
171
+ #: ../view/admin.php:36
172
+ msgid "Default set size"
173
+ msgstr "Predvolena velkost"
174
+
175
+ #: ../view/wizard.php:75
176
+ msgid "(remove)"
177
+ msgstr "(zmazať)"
178
+
179
+ #: ../view/wizard.php:76 ../view/wizard.php:96 ../view/wizard.php:105
180
+ msgid "Video"
181
+ msgstr "Video"
182
+
183
+ #: ../view/wizard.php:80 ../view/wizard.php:99 ../view/wizard.php:108
184
+ #: ../view/wizard.php:132
185
+ msgid "Add Video"
186
+ msgstr "Pridaj video"
187
+
188
+ #: ../view/wizard.php:87
189
+ msgid "Video Duration"
190
+ msgstr "Dĺžka videa"
191
+
192
+ #: ../view/wizard.php:88
193
+ msgid "File size"
194
+ msgstr "Veľkosť videa"
195
+
196
+ #: ../view/wizard.php:92 ../view/wizard.php:231
197
+ msgid "Width"
198
+ msgstr "Šírka"
199
+
200
+ #: ../view/wizard.php:92 ../view/wizard.php:231
201
+ msgid "Height"
202
+ msgstr "Výška"
203
+
204
+ #: ../view/wizard.php:96 ../view/wizard.php:105
205
+ msgid "(another format)"
206
+ msgstr "(iný formát)"
207
+
208
+ #: ../view/wizard.php:114
209
+ msgid "RTMP Server"
210
+ msgstr "RTMP server"
211
+
212
+ #: ../view/wizard.php:114
213
+ msgid "Leave empty to use Flash streaming server from plugin settings"
214
+ msgstr ""
215
+ "Nechajte prázdne pre použitie Flash streaming servra z nastavení pluginu"
216
+
217
+ #: ../view/wizard.php:117
218
+ msgid "RTMP Path"
219
+ msgstr "RTMP cesta"
220
+
221
+ #: ../view/wizard.php:124
222
+ msgid "Add another format"
223
+ msgstr "Pridaj iný formát"
224
+
225
+ #: ../view/wizard.php:124
226
+ msgid "(i.e. WebM, OGV)"
227
+ msgstr "(napr. WebM, OGV)"
228
+
229
+ #: ../view/wizard.php:125
230
+ msgid "Add RTMP"
231
+ msgstr "Pridajt RTMP"
232
+
233
+ #: ../view/wizard.php:129
234
+ msgid "Mobile Video"
235
+ msgstr "Video pre mobil"
236
+
237
+ #: ../view/wizard.php:130
238
+ msgid "Put low-bandwidth video here or leave blank"
239
+ msgstr "Vložte low-bandwith video alebo nechajte prázdne"
240
+
241
+ #: ../view/wizard.php:137
242
+ msgid "Splash Image"
243
+ msgstr "Obrázok videa"
244
+
245
+ #: ../view/wizard.php:140
246
+ msgid "Add Image"
247
+ msgstr "Pridaj obrázok"
248
+
249
+ #: ../view/wizard.php:145
250
+ msgid "Subtitles"
251
+ msgstr "Titulky"
252
+
253
+ #: ../view/wizard.php:148
254
+ msgid "Add Subtitles"
255
+ msgstr "Pridaj titulky"
256
+
257
+ #: ../view/wizard.php:153
258
+ msgid "Caption"
259
+ msgstr "Názov"
260
+
261
+ #: ../view/wizard.php:164
262
+ msgid "Add Playlist Item"
263
+ msgstr "Pridaj video do playlistu"
264
+
265
+ #: ../view/wizard.php:181
266
+ msgid "Additional features"
267
+ msgstr "Rozšírené funkcie"
268
+
269
+ #: ../view/wizard.php:184
270
+ msgid "HTML Popup"
271
+ msgstr "HTML Popup"
272
+
273
+ #: ../view/wizard.php:188
274
+ msgid "Redirect to"
275
+ msgstr "Presmerovať na"
276
+
277
+ #: ../view/wizard.php:192
278
+ msgid "Autoplay"
279
+ msgstr "Auto. prehratie"
280
+
281
+ #: ../view/wizard.php:195 ../view/wizard.php:217 ../view/wizard.php:239
282
+ #: ../view/wizard.php:249
283
+ msgid "Default"
284
+ msgstr "Predvolené"
285
+
286
+ #: ../view/wizard.php:196 ../view/wizard.php:218
287
+ msgid "On"
288
+ msgstr "Zapnuté"
289
+
290
+ #: ../view/wizard.php:197 ../view/wizard.php:219
291
+ msgid "Off"
292
+ msgstr "Vypnuté"
293
+
294
+ #: ../view/wizard.php:202
295
+ msgid "Loop"
296
+ msgstr "Slučka"
297
+
298
+ #: ../view/wizard.php:207
299
+ msgid "Splash end"
300
+ msgstr "Koncový obrázok"
301
+
302
+ #: ../view/wizard.php:210
303
+ msgid "(show splash image at the end)"
304
+ msgstr "(zobraz obrázok po prehratí videa)"
305
+
306
+ #: ../view/wizard.php:214
307
+ msgid "Embedding"
308
+ msgstr "Vkladanie"
309
+
310
+ #: ../view/wizard.php:224
311
+ msgid "Ad code"
312
+ msgstr "Reklama(HTML alebo skript)"
313
+
314
+ #: ../view/wizard.php:232
315
+ msgid "Skip global ad in this video"
316
+ msgstr "Vynechaj reklamu"
317
+
318
+ #: ../view/wizard.php:236
319
+ msgid "Align"
320
+ msgstr "Zarovnanie"
321
+
322
+ #: ../view/wizard.php:240
323
+ msgid "Left"
324
+ msgstr "Vľavo"
325
+
326
+ #: ../view/wizard.php:241
327
+ msgid "Right"
328
+ msgstr "Vpravo"
329
+
330
+ #: ../view/wizard.php:246
331
+ msgid "Controlbar"
332
+ msgstr "Ovládacia lišta"
333
+
334
+ #: ../view/wizard.php:250
335
+ msgid "Yes"
336
+ msgstr "Áno"
337
+
338
+ #: ../view/wizard.php:251
339
+ msgid "No"
340
+ msgstr "Nie"
341
+
342
+ #: ../view/wizard.php:256
343
+ msgid "Live Stream"
344
+ msgstr "Živý prenos"
345
+
346
+ #: ../view/wizard.php:263
347
+ msgid "Insert"
348
+ msgstr "Vlož"
349
+
350
+ #: ../view/wizard.php:269
351
+ msgid ""
352
+ "Admin note: Video uploads are currenty disabled, set Allow User Uploads to "
353
+ "true in"
354
+ msgstr ""
355
+ "Poznámka pre admina: Upload videa je dočasne zakázaný, zaškrtnite 'Povoliť "
356
+ "upload uživateľovi' v "
357
+
358
+ #: ../view/wizard.php:269 ../view/wizard.php:276
359
+ msgid "Settings"
360
+ msgstr "nastaveniach"
361
+
362
+ #: ../view/wizard.php:276
363
+ msgid "Admin note: Enable more per video features in Interface options in"
364
+ msgstr ""
365
+ "Poznámka pre admina: Nové funkcie videa nájdete v Používateľskom rozhraní v"
366
+
367
+ #: ../view/wizard.php:281
368
+ msgid "currently not working with playlist"
369
+ msgstr "dočasne nefunguje s playlistom"
370
+
371
+ #~ msgid ""
372
+ #~ "<p class=\"fv-flowplayer-mobile-switch\">Mobile browser detected, serving "
373
+ #~ "low bandwidth video. <a href=\""
374
+ #~ msgstr ""
375
+ #~ "<p class=\"fv-flowplayer-mobile-switch\">Mobilné zariadenie prehráva "
376
+ #~ "video s nižšou kvalitou. <a href=\""
377
+
378
+ #~ msgid "?fv_flowplayer_mobile=no\">Click here</a> for full quality.</p>"
379
+ #~ msgstr "?fv_flowplayer_mobile=no\">Kliknite sem</a> pre plnú kvalitu.</p>"
380
+
381
+ #~ msgid ""
382
+ #~ "<div class=\"fp-message\"><h2>Live stream load failed.</h2><h3>Please try "
383
+ #~ "again later, perhaps the stream is currently offline.</h3></div>"
384
+ #~ msgstr ""
385
+ #~ "<div class=\"fp-message\"><h2>Načítanie živého prenosu zlyhalo.</"
386
+ #~ "h2><h3>Prenos je pravdepodobne dočasne pozastavený. Skúste to neskôr, "
387
+ #~ "prosím.</h3></div>"
388
+
389
+ #~ msgid ""
390
+ #~ "<p class=\"fv_flowplayer_submit_error\" style=\"display:none; "
391
+ #~ "\"><strong>Please tell us what is wrong</strong>:</p>"
392
+ #~ msgstr ""
393
+ #~ "<p class=\"fv_flowplayer_submit_error\" style=\"display:none; "
394
+ #~ "\"><strong>Prosím, povedzte nám čo je zlé</strong>:</p>"
395
+
396
+ #~ msgid ""
397
+ #~ "<p class=\"fv_flowplayer_submit_error\" style=\"display:none; "
398
+ #~ "\"><strong>Please give us more information (a full sentence) so we can "
399
+ #~ "help you better</strong>:</p>"
400
+ #~ msgstr ""
401
+ #~ "<p class=\"fv_flowplayer_submit_error\" style=\"display:none; "
402
+ #~ "\"><strong>Prosím, dajte nám viac informácií ( celou vetou),potom Vám "
403
+ #~ "budeme môcť lepšie pomôcť</strong>:</p>"
404
+
405
+ #~ msgid ""
406
+ #~ "Admin note: Video uploads are currenty disabled, set 'Allow User Uploads' "
407
+ #~ "to true in"
408
+ #~ msgstr ""
409
+ #~ "Poznámka pre admina: Upload videa je dočasne zakázaný, zaškrtnite "
410
+ #~ "'Povoliť upload uživateľovi' v "
models/flowplayer-frontend.php CHANGED
@@ -77,19 +77,6 @@ class flowplayer_frontend extends flowplayer
77
 
78
  $src1 = ( isset($this->aCurArgs['src1']) && !empty($this->aCurArgs['src1']) ) ? trim($this->aCurArgs['src1']) : false;
79
  $src2 = ( isset($this->aCurArgs['src2']) && !empty($this->aCurArgs['src2']) ) ? trim($this->aCurArgs['src2']) : false;
80
-
81
-
82
- $autoplay = false;
83
- if( isset($this->conf['autoplay']) && $this->conf['autoplay'] == 'true' && $this->aCurArgs['autoplay'] != 'false' ) {
84
- $this->autobuffer_count++;
85
- if( $this->autobuffer_count < apply_filters( 'fv_flowplayer_autobuffer_limit', 2 ) ) {
86
- $autoplay = true;
87
- }
88
- }
89
- if( isset($this->aCurArgs['autoplay']) && $this->aCurArgs['autoplay'] == 'true') {
90
- $this->autobuffer_count++;
91
- $autoplay = true;
92
- }
93
 
94
 
95
  $splash_img = $this->get_splash();
@@ -157,6 +144,20 @@ class flowplayer_frontend extends flowplayer
157
 
158
  $this->aCurArgs = apply_filters( 'fv_flowplayer_args', $this->aCurArgs, $this->hash, $media, $aPlaylistItems );
159
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  $player_type = apply_filters( 'fv_flowplayer_player_type', $player_type, $this->hash, $media, $aPlaylistItems, $this->aCurArgs );
161
 
162
 
@@ -434,9 +435,10 @@ class flowplayer_frontend extends flowplayer
434
 
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]);
@@ -447,12 +449,13 @@ class flowplayer_frontend extends flowplayer
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
  }
 
456
  $this->ret['html'] .= "\t"."\t".'<source src="'.$extension.trim($rtmp_file, " \t\n\r\0\x0B/").'" type="video/flash" />'."\n";
457
  }
458
  }
@@ -463,7 +466,8 @@ class flowplayer_frontend extends flowplayer
463
 
464
  $this->ret['html'] .= "\t".'</video>';//."\n";
465
  }
466
-
 
467
 
468
  if( isset($splashend_contents) ) {
469
  $this->ret['html'] .= $splashend_contents;
@@ -474,7 +478,10 @@ class flowplayer_frontend extends flowplayer
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
 
@@ -603,6 +610,26 @@ class flowplayer_frontend extends flowplayer
603
  return $sClass;
604
  }
605
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
606
 
607
  function get_chrome_fail_code( $media, $src1, $src2, $attributes_html ) {
608
  $count = $mp4_position = $webm_position = 0;
@@ -665,6 +692,24 @@ class flowplayer_frontend extends flowplayer
665
  }
666
 
667
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
668
  function get_splash() {
669
  $splash_img = false;
670
  if (isset($this->aCurArgs['splash']) && !empty($this->aCurArgs['splash'])) {
@@ -831,14 +876,7 @@ HTML;
831
 
832
  return $sHTML;
833
  }
 
834
 
835
-
836
- /**
837
- * Displays the elements that need to be added to frontend.
838
- */
839
- function flowplayer_head() {
840
- include dirname( __FILE__ ) . '/../view/frontend-head.php';
841
- }
842
-
843
  }
844
 
77
 
78
  $src1 = ( isset($this->aCurArgs['src1']) && !empty($this->aCurArgs['src1']) ) ? trim($this->aCurArgs['src1']) : false;
79
  $src2 = ( isset($this->aCurArgs['src2']) && !empty($this->aCurArgs['src2']) ) ? trim($this->aCurArgs['src2']) : false;
 
 
 
 
 
 
 
 
 
 
 
 
 
80
 
81
 
82
  $splash_img = $this->get_splash();
144
 
145
  $this->aCurArgs = apply_filters( 'fv_flowplayer_args', $this->aCurArgs, $this->hash, $media, $aPlaylistItems );
146
 
147
+
148
+ $autoplay = false; // todo: should be changed into a property
149
+ if( isset($this->conf['autoplay']) && $this->conf['autoplay'] == 'true' && $this->aCurArgs['autoplay'] != 'false' ) {
150
+ $this->autobuffer_count++;
151
+ if( $this->autobuffer_count < apply_filters( 'fv_flowplayer_autobuffer_limit', 2 ) ) {
152
+ $autoplay = true;
153
+ }
154
+ }
155
+ if( isset($this->aCurArgs['autoplay']) && $this->aCurArgs['autoplay'] == 'true') {
156
+ $this->autobuffer_count++;
157
+ $autoplay = true;
158
+ }
159
+
160
+
161
  $player_type = apply_filters( 'fv_flowplayer_player_type', $player_type, $this->hash, $media, $aPlaylistItems, $this->aCurArgs );
162
 
163
 
435
 
436
  foreach( apply_filters( 'fv_player_media_rtmp', array($rtmp),$this ) AS $rtmp_item ) {
437
  $rtmp_item = apply_filters( 'fv_flowplayer_video_src', $rtmp_item, $this );
438
+
439
+ if( preg_match( '~([a-zA-Z0-9]+)?:~', $rtmp ) ) {
440
+ $aTMP = preg_split( '~([a-zA-Z0-9]+)?:~', $rtmp, -1, PREG_SPLIT_DELIM_CAPTURE );
441
+
442
  if( isset($aTMP[1]) && isset($aTMP[2]) ) {
443
  $rtmp_file = $aTMP[2];
444
  $extension = $this->get_file_extension($rtmp_file, $aTMP[1]);
449
  } else {
450
  $rtmp_url = parse_url($rtmp_item);
451
  $rtmp_file = $rtmp_url['path'] . ( ( !empty($rtmp_url['query']) ) ? '?'. str_replace( '&amp;', '&', $rtmp_url['query'] ) : '' );
452
+ $extension = $this->get_file_extension($rtmp_url['path'], false);
453
  }
454
 
455
  if( $extension ) {
456
  $extension .= ':';
457
  }
458
+
459
  $this->ret['html'] .= "\t"."\t".'<source src="'.$extension.trim($rtmp_file, " \t\n\r\0\x0B/").'" type="video/flash" />'."\n";
460
  }
461
  }
466
 
467
  $this->ret['html'] .= "\t".'</video>';//."\n";
468
  }
469
+
470
+ $this->ret['html'] .= $this->get_buttons();
471
 
472
  if( isset($splashend_contents) ) {
473
  $this->ret['html'] .= $splashend_contents;
478
  if( $ad_contents = $this->get_ad_code() ) {
479
  $this->aAds["wpfp_{$this->hash}"] = $ad_contents;
480
  }
481
+
482
+ if( flowplayer::is_optimizepress() ) {
483
+ $this->ret['html'] .= '<div class="fp-ui"></div>';
484
+ } else if( current_user_can('manage_options') && !isset($playlist_items_external_html) ) {
485
  $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>';
486
  }
487
 
610
  return $sClass;
611
  }
612
 
613
+
614
+ function get_buttons() {
615
+ add_filter( 'fv_flowplayer_buttons_center', array( $this, 'get_speed_buttons' ) );
616
+
617
+ $sHTML = false;
618
+ foreach( array('left','center','right','controlbar') AS $key ) {
619
+ $aButtons = apply_filters( 'fv_flowplayer_buttons_'.$key, array() );
620
+ if( !$aButtons || !count($aButtons) ) continue;
621
+
622
+ $sButtons = implode( '', $aButtons );
623
+ $sHTML .= "<div class='fv-player-buttons fv-player-buttons-$key'>$sButtons</div>";
624
+ }
625
+ if( $sHTML ) {
626
+ $sHTML = "<div class='fv-player-buttons-wrap'>$sHTML</div>";
627
+ }
628
+
629
+ //var_dump($sHTML);die();
630
+ return $sHTML;
631
+ }
632
+
633
 
634
  function get_chrome_fail_code( $media, $src1, $src2, $attributes_html ) {
635
  $count = $mp4_position = $webm_position = 0;
692
  }
693
 
694
 
695
+ function get_speed_buttons( $aButtons ) {
696
+ $bShow = false;
697
+ if( isset($this->conf['ui_speed']) && $this->conf['ui_speed'] == "true" || isset($this->aCurArgs['speed']) && $this->aCurArgs['speed'] == 'buttons' ) {
698
+ $bShow = true;
699
+ }
700
+
701
+ if( isset($this->aCurArgs['speed']) && $this->aCurArgs['speed'] == 'no' ) {
702
+ $bShow = false;
703
+ }
704
+
705
+ if( $bShow ) {
706
+ $aButtons[] = "<ul class='fv-player-speed'><li><a class='fv_sp_slower'>&#45;</a></li><li><a class='fv_sp_faster'>&#43;</a></li></ul>";
707
+ }
708
+
709
+ return $aButtons;
710
+ }
711
+
712
+
713
  function get_splash() {
714
  $splash_img = false;
715
  if (isset($this->aCurArgs['splash']) && !empty($this->aCurArgs['splash'])) {
876
 
877
  return $sHTML;
878
  }
879
+
880
 
 
 
 
 
 
 
 
 
881
  }
882
 
models/flowplayer.php CHANGED
@@ -47,7 +47,9 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
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
 
@@ -90,6 +92,9 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
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
 
@@ -259,7 +264,11 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
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
  }
@@ -329,7 +338,11 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
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
  }
@@ -377,12 +390,12 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
377
 
378
 
379
 
380
- function css_generate( $style_tag = true ) {
381
  global $fv_fp;
382
 
383
  $iMarginBottom = (isset($fv_fp->conf['marginBottom']) && intval($fv_fp->conf['marginBottom']) > -1 ) ? intval($fv_fp->conf['marginBottom']) : '28';
384
 
385
- if( $style_tag ) : ?>
386
  <style type="text/css">
387
  <?php endif;
388
 
@@ -394,7 +407,7 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
394
  .flowplayer { border: 1px solid <?php echo trim($fv_fp->conf['borderColor']); ?> !important; }
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; }
@@ -403,7 +416,7 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
403
  .flowplayer .fp-volumelevel { background-color: <?php echo trim($fv_fp->conf['progressColor']); ?> !important; }
404
  .flowplayer .fp-volumeslider { background-color: <?php echo trim($fv_fp->conf['bufferColor']); ?> !important; }
405
  .flowplayer .fp-timeline { background-color: <?php echo trim($fv_fp->conf['timelineColor']); ?> !important; }
406
- .flowplayer .fp-progress { background-color: <?php echo trim($fv_fp->conf['progressColor']); ?> !important; }
407
  .flowplayer .fp-buffer { background-color: <?php echo trim($fv_fp->conf['bufferColor']); ?> !important; }
408
  #content .flowplayer, .flowplayer { font-family: <?php echo trim($fv_fp->conf['font-face']); ?>; }
409
 
@@ -423,6 +436,8 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
423
  .wpfp_custom_ad { color: <?php echo trim($fv_fp->conf['adTextColor']); ?>; }
424
  .wpfp_custom_ad a { color: <?php echo trim($fv_fp->conf['adLinksColor']); ?> }
425
 
 
 
426
  .fvfp_admin_error { color: <?php echo trim($fv_fp->conf['durationColor']); ?>; }
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']); ?>; }
@@ -443,16 +458,21 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
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>
448
  <?php endif;
449
  }
450
 
451
 
452
- function css_get() {
 
 
 
 
453
  global $fv_wp_flowplayer_ver;
454
- $bInline = true;
455
- $sURL = FV_FP_RELATIVE_PATH.'/css/flowplayer.css?ver='.$fv_wp_flowplayer_ver;
 
456
 
457
  if( is_multisite() ) {
458
  global $blog_id;
@@ -464,16 +484,23 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
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()];
468
- $bInline = false;
 
469
  }
470
  }
471
 
472
- echo '<link rel="stylesheet" href="'.$sURL.'" type="text/css" media="screen" />'."\n";
473
- if( $bInline ) {
474
- $this->css_generate();
 
 
 
 
 
 
475
  }
476
- return ;
477
  }
478
 
479
 
@@ -525,12 +552,13 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
525
  }
526
 
527
  ob_start();
528
- $this->css_generate(false);
529
  $sCSS = "\n/*CSS writeout performed on FV Flowplayer Settings save on ".date('r')."*/\n".ob_get_clean();
530
  if( !$sCSSCurrent = $wp_filesystem->get_contents( self::get_plugin_url().'/css/flowplayer.css' ) ) {
531
  return false;
532
  }
533
  $sCSSCurrent = preg_replace( '~url\((")?~', 'url($1'.self::get_plugin_url().'/css/', $sCSSCurrent ); // fix relative paths!
 
534
 
535
  if( !$wp_filesystem->put_contents( $filename, $sCSSCurrent.$sCSS, FS_CHMOD_FILE) ) {
536
  return false;
@@ -578,14 +606,22 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
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
@@ -748,6 +784,8 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
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' ) {
@@ -820,25 +858,14 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
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 );
@@ -846,7 +873,18 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
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 ) {
@@ -891,6 +929,16 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
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
  }
@@ -904,21 +952,6 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
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
 
47
 
48
  var $ret = array('html' => false, 'script' => false);
49
 
50
+ var $hash = false;
51
+
52
+ var $bCSSInline = false;
53
 
54
  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 }";
55
 
92
  add_filter( 'fv_flowplayer_video_src', array( $this, 'get_amazon_secure'), 10, 2 );
93
 
94
  add_filter('fv_flowplayer_css_writeout', array( $this, 'css_writeout_option' ) );
95
+
96
+ add_action( 'wp_enqueue_scripts', array( $this, 'css_enqueue' ) );
97
+ add_action( 'admin_enqueue_scripts', array( $this, 'css_enqueue' ) );
98
 
99
  }
100
 
264
  $actual_media_url = $media_url;
265
  }
266
  if( stripos( $media_item, 'rtmp:' ) === 0 ) {
267
+ if( !preg_match( '~^[a-z0-9]+:~', $actual_media_url ) ) {
268
+ $aItem[] = array( 'flash' => $this->get_file_extension($actual_media_url,'mp4').':'.str_replace( '+', ' ', $actual_media_url ) );
269
+ } else {
270
+ $aItem[] = array( 'flash' => str_replace( '+', ' ', $actual_media_url ) );
271
+ }
272
  } else {
273
  $aItem[] = array( $this->get_file_extension($actual_media_url) => $actual_media_url );
274
  }
338
  $actual_media_url = $media_url;
339
  }
340
  if( stripos( $aPlaylist_item_i, 'rtmp:' ) === 0 ) {
341
+ if( !preg_match( '~^[a-z0-9]+:~', $actual_media_url ) ) {
342
+ $aItem[] = array( 'flash' => $this->get_file_extension($actual_media_url,'mp4').':'.str_replace( '+', ' ', $actual_media_url ) );
343
+ } else {
344
+ $aItem[] = array( 'flash' => str_replace( '+', ' ', $actual_media_url ) );
345
+ }
346
  } else {
347
  $aItem[] = array( $this->get_file_extension($aPlaylist_item_i) => $actual_media_url );
348
  }
390
 
391
 
392
 
393
+ function css_generate( $skip_style_tag = true ) {
394
  global $fv_fp;
395
 
396
  $iMarginBottom = (isset($fv_fp->conf['marginBottom']) && intval($fv_fp->conf['marginBottom']) > -1 ) ? intval($fv_fp->conf['marginBottom']) : '28';
397
 
398
+ if( !$skip_style_tag ) : ?>
399
  <style type="text/css">
400
  <?php endif;
401
 
407
  .flowplayer { border: 1px solid <?php echo trim($fv_fp->conf['borderColor']); ?> !important; }
408
  <?php endif; ?>
409
 
410
+ .flowplayer { margin: 0 auto <?php echo $iMarginBottom; ?>px auto; display: block; }
411
  .flowplayer.has-caption, flowplayer.has-caption * { margin: 0 auto; }
412
  .flowplayer .fp-controls { background-color: <?php echo trim($fv_fp->conf['backgroundColor']); ?> !important; }
413
  .flowplayer { background-color: <?php echo trim($fv_fp->conf['canvas']); ?> !important; }
416
  .flowplayer .fp-volumelevel { background-color: <?php echo trim($fv_fp->conf['progressColor']); ?> !important; }
417
  .flowplayer .fp-volumeslider { background-color: <?php echo trim($fv_fp->conf['bufferColor']); ?> !important; }
418
  .flowplayer .fp-timeline { background-color: <?php echo trim($fv_fp->conf['timelineColor']); ?> !important; }
419
+ .flowplayer .fp-progress, .flowplayer .fv-ab-loop .noUi-connect { background-color: <?php echo trim($fv_fp->conf['progressColor']); ?> !important; }
420
  .flowplayer .fp-buffer { background-color: <?php echo trim($fv_fp->conf['bufferColor']); ?> !important; }
421
  #content .flowplayer, .flowplayer { font-family: <?php echo trim($fv_fp->conf['font-face']); ?>; }
422
 
436
  .wpfp_custom_ad { color: <?php echo trim($fv_fp->conf['adTextColor']); ?>; }
437
  .wpfp_custom_ad a { color: <?php echo trim($fv_fp->conf['adLinksColor']); ?> }
438
 
439
+ .fv-wp-flowplayer-notice-small { color: <?php echo trim($fv_fp->conf['timeColor']); ?> !important; }
440
+
441
  .fvfp_admin_error { color: <?php echo trim($fv_fp->conf['durationColor']); ?>; }
442
  .fvfp_admin_error a { color: <?php echo trim($fv_fp->conf['durationColor']); ?>; }
443
  #content .fvfp_admin_error a { color: <?php echo trim($fv_fp->conf['durationColor']); ?>; }
458
 
459
  <?php if( isset($fv_fp->conf['player-position']) && 'left' == $fv_fp->conf['player-position'] ) : ?>.flowplayer { margin-left: 0; }<?php endif; ?>
460
 
461
+ <?php if( !$skip_style_tag ) : ?>
462
  </style>
463
  <?php endif;
464
  }
465
 
466
 
467
+ function css_enqueue() {
468
+ if( is_admin() && ( !isset($_GET['page']) || $_GET['page'] != 'fvplayer' ) ) {
469
+ return;
470
+ }
471
+
472
  global $fv_wp_flowplayer_ver;
473
+ $this->bCSSInline = true;
474
+ $sURL = FV_FP_RELATIVE_PATH.'/css/flowplayer.css';
475
+ $sVer = $fv_wp_flowplayer_ver;
476
 
477
  if( is_multisite() ) {
478
  global $blog_id;
484
  if( apply_filters('fv_flowplayer_css_writeout', true ) && isset($this->conf[$this->css_option()]) && $this->conf[$this->css_option()] ) {
485
  $filename = trailingslashit(WP_CONTENT_DIR).'fv-flowplayer-custom/style-'.$site_id.'.css';
486
  if( @file_exists($filename) ) {
487
+ $sURL = trailingslashit( str_replace( array('/plugins','\\plugins'), '', plugins_url() )).'fv-flowplayer-custom/style-'.$site_id.'.css';
488
+ $sVer = $this->conf[$this->css_option()];
489
+ $this->bCSSInline = false;
490
  }
491
  }
492
 
493
+ wp_enqueue_style( 'fv_flowplayer', $sURL, array(), $sVer );
494
+
495
+ if( current_user_can('manage_options') ) {
496
+ wp_enqueue_style( 'fv_flowplayer_admin', FV_FP_RELATIVE_PATH.'/css/admin.css', array(), $fv_wp_flowplayer_ver );
497
+ }
498
+
499
+ if( $this->bCSSInline ) {
500
+ add_action( 'wp_head', array( $this, 'css_generate' ) );
501
+ add_action( 'admin_head', array( $this, 'css_generate' ) );
502
  }
503
+
504
  }
505
 
506
 
552
  }
553
 
554
  ob_start();
555
+ $this->css_generate(true);
556
  $sCSS = "\n/*CSS writeout performed on FV Flowplayer Settings save on ".date('r')."*/\n".ob_get_clean();
557
  if( !$sCSSCurrent = $wp_filesystem->get_contents( self::get_plugin_url().'/css/flowplayer.css' ) ) {
558
  return false;
559
  }
560
  $sCSSCurrent = preg_replace( '~url\((")?~', 'url($1'.self::get_plugin_url().'/css/', $sCSSCurrent ); // fix relative paths!
561
+ $sCSSCurrent = str_replace( array('http://', 'https://'), array('//','//'), $sCSSCurrent );
562
 
563
  if( !$wp_filesystem->put_contents( $filename, $sCSSCurrent.$sCSS, FS_CHMOD_FILE) ) {
564
  return false;
606
  $time = apply_filters( 'fv_flowplayer_amazon_expires', $time, $media );
607
 
608
  $url_components = parse_url($resource);
609
+
610
+ $iAWSVersion = ( isset($fv_fp->conf['amazon_region'][$amazon_key]) && $fv_fp->conf['amazon_region'][$amazon_key] ) ? 4 : 2;
611
+
612
+ if( $iAWSVersion == 4 ) {
613
+ $url_components['path'] = str_replace('+', ' ', $url_components['path']);
614
+ }
615
+
616
+ $url_components['path'] = rawurlencode($url_components['path']);
617
  $url_components['path'] = str_replace('%2F', '/', $url_components['path']);
618
+ $url_components['path'] = str_replace('%2B', '+', $url_components['path']);
619
+ $url_components['path'] = str_replace('%2523', '%23', $url_components['path']);
620
+ $url_components['path'] = str_replace('%252B', '%2B', $url_components['path']);
621
+
622
+ $sGlue = ( $aArgs['url_only'] ) ? '&' : '&amp;';
623
 
624
+ if( $iAWSVersion == 4 ) {
 
625
  $sXAMZDate = date('Ymd\THis\Z');
626
  $sDate = date('Ymd');
627
  $sCredentialScope = $sDate."/".$fv_fp->conf['amazon_region'][$amazon_key]."/s3/aws4_request"; // todo: variable
784
  } else {
785
  if ($extension == 'm3u8' || $extension == 'm3u') {
786
  $output = 'x-mpegurl';
787
+ } else if ($extension == 'mpd') {
788
+ $output = 'dash+xml';
789
  } else if ($extension == 'm4v') {
790
  $output = 'mp4';
791
  } else if( $extension == 'mp3' ) {
858
  $source_flash_encoded = false;
859
  if( $this->is_secure_amazon_s3($media) /*&& stripos($media,'.webm') === false && stripos($media,'.ogv') === false */) {
860
  $media_fixed = str_replace('%2B', '%25252B',$media);
861
+ $media_fixed = str_replace('%23', '%252523',$media_fixed );
862
+ $media_fixed = str_replace('+', '%2B',$media_fixed );
863
  // only if there was a change and we don't have an RTMP for Flash
864
  if( $media_fixed != $media && empty($aArgs['rtmp']) ) {
865
  $source_flash_encoded = $media_fixed;
866
  }
867
  }
868
 
 
 
 
 
 
 
 
 
 
 
 
 
 
869
  if( $aArgs['url_only'] ) {
870
  if( $aArgs['flash'] && $source_flash_encoded ) {
871
  return array( 'media' => $media, 'flash' => $source_flash_encoded );
873
  return trim($media);
874
  }
875
  } else {
876
+ switch($extension) {
877
+ case 'dash+xml' :
878
+ $mime_type = 'application/'.$extension;
879
+ break;
880
+ case 'x-mpegurl' :
881
+ $mime_type = 'application/'.$extension;
882
+ break;
883
+ default:
884
+ $mime_type = 'video/'.$extension;
885
+ break;
886
+ }
887
+
888
  $sReturn = '<source '.$sID.'src="'.trim($media).'" type="'.$mime_type.'" />'."\n";
889
 
890
  if( $source_flash_encoded && strcmp($extension,'mp4') == 0 ) {
929
  }
930
 
931
 
932
+ public static function is_optimizepress() {
933
+ if( ( isset($_GET['page']) && $_GET['page'] == 'optimizepress-page-builder' ) ||
934
+ ( isset($_POST['action']) && $_POST['action'] == 'optimizepress-live-editor-parse' )
935
+ ) {
936
+ return true;
937
+ }
938
+ return false;
939
+ }
940
+
941
+
942
  public function is_secure_amazon_s3( $url ) {
943
  return preg_match( '/^.+?s3.*?\.amazonaws\.com\/.+Signature=.+?$/', $url ) || preg_match( '/^.+?\.cloudfront\.net\/.+Signature=.+?$/', $url );
944
  }
952
  }
953
 
954
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
955
 
956
 
957
 
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: 4.1
7
  Stable tag: trunk
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -318,10 +318,53 @@ Thank you for being part of the HMTL 5 mobile video revolution!
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 =
@@ -989,6 +1032,18 @@ On the right side of this screen, you can see the current visual configuration o
989
 
990
  == Upgrade Notice ==
991
 
 
 
 
 
 
 
 
 
 
 
 
 
992
  = 2.3.8 =
993
 
994
  * New core Flowplayer - fixed for HLS, Flash performance, Windows Phone 8.1
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.2.2
7
  Stable tag: trunk
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
318
 
319
  == Changelog ==
320
 
321
+ = 2.4.2 - 2015/07/22 =
322
+
323
+ * Flowplayer 6 - last preparations for the upgrade
324
+
325
+ = 2.4.1 - 2015/07/20 =
326
+
327
+ * CSS - making sure the CSS writeout uses protocol independent links
328
+
329
+ = 2.4 - 2015/07/15 =
330
+
331
+ * Compatibily - CSS styles are now loaded using WP API wp_enqueue_scripts()
332
+
333
+ = 2.3.17 - 2015/07/07 =
334
+
335
+ * Core - putting in warning for Flowplayer 6 upgrade
336
+
337
+ = 2.3.16 - 2015/05/28 =
338
+
339
+ * Feature - MPEG DASH experimental support
340
+ * Feature - support for translations (covers front-end error messages and shortcode editor)
341
+ * Bugfix - Amazon S3 signed URLs - AWS signature version 4 fixes
342
+ * Bugfix - playlist loading improvements
343
+ * Bugfix - styling fixes (for FV Player Pro)
344
+
345
+ = 2.3.15 - 2015/04/24 =
346
+
347
+ * Bugfix - Fix for fancy quotes in shortcode attributes.
348
+ * Bugfix - Internet Explorer on Windows Phone 8.1 pretend to be Android and iPhone - breaking the playback. Fixed.
349
+ * Bugfix - RTMP extension parsing fix for RTMP path like mp4:file.mp4
350
+
351
+ = 2.3.14 - 2015/04/20 =
352
+
353
+ * Feature - speed control buttons - check Settings -> FV Wordpress Flowplayer -> Player Skin - Speed Buttons
354
+ * Feature - support for [video] shortcode - check Settings -> FV Wordpress Flowplayer -> Integrations -> Handle Wordpress [video] shortcodes. This will be the new default in a couple of versions.
355
+ * Bugfix - fix for disappearing share bar (caused by new Google Analytics tracking in last version)
356
+
357
+ = 2.3.13 - 2015/04/17 =
358
+
359
+ * Feature - Google Analytics now tracks Video start, first/second/third quartile and completed playback
360
+ * Bugfix - OptimizePress 2 LiveEditor fix - live preview of video disabled for better compatibility
361
+ * Bugfix - RTMP playlist parsing fix is you enter the RTMP path like mp4:file.mp4
362
+
363
  = 2.3.12 - 2015/02/13 =
364
 
365
  * Feature - player position setting - lets you change the default centering to left align with no text wrapping
366
  * Feature - RSS - improving player appearance
367
+ * Bugfix - autobuffering option fixed
368
  * Bugfix - FV Flowplayer preview in admin screen conflict with WP Media Library fixed
369
 
370
  = 2.3.11 - 2015/01/30 =
1032
 
1033
  == Upgrade Notice ==
1034
 
1035
+ = 2.4 =
1036
+
1037
+ * CSS styles are now loaded using WP API wp_enqueue_scripts(). Please check your player appearance.
1038
+
1039
+ = 2.3.16 =
1040
+
1041
+ * Check your videos using Amazon S3 download protection
1042
+
1043
+ = 2.3.13 =
1044
+
1045
+ * RTMP path fix - double check that you use RTMP file extensions properly - rtmp_path="mp4:example.mp4" for mp4 file and rtmp_path="example" for FLV/Flash video file.
1046
+
1047
  = 2.3.8 =
1048
 
1049
  * New core Flowplayer - fixed for HLS, Flash performance, Windows Phone 8.1
view/admin.php CHANGED
@@ -29,12 +29,12 @@ function fv_flowplayer_admin_ads() {
29
  <table class="form-table2">
30
  <tr>
31
  <td colspan="2">
32
- <label for="ad">Default Ad Code:</label><br />
33
  <textarea id="ad" name="ad" class="large-text code"><?php if( isset($fv_fp->conf['ad']) ) echo trim($fv_fp->conf['ad']); ?></textarea>
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">
@@ -436,14 +436,14 @@ function fv_flowplayer_admin_integrations() {
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" />
@@ -748,12 +748,13 @@ function fv_flowplayer_admin_skin() {
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">
@@ -889,20 +890,25 @@ add_meta_box( 'fv_flowplayer_usage', 'Usage', 'fv_flowplayer_admin_usage', 'fv_f
889
  $aInstalled = get_option('fv_flowplayer_extension_install');
890
  }
891
 
892
- if( isset($aCheck->valid) && $aCheck->valid && is_plugin_inactive('fv-player-pro/fv-player-pro.php') && !is_wp_error(validate_plugin('fv-player-pro/fv-player-pro.php')) ) : ?>
893
- <div id="fv_flowplayer_addon_pro">
894
- <p>Thank you for purchasing FV Player license! <input type="button" class='button fv_wp_flowplayer_activate_extension' data-plugin='fv-player-pro/fv-player-pro.php' value="Enable the Pro extension" /> <img style="display: none; " src="<?php echo site_url(); ?>/wp-includes/images/wpspin.gif" width="16" height="16" /></p>
895
- </div>
896
- <?php elseif( isset($aCheck->valid) && $aCheck->valid && is_plugin_active('fv-player-pro/fv-player-pro.php') && !is_wp_error(validate_plugin('fv-player-pro/fv-player-pro.php')) ) : ?>
897
- <div id="fv_flowplayer_addon_pro">
898
- <p>Thank you for purchasing FV Player license! <input type="button" class="button" onclick="window.location.href += '&fv_player_pro_installed=yes#fv_player_pro'" value="Pro pack installed" /></p>
899
- </div>
900
- <?php elseif( isset($aCheck->valid) && $aCheck->valid ) : ?>
901
- <div id="fv_flowplayer_addon_pro">
902
- <p>Thank you for purchasing FV Player license! <form method="post"><input type="submit" class="button" value="Install Pro extension" /><?php wp_nonce_field('fv_player_pro_install', 'nonce_fv_player_pro_install') ?></form></p>
903
- </div>
904
- <?php
905
- endif;
 
 
 
 
 
906
 
907
 
908
  if( preg_match( '!^\$\d+!', $fv_fp->conf['key'] ) || apply_filters('fv_player_skip_ads',false) ) : ?>
@@ -916,7 +922,7 @@ add_meta_box( 'fv_flowplayer_usage', 'Usage', 'fv_flowplayer_admin_usage', 'fv_f
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">
29
  <table class="form-table2">
30
  <tr>
31
  <td colspan="2">
32
+ <label for="ad"><?php _e('Default Ad Code', 'fv_flowplayer'); ?>:</label><br />
33
  <textarea id="ad" name="ad" class="large-text code"><?php if( isset($fv_fp->conf['ad']) ) echo trim($fv_fp->conf['ad']); ?></textarea>
34
  </td>
35
  </tr>
36
  <tr>
37
+ <td colspan="2"><label for="width"><?php _e('Default set size', 'fv_flowplayer');?> [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">
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" />
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 id="volume" name="volume" type="range" min="0" max="1" step="0.1" 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><label for="ui_play_button">Speed Buttons (beta)</label></td>
757
+ <td colspan="2"><?php fv_flowplayer_admin_checkbox('ui_speed'); ?></td>
758
  </tr>
759
  <tr>
760
  <td colspan="4">
890
  $aInstalled = get_option('fv_flowplayer_extension_install');
891
  }
892
 
893
+ if( isset($aCheck->valid) && $aCheck->valid ){
894
+
895
+ $fv_player_pro_path = fv_flowplayer_get_extension_path('fv-player-pro');
896
+
897
+ if( is_plugin_inactive($fv_player_pro_path) && !is_wp_error(validate_plugin($fv_player_pro_path)) ) : ?>
898
+ <div id="fv_flowplayer_addon_pro">
899
+ <p>Thank you for purchasing FV Player license! <input type="button" class='button fv_wp_flowplayer_activate_extension' data-plugin="<?php echo $fv_player_pro_path; ?>" value="Enable the Pro extension" /> <img style="display: none; " src="<?php echo site_url(); ?>/wp-includes/images/wpspin.gif" width="16" height="16" /></p>
900
+ </div>
901
+ <?php elseif( is_plugin_active($fv_player_pro_path) && !is_wp_error(validate_plugin($fv_player_pro_path)) ) : ?>
902
+ <div id="fv_flowplayer_addon_pro">
903
+ <p>Thank you for purchasing FV Player license! <input type="button" class="button" onclick="window.location.href += '&fv_player_pro_installed=yes#fv_player_pro'" value="Pro pack installed" /></p>
904
+ </div>
905
+ <?php else : ?>
906
+ <div id="fv_flowplayer_addon_pro">
907
+ <p>Thank you for purchasing FV Player license! <form method="post"><input type="submit" class="button" value="Install Pro extension" /><?php wp_nonce_field('fv_player_pro_install', 'nonce_fv_player_pro_install') ?></form></p>
908
+ </div>
909
+ <?php
910
+ endif;
911
+ }
912
 
913
 
914
  if( preg_match( '!^\$\d+!', $fv_fp->conf['key'] ) || apply_filters('fv_player_skip_ads',false) ) : ?>
922
  <li>Or remove the logo completely</li>
923
  <li>The best video plugin for Wordpress</li>
924
  </ul>
925
+ <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>
926
  </div>
927
  <div class="graphic-part">
928
  <a href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/buy">
view/frontend-head.php DELETED
@@ -1,28 +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
- 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,14 +38,17 @@
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; }
@@ -72,87 +75,89 @@ var fv_flowplayer_set_post_thumbnail_nonce = '<?php echo wp_create_nonce( "set_p
72
  <?php do_action( 'fv_flowplayer_shortcode_editor_before' ); ?>
73
  <tr>
74
  <th scope="row" class="label" style="width: 19%">
75
- <a class="alignleft fv_wp_flowplayer_playlist_remove" href="#" onclick="return fv_wp_flowplayer_playlist_remove(this)">(remove)</a>
76
- <label for="fv_wp_flowplayer_field_src" class="alignright">Video</label>
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
 
84
  <tr style="display: none" id="fv_wp_flowplayer_file_info">
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>
92
- <td class="field"><label for="fv_wp_flowplayer_field_width">Width <small>(px)</small></label> <input type="text" id="fv_wp_flowplayer_field_width" class="fv_wp_flowplayer_field_width" name="fv_wp_flowplayer_field_width" style="width: 19%; margin-right: 25px;" value=""/> <label for="fv_wp_flowplayer_field_height">Height <small>(px)</small></label> <input type="text" id="fv_wp_flowplayer_field_height" class="fv_wp_flowplayer_field_height" name="fv_wp_flowplayer_field_height" style="width: 19%" value=""/></td>
93
  </tr>
94
 
95
  <tr style="display: none;" class="fv_wp_flowplayer_field_src_1_wrapper">
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>
103
 
104
  <tr style="display: none;" class="fv_wp_flowplayer_field_src_2_wrapper">
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>
112
 
113
  <tr style="display: none;" class="fv_wp_flowplayer_field_rtmp_wrapper">
114
- <th scope="row" class="label" style="width: 19%"><label for="fv_wp_flowplayer_field_rtmp" class="alignright">RTMP Server</label> <?php if( !empty($fv_flowplayer_conf["rtmp"]) ) : ?>(<abbr title="Leave empty to use Flash streaming server from plugin settings">?</abbr>)<?php endif; ?></th>
115
  <td colspan="2" class="field">
116
  <input type="text" class="text fv_wp_flowplayer_field_rtmp" id="fv_wp_flowplayer_field_rtmp" name="fv_wp_flowplayer_field_rtmp" value="" style="width: 40%" placeholder="<?php if( !empty($fv_flowplayer_conf["rtmp"]) ) echo $fv_flowplayer_conf["rtmp"]; ?>" />
117
- &nbsp;<label for="fv_wp_flowplayer_field_rtmp_path"><strong>RTMP Path</strong></label>
118
  <input type="text" class="text fv_wp_flowplayer_field_rtmp_path" id="fv_wp_flowplayer_field_rtmp_path" name="fv_wp_flowplayer_field_rtmp_path" value="" style="width: 37%" />
119
  </td>
120
  </tr>
121
 
122
  <tr id="fv_wp_flowplayer_add_format_wrapper">
123
  <th scope="row" class="label" style="width: 19%"></th>
124
- <td class="field" style="width: 50%"><div id="add_format_wrapper"><a href="#" class="partial-underline" onclick="fv_wp_flowplayer_add_format()" style="outline: 0"><span id="add-format">+</span>&nbsp;Add another format</a> (i.e. WebM, OGV)</div></td>
125
- <td class="field"><div id="add_rtmp_wrapper"><a href="#" class="partial-underline" onclick="fv_wp_flowplayer_add_rtmp()" style="outline: 0"><span id="add-rtmp">+</span>&nbsp;Add RTMP</a></div></td>
126
  </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
 
136
  <tr>
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
 
144
  <tr<?php if( $fv_flowplayer_conf["interface"]["subtitles"] !== 'true' ) echo ' style="display: none"'; ?>>
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>
 
 
156
 
157
  </tbody>
158
  </table>
@@ -161,7 +166,7 @@ var fv_flowplayer_set_post_thumbnail_nonce = '<?php echo wp_create_nonce( "set_p
161
  <tr id="fv_wp_flowplayer_add_format_wrapper">
162
  <th scope="row" class="label" style="width: 19%"></th>
163
  <td class="field" style="width: 50%"></td>
164
- <td class="field"><div id="add_rtmp_wrapper"><a style="outline: 0" onclick="return fv_flowplayer_playlist_add(false, <?php echo ( isset($fv_flowplayer_conf["interface"]["playlist_captions"]) && $fv_flowplayer_conf["interface"]["playlist_captions"] == 'true' ) ? 'true' : 'false'; ?>)" class="partial-underline" href="#"><span id="add-rtmp">+</span>&nbsp;Add Playlist Item</a></div></td>
165
  </tr>
166
  </table>
167
  <table width="100%">
@@ -178,106 +183,106 @@ var fv_flowplayer_set_post_thumbnail_nonce = '<?php echo wp_create_nonce( "set_p
178
  ?>
179
  <tr<?php if( !$show_additonal_features ) echo ' style="display: none"';?>>
180
  <th scope="row" width="19%"></th>
181
- <td style="text-align: left; padding: 10px 0; text-transform: uppercase;">Additional features</td>
182
  </tr>
183
  <tr<?php if( $fv_flowplayer_conf["interface"]["popup"] !== 'true' ) echo ' style="display: none"'; ?>>
184
- <th valign="top" scope="row" class="label" style="width: 19%"><label for="fv_wp_flowplayer_field_popup" class="alignright">HTML Popup</label></th>
185
  <td><textarea type="text" id="fv_wp_flowplayer_field_popup" name="fv_wp_flowplayer_field_popup" style="width: 93%"></textarea></td>
186
  </tr>
187
  <tr<?php if( $fv_flowplayer_conf["interface"]["redirect"] !== 'true' ) echo ' style="display: none"'; ?>>
188
- <th scope="row" class="label"><label for="fv_wp_flowplayer_field_redirect" class="alignright">Redirect to</label></th>
189
  <td class="field"><input type="text" id="fv_wp_flowplayer_field_redirect" name="fv_wp_flowplayer_field_redirect" style="width: 93%" /></td>
190
  </tr>
191
  <tr<?php if( $fv_flowplayer_conf["interface"]["autoplay"] !== 'true' ) echo ' style="display: none"'; ?>>
192
- <th scope="row" class="label"><label for="fv_wp_flowplayer_field_autoplay" class="alignright">Autoplay</label></th>
193
  <td class="field">
194
  <select id="fv_wp_flowplayer_field_autoplay" name="fv_wp_flowplayer_field_autoplay">
195
- <option>Default</option>
196
- <option>On</option>
197
- <option>Off</option>
198
  </select>
199
  </td>
200
  </tr>
201
  <tr<?php if( $fv_flowplayer_conf["interface"]["loop"] !== 'true' ) { echo ' style="display: none"'; } ?>>
202
- <th scope="row" class="label"><label for="fv_wp_flowplayer_field_loop" class="alignright">Loop</label></th>
203
  <td class="field"><input type="checkbox" id="fv_wp_flowplayer_field_loop" name="fv_wp_flowplayer_field_loop" /></td>
204
  </tr>
205
  <tr<?php if( $fv_flowplayer_conf["interface"]["splashend"] !== 'true' ) { echo ' style="display: none"'; } ?>>
206
  <th scope="row" class="label">
207
- <label for="fv_wp_flowplayer_field_splashend">Splash end</label>
208
  </th>
209
  <td>
210
- <input type="checkbox" id="fv_wp_flowplayer_field_splashend" name="fv_wp_flowplayer_field_splashend" /> (show splash image at the end)
211
  </td>
212
  </tr>
213
  <tr<?php if( $fv_flowplayer_conf["interface"]["embed"] !== 'true' ) echo ' style="display: none"'; ?>>
214
- <th scope="row" class="label"><label for="fv_wp_flowplayer_field_embed" class="alignright">Embeding</label></th>
215
  <td class="field">
216
  <select id="fv_wp_flowplayer_field_embed" name="fv_wp_flowplayer_field_embed">
217
- <option>Default</option>
218
- <option>On</option>
219
- <option>Off</option>
220
  </select>
221
  </td>
222
  </tr>
223
  <tr<?php if( $fv_flowplayer_conf["interface"]["ads"] !== 'true' ) echo ' style="display: none"'; ?>>
224
- <th valign="top" scope="row" class="label" style="width: 19%"><label for="fv_wp_flowplayer_field_ad" class="alignright">Ad code</label></th>
225
  <td>
226
  <textarea type="text" id="fv_wp_flowplayer_field_ad" name="fv_wp_flowplayer_field_ad" style="width: 93%"></textarea>
227
  </td>
228
  </tr>
229
  <tr<?php if( $fv_flowplayer_conf["interface"]["ads"] !== 'true' ) echo ' style="display: none"'; ?>><th></th>
230
  <td class="field">
231
- <label for="fv_wp_flowplayer_field_ad_width">Width <small>(px)</small></label> <input type="text" id="fv_wp_flowplayer_field_ad_width" name="fv_wp_flowplayer_field_ad_width" style="width: 19%; margin-right: 25px;" value=""/> <label for="fv_wp_flowplayer_field_ad_height">Height <small>(px)</small></label> <input type="text" id="fv_wp_flowplayer_field_ad_height" name="fv_wp_flowplayer_field_ad_height" style="width: 19%" value=""/><br />
232
- <input type="checkbox" id="fv_wp_flowplayer_field_ad_skip" name="fv_wp_flowplayer_field_ad_skip" /> Skip global ad in this video
233
  </td>
234
  </tr>
235
  <tr<?php if( $fv_flowplayer_conf["interface"]["align"] !== 'true' ) echo ' style="display: none"'; ?>>
236
- <th valign="top" scope="row" class="label" style="width: 19%"><label for="fv_wp_flowplayer_field_align" class="alignright">Align</label></th>
237
  <td>
238
  <select id="fv_wp_flowplayer_field_align" name="fv_wp_flowplayer_field_align">
239
- <option>Default</option>
240
- <option>Left</option>
241
- <option>Right</option>
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>
262
- <td style="padding-top: 20px;"><input type="button" value="Insert" name="insert" id="fv_wp_flowplayer_field_insert-button" class="button-primary alignleft" onclick="fv_wp_flowplayer_submit();" />
263
  </td>
264
  </tr>
265
  <?php if( !$allow_uploads && current_user_can('manage_options') ) { ?>
266
  <tr>
267
  <td colspan="2">
268
- <div class="fv-wp-flowplayer-notice">Admin note: Video uploads are currenty disabled, set 'Allow User Uploads' to true in <a href="<?php echo site_url(); ?>/wp-admin/options-general.php?page=fvplayer">Settings</a></div>
269
  </td>
270
  </tr>
271
  <?php } ?>
272
  <?php if( current_user_can('manage_options') ) { ?>
273
  <tr>
274
  <td colspan="2">
275
- <div class="fv-wp-flowplayer-notice fv-wp-flowplayer-note">Admin note: Enable more per video features in Interface options in <a href="<?php echo site_url(); ?>/wp-admin/options-general.php?page=fvplayer#interface">Settings</a></div>
276
  </td>
277
  </tr>
278
  <?php } ?>
279
  <tr<?php if( $fv_flowplayer_conf["interface"]["mobile"] !== 'true' ) echo ' style="display: none"'; ?>>
280
- <td colspan="2">* - currently not working with playlist</td>
281
  </tr>
282
  </tbody>
283
  </table>
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 input.half-field { width: 46%; }
42
  #fv-flowplayer-playlist table/*:first-child*/ input.with-button { width: 70%; }
43
  #fv-flowplayer-playlist table tr.video-size { display: none; }
44
  #fv-flowplayer-playlist table tr#fv_wp_flowplayer_add_format_wrapper { display: none; }
45
  #fv-flowplayer-playlist table tr#fv_wp_flowplayer_file_info { display: none; }
46
  #fv-flowplayer-playlist table .fv_wp_flowplayer_field_rtmp { visibility: hidden; }
47
  #fv-flowplayer-playlist table .fv_wp_flowplayer_field_rtmp_wrapper th { visibility: hidden; }
48
+ #fv-flowplayer-playlist table .hint { display: none; }
49
  /*#fv-flowplayer-playlist table .button { display: none; }*/
50
  #fv-flowplayer-playlist table:first-child tr.video-size { display: table-row; }
51
+ #fv-flowplayer-playlist table:first-child .hint { display: inline; }
52
  #fv-flowplayer-playlist table:first-child tr#fv_wp_flowplayer_add_format_wrapper { display: table-row; }
53
  #fv-flowplayer-playlist table:first-child tr#fv_wp_flowplayer_file_info { display: none; }
54
  #fv-flowplayer-playlist table:first-child .fv_wp_flowplayer_field_rtmp { visibility: visible; }
75
  <?php do_action( 'fv_flowplayer_shortcode_editor_before' ); ?>
76
  <tr>
77
  <th scope="row" class="label" style="width: 19%">
78
+ <a class="alignleft fv_wp_flowplayer_playlist_remove" href="#" onclick="return fv_wp_flowplayer_playlist_remove(this)"><?php _e('(remove)', 'fv_flowplayer'); ?></a>
79
+ <label for="fv_wp_flowplayer_field_src" class="alignright"><?php _e('Video', 'fv_flowplayer'); ?></label>
80
  </th>
81
  <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="" />
82
  <?php if ($allow_uploads=="true") { ?>
83
+ <a class="button add_media" href="#"><span class="wp-media-buttons-icon"></span> <?php _e('Add Video', 'fv_flowplayer'); ?></a>
84
  <?php }; //allow uplads video ?></td>
85
  </tr>
86
 
87
  <tr style="display: none" id="fv_wp_flowplayer_file_info">
88
  <th></th>
89
+ <td colspan="2">
90
+ <?php _e('Video Duration', 'fv_flowplayer'); ?>: <span id="fv_wp_flowplayer_file_duration"></span><br />
91
+ <?php _e('File size', 'fv_flowplayer'); ?>: <span id="fv_wp_flowplayer_file_size"></span>
92
  </td>
93
  </tr>
94
  <tr class="video-size"><th></th>
95
+ <td class="field" colspan="2"><label for="fv_wp_flowplayer_field_width"><?php _e('Width', 'fv_flowplayer'); ?> <small>(px)</small></label> <input type="text" id="fv_wp_flowplayer_field_width" class="fv_wp_flowplayer_field_width" name="fv_wp_flowplayer_field_width" style="width: 19%; margin-right: 25px;" value=""/> <label for="fv_wp_flowplayer_field_height"><?php _e('Height', 'fv_flowplayer'); ?> <small>(px)</small></label> <input type="text" id="fv_wp_flowplayer_field_height" class="fv_wp_flowplayer_field_height" name="fv_wp_flowplayer_field_height" style="width: 19%" value=""/></td>
96
  </tr>
97
 
98
  <tr style="display: none;" class="fv_wp_flowplayer_field_src_1_wrapper">
99
+ <th scope="row" class="label" style="width: 19%"><label for="fv_wp_flowplayer_field_src_1" class="alignright"><?php _e('Video', 'fv_flowplayer'); ?> <small><?php _e('(another format)', 'fv_flowplayer'); ?></small></label></th>
100
  <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=""/>
101
  <?php if ($allow_uploads=="true") { ?>
102
+ <a class="button add_media" href="#"><span class="wp-media-buttons-icon"></span> <?php _e('Add Video', 'fv_flowplayer'); ?></a>
103
  <?php }; //allow uplads video ?>
104
  </td>
105
  </tr>
106
 
107
  <tr style="display: none;" class="fv_wp_flowplayer_field_src_2_wrapper">
108
+ <th scope="row" class="label" style="width: 19%"><label for="fv_wp_flowplayer_field_src_2" class="alignright"><?php _e('Video', 'fv_flowplayer'); ?> <small><?php _e('(another format)', 'fv_flowplayer'); ?></small></label></th>
109
  <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=""/>
110
  <?php if ($allow_uploads=="true") { ?>
111
+ <a class="button add_media" href="#"><span class="wp-media-buttons-icon"></span> <?php _e('Add Video', 'fv_flowplayer'); ?></a>
112
  <?php }; //allow uplads video ?>
113
  </td>
114
  </tr>
115
 
116
  <tr style="display: none;" class="fv_wp_flowplayer_field_rtmp_wrapper">
117
+ <th scope="row" class="label" style="width: 19%"><label for="fv_wp_flowplayer_field_rtmp" class="alignright"><?php _e('RTMP Server', 'fv_flowplayer'); ?></label> <?php if( !empty($fv_flowplayer_conf["rtmp"]) ) : ?>(<abbr title="<?php _e('Leave empty to use Flash streaming server from plugin settings', 'fv_flowplayer'); ?>">?</abbr>)<?php endif; ?></th>
118
  <td colspan="2" class="field">
119
  <input type="text" class="text fv_wp_flowplayer_field_rtmp" id="fv_wp_flowplayer_field_rtmp" name="fv_wp_flowplayer_field_rtmp" value="" style="width: 40%" placeholder="<?php if( !empty($fv_flowplayer_conf["rtmp"]) ) echo $fv_flowplayer_conf["rtmp"]; ?>" />
120
+ &nbsp;<label for="fv_wp_flowplayer_field_rtmp_path"><strong><?php _e('RTMP Path', 'fv_flowplayer'); ?></strong></label>
121
  <input type="text" class="text fv_wp_flowplayer_field_rtmp_path" id="fv_wp_flowplayer_field_rtmp_path" name="fv_wp_flowplayer_field_rtmp_path" value="" style="width: 37%" />
122
  </td>
123
  </tr>
124
 
125
  <tr id="fv_wp_flowplayer_add_format_wrapper">
126
  <th scope="row" class="label" style="width: 19%"></th>
127
+ <td class="field" style="width: 50%"><div id="add_format_wrapper"><a href="#" class="partial-underline" onclick="fv_wp_flowplayer_add_format(); return false" style="outline: 0"><span id="add-format">+</span>&nbsp;<?php _e('Add another format', 'fv_flowplayer'); ?></a> <?php _e('(i.e. WebM, OGV)', 'fv_flowplayer'); ?></div></td>
128
+ <td class="field"><div id="add_rtmp_wrapper"><a href="#" class="partial-underline" onclick="fv_wp_flowplayer_add_rtmp(); return false" style="outline: 0"><span id="add-rtmp">+</span>&nbsp;<?php _e('Add RTMP', 'fv_flowplayer'); ?></a></div></td>
129
  </tr>
130
 
131
  <tr<?php if( $fv_flowplayer_conf["interface"]["mobile"] !== 'true' ) echo ' style="display: none"'; ?>>
132
+ <th scope="row" class="label"><label for="fv_wp_flowplayer_field_mobile" class="alignright"><?php _e('Mobile Video', 'fv_flowplayer'); ?>*</label></th>
133
  <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" />
134
  <?php if ($allow_uploads=='true') { ?>
135
+ <a class="button add_media" href="#"><span class="wp-media-buttons-icon"></span> <?php _e('Add Video', 'fv_flowplayer'); ?></a>
136
  <?php }; //allow uploads splash image ?></td>
137
  </tr>
138
 
139
  <tr>
140
+ <th scope="row" class="label"><label for="fv_wp_flowplayer_field_splash" class="alignright"><?php _e('Splash Image', 'fv_flowplayer'); ?></label></th>
141
  <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=""/>
142
  <?php if ($allow_uploads=='true') { ?>
143
+ <a class="button add_media" href="#"><span class="wp-media-buttons-icon"></span> <?php _e('Add Image', 'fv_flowplayer'); ?></a>
144
  <?php }; //allow uploads splash image ?></td>
145
  </tr>
146
 
147
  <tr<?php if( $fv_flowplayer_conf["interface"]["subtitles"] !== 'true' ) echo ' style="display: none"'; ?>>
148
+ <th scope="row" class="label"><label for="fv_wp_flowplayer_field_subtitles" class="alignright"><?php _e('Subtitles', 'fv_flowplayer'); ?></label></th>
149
  <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=""/>
150
  <?php if ($allow_uploads=='true') { ?>
151
+ <a class="button add_media" href="#"><span class="wp-media-buttons-icon"></span> <?php _e('Add Subtitles', 'fv_flowplayer'); ?></a>
152
  <?php }; //allow uploads splash image ?></td>
153
  </tr>
154
 
155
  <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"'; ?>>
156
+ <th scope="row" class="label"><label for="fv_wp_flowplayer_field_caption" class="alignright"><?php _e('Caption', 'fv_flowplayer'); ?></label></th>
157
  <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>
158
+ </tr>
159
+
160
+ <?php do_action( 'fv_flowplayer_shortcode_editor_item_after' ); ?>
161
 
162
  </tbody>
163
  </table>
166
  <tr id="fv_wp_flowplayer_add_format_wrapper">
167
  <th scope="row" class="label" style="width: 19%"></th>
168
  <td class="field" style="width: 50%"></td>
169
+ <td class="field"><div id="add_rtmp_wrapper"><a style="outline: 0" onclick="return fv_flowplayer_playlist_add(false, <?php echo ( isset($fv_flowplayer_conf["interface"]["playlist_captions"]) && $fv_flowplayer_conf["interface"]["playlist_captions"] == 'true' ) ? 'true' : 'false'; ?>)" class="partial-underline" href="#"><span id="add-rtmp">+</span>&nbsp;<?php _e('Add Playlist Item', 'fv_flowplayer'); ?></a></div></td>
170
  </tr>
171
  </table>
172
  <table width="100%">
183
  ?>
184
  <tr<?php if( !$show_additonal_features ) echo ' style="display: none"';?>>
185
  <th scope="row" width="19%"></th>
186
+ <td style="text-align: left; padding: 10px 0; text-transform: uppercase;"><?php _e('Additional features', 'fv_flowplayer'); ?></td>
187
  </tr>
188
  <tr<?php if( $fv_flowplayer_conf["interface"]["popup"] !== 'true' ) echo ' style="display: none"'; ?>>
189
+ <th valign="top" scope="row" class="label" style="width: 19%"><label for="fv_wp_flowplayer_field_popup" class="alignright"><?php _e('HTML Popup', 'fv_flowplayer'); ?></label></th>
190
  <td><textarea type="text" id="fv_wp_flowplayer_field_popup" name="fv_wp_flowplayer_field_popup" style="width: 93%"></textarea></td>
191
  </tr>
192
  <tr<?php if( $fv_flowplayer_conf["interface"]["redirect"] !== 'true' ) echo ' style="display: none"'; ?>>
193
+ <th scope="row" class="label"><label for="fv_wp_flowplayer_field_redirect" class="alignright"><?php _e('Redirect to', 'fv_flowplayer'); ?></label></th>
194
  <td class="field"><input type="text" id="fv_wp_flowplayer_field_redirect" name="fv_wp_flowplayer_field_redirect" style="width: 93%" /></td>
195
  </tr>
196
  <tr<?php if( $fv_flowplayer_conf["interface"]["autoplay"] !== 'true' ) echo ' style="display: none"'; ?>>
197
+ <th scope="row" class="label"><label for="fv_wp_flowplayer_field_autoplay" class="alignright"><?php _e('Autoplay', 'fv_flowplayer'); ?></label></th>
198
  <td class="field">
199
  <select id="fv_wp_flowplayer_field_autoplay" name="fv_wp_flowplayer_field_autoplay">
200
+ <option><?php _e('Default', 'fv_flowplayer'); ?></option>
201
+ <option><?php _e('On', 'fv_flowplayer'); ?></option>
202
+ <option><?php _e('Off', 'fv_flowplayer'); ?></option>
203
  </select>
204
  </td>
205
  </tr>
206
  <tr<?php if( $fv_flowplayer_conf["interface"]["loop"] !== 'true' ) { echo ' style="display: none"'; } ?>>
207
+ <th scope="row" class="label"><label for="fv_wp_flowplayer_field_loop" class="alignright"><?php _e('Loop', 'fv_flowplayer'); ?></label></th>
208
  <td class="field"><input type="checkbox" id="fv_wp_flowplayer_field_loop" name="fv_wp_flowplayer_field_loop" /></td>
209
  </tr>
210
  <tr<?php if( $fv_flowplayer_conf["interface"]["splashend"] !== 'true' ) { echo ' style="display: none"'; } ?>>
211
  <th scope="row" class="label">
212
+ <label for="fv_wp_flowplayer_field_splashend"><?php _e('Splash end', 'fv_flowplayer'); ?></label>
213
  </th>
214
  <td>
215
+ <input type="checkbox" id="fv_wp_flowplayer_field_splashend" name="fv_wp_flowplayer_field_splashend" /> <?php _e('(show splash image at the end)', 'fv_flowplayer'); ?>
216
  </td>
217
  </tr>
218
  <tr<?php if( $fv_flowplayer_conf["interface"]["embed"] !== 'true' ) echo ' style="display: none"'; ?>>
219
+ <th scope="row" class="label"><label for="fv_wp_flowplayer_field_embed" class="alignright"><?php _e('Embedding', 'fv_flowplayer'); ?></label></th>
220
  <td class="field">
221
  <select id="fv_wp_flowplayer_field_embed" name="fv_wp_flowplayer_field_embed">
222
+ <option><?php _e('Default', 'fv_flowplayer'); ?></option>
223
+ <option><?php _e('On', 'fv_flowplayer'); ?></option>
224
+ <option><?php _e('Off', 'fv_flowplayer'); ?></option>
225
  </select>
226
  </td>
227
  </tr>
228
  <tr<?php if( $fv_flowplayer_conf["interface"]["ads"] !== 'true' ) echo ' style="display: none"'; ?>>
229
+ <th valign="top" scope="row" class="label" style="width: 19%"><label for="fv_wp_flowplayer_field_ad" class="alignright"><?php _e('Ad code', 'fv_flowplayer'); ?></label></th>
230
  <td>
231
  <textarea type="text" id="fv_wp_flowplayer_field_ad" name="fv_wp_flowplayer_field_ad" style="width: 93%"></textarea>
232
  </td>
233
  </tr>
234
  <tr<?php if( $fv_flowplayer_conf["interface"]["ads"] !== 'true' ) echo ' style="display: none"'; ?>><th></th>
235
  <td class="field">
236
+ <label for="fv_wp_flowplayer_field_ad_width"><?php _e('Width', 'fv_flowplayer'); ?> <small>(px)</small></label> <input type="text" id="fv_wp_flowplayer_field_ad_width" name="fv_wp_flowplayer_field_ad_width" style="width: 19%; margin-right: 25px;" value=""/> <label for="fv_wp_flowplayer_field_ad_height"><?php _e('Height', 'fv_flowplayer'); ?> <small>(px)</small></label> <input type="text" id="fv_wp_flowplayer_field_ad_height" name="fv_wp_flowplayer_field_ad_height" style="width: 19%" value=""/><br />
237
+ <input type="checkbox" id="fv_wp_flowplayer_field_ad_skip" name="fv_wp_flowplayer_field_ad_skip" /> <?php _e('Skip global ad in this video', 'fv_flowplayer'); ?>
238
  </td>
239
  </tr>
240
  <tr<?php if( $fv_flowplayer_conf["interface"]["align"] !== 'true' ) echo ' style="display: none"'; ?>>
241
+ <th valign="top" scope="row" class="label" style="width: 19%"><label for="fv_wp_flowplayer_field_align" class="alignright"><?php _e('Align', 'fv_flowplayer'); ?></label></th>
242
  <td>
243
  <select id="fv_wp_flowplayer_field_align" name="fv_wp_flowplayer_field_align">
244
+ <option><?php _e('Default', 'fv_flowplayer'); ?></option>
245
+ <option><?php _e('Left', 'fv_flowplayer'); ?></option>
246
+ <option><?php _e('Right', 'fv_flowplayer'); ?></option>
247
  </select>
248
  </td>
249
  </tr>
250
  <tr<?php if( !isset($fv_flowplayer_conf["interface"]["controlbar"]) || $fv_flowplayer_conf["interface"]["controlbar"] !== 'true' ) echo ' style="display: none"'; ?>>
251
+ <th valign="top" scope="row" class="label" style="width: 19%"><label for="fv_wp_flowplayer_field_controlbar" class="alignright"><?php _e('Controlbar', 'fv_flowplayer'); ?></label></th>
252
  <td>
253
  <select id="fv_wp_flowplayer_field_controlbar" name="fv_wp_flowplayer_field_controlbar">
254
+ <option><?php _e('Default', 'fv_flowplayer'); ?></option>
255
+ <option><?php _e('Yes', 'fv_flowplayer'); ?></option>
256
+ <option><?php _e('No', 'fv_flowplayer'); ?></option>
257
  </select>
258
  </td>
259
  </tr>
260
  <tr<?php if( $fv_flowplayer_conf["interface"]["live"] !== 'true' ) { echo ' style="display: none"'; } ?>>
261
+ <th scope="row" class="label"><label for="fv_wp_flowplayer_field_live" class="alignright"><?php _e('Live Stream', 'fv_flowplayer'); ?></label></th>
262
  <td class="field"><input type="checkbox" id="fv_wp_flowplayer_field_live" name="fv_wp_flowplayer_field_live" /></td>
263
  </tr>
264
  <?php do_action( 'fv_flowplayer_shortcode_editor_after' ); ?>
265
  <tr>
266
  <th scope="row" class="label"></th>
267
+ <td style="padding-top: 20px;"><input type="button" value="<?php _e('Insert', 'fv_flowplayer'); ?>" name="insert" id="fv_wp_flowplayer_field_insert-button" class="button-primary alignleft" onclick="fv_wp_flowplayer_submit();" />
268
  </td>
269
  </tr>
270
  <?php if( !$allow_uploads && current_user_can('manage_options') ) { ?>
271
  <tr>
272
  <td colspan="2">
273
+ <div class="fv-wp-flowplayer-notice"><?php _e('Admin note: Video uploads are currenty disabled, set Allow User Uploads to true in', 'fv_flowplayer'); ?> <a href="<?php echo site_url(); ?>/wp-admin/options-general.php?page=fvplayer"><?php _e('Settings', 'fv_flowplayer'); ?></a></div>
274
  </td>
275
  </tr>
276
  <?php } ?>
277
  <?php if( current_user_can('manage_options') ) { ?>
278
  <tr>
279
  <td colspan="2">
280
+ <div class="fv-wp-flowplayer-notice fv-wp-flowplayer-note"><?php _e('Admin note: Enable more per video features in Interface options in', 'fv_flowplayer'); ?> <a href="<?php echo site_url(); ?>/wp-admin/options-general.php?page=fvplayer#interface"><?php _e('Settings', 'fv_flowplayer'); ?></a></div>
281
  </td>
282
  </tr>
283
  <?php } ?>
284
  <tr<?php if( $fv_flowplayer_conf["interface"]["mobile"] !== 'true' ) echo ' style="display: none"'; ?>>
285
+ <td colspan="2">* - <?php _e('currently not working with playlist', 'fv_flowplayer'); ?> </td>
286
  </tr>
287
  </tbody>
288
  </table>