FV Flowplayer Video Player - Version 7.3.12.727

Version Description

  • 2019/02/26 =

  • New Feature - Rewind Button - seeks 10 seconds back in the video, enable in Settings -> FV Player -> Sitewide FV Player Defaults

  • Live stream - removing from Post Interface Options and showing it for HLS streams automatically

  • Audio - checkbox for HLS streams to make them audio-only

  • Bugfix - video duration check forgetting to remove fv_flowlayer_tmp_* temporary files

  • Bugfix - video position saving too many requests when leaving the web page

  • Bugfix - video start/end time editing for FV Player Pro

  • Bugfix - too many database checks in wp-admin

Download this release

Release Info

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

Code changes from version 7.3.9.727 to 7.3.12.727

controller/frontend.php CHANGED
@@ -455,6 +455,16 @@ function flowplayer_display_scripts() {
455
include_once(dirname( __FILE__ ) . '/../css/fvp-icon-sprite.svg');
456
}
457
458
if( flowplayer::is_special_editor() ) {
459
return;
460
}
455
include_once(dirname( __FILE__ ) . '/../css/fvp-icon-sprite.svg');
456
}
457
458
+ if( $fv_fp->_get_option('ui_rewind_button') ) { // todo: only include if it's going to be used!
459
+ ?>
460
+ <svg style="position: absolute; width: 0; height: 0; overflow: hidden;" class="fvp-icon" xmlns="http://www.w3.org/2000/svg">
461
+ <g id="fvp-rewind">
462
+ <path d="M22.7 10.9c0 1.7-0.4 3.3-1.1 4.8 -0.7 1.5-1.8 2.8-3.2 3.8 -0.4 0.3-1.3-0.9-0.9-1.2 1.2-0.9 2.1-2 2.7-3.3 0.7-1.3 1-2.7 1-4.1 0-2.6-0.9-4.7-2.7-6.5 -1.8-1.8-4-2.7-6.5-2.7 -2.5 0-4.7 0.9-6.5 2.7 -1.8 1.8-2.7 4-2.7 6.5 0 2.4 0.8 4.5 2.5 6.3 1.7 1.8 3.7 2.7 6.1 2.9l-1.2-2c-0.2-0.3 0.9-1 1.1-0.7l2.3 3.7c0.2 0.3 0 0.6-0.2 0.7L9.5 23.8c-0.3 0.2-0.9-0.9-0.5-1.2l2.1-1.1c-2.7-0.2-5-1.4-6.9-3.4 -1.9-2-2.8-4.5-2.8-7.2 0-3 1.1-5.5 3.1-7.6C6.5 1.2 9 0.2 12 0.2c3 0 5.5 1.1 7.6 3.1C21.7 5.4 22.7 7.9 22.7 10.9z" fill="#fff"/><path d="M8.1 15.1c-0.1 0-0.1 0-0.1-0.1V8C8 7.7 7.8 7.9 7.7 7.9L6.8 8.3C6.8 8.4 6.7 8.3 6.7 8.2L6.3 7.3C6.2 7.2 6.3 7.1 6.4 7.1l2.7-1.2c0.1 0 0.4 0 0.4 0.3v8.8c0 0.1 0 0.1-0.1 0.1H8.1z" fill="#fff"/><path d="M17.7 10.6c0 2.9-1.3 4.7-3.5 4.7 -2.2 0-3.5-1.8-3.5-4.7s1.3-4.7 3.5-4.7C16.4 5.9 17.7 7.7 17.7 10.6zM12.3 10.6c0 2.1 0.7 3.4 2 3.4 1.3 0 2-1.2 2-3.4 0-2.1-0.7-3.4-2-3.4C13 7.2 12.3 8.5 12.3 10.6z" fill="#fff"/>
463
+ </g>
464
+ </svg>
465
+ <?php
466
+ }
467
+
468
if( flowplayer::is_special_editor() ) {
469
return;
470
}
controller/settings.php CHANGED
@@ -352,6 +352,7 @@ function flowplayer_admin_footer() {
352
if( !fv_player_is_admin_screen() ) return;
353
354
flowplayer_prepare_scripts();
355
}
356
357
352
if( !fv_player_is_admin_screen() ) return;
353
354
flowplayer_prepare_scripts();
355
+ flowplayer_display_scripts();
356
}
357
358
css/flowplayer.css CHANGED
@@ -1818,6 +1818,6 @@ body.fv_flowplayer_tabs_hide .fv_flowplayer_tabs_content > div.fv_flowplayer_tab
1818
border-right: 1px solid #fff;
1819
}
1820
1821
- .flowplayer.is-tiny .fv-fp-prevbtn, .flowplayer.is-tiny .fv-fp-nextbtn {
1822
display: none;
1823
}
1818
border-right: 1px solid #fff;
1819
}
1820
1821
+ .flowplayer.is-tiny .fv-fp-prevbtn, .flowplayer.is-tiny .fv-fp-nextbtn, .flowplayer.is-tiny .fv-fp-rewind {
1822
display: none;
1823
}
flowplayer.php CHANGED
@@ -3,7 +3,7 @@
3
Plugin Name: FV Player
4
Plugin URI: http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer
5
Description: Formerly FV WordPress Flowplayer. Supports MP4, HLS, MPEG-DASH, WebM and OGV. Advanced features such as overlay ads or popups. Uses Flowplayer 7.2.7.
6
- Version: 7.3.9.727
7
Author URI: http://foliovision.com/
8
License: GPL-3.0
9
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
@@ -27,7 +27,7 @@ License URI: http://www.gnu.org/licenses/gpl-3.0.txt
27
*/
28
29
global $fv_wp_flowplayer_ver;
30
- $fv_wp_flowplayer_ver = '7.3.9.727';
31
$fv_wp_flowplayer_core_ver = '7.2.7.1';
32
33
include_once( dirname( __FILE__ ) . '/includes/extra-functions.php' );
3
Plugin Name: FV Player
4
Plugin URI: http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer
5
Description: Formerly FV WordPress Flowplayer. Supports MP4, HLS, MPEG-DASH, WebM and OGV. Advanced features such as overlay ads or popups. Uses Flowplayer 7.2.7.
6
+ Version: 7.3.12.727
7
Author URI: http://foliovision.com/
8
License: GPL-3.0
9
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
27
*/
28
29
global $fv_wp_flowplayer_ver;
30
+ $fv_wp_flowplayer_ver = '7.3.12.727';
31
$fv_wp_flowplayer_core_ver = '7.2.7.1';
32
33
include_once( dirname( __FILE__ ) . '/includes/extra-functions.php' );
flowplayer/fv-flowplayer.min.js CHANGED
@@ -2204,7 +2204,7 @@ flowplayer( function(api,root) {
2204
flowplayer( function(api,root) {
2205
root = jQuery(root);
2206
2207
- if( !root.data('button-no-picture') && !root.data('button-repeat') ) return;
2208
2209
api.bind('ready', function(e,api) {
2210
if( !api.video.type.match(/^audio/) && root.data('button-no-picture') && root.find('.fv-fp-no-picture').length == 0 ) {
@@ -2323,6 +2323,19 @@ flowplayer( function(api,root) {
2323
2324
}
2325
}
2326
}).bind('unload', function() {
2327
root.find('.fv-fp-no-picture').remove();
2328
root.find('.fv-fp-playlist').remove();
@@ -2570,7 +2583,9 @@ flowplayer( function(api,root) {
2570
},
2571
2572
// used to seek into the desired last stored position when he video has started
2573
- seekIntoPosition = function (e, api) {
2574
var
2575
originalVideoApiPath = getOriginalSource(api.video),
2576
position = originalVideoApiPath.position;
@@ -2704,9 +2719,11 @@ flowplayer( function(api,root) {
2704
2705
// TODO: find out what event can be used to force saving of playlist video positions on video change
2706
//api.bind('finish', forceSavePosition);
2707
- jQuery(window).on('beforeunload', function () {
2708
- flowplayer.conf.closingPage = true;
2709
- sendVideoPositions();
2710
});
2711
2712
// check whether local storage is enabled
2204
flowplayer( function(api,root) {
2205
root = jQuery(root);
2206
2207
+ if( !root.data('button-no-picture') && !root.data('button-repeat') && !root.data('button-rewind') ) return;
2208
2209
api.bind('ready', function(e,api) {
2210
if( !api.video.type.match(/^audio/) && root.data('button-no-picture') && root.find('.fv-fp-no-picture').length == 0 ) {
2323
2324
}
2325
}
2326
+
2327
+ if( root.data('button-rewind') && root.find('.fv-fp-rewind').length == 0 ) {
2328
+ var button_rewind = jQuery('<span class="fv-fp-rewind"><svg viewBox="0 0 24 24" width="24px" height="24px" class="fvp-icon fvp-rewind"><use xlink:href="#fvp-rewind"></use></svg></span>');
2329
+
2330
+ button_rewind.insertBefore( root.find('.fp-controls .fp-elapsed') ).click( function(e) {
2331
+ e.preventDefault();
2332
+ e.stopPropagation();
2333
+
2334
+ api.seek(api.video.time-10);
2335
+ });
2336
+
2337
+ button_rewind.toggle(!api.video.live);
2338
+ }
2339
}).bind('unload', function() {
2340
root.find('.fv-fp-no-picture').remove();
2341
root.find('.fv-fp-playlist').remove();
2583
},
2584
2585
// used to seek into the desired last stored position when he video has started
2586
+ seekIntoPosition = function (e, api) {
2587
+ if( api.video && api.video.live ) return;
2588
+
2589
var
2590
originalVideoApiPath = getOriginalSource(api.video),
2591
position = originalVideoApiPath.position;
2719
2720
// TODO: find out what event can be used to force saving of playlist video positions on video change
2721
//api.bind('finish', forceSavePosition);
2722
+ api.one('progress', function() {
2723
+ jQuery(window).on('beforeunload', function () {
2724
+ flowplayer.conf.closingPage = true;
2725
+ sendVideoPositions();
2726
+ });
2727
});
2728
2729
// check whether local storage is enabled
js/shortcode-editor.js CHANGED
@@ -708,6 +708,13 @@ function fv_flowplayer_playlist_add( sInput, sCaption, sSubtitles, sSplashText )
708
new_item.find('[name=fv_wp_flowplayer_field_splash]').val(objVid.splash);
709
new_item.find('[name=fv_wp_flowplayer_field_splash_text]').val(objVid.splash_text);
710
711
if (typeof sSubtitles === 'object' && sSubtitles.length && sSubtitles[0].lang) {
712
// DB-based subtitles value
713
var firstDone = false;
@@ -1657,7 +1664,10 @@ function fv_wp_flowplayer_edit() {
1657
1658
if(sPlaylist){
1659
fv_flowplayer_playlist_show();
1660
}
1661
//initial preview
1662
fv_player_refresh_tabs();
1663
@@ -2104,7 +2114,14 @@ function fv_wp_flowplayer_check_for_player_meta_field(fieldName) {
2104
2105
2106
function fv_wp_flowplayer_check_for_video_meta_field(fieldName) {
2107
- return ['fv_wp_flowplayer_field_duration', 'fv_wp_flowplayer_field_last_video_meta_check', 'fv_wp_flowplayer_field_live', 'fv_wp_flowplayer_field_auto_splash', 'fv_wp_flowplayer_field_auto_caption'].indexOf(fieldName) > -1;
2108
}
2109
2110
@@ -3505,3 +3522,28 @@ jQuery(document).on('keydown', '#fv_wp_flowplayer_field_splash, #fv_wp_flowplaye
3505
console.log(this.id+' has been updated manually!');
3506
$element.data('fv_player_user_updated', 1);
3507
});
708
new_item.find('[name=fv_wp_flowplayer_field_splash]').val(objVid.splash);
709
new_item.find('[name=fv_wp_flowplayer_field_splash_text]').val(objVid.splash_text);
710
711
+ new_item.find('[name=fv_wp_flowplayer_field_start]').val(objVid.start);
712
+ new_item.find('[name=fv_wp_flowplayer_field_end]').val(objVid.end);
713
+
714
+ jQuery(objVid.meta).each( function(k,v) {
715
+ if( v.meta_key == 'audio' ) new_item.find('[name=fv_wp_flowplayer_field_audio]').prop('checked',v.meta_value).attr('data-id',v.id);
716
+ });
717
+
718
if (typeof sSubtitles === 'object' && sSubtitles.length && sSubtitles[0].lang) {
719
// DB-based subtitles value
720
var firstDone = false;
1664
1665
if(sPlaylist){
1666
fv_flowplayer_playlist_show();
1667
+ } else {
1668
+ fv_flowplayer_editor_item_show(0);
1669
}
1670
+
1671
//initial preview
1672
fv_player_refresh_tabs();
1673
2114
2115
2116
function fv_wp_flowplayer_check_for_video_meta_field(fieldName) {
2117
+ return [
2118
+ 'fv_wp_flowplayer_field_duration',
2119
+ 'fv_wp_flowplayer_field_last_video_meta_check',
2120
+ 'fv_wp_flowplayer_field_live',
2121
+ 'fv_wp_flowplayer_field_auto_splash',
2122
+ 'fv_wp_flowplayer_field_auto_caption',
2123
+ 'fv_wp_flowplayer_field_audio'
2124
+ ].indexOf(fieldName) > -1;
2125
}
2126
2127
3522
console.log(this.id+' has been updated manually!');
3523
$element.data('fv_player_user_updated', 1);
3524
});
3525
+
3526
+ jQuery(document).on('keyup', '[name=fv_wp_flowplayer_field_src], [name=fv_wp_flowplayer_field_rtmp_path]', fv_player_editor_show_stream_fields );
3527
+ jQuery(document).on('fv_flowplayer_shortcode_item_switch fv_flowplayer_shortcode_new', fv_player_editor_show_stream_fields );
3528
+
3529
+ function fv_player_editor_show_stream_fields(e,index) {
3530
+ // on keyup
3531
+ var src = jQuery(this).val(),
3532
+ item = jQuery(this).parents('table');
3533
+
3534
+ // on fv_flowplayer_shortcode_item_switch
3535
+ if( typeof(index) != "undefined" ) {
3536
+ item = jQuery('.fv-player-playlist-item[data-index='+index+']');
3537
+ src = item.find('[name=fv_wp_flowplayer_field_src]').val();
3538
+ }
3539
+
3540
+ // on fv_flowplayer_shortcode_new
3541
+ if( item.length == 0 ) item = jQuery('.fv-player-playlist-item[data-index=0]');
3542
+
3543
+ var rtmp = item.find('[name=fv_wp_flowplayer_field_rtmp_path]').val();
3544
+ var show = rtmp || src.match(/\.m3u8/) || src.match(/rtmp:/) || src.match(/\.mpd/);
3545
+
3546
+ item.find('[name=fv_wp_flowplayer_field_live]').closest('tr').toggle(!!show);
3547
+ item.find('[name=fv_wp_flowplayer_field_audio]').closest('tr').toggle(!!show);
3548
+
3549
+ }
models/checker.php CHANGED
@@ -174,8 +174,12 @@ class FV_Player_Checker {
174
175
if( $bValidFile ) {
176
$ThisFileInfo = $getID3->analyze( $localtempfilename );
177
- }
178
- }
179
}
180
181
174
175
if( $bValidFile ) {
176
$ThisFileInfo = $getID3->analyze( $localtempfilename );
177
+ }
178
+ }
179
+
180
+ foreach( glob( trailingslashit($upload_dir['basedir']).'fv_flowlayer_tmp_*' ) AS $file ) {
181
+ @unlink($file);
182
+ }
183
}
184
185
models/db-player-meta.php CHANGED
@@ -94,7 +94,7 @@ class FV_Player_Db_Player_Meta {
94
95
self::init_db_name();
96
97
- if( is_admin() || !$fv_fp->_get_option('player_meta_model_db_checked') || $fv_fp->_get_option('player_meta_model_db_checked') != $fv_wp_flowplayer_ver ) {
98
$sql = "
99
CREATE TABLE " . self::$db_table_name . " (
100
id bigint(20) unsigned NOT NULL auto_increment,
94
95
self::init_db_name();
96
97
+ if( !$fv_fp->_get_option('player_meta_model_db_checked') || $fv_fp->_get_option('player_meta_model_db_checked') != $fv_wp_flowplayer_ver ) {
98
$sql = "
99
CREATE TABLE " . self::$db_table_name . " (
100
id bigint(20) unsigned NOT NULL auto_increment,
models/db-player.php CHANGED
@@ -379,7 +379,7 @@ class FV_Player_Db_Player {
379
380
self::init_db_name();
381
382
- if( is_admin() || !$fv_fp->_get_option('player_model_db_checked') || $fv_fp->_get_option('player_model_db_checked') != $fv_wp_flowplayer_ver ) {
383
$sql = "
384
CREATE TABLE " . self::$db_table_name . " (
385
id bigint(20) unsigned NOT NULL auto_increment,
379
380
self::init_db_name();
381
382
+ if( !$fv_fp->_get_option('player_model_db_checked') || $fv_fp->_get_option('player_model_db_checked') != $fv_wp_flowplayer_ver ) {
383
$sql = "
384
CREATE TABLE " . self::$db_table_name . " (
385
id bigint(20) unsigned NOT NULL auto_increment,
models/db-video-meta.php CHANGED
@@ -87,7 +87,7 @@ class FV_Player_Db_Video_Meta {
87
88
self::init_db_name();
89
90
- if( is_admin() || !$fv_fp->_get_option('video_meta_model_db_checked') || $fv_fp->_get_option('video_meta_model_db_checked') != $fv_wp_flowplayer_ver ) {
91
$sql = "
92
CREATE TABLE " . self::$db_table_name . " (
93
id bigint(20) unsigned NOT NULL auto_increment,
87
88
self::init_db_name();
89
90
+ if( !$fv_fp->_get_option('video_meta_model_db_checked') || $fv_fp->_get_option('video_meta_model_db_checked') != $fv_wp_flowplayer_ver ) {
91
$sql = "
92
CREATE TABLE " . self::$db_table_name . " (
93
id bigint(20) unsigned NOT NULL auto_increment,
models/db-video.php CHANGED
@@ -194,7 +194,7 @@ class FV_Player_Db_Video {
194
195
self::init_db_name();
196
197
- if( is_admin() || !$fv_fp->_get_option('video_model_db_checked') || $fv_fp->_get_option('video_model_db_checked') != $fv_wp_flowplayer_ver ) {
198
$sql = "
199
CREATE TABLE " . self::$db_table_name . " (
200
id bigint(20) unsigned NOT NULL auto_increment,
194
195
self::init_db_name();
196
197
+ if( !$fv_fp->_get_option('video_model_db_checked') || $fv_fp->_get_option('video_model_db_checked') != $fv_wp_flowplayer_ver ) {
198
$sql = "
199
CREATE TABLE " . self::$db_table_name . " (
200
id bigint(20) unsigned NOT NULL auto_increment,
models/db.php CHANGED
@@ -920,6 +920,9 @@ class FV_Player_Db {
920
}
921
922
echo $id;
923
} else {
924
echo -1;
925
}
920
}
921
922
echo $id;
923
+
924
+ do_action('fv_player_db_save', $id);
925
+
926
} else {
927
echo -1;
928
}
models/flowplayer-frontend.php CHANGED
@@ -84,6 +84,16 @@ class flowplayer_frontend extends flowplayer
84
$this->aCurArgs['src'] = $media;
85
}
86
$this->aCurArgs = apply_filters( 'fv_flowplayer_args_pre', $args );
87
$media = $this->aCurArgs['src'];
88
89
if( !$media && empty($this->aCurArgs['rtmp_path']) ) {
@@ -372,7 +382,11 @@ class flowplayer_frontend extends flowplayer
372
$splashend_contents = '<div id="wpfp_'.$this->hash.'_custom_background" class="wpfp_custom_background" style="position: absolute; background: url(\''.$splash_img.'\') no-repeat center center; background-size: contain; width: 100%; height: 100%; z-index: 1;"></div>';
373
}
374
375
- $bIsAudio = ( empty($splash_img) || $splash_img == $this->_get_option('splash') ) && preg_match( '~\.(mp3|wav|ogg)([?#].*?)?$~', $media );
376
377
$attributes['class'] = 'flowplayer no-brand is-splash';
378
@@ -442,6 +456,9 @@ class flowplayer_frontend extends flowplayer
442
if( $this->_get_option('ui_repeat_button') ) {
443
$attributes['data-button-repeat'] = true;
444
}
445
446
// Align
447
$attributes['class'] .= $this->get_align();
@@ -887,7 +904,7 @@ class flowplayer_frontend extends flowplayer
887
888
function get_speed_attribute( $attributes ) {
889
$bShow = false;
890
- if( $this->_get_option('ui_speed') || isset($this->aCurArgs['speed']) && $this->aCurArgs['speed'] == 'buttons' ) {
891
$bShow = true;
892
}
893
84
$this->aCurArgs['src'] = $media;
85
}
86
$this->aCurArgs = apply_filters( 'fv_flowplayer_args_pre', $args );
87
+
88
+ // force horizontal playlist style for audio as that the only one styled properly
89
+ if( $player = $this->current_player() ) {
90
+ if( $videos = $player->getVideos() ) {
91
+ if( !empty($videos[0]) && $videos[0]->getMetaValue('audio',true) ) {
92
+ $this->aCurArgs['liststyle'] = 'horizontal';
93
+ }
94
+ }
95
+ }
96
+
97
$media = $this->aCurArgs['src'];
98
99
if( !$media && empty($this->aCurArgs['rtmp_path']) ) {
382
$splashend_contents = '<div id="wpfp_'.$this->hash.'_custom_background" class="wpfp_custom_background" style="position: absolute; background: url(\''.$splash_img.'\') no-repeat center center; background-size: contain; width: 100%; height: 100%; z-index: 1;"></div>';
383
}
384
385
+ $bIsAudio = ( empty($splash_img) || $splash_img == $this->_get_option('splash') ) && preg_match( '~\.(mp3|wav|ogg)([?#].*?)?$~', $media );
386
+
387
+ if( !$bIsAudio && $video = $this->current_video() ) {
388
+ $bIsAudio = $video->getMetaValue('audio',true);
389
+ }
390
391
$attributes['class'] = 'flowplayer no-brand is-splash';
392
456
if( $this->_get_option('ui_repeat_button') ) {
457
$attributes['data-button-repeat'] = true;
458
}
459
+ if( $this->_get_option('ui_rewind_button') ) {
460
+ $attributes['data-button-rewind'] = true;
461
+ }
462
463
// Align
464
$attributes['class'] .= $this->get_align();
904
905
function get_speed_attribute( $attributes ) {
906
$bShow = false;
907
+ if( $this->_get_option('ui_speed') || isset($this->aCurArgs['speed']) && ( $this->aCurArgs['speed'] == 'buttons' || $this->aCurArgs['speed'] == 'yes' ) ) {
908
$bShow = true;
909
}
910
models/flowplayer.php CHANGED
@@ -1428,6 +1428,14 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin_Private {
1428
public static function get_duration_post( $post_id = false ) {
1429
global $post, $fv_fp;
1430
$post_id = ( $post_id ) ? $post_id : $post->ID;
1431
1432
$content = false;
1433
$objPost = get_post($post_id);
@@ -1891,7 +1899,7 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin_Private {
1891
1892
function rewrite_check( $aRules ) {
1893
$aRewriteRules = get_option('rewrite_rules');
1894
- if( empty($aRewriteRules) ) {
1895
return;
1896
}
1897
1428
public static function get_duration_post( $post_id = false ) {
1429
global $post, $fv_fp;
1430
$post_id = ( $post_id ) ? $post_id : $post->ID;
1431
+
1432
+ global $wpdb;
1433
+ $tDuration = intval( $wpdb->get_var( "SELECT vm.meta_value FROM {$wpdb->prefix}fv_player_playermeta AS pm JOIN {$wpdb->prefix}fv_player_players AS p ON p.id = pm.id_player JOIN {$wpdb->prefix}fv_player_videos AS v ON FIND_IN_SET(v.id, p.videos) > 0 JOIN {$wpdb->prefix}fv_player_videometa AS vm ON v.id = vm.id_video WHERE pm.meta_key = 'post_id' AND pm.meta_value = ".intval($post_id)." AND vm.meta_key = 'duration' ORDER BY CAST(vm.meta_value AS UNSIGNED) DESC LIMIT 1" ) );
1434
+ if( $tDuration > 3600 ) {
1435
+ return gmdate( "H:i:s", $tDuration );
1436
+ } else if( $tDuration > 0 ) {
1437
+ return gmdate( "i:s", $tDuration );
1438
+ }
1439
1440
$content = false;
1441
$objPost = get_post($post_id);
1899
1900
function rewrite_check( $aRules ) {
1901
$aRewriteRules = get_option('rewrite_rules');
1902
+ if( empty($aRewriteRules) || !is_array($aRewriteRules) || count($aRewriteRules) == 0 ) {
1903
return;
1904
}
1905
models/lightbox.php CHANGED
@@ -494,8 +494,6 @@ class FV_Player_lightbox {
494
</tr>
495
<script>
496
jQuery(document).ready(function(){
497
- jQuery('[name="pro[interface][lightbox]"]').parents('td').replaceWith('<td><p><?php _e('Setting <a href="#interface[live]">moved</a>', 'fv-wordpress-flowplayer'); ?></p></td>');
498
- jQuery('[name="pro[lightbox_images]"]').parents('td').replaceWith('<td><p><?php _e('Setting <a href="#subtitleOn">moved</a>', 'fv-wordpress-flowplayer'); ?></p></td>');
499
var lightbox_images = jQuery('#lightbox_images');
500
if(lightbox_images.attr('checked')){
501
jQuery('#lightbox-wp-galleries').show();
494
</tr>
495
<script>
496
jQuery(document).ready(function(){
497
var lightbox_images = jQuery('#lightbox_images');
498
if(lightbox_images.attr('checked')){
499
jQuery('#lightbox-wp-galleries').show();
models/media-browser-s3.php CHANGED
@@ -30,8 +30,6 @@ class FV_Player_Media_Browser_S3 extends FV_Player_Media_Browser {
30
$this->fv_wp_flowplayer_include_aws_sdk();
31
global $fv_fp, $s3Client;
32
33
- $error = false;
34
-
35
$regions = $fv_fp->_get_option('amazon_region');
36
$secrets = $fv_fp->_get_option('amazon_secret');
37
$keys = $fv_fp->_get_option('amazon_key');
@@ -142,7 +140,7 @@ class FV_Player_Media_Browser_S3 extends FV_Player_Media_Browser {
142
}
143
144
} catch ( Aws\CloudFront\Exception\CloudFrontException $e ) {
145
- $error = 'It appears that the policy of AWS IAM user identified by '.$key.' doesn\'t permit List and Read operations for the CloudFront service. Please add these access levels if you are using CloudFront for your S3 buckets in order to obtain CloudFront links for your videos.';
146
}
147
148
// instantiate the S3 client with AWS credentials
@@ -164,69 +162,73 @@ class FV_Player_Media_Browser_S3 extends FV_Player_Media_Browser {
164
$args['Prefix'] = $request_path;
165
}
166
167
- $res = $s3Client->ListObjects( $args );
168
- $objects = array_merge( !empty($res['CommonPrefixes']) ? $res['CommonPrefixes'] : array(), $res->get('Contents') );
169
-
170
- if( isset($_REQUEST['debug']) ) {
171
- var_dump($args,$objects);
172
- die();
173
- }
174
175
$sum_up = array();
176
- foreach ( $objects as $object ) {
177
- if ( ! isset( $objectarray ) ) {
178
- $objectarray = array();
179
- }
180
-
181
- $item = array();
182
183
- $path = $object['Prefix'] ? $object['Prefix'] : $object['Key'];
184
185
- if( !empty($object['Key']) && preg_match( '~\.ts$~', $object['Key'] ) ) {
186
- if( empty($sum_up['ts']) ) $sum_up['ts'] = 0;
187
- $sum_up['ts']++;
188
- continue;
189
- }
190
191
- $item['path'] = 'Home/' . $path;
192
-
193
- if( $request_path ) {
194
- if( $request_path == $path ) continue; // sometimes the current folder is present in the response, weird
195
196
- $item['name'] = str_replace( $request_path, '', $path );
197
- } else {
198
- $item['name'] = $path;
199
- }
200
-
201
- if( !empty($object['Size']) ) {
202
- $item['type'] = 'file';
203
- $item['size'] = $object['Size'];
204
205
- $link = (string) $s3Client->getObjectUrl( $bucket, $path );
206
- $link = str_replace( '%20', '+', $link );
207
208
- // replace link with CloudFront URL, if we have one
209
- if( !empty($domains[$array_id]) ) {
210
- // replace S3 URLs with buckets in the S3 subdomain
211
- $link = preg_replace('/https?:\/\/' . $bucket . '\.s3[^.]*\.amazonaws\.com\/(.*)/i', rtrim($domains[$array_id], '/').'/$1', $link);
212
-
213
- // replace S3 URLs with bucket name as a subfolder
214
- $link = preg_replace('/https?:\/\/[^\/]+\/' . $bucket . '\/(.*)/i', rtrim($domains[$array_id], '/').'/$1', $link);
215
}
216
217
- $item['link'] = $link;
218
219
- } else {
220
- $item['type'] = 'folder';
221
- $item['items'] = array();
222
- }
223
-
224
- $output['items'][] = $item;
225
-
226
- if (strtolower(substr($name, strrpos($name, '.') + 1)) === 'ts') {
227
- continue;
228
}
229
-
230
}
231
232
foreach( $sum_up AS $ext => $count ) {
@@ -276,10 +278,6 @@ class FV_Player_Media_Browser_S3 extends FV_Player_Media_Browser {
276
)
277
)
278
);
279
-
280
- if( $error ) {
281
- $json_final['error'] = $error;
282
- }
283
284
if (isset($err) && $err) {
285
$json_final['err'] = $err;
30
$this->fv_wp_flowplayer_include_aws_sdk();
31
global $fv_fp, $s3Client;
32
33
$regions = $fv_fp->_get_option('amazon_region');
34
$secrets = $fv_fp->_get_option('amazon_secret');
35
$keys = $fv_fp->_get_option('amazon_key');
140
}
141
142
} catch ( Aws\CloudFront\Exception\CloudFrontException $e ) {
143
+ $err = 'It appears that the policy of AWS IAM user identified by '.$key.' doesn\'t permit List and Read operations for the CloudFront service. Please add these access levels if you are using CloudFront for your S3 buckets in order to obtain CloudFront links for your videos.';
144
}
145
146
// instantiate the S3 client with AWS credentials
162
$args['Prefix'] = $request_path;
163
}
164
165
+ $paged = $s3Client->getPaginator('ListObjects',$args);
166
167
$sum_up = array();
168
+
169
+ foreach( $paged AS $res ) {
170
171
+ $folders = !empty($res['CommonPrefixes']) ? $res['CommonPrefixes'] : array();
172
+ $files = $res->get('Contents');
173
+ if( !$files ) $files = array();
174
175
+ $objects = array_merge( $folders, $files );
176
177
+ foreach ( $objects as $object ) {
178
+ if ( ! isset( $objectarray ) ) {
179
+ $objectarray = array();
180
+ }
181
182
+ $item = array();
183
184
+ $path = $object['Prefix'] ? $object['Prefix'] : $object['Key'];
185
186
+ if( !empty($object['Key']) && preg_match( '~\.ts$~', $object['Key'] ) ) {
187
+ if( empty($sum_up['ts']) ) $sum_up['ts'] = 0;
188
+ $sum_up['ts']++;
189
+ continue;
190
}
191
192
+ $item['path'] = 'Home/' . $path;
193
194
+ if( $request_path ) {
195
+ if( $request_path == $path ) continue; // sometimes the current folder is present in the response, weird
196
+
197
+ $item['name'] = str_replace( $request_path, '', $path );
198
+ } else {
199
+ $item['name'] = $path;
200
+ }
201
+
202
+ if( !empty($object['Size']) ) {
203
+ $item['type'] = 'file';
204
+ $item['size'] = $object['Size'];
205
+
206
+ $link = (string) $s3Client->getObjectUrl( $bucket, $path );
207
+ $link = str_replace( '%20', '+', $link );
208
+
209
+ // replace link with CloudFront URL, if we have one
210
+ if( !empty($domains[$array_id]) ) {
211
+ // replace S3 URLs with buckets in the S3 subdomain
212
+ $link = preg_replace('/https?:\/\/' . $bucket . '\.s3[^.]*\.amazonaws\.com\/(.*)/i', rtrim($domains[$array_id], '/').'/$1', $link);
213
+
214
+ // replace S3 URLs with bucket name as a subfolder
215
+ $link = preg_replace('/https?:\/\/[^\/]+\/' . $bucket . '\/(.*)/i', rtrim($domains[$array_id], '/').'/$1', $link);
216
+ }
217
+
218
+ $item['link'] = $link;
219
+
220
+ } else {
221
+ $item['type'] = 'folder';
222
+ $item['items'] = array();
223
+ }
224
+
225
+ $output['items'][] = $item;
226
+
227
+ if (strtolower(substr($name, strrpos($name, '.') + 1)) === 'ts') {
228
+ continue;
229
+ }
230
+
231
}
232
}
233
234
foreach( $sum_up AS $ext => $count ) {
278
)
279
)
280
);
281
282
if (isset($err) && $err) {
283
$json_final['err'] = $err;
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: FolioVision
3
Donate link: https://foliovision.com/donate
4
Tags: video player, flowplayer, mobile video, html5 video, Vimeo, html5 player, youtube player, youtube playlist, video playlist, RTMP, Cloudfront, HLS
5
Requires at least: 3.5
6
- Tested up to: 5.0.2
7
Stable tag: trunk
8
License: GPLv3 or later
9
License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -357,6 +357,16 @@ Thank you for being part of the HMTL 5 mobile video revolution!
357
358
== Changelog ==
359
360
= 7.3.9.727 - 2019/02/05 =
361
362
* FV Player wp-admin menu - sorting by player date, latest first
3
Donate link: https://foliovision.com/donate
4
Tags: video player, flowplayer, mobile video, html5 video, Vimeo, html5 player, youtube player, youtube playlist, video playlist, RTMP, Cloudfront, HLS
5
Requires at least: 3.5
6
+ Tested up to: 5.1.1
7
Stable tag: trunk
8
License: GPLv3 or later
9
License URI: http://www.gnu.org/licenses/gpl-3.0.html
357
358
== Changelog ==
359
360
+ = 7.3.12.727 - 2019/02/26 =
361
+
362
+ * New Feature - Rewind Button - seeks 10 seconds back in the video, enable in Settings -> FV Player -> Sitewide FV Player Defaults
363
+ * Live stream - removing from Post Interface Options and showing it for HLS streams automatically
364
+ * Audio - checkbox for HLS streams to make them audio-only
365
+ * Bugfix - video duration check forgetting to remove fv_flowlayer_tmp_* temporary files
366
+ * Bugfix - video position saving too many requests when leaving the web page
367
+ * Bugfix - video start/end time editing for FV Player Pro
368
+ * Bugfix - too many database checks in wp-admin
369
+
370
= 7.3.9.727 - 2019/02/05 =
371
372
* FV Player wp-admin menu - sorting by player date, latest first
view/admin.php CHANGED
@@ -291,6 +291,8 @@ function fv_flowplayer_admin_default_options() {
291
<?php $fv_fp->_get_checkbox(__('Popup Box', 'fv-wordpress-flowplayer'), 'popupbox', __('Shows a generic "Would you like to replay the video?" message at the end of each video.', 'fv-wordpress-flowplayer') ); ?>
292
293
<?php $fv_fp->_get_checkbox(__('Repeat Button', 'fv-wordpress-flowplayer'), 'ui_repeat_button', __('Adds a button to set playlist/track repeat and shuffle.', 'fv-wordpress-flowplayer') ); ?>
294
295
<tr>
296
<td><label for="sharing_text"><?php _e('Sharing Text', 'fv-wordpress-flowplayer'); ?>:</label></td>
@@ -830,7 +832,6 @@ function fv_flowplayer_admin_interface_options() {
830
<?php $fv_fp->_get_checkbox(__('Autoplay', 'fv-wordpress-flowplayer'), array('interface', 'autoplay') ); ?>
831
<?php $fv_fp->_get_checkbox(__('Controlbar', 'fv-wordpress-flowplayer'), array('interface', 'controlbar') ); ?>
832
<?php $fv_fp->_get_checkbox(__('Embed', 'fv-wordpress-flowplayer'), array('interface', 'embed') ); ?>
833
- <?php $fv_fp->_get_checkbox(__('Live Stream', 'fv-wordpress-flowplayer'), array('interface', 'live') ); ?>
834
<?php $fv_fp->_get_checkbox(__('Mobile Video', 'fv-wordpress-flowplayer'), array('interface', 'mobile') ); ?>
835
<?php $fv_fp->_get_checkbox(__('Playlist Auto Advance', 'fv-wordpress-flowplayer'), array('interface', 'playlist_advance') ); ?>
836
<?php $fv_fp->_get_checkbox(__('Playlist Style', 'fv-wordpress-flowplayer'), array('interface', 'playlist') ); ?>
291
<?php $fv_fp->_get_checkbox(__('Popup Box', 'fv-wordpress-flowplayer'), 'popupbox', __('Shows a generic "Would you like to replay the video?" message at the end of each video.', 'fv-wordpress-flowplayer') ); ?>
292
293
<?php $fv_fp->_get_checkbox(__('Repeat Button', 'fv-wordpress-flowplayer'), 'ui_repeat_button', __('Adds a button to set playlist/track repeat and shuffle.', 'fv-wordpress-flowplayer') ); ?>
294
+
295
+ <?php $fv_fp->_get_checkbox(__('Rewind Button', 'fv-wordpress-flowplayer'), 'ui_rewind_button', __('Adds a button to go 10 seconds back.', 'fv-wordpress-flowplayer') ); ?>
296
297
<tr>
298
<td><label for="sharing_text"><?php _e('Sharing Text', 'fv-wordpress-flowplayer'); ?>:</label></td>
832
<?php $fv_fp->_get_checkbox(__('Autoplay', 'fv-wordpress-flowplayer'), array('interface', 'autoplay') ); ?>
833
<?php $fv_fp->_get_checkbox(__('Controlbar', 'fv-wordpress-flowplayer'), array('interface', 'controlbar') ); ?>
834
<?php $fv_fp->_get_checkbox(__('Embed', 'fv-wordpress-flowplayer'), array('interface', 'embed') ); ?>
835
<?php $fv_fp->_get_checkbox(__('Mobile Video', 'fv-wordpress-flowplayer'), array('interface', 'mobile') ); ?>
836
<?php $fv_fp->_get_checkbox(__('Playlist Auto Advance', 'fv-wordpress-flowplayer'), array('interface', 'playlist_advance') ); ?>
837
<?php $fv_fp->_get_checkbox(__('Playlist Style', 'fv-wordpress-flowplayer'), array('interface', 'playlist') ); ?>
view/wizard.php CHANGED
@@ -287,10 +287,15 @@ var fv_flowplayer_preview_nonce = '<?php echo wp_create_nonce( "fv-player-previe
287
<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>
288
</tr>
289
290
- <tr <?php if( !isset($fv_flowplayer_conf["interface"]["live"]) || $fv_flowplayer_conf["interface"]["live"] !== 'true' ) echo ' class="fv_player_interface_hide"'; ?>>
291
<th scope="row" class="label"><label for="fv_wp_flowplayer_field_live" class="alignright"><?php _e('Live stream', 'fv_flowplayer'); ?></label></th>
292
<td class="field"><input type="checkbox" id="fv_wp_flowplayer_field_live" name="fv_wp_flowplayer_field_live" /></td>
293
</tr>
294
295
<?php do_action('fv_flowplayer_shortcode_editor_item_after'); ?>
296
@@ -377,12 +382,6 @@ var fv_flowplayer_preview_nonce = '<?php echo wp_create_nonce( "fv-player-previe
377
<?php fv_player_shortcode_row( array( 'label' => 'Align', 'name' => 'align', 'dropdown' => array( 'Default', 'Left', 'Right' ) ) ); ?>
378
<?php fv_player_shortcode_row( array( 'label' => 'Controlbar', 'name' => 'controlbar', 'dropdown' => array( 'Default', 'Yes', 'No' ) ) ); ?>
379
<?php fv_player_shortcode_row( array( 'label' => 'Sticky video', 'name' => 'sticky' ) ); ?>
380
-
381
- <tr <?php if( !isset($fv_flowplayer_conf["interface"]["live"]) || $fv_flowplayer_conf["interface"]["live"] !== 'true' ) echo ' class="fv_player_interface_hide"'; ?>>
382
- <th scope="row" class="label"><label for="fv_wp_flowplayer_field_live" class="alignright"><?php _e('Live stream', 'fv_flowplayer'); ?></label></th>
383
- <td class="field"><input type="checkbox" id="fv_wp_flowplayer_field_live" name="fv_wp_flowplayer_field_live" /></td>
384
- </tr>
385
-
386
<?php fv_player_shortcode_row( array( 'label' => 'Playlist Style', 'name' => 'playlist', 'dropdown' => array( 'Default', 'Tabs', 'Prev/Next', 'Vertical', 'Horizontal', 'Text', 'Slider' ), 'class' => 'hide-if-singular', 'id' => 'fv_wp_flowplayer_add_format_wrapper' ) ); ?>
387
<?php fv_player_shortcode_row( array( 'label' => 'Sharing Buttons', 'name' => 'share', 'dropdown' => array( 'Default', 'Yes', 'No', 'Custom' ) ) ); ?>
388
287
<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>
288
</tr>
289
290
+ <tr class="fv_player_interface_hide">
291
<th scope="row" class="label"><label for="fv_wp_flowplayer_field_live" class="alignright"><?php _e('Live stream', 'fv_flowplayer'); ?></label></th>
292
<td class="field"><input type="checkbox" id="fv_wp_flowplayer_field_live" name="fv_wp_flowplayer_field_live" /></td>
293
</tr>
294
+
295
+ <tr class="fv_player_interface_hide">
296
+ <th scope="row" class="label"><label for="fv_wp_flowplayer_field_audio" class="alignright"><?php _e('Audio stream', 'fv_flowplayer'); ?></label></th>
297
+ <td class="field"><input type="checkbox" id="fv_wp_flowplayer_field_audio" name="fv_wp_flowplayer_field_audio" /></td>
298
+ </tr>
299
300
<?php do_action('fv_flowplayer_shortcode_editor_item_after'); ?>
301
382
<?php fv_player_shortcode_row( array( 'label' => 'Align', 'name' => 'align', 'dropdown' => array( 'Default', 'Left', 'Right' ) ) ); ?>
383
<?php fv_player_shortcode_row( array( 'label' => 'Controlbar', 'name' => 'controlbar', 'dropdown' => array( 'Default', 'Yes', 'No' ) ) ); ?>
384
<?php fv_player_shortcode_row( array( 'label' => 'Sticky video', 'name' => 'sticky' ) ); ?>
385
<?php fv_player_shortcode_row( array( 'label' => 'Playlist Style', 'name' => 'playlist', 'dropdown' => array( 'Default', 'Tabs', 'Prev/Next', 'Vertical', 'Horizontal', 'Text', 'Slider' ), 'class' => 'hide-if-singular', 'id' => 'fv_wp_flowplayer_add_format_wrapper' ) ); ?>
386
<?php fv_player_shortcode_row( array( 'label' => 'Sharing Buttons', 'name' => 'share', 'dropdown' => array( 'Default', 'Yes', 'No', 'Custom' ) ) ); ?>
387