Version Description
2018/09/28 =
Amazon S3 - fixing issues caused by Flash version of signed URL
Amazon S3 - fixing handling of blank spaces for S3 bucket browser
Amazon S3 - fixing handling of blank spaces for URL signature
Download this release
Release Info
Developer | FolioVision |
Plugin | FV Flowplayer Video Player |
Version | 7.2.2.727 |
Comparing to | |
See all releases |
Code changes from version 7.2.1.727 to 7.2.2.727
- css/flowplayer.css +3 -2
- flowplayer.php +2 -2
- models/flowplayer-frontend.php +7 -94
- models/flowplayer.php +25 -116
- models/media-browser-s3.php +4 -3
- readme.txt +12 -6
css/flowplayer.css
CHANGED
@@ -797,7 +797,7 @@
|
|
797 |
}
|
798 |
.flowplayer .fp-speed-menu.fp-active.wont-fit {
|
799 |
overflow-y: scroll;
|
800 |
-
height:
|
801 |
}
|
802 |
.flowplayer .fp-speed-menu::-webkit-scrollbar {
|
803 |
width: 8px;
|
@@ -1602,6 +1602,7 @@ article .entry-content .fvfp_admin_error p { line-height: 18px }
|
|
1602 |
|
1603 |
}
|
1604 |
@media (max-width: 39.9375em){
|
|
|
1605 |
.flowplayer .fp-captions{line-height:14px !important}
|
1606 |
.flowplayer .fp-captions p{font-size:14px !important;line-height:20px !important}
|
1607 |
.flowplayer .fp-help p{font-size:9px;}
|
@@ -1615,7 +1616,7 @@ article .entry-content .fvfp_admin_error p { line-height: 18px }
|
|
1615 |
@media only screen and (max-width: 29.9375em) {
|
1616 |
.flowplayer .fp-captions{bottom:4px;line-height:12px !important}
|
1617 |
.flowplayer .fp-captions p{font-size:11px !important;line-height:18px !important;-webkit-text-shadow:0 0 2px #666;-moz-text-shadow:0 0 2px #666;text-shadow:0 0 2px #666}
|
1618 |
-
.flowplayer .fv_player_popup {width:99%;font-size:
|
1619 |
.flowplayer.is-fv-narrow .fv_player_popup{font-size:.8em}
|
1620 |
.flowplayer.is-audio .fp-time em {font-size:12px}
|
1621 |
.fp-playlist-external a h4 {font-size:10px}
|
797 |
}
|
798 |
.flowplayer .fp-speed-menu.fp-active.wont-fit {
|
799 |
overflow-y: scroll;
|
800 |
+
height: 83%;
|
801 |
}
|
802 |
.flowplayer .fp-speed-menu::-webkit-scrollbar {
|
803 |
width: 8px;
|
1602 |
|
1603 |
}
|
1604 |
@media (max-width: 39.9375em){
|
1605 |
+
.flowplayer .fv_player_popup { padding: 12px 0 0 }
|
1606 |
.flowplayer .fp-captions{line-height:14px !important}
|
1607 |
.flowplayer .fp-captions p{font-size:14px !important;line-height:20px !important}
|
1608 |
.flowplayer .fp-help p{font-size:9px;}
|
1616 |
@media only screen and (max-width: 29.9375em) {
|
1617 |
.flowplayer .fp-captions{bottom:4px;line-height:12px !important}
|
1618 |
.flowplayer .fp-captions p{font-size:11px !important;line-height:18px !important;-webkit-text-shadow:0 0 2px #666;-moz-text-shadow:0 0 2px #666;text-shadow:0 0 2px #666}
|
1619 |
+
.flowplayer .fv_player_popup {width:99%;font-size:12px;top:0;}
|
1620 |
.flowplayer.is-fv-narrow .fv_player_popup{font-size:.8em}
|
1621 |
.flowplayer.is-audio .fp-time em {font-size:12px}
|
1622 |
.fp-playlist-external a h4 {font-size:10px}
|
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.2.
|
7 |
Author URI: http://foliovision.com/
|
8 |
License: GPL-3.0
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
|
@@ -26,7 +26,7 @@ License URI: http://www.gnu.org/licenses/gpl-3.0.txt
|
|
26 |
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
27 |
*/
|
28 |
|
29 |
-
$fv_wp_flowplayer_ver = '7.2.
|
30 |
$fv_wp_flowplayer_core_ver = '7.2.7.1';
|
31 |
|
32 |
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.2.2.727
|
7 |
Author URI: http://foliovision.com/
|
8 |
License: GPL-3.0
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
|
26 |
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
27 |
*/
|
28 |
|
29 |
+
$fv_wp_flowplayer_ver = '7.2.2.727';
|
30 |
$fv_wp_flowplayer_core_ver = '7.2.7.1';
|
31 |
|
32 |
include_once( dirname( __FILE__ ) . '/includes/extra-functions.php' );
|
models/flowplayer-frontend.php
CHANGED
@@ -282,10 +282,12 @@ class flowplayer_frontend extends flowplayer
|
|
282 |
$this->ret['html'] .= ">\n";
|
283 |
|
284 |
if (!empty($mobile)) {
|
285 |
-
$
|
|
|
286 |
} else {
|
287 |
-
foreach( apply_filters( 'fv_player_media', array($media, $src1, $src2), $this ) AS $media_item ) {
|
288 |
-
|
|
|
289 |
}
|
290 |
}
|
291 |
|
@@ -535,95 +537,6 @@ class flowplayer_frontend extends flowplayer
|
|
535 |
$this->ret['html'] .= "\t".'<div class="fp-ratio" style="padding-top: '.str_replace(',','.',$this->fRatio * 100).'%"></div>'."\n";
|
536 |
$this->ret['html'] .= "\t".'<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>'."\n";
|
537 |
}
|
538 |
-
|
539 |
-
if( count($aPlaylistItems) == 0 ) { // todo: this stops subtitles, mobile video, preload etc.
|
540 |
-
$this->ret['html'] .= "\t".'<video class="fp-engine" preload="none"';
|
541 |
-
if (isset($splash_img) && !empty($splash_img)) {
|
542 |
-
$this->ret['html'] .= ' poster="'.flowplayer::get_encoded_url($splash_img).'"';
|
543 |
-
}
|
544 |
-
|
545 |
-
$this->ret['html'] .= ">\n";
|
546 |
-
|
547 |
-
if( isset($rtmp) && !empty($rtmp) ) {
|
548 |
-
|
549 |
-
foreach( apply_filters( 'fv_player_media_rtmp', array($rtmp),$this ) AS $rtmp_item ) {
|
550 |
-
$rtmp_item = apply_filters( 'fv_flowplayer_video_src', $rtmp_item, $this );
|
551 |
-
|
552 |
-
if( preg_match( '~([a-zA-Z0-9]+)?:~', $rtmp ) ) {
|
553 |
-
$aTMP = preg_split( '~([a-zA-Z0-9]+)?:~', $rtmp, -1, PREG_SPLIT_DELIM_CAPTURE );
|
554 |
-
|
555 |
-
if( isset($aTMP[1]) && isset($aTMP[2]) ) {
|
556 |
-
$rtmp_file = $aTMP[2];
|
557 |
-
$extension = $this->get_mime_type($rtmp_file, $aTMP[1], true);
|
558 |
-
} else {
|
559 |
-
$rtmp_file = $aTMP[1];
|
560 |
-
$extension = $this->get_mime_type($rtmp_file, false, true);
|
561 |
-
}
|
562 |
-
} else {
|
563 |
-
$rtmp_url = parse_url($rtmp_item);
|
564 |
-
$rtmp_file = $rtmp_url['path'] . ( ( !empty($rtmp_url['query']) ) ? '?'. str_replace( '&', '&', $rtmp_url['query'] ) : '' );
|
565 |
-
$extension = $this->get_mime_type($rtmp_url['path'], false, true);
|
566 |
-
}
|
567 |
-
|
568 |
-
if( $extension ) {
|
569 |
-
$extension .= ':';
|
570 |
-
} else {
|
571 |
-
//$extension = 'mp4:'; // https://github.com/flowplayer/flowplayer/search?q=rtmp&type=Issues&utf8=%E2%9C%93
|
572 |
-
}
|
573 |
-
|
574 |
-
$this->ret['html'] .= "\t"."\t".'<source src="'.$extension.trim($rtmp_file, " \t\n\r\0\x0B/").'" type="video/flash" />'."\n";
|
575 |
-
}
|
576 |
-
}
|
577 |
-
|
578 |
-
foreach( apply_filters( 'fv_player_media', array($media, $src1, $src2), $this ) AS $media_item ) {
|
579 |
-
$this->ret['html'] .= $this->get_video_src($media_item, array( 'rtmp' => $rtmp ) );
|
580 |
-
}
|
581 |
-
if (!empty($mobile)) {
|
582 |
-
$this->ret['script']['fv_flowplayer_mobile_switch'][$this->hash] = true;
|
583 |
-
$this->ret['html'] .= $this->get_video_src($mobile, array( 'id' => 'wpfp_'.$this->hash.'_mobile', 'rtmp' => $rtmp ) );
|
584 |
-
}
|
585 |
-
|
586 |
-
if (isset($aSubtitles) && !empty($aSubtitles)) {
|
587 |
-
$aLangs = self::get_languages();
|
588 |
-
$countSubtitles = 0;
|
589 |
-
foreach( $aSubtitles AS $key => $subtitles ) {
|
590 |
-
if( $key == 'subtitles' ) {
|
591 |
-
$aLang = explode('-', get_bloginfo('language'));
|
592 |
-
$sExtra = !empty($aLang[0]) ? 'srclang="'.$aLang[0].'" ' : '';
|
593 |
-
$sCode = $aLang[0];
|
594 |
-
|
595 |
-
$sCaption = '';
|
596 |
-
if( !empty($sCode) && $sCode == 'en' ) {
|
597 |
-
$sCaption = 'English';
|
598 |
-
|
599 |
-
} elseif( !empty($sCode) ) {
|
600 |
-
$translations = get_site_transient( 'available_translations' );
|
601 |
-
$sLangCode = str_replace( '-', '_', get_bloginfo('language') );
|
602 |
-
if( $translations && isset($translations[$sLangCode]) && !empty($translations[$sLangCode]['native_name']) ) {
|
603 |
-
$sCaption = $translations[$sLangCode]['native_name'];
|
604 |
-
}
|
605 |
-
|
606 |
-
}
|
607 |
-
|
608 |
-
if( $sCaption ) {
|
609 |
-
$sExtra .= 'label="'.$sCaption.'" ';
|
610 |
-
}
|
611 |
-
|
612 |
-
} else {
|
613 |
-
$sExtra = 'srclang="'.$key.'" label="'.$aLangs[strtoupper($key)].'" ';
|
614 |
-
}
|
615 |
-
|
616 |
-
if( $countSubtitles == 0 && $this->_get_option('subtitleOn') ) {
|
617 |
-
$sExtra .= 'default ';
|
618 |
-
}
|
619 |
-
|
620 |
-
$countSubtitles++;
|
621 |
-
$this->ret['html'] .= "\t"."\t".'<track '.$sExtra.'src="'.esc_attr($subtitles).'" />'."\n";
|
622 |
-
}
|
623 |
-
}
|
624 |
-
|
625 |
-
$this->ret['html'] .= "\t".'</video>';//."\n";
|
626 |
-
}
|
627 |
|
628 |
$this->ret['html'] .= $this->get_buttons();
|
629 |
|
@@ -1051,13 +964,13 @@ class flowplayer_frontend extends flowplayer
|
|
1051 |
$aTest_media = array();
|
1052 |
foreach( array( $media, $src1, $src2, $rtmp ) AS $media_item ) {
|
1053 |
if( $media_item ) {
|
1054 |
-
$aTest_media[] = $this->get_video_src( $media_item, array( '
|
1055 |
//break;
|
1056 |
}
|
1057 |
}
|
1058 |
|
1059 |
if( !empty($this->aCurArgs['mobile']) ) {
|
1060 |
-
$aTest_media[] = $this->get_video_src($this->aCurArgs['mobile'], array( '
|
1061 |
}
|
1062 |
|
1063 |
if( isset($aTest_media) && count($aTest_media) > 0 ) {
|
282 |
$this->ret['html'] .= ">\n";
|
283 |
|
284 |
if (!empty($mobile)) {
|
285 |
+
$src = $this->get_video_src($mobile);
|
286 |
+
$this->ret['html'] .= '<source src="'.esc_attr($src).'" type="'.$this->get_mime_type($src).'" />';
|
287 |
} else {
|
288 |
+
foreach( apply_filters( 'fv_player_media', array($media, $src1, $src2), $this ) AS $media_item ) {
|
289 |
+
$src = $this->get_video_src($media_item);
|
290 |
+
$this->ret['html'] .= '<source src="'.esc_attr($src).'" type="'.$this->get_mime_type($src).'" />';
|
291 |
}
|
292 |
}
|
293 |
|
537 |
$this->ret['html'] .= "\t".'<div class="fp-ratio" style="padding-top: '.str_replace(',','.',$this->fRatio * 100).'%"></div>'."\n";
|
538 |
$this->ret['html'] .= "\t".'<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>'."\n";
|
539 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
540 |
|
541 |
$this->ret['html'] .= $this->get_buttons();
|
542 |
|
964 |
$aTest_media = array();
|
965 |
foreach( array( $media, $src1, $src2, $rtmp ) AS $media_item ) {
|
966 |
if( $media_item ) {
|
967 |
+
$aTest_media[] = $this->get_video_src( $media_item, array( 'dynamic' => true ) );
|
968 |
//break;
|
969 |
}
|
970 |
}
|
971 |
|
972 |
if( !empty($this->aCurArgs['mobile']) ) {
|
973 |
+
$aTest_media[] = $this->get_video_src($this->aCurArgs['mobile'], array( 'dynamic' => true ) );
|
974 |
}
|
975 |
|
976 |
if( isset($aTest_media) && count($aTest_media) > 0 ) {
|
models/flowplayer.php
CHANGED
@@ -121,7 +121,7 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin_Private {
|
|
121 |
//add_filter( 'fv_flowplayer_caption', array( $this, 'get_duration_playlist' ), 10, 3 );
|
122 |
add_filter( 'fv_flowplayer_inner_html', array( $this, 'get_duration_video' ), 10, 2 );
|
123 |
|
124 |
-
add_filter( 'fv_flowplayer_video_src', array( $this, 'get_amazon_secure')
|
125 |
|
126 |
add_filter( 'fv_flowplayer_splash', array( $this, 'get_amazon_secure') );
|
127 |
add_filter( 'fv_flowplayer_playlist_splash', array( $this, 'get_amazon_secure') );
|
@@ -803,7 +803,6 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin_Private {
|
|
803 |
}
|
804 |
|
805 |
$aItem = array();
|
806 |
-
$flash_media = array();
|
807 |
|
808 |
if( $rtmp && stripos($rtmp,'rtmp://') === false ) {
|
809 |
$rtmp = 'rtmp:'.$rtmp;
|
@@ -818,48 +817,25 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin_Private {
|
|
818 |
$media_item_tmp = $media_item;
|
819 |
}
|
820 |
|
821 |
-
$media_url = $this->get_video_src( $media_item_tmp, array( '
|
822 |
|
823 |
// add domain for relative video URLs if it's not RTMP
|
824 |
if( stripos($media_item,'rtmp://') === false && $key != 3 ) {
|
825 |
$media_url = $this->get_video_url($media_url);
|
826 |
}
|
827 |
|
828 |
-
if( is_array($media_url) ) {
|
829 |
-
$actual_media_url = $media_url['media'];
|
830 |
-
if( $this->get_mime_type($actual_media_url) == 'video/mp4' ) {
|
831 |
-
$flash_media[] = $media_url['flash'];
|
832 |
-
}
|
833 |
-
} else {
|
834 |
-
$actual_media_url = $media_url;
|
835 |
-
}
|
836 |
if( stripos( $media_item, 'rtmp:' ) === 0 ) {
|
837 |
-
if( !preg_match( '~^[a-z0-9]+:~', $
|
838 |
-
$ext = $this->get_mime_type($
|
839 |
-
$aItem[] = array( 'src' => $ext.str_replace( '+', ' ', $
|
840 |
} else {
|
841 |
-
$aItem[] = array( 'src' => str_replace( '+', ' ', $
|
842 |
}
|
843 |
} else {
|
844 |
-
$aItem[] = array( 'src' => $
|
845 |
}
|
846 |
}
|
847 |
|
848 |
-
if( count($flash_media) ) {
|
849 |
-
$bHaveFlash = false;
|
850 |
-
foreach( $aItem AS $key => $aItemFile ) { // how to avoid duplicates?
|
851 |
-
if( in_array( 'flash', array_keys($aItemFile) ) ) {
|
852 |
-
$bHaveFlash = true;
|
853 |
-
}
|
854 |
-
}
|
855 |
-
|
856 |
-
if( !$bHaveFlash ) {
|
857 |
-
foreach( $flash_media AS $flash_media_items ) {
|
858 |
-
$aItem[] = array( 'flash' => $flash_media_items );
|
859 |
-
}
|
860 |
-
}
|
861 |
-
}
|
862 |
-
|
863 |
$sItemCaption = ( isset($aCaption) ) ? array_shift($aCaption) : false;
|
864 |
$sItemCaption = apply_filters( 'fv_flowplayer_caption', $sItemCaption, $aItem, $aArgs );
|
865 |
|
@@ -868,7 +844,7 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin_Private {
|
|
868 |
list( $rtmp_server, $rtmp ) = $this->get_rtmp_server($rtmp);
|
869 |
|
870 |
if( !empty($aArgs['mobile']) ) {
|
871 |
-
$mobile = $this->get_video_url($aArgs['mobile']);
|
872 |
$aItem[] = array( 'src' => $mobile, 'type' => $this->get_mime_type($mobile), 'mobile' => true );
|
873 |
}
|
874 |
|
@@ -906,7 +882,6 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin_Private {
|
|
906 |
|
907 |
$aItem = array();
|
908 |
$sSplashImage = false;
|
909 |
-
$flash_media = array();
|
910 |
|
911 |
foreach( apply_filters( 'fv_player_media', $aPlaylist_item, $this ) AS $aPlaylist_item_i ) {
|
912 |
if( preg_match('~\.(png|gif|jpg|jpe|jpeg)($|\?)~',$aPlaylist_item_i) ) {
|
@@ -914,44 +889,22 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin_Private {
|
|
914 |
continue;
|
915 |
}
|
916 |
|
917 |
-
$media_url = $this->get_video_src( preg_replace( '~^rtmp:~', '', $aPlaylist_item_i ), array( '
|
918 |
-
|
919 |
-
$actual_media_url = $media_url['media'];
|
920 |
-
if( $this->get_mime_type($actual_media_url) == 'video/mp4' ) {
|
921 |
-
$flash_media[] = $media_url['flash'];
|
922 |
-
}
|
923 |
-
} else {
|
924 |
-
$actual_media_url = $media_url;
|
925 |
-
}
|
926 |
if( stripos( $aPlaylist_item_i, 'rtmp:' ) === 0 ) {
|
927 |
-
if( !preg_match( '~^[a-z0-9]+:~', $
|
928 |
-
$ext = $this->get_mime_type($
|
929 |
-
$aItem[] = array( 'src' => $ext.str_replace( '+', ' ', $
|
930 |
} else {
|
931 |
-
$aItem[] = array( 'src' => str_replace( '+', ' ', $
|
932 |
}
|
933 |
} else {
|
934 |
-
$aItem[] = array( 'src' => $
|
935 |
}
|
936 |
|
937 |
}
|
938 |
|
939 |
$sSplashImage = apply_filters( 'fv_flowplayer_playlist_splash', $sSplashImage, $this, $aPlaylist_item );
|
940 |
-
|
941 |
-
if( count($flash_media) ) {
|
942 |
-
$bHaveFlash = false;
|
943 |
-
foreach( $aItem AS $key => $aItemFile ) {
|
944 |
-
if( in_array( 'flash', array_keys($aItemFile) ) ) {
|
945 |
-
$bHaveFlash = true;
|
946 |
-
}
|
947 |
-
}
|
948 |
-
|
949 |
-
if( !$bHaveFlash ) {
|
950 |
-
foreach( $flash_media AS $flash_media_items ) {
|
951 |
-
$aItem[] = array( 'flash' => $flash_media_items );
|
952 |
-
}
|
953 |
-
}
|
954 |
-
}
|
955 |
|
956 |
$aPlayer = array( 'sources' => $aItem );
|
957 |
if( $rtmp_server ) $aPlayer['rtmp'] = array( 'url' => $rtmp_server );
|
@@ -1295,9 +1248,6 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin_Private {
|
|
1295 |
|
1296 |
if( stripos($media,'X-Amz-Expires') !== false || stripos($media,'AWSAccessKeyId') !== false ) return $media;
|
1297 |
|
1298 |
-
$aArgs = func_get_args();
|
1299 |
-
$aArgs = isset($aArgs[1]) ? $aArgs[1] : array();
|
1300 |
-
|
1301 |
global $fv_fp;
|
1302 |
|
1303 |
$amazon_key = -1;
|
@@ -1336,7 +1286,7 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin_Private {
|
|
1336 |
$iAWSVersion = $fv_fp->_get_option( array( 'amazon_region', $amazon_key ) ) ? 4 : 2;
|
1337 |
|
1338 |
if( $iAWSVersion == 4 ) {
|
1339 |
-
$url_components['path'] = str_replace('+', ' ', $url_components['path']);
|
1340 |
}
|
1341 |
|
1342 |
$url_components['path'] = rawurlencode($url_components['path']);
|
@@ -1345,8 +1295,6 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin_Private {
|
|
1345 |
$url_components['path'] = str_replace('%2523', '%23', $url_components['path']);
|
1346 |
$url_components['path'] = str_replace('%252B', '%2B', $url_components['path']);
|
1347 |
$url_components['path'] = str_replace('%2527', '%27', $url_components['path']);
|
1348 |
-
|
1349 |
-
$sGlue = ( !empty($aArgs['url_only']) && $aArgs['url_only'] ) ? '&' : '&';
|
1350 |
|
1351 |
if( $iAWSVersion == 4 ) {
|
1352 |
$sXAMZDate = gmdate('Ymd\THis\Z');
|
@@ -1378,11 +1326,11 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin_Private {
|
|
1378 |
|
1379 |
// 4. http://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html
|
1380 |
$resource .= "?X-Amz-Algorithm=AWS4-HMAC-SHA256";
|
1381 |
-
$resource .=
|
1382 |
-
$resource .=
|
1383 |
-
$resource .=
|
1384 |
-
$resource .=
|
1385 |
-
$resource .=
|
1386 |
|
1387 |
$this->ret['script']['fv_flowplayer_amazon_s3'][$this->hash] = $time;
|
1388 |
|
@@ -1405,7 +1353,7 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin_Private {
|
|
1405 |
$signature = urlencode($signature);
|
1406 |
} while( stripos($signature,'%2B') !== false );
|
1407 |
|
1408 |
-
$resource .= '?AWSAccessKeyId='.$fv_fp->_get_option( array('amazon_key', $amazon_key) )
|
1409 |
|
1410 |
}
|
1411 |
|
@@ -1787,52 +1735,16 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin_Private {
|
|
1787 |
|
1788 |
function get_video_src($media, $aArgs = array() ) {
|
1789 |
$aArgs = wp_parse_args( $aArgs, array(
|
1790 |
-
'dynamic' => false,
|
1791 |
-
'flash' => true,
|
1792 |
-
'id' => false,
|
1793 |
-
'rtmp' => false,
|
1794 |
'suppress_filters' => false,
|
1795 |
-
'url_only' => false
|
1796 |
)
|
1797 |
);
|
1798 |
|
1799 |
if( $media ) {
|
1800 |
-
$mime_type = $this->get_mime_type($media);
|
1801 |
-
$sID = ($aArgs['id']) ? 'id="'.$aArgs['id'].'" ' : '';
|
1802 |
-
|
1803 |
if( !$aArgs['suppress_filters'] ) {
|
1804 |
$media = apply_filters( 'fv_flowplayer_video_src', $media, $aArgs );
|
1805 |
}
|
1806 |
-
|
1807 |
-
$media = trim($media);
|
1808 |
-
|
1809 |
-
// fix for signed Amazon URLs, we actually need it for Flash only, so it gets into an extra source tag
|
1810 |
-
$source_flash_encoded = false;
|
1811 |
-
if( $this->is_secure_amazon_s3($media) /*&& stripos($media,'.webm') === false && stripos($media,'.ogv') === false */) {
|
1812 |
-
$media_fixed = str_replace('%2B', '%25252B',$media);
|
1813 |
-
$media_fixed = str_replace('%23', '%252523',$media_fixed );
|
1814 |
-
$media_fixed = str_replace('+', '%2B',$media_fixed );
|
1815 |
-
// only if there was a change and we don't have an RTMP for Flash
|
1816 |
-
if( $media_fixed != $media && empty($aArgs['rtmp']) ) {
|
1817 |
-
$source_flash_encoded = $media_fixed;
|
1818 |
-
}
|
1819 |
-
}
|
1820 |
-
|
1821 |
-
if( $aArgs['url_only'] ) {
|
1822 |
-
if( $aArgs['flash'] && $source_flash_encoded ) {
|
1823 |
-
return array( 'media' => $media, 'flash' => $source_flash_encoded );
|
1824 |
-
} else {
|
1825 |
-
return strip_tags($media);
|
1826 |
-
}
|
1827 |
-
} else {
|
1828 |
-
|
1829 |
-
$sReturn = '<source '.$sID.'src="'.esc_attr($media).'" type="'.$mime_type.'" />'."\n";
|
1830 |
-
|
1831 |
-
if( $source_flash_encoded && strcmp($mime_type,'video/mp4') == 0 ) {
|
1832 |
-
$sReturn .= '<source '.$sID.'src="'.esc_attr($source_flash_encoded).'" type="video/flash" />'."\n";
|
1833 |
-
}
|
1834 |
-
return $sReturn;
|
1835 |
-
}
|
1836 |
}
|
1837 |
return null;
|
1838 |
}
|
@@ -2142,10 +2054,7 @@ function fv_wp_flowplayer_save_post( $post_id ) {
|
|
2142 |
}
|
2143 |
|
2144 |
if( isset($post->ID) && !get_post_meta( $post->ID, flowplayer::get_video_key($video), true ) ) {
|
2145 |
-
$video_secured = $fv_fp->get_video_src( $video, array( 'dynamic' => true
|
2146 |
-
if( !is_array($video_secured) ) {
|
2147 |
-
$video_secured = array( 'media' => $video_secured );
|
2148 |
-
}
|
2149 |
if( isset($video_secured['media']) && $FV_Player_Checker->check_mimetype( array($video_secured['media']), array( 'meta_action' => 'check_time', 'meta_original' => $video ) ) ) {
|
2150 |
$iDone++;
|
2151 |
if( isset($_GET['fv_flowplayer_checker'] ) ) {
|
121 |
//add_filter( 'fv_flowplayer_caption', array( $this, 'get_duration_playlist' ), 10, 3 );
|
122 |
add_filter( 'fv_flowplayer_inner_html', array( $this, 'get_duration_video' ), 10, 2 );
|
123 |
|
124 |
+
add_filter( 'fv_flowplayer_video_src', array( $this, 'get_amazon_secure') );
|
125 |
|
126 |
add_filter( 'fv_flowplayer_splash', array( $this, 'get_amazon_secure') );
|
127 |
add_filter( 'fv_flowplayer_playlist_splash', array( $this, 'get_amazon_secure') );
|
803 |
}
|
804 |
|
805 |
$aItem = array();
|
|
|
806 |
|
807 |
if( $rtmp && stripos($rtmp,'rtmp://') === false ) {
|
808 |
$rtmp = 'rtmp:'.$rtmp;
|
817 |
$media_item_tmp = $media_item;
|
818 |
}
|
819 |
|
820 |
+
$media_url = $this->get_video_src( $media_item_tmp, array( 'suppress_filters' => $suppress_filters ) );
|
821 |
|
822 |
// add domain for relative video URLs if it's not RTMP
|
823 |
if( stripos($media_item,'rtmp://') === false && $key != 3 ) {
|
824 |
$media_url = $this->get_video_url($media_url);
|
825 |
}
|
826 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
827 |
if( stripos( $media_item, 'rtmp:' ) === 0 ) {
|
828 |
+
if( !preg_match( '~^[a-z0-9]+:~', $media_url ) ) { // no RTMP extension provided
|
829 |
+
$ext = $this->get_mime_type($media_url,false,true) ? $this->get_mime_type($media_url,false,true).':' : false;
|
830 |
+
$aItem[] = array( 'src' => $ext.str_replace( '+', ' ', $media_url ), 'type' => 'video/flash' );
|
831 |
} else {
|
832 |
+
$aItem[] = array( 'src' => str_replace( '+', ' ', $media_url ), 'type' => 'video/flash' );
|
833 |
}
|
834 |
} else {
|
835 |
+
$aItem[] = array( 'src' => $media_url, 'type' => $this->get_mime_type($media_url) );
|
836 |
}
|
837 |
}
|
838 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
839 |
$sItemCaption = ( isset($aCaption) ) ? array_shift($aCaption) : false;
|
840 |
$sItemCaption = apply_filters( 'fv_flowplayer_caption', $sItemCaption, $aItem, $aArgs );
|
841 |
|
844 |
list( $rtmp_server, $rtmp ) = $this->get_rtmp_server($rtmp);
|
845 |
|
846 |
if( !empty($aArgs['mobile']) ) {
|
847 |
+
$mobile = $this->get_video_src( $this->get_video_url($aArgs['mobile']) );
|
848 |
$aItem[] = array( 'src' => $mobile, 'type' => $this->get_mime_type($mobile), 'mobile' => true );
|
849 |
}
|
850 |
|
882 |
|
883 |
$aItem = array();
|
884 |
$sSplashImage = false;
|
|
|
885 |
|
886 |
foreach( apply_filters( 'fv_player_media', $aPlaylist_item, $this ) AS $aPlaylist_item_i ) {
|
887 |
if( preg_match('~\.(png|gif|jpg|jpe|jpeg)($|\?)~',$aPlaylist_item_i) ) {
|
889 |
continue;
|
890 |
}
|
891 |
|
892 |
+
$media_url = $this->get_video_src( preg_replace( '~^rtmp:~', '', $aPlaylist_item_i ), array( 'suppress_filters' => $suppress_filters ) );
|
893 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
894 |
if( stripos( $aPlaylist_item_i, 'rtmp:' ) === 0 ) {
|
895 |
+
if( !preg_match( '~^[a-z0-9]+:~', $media_url ) ) { // no RTMP extension provided
|
896 |
+
$ext = $this->get_mime_type($media_url,false,true) ? $this->get_mime_type($media_url,false,true).':' : false;
|
897 |
+
$aItem[] = array( 'src' => $ext.str_replace( '+', ' ', $media_url ), 'type' => 'video/flash' );
|
898 |
} else {
|
899 |
+
$aItem[] = array( 'src' => str_replace( '+', ' ', $media_url ), 'type' => 'video/flash' );
|
900 |
}
|
901 |
} else {
|
902 |
+
$aItem[] = array( 'src' => $media_url, 'type' => $this->get_mime_type($media_url) );
|
903 |
}
|
904 |
|
905 |
}
|
906 |
|
907 |
$sSplashImage = apply_filters( 'fv_flowplayer_playlist_splash', $sSplashImage, $this, $aPlaylist_item );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
908 |
|
909 |
$aPlayer = array( 'sources' => $aItem );
|
910 |
if( $rtmp_server ) $aPlayer['rtmp'] = array( 'url' => $rtmp_server );
|
1248 |
|
1249 |
if( stripos($media,'X-Amz-Expires') !== false || stripos($media,'AWSAccessKeyId') !== false ) return $media;
|
1250 |
|
|
|
|
|
|
|
1251 |
global $fv_fp;
|
1252 |
|
1253 |
$amazon_key = -1;
|
1286 |
$iAWSVersion = $fv_fp->_get_option( array( 'amazon_region', $amazon_key ) ) ? 4 : 2;
|
1287 |
|
1288 |
if( $iAWSVersion == 4 ) {
|
1289 |
+
$url_components['path'] = str_replace( array('%20','+'), ' ', $url_components['path']);
|
1290 |
}
|
1291 |
|
1292 |
$url_components['path'] = rawurlencode($url_components['path']);
|
1295 |
$url_components['path'] = str_replace('%2523', '%23', $url_components['path']);
|
1296 |
$url_components['path'] = str_replace('%252B', '%2B', $url_components['path']);
|
1297 |
$url_components['path'] = str_replace('%2527', '%27', $url_components['path']);
|
|
|
|
|
1298 |
|
1299 |
if( $iAWSVersion == 4 ) {
|
1300 |
$sXAMZDate = gmdate('Ymd\THis\Z');
|
1326 |
|
1327 |
// 4. http://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html
|
1328 |
$resource .= "?X-Amz-Algorithm=AWS4-HMAC-SHA256";
|
1329 |
+
$resource .= "&X-Amz-Credential=$sXAMZCredential";
|
1330 |
+
$resource .= "&X-Amz-Date=$sXAMZDate";
|
1331 |
+
$resource .= "&X-Amz-Expires=$time";
|
1332 |
+
$resource .= "&X-Amz-SignedHeaders=$sSignedHeaders";
|
1333 |
+
$resource .= "&X-Amz-Signature=".$sSignature;
|
1334 |
|
1335 |
$this->ret['script']['fv_flowplayer_amazon_s3'][$this->hash] = $time;
|
1336 |
|
1353 |
$signature = urlencode($signature);
|
1354 |
} while( stripos($signature,'%2B') !== false );
|
1355 |
|
1356 |
+
$resource .= '?AWSAccessKeyId='.$fv_fp->_get_option( array('amazon_key', $amazon_key) ).'&Expires='.$expires.'&Signature='.$signature;
|
1357 |
|
1358 |
}
|
1359 |
|
1735 |
|
1736 |
function get_video_src($media, $aArgs = array() ) {
|
1737 |
$aArgs = wp_parse_args( $aArgs, array(
|
1738 |
+
'dynamic' => false, // apply URL signature for CDNs which normally use Ajax
|
|
|
|
|
|
|
1739 |
'suppress_filters' => false,
|
|
|
1740 |
)
|
1741 |
);
|
1742 |
|
1743 |
if( $media ) {
|
|
|
|
|
|
|
1744 |
if( !$aArgs['suppress_filters'] ) {
|
1745 |
$media = apply_filters( 'fv_flowplayer_video_src', $media, $aArgs );
|
1746 |
}
|
1747 |
+
return strip_tags(trim($media));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1748 |
}
|
1749 |
return null;
|
1750 |
}
|
2054 |
}
|
2055 |
|
2056 |
if( isset($post->ID) && !get_post_meta( $post->ID, flowplayer::get_video_key($video), true ) ) {
|
2057 |
+
$video_secured = array( 'media' => $fv_fp->get_video_src( $video, array( 'dynamic' => true ) ) );
|
|
|
|
|
|
|
2058 |
if( isset($video_secured['media']) && $FV_Player_Checker->check_mimetype( array($video_secured['media']), array( 'meta_action' => 'check_time', 'meta_original' => $video ) ) ) {
|
2059 |
$iDone++;
|
2060 |
if( isset($_GET['fv_flowplayer_checker'] ) ) {
|
models/media-browser-s3.php
CHANGED
@@ -97,13 +97,13 @@ class FV_Player_Media_Browser_S3 extends FV_Player_Media_Browser {
|
|
97 |
|
98 |
try {
|
99 |
|
100 |
-
$
|
101 |
'credentials' => $credentials,
|
102 |
'region' => 'us-east-1',
|
103 |
'version' => 'latest'
|
104 |
) );
|
105 |
|
106 |
-
$cloudfronts = $
|
107 |
foreach( $cloudfronts['DistributionList']['Items'] AS $item ) {
|
108 |
if( !$item['Enabled'] ) continue;
|
109 |
|
@@ -157,7 +157,8 @@ class FV_Player_Media_Browser_S3 extends FV_Player_Media_Browser {
|
|
157 |
if ( $object['Size'] != '0' ) {
|
158 |
|
159 |
$link = (string) $s3Client->getObjectUrl( $bucket, $name );
|
160 |
-
|
|
|
161 |
// replace link with CloudFront URL, if we have one
|
162 |
if( !empty($domains[$array_id]) ) {
|
163 |
// replace S3 URLs with buckets in the S3 subdomain
|
97 |
|
98 |
try {
|
99 |
|
100 |
+
$cfClient = Aws\CloudFront\CloudFrontClient::factory( array(
|
101 |
'credentials' => $credentials,
|
102 |
'region' => 'us-east-1',
|
103 |
'version' => 'latest'
|
104 |
) );
|
105 |
|
106 |
+
$cloudfronts = $cfClient->listDistributions();
|
107 |
foreach( $cloudfronts['DistributionList']['Items'] AS $item ) {
|
108 |
if( !$item['Enabled'] ) continue;
|
109 |
|
157 |
if ( $object['Size'] != '0' ) {
|
158 |
|
159 |
$link = (string) $s3Client->getObjectUrl( $bucket, $name );
|
160 |
+
$link = str_replace( '%20', '+', $link );
|
161 |
+
|
162 |
// replace link with CloudFront URL, if we have one
|
163 |
if( !empty($domains[$array_id]) ) {
|
164 |
// replace S3 URLs with buckets in the S3 subdomain
|
readme.txt
CHANGED
@@ -349,15 +349,21 @@ Thank you for being part of the HMTL 5 mobile video revolution!
|
|
349 |
|
350 |
== Screenshots ==
|
351 |
|
352 |
-
1.
|
353 |
-
2.
|
354 |
-
3.
|
355 |
-
4.
|
356 |
-
5. Video checker
|
357 |
|
358 |
== Changelog ==
|
359 |
|
360 |
-
= 7.2.
|
|
|
|
|
|
|
|
|
|
|
|
|
361 |
|
362 |
* Security - adding nonce for the Shortcode Editor preview
|
363 |
|
349 |
|
350 |
== Screenshots ==
|
351 |
|
352 |
+
1. FV Player different skin options
|
353 |
+
2. FV Player shortcode in post content
|
354 |
+
3. It's easy to use our shortcode editor to add videos
|
355 |
+
4. Plugin settings screen
|
356 |
+
5. Video checker helps you find issues with your video encoding
|
357 |
|
358 |
== Changelog ==
|
359 |
|
360 |
+
= 7.2.2.727 - 2018/09/28 =
|
361 |
+
|
362 |
+
* Amazon S3 - fixing issues caused by Flash version of signed URL
|
363 |
+
* Amazon S3 - fixing handling of blank spaces for S3 bucket browser
|
364 |
+
* Amazon S3 - fixing handling of blank spaces for URL signature
|
365 |
+
|
366 |
+
= 7.2.1.727 - 2018/09/20 =
|
367 |
|
368 |
* Security - adding nonce for the Shortcode Editor preview
|
369 |
|