From 78eefc2836ccc4928150cb22b7e3f6d2cd442054 Mon Sep 17 00:00:00 2001 From: Michal Date: Tue, 18 Jul 2023 16:16:27 +0200 Subject: [PATCH 1/3] bunny stream: load from flowplayer.php --- flowplayer.php | 2 ++ models/bunny-stream-wizard/step_1_api_key.php | 4 +--- models/bunny-stream-wizard/step_2_stream_libs.php | 4 +--- models/class.fv-player-bunny_stream-browser.php | 2 -- models/class.fv-player-bunny_stream.php | 4 ---- 5 files changed, 4 insertions(+), 12 deletions(-) diff --git a/flowplayer.php b/flowplayer.php index 030ab5f5c..ee65fd887 100644 --- a/flowplayer.php +++ b/flowplayer.php @@ -122,6 +122,8 @@ include_once(dirname( __FILE__ ) . '/models/youtube.php'); +include_once(dirname( __FILE__ ) . '/models/class.fv-player-bunny_stream-api.php' ); + add_action('plugins_loaded', 'fv_player_bunny_stream_include' ); if( !function_exists( 'fv_player_bunny_stream_include' ) && version_compare(PHP_VERSION, '5.2.17') >= 0 ) { diff --git a/models/bunny-stream-wizard/step_1_api_key.php b/models/bunny-stream-wizard/step_1_api_key.php index b9455b658..ebd193cf7 100644 --- a/models/bunny-stream-wizard/step_1_api_key.php +++ b/models/bunny-stream-wizard/step_1_api_key.php @@ -16,9 +16,7 @@ class FV_Player_Bunny_Stream_Wizard_API_Key extends FV_Player_Wizard_Step_Base_C ) ); - public function __construct() { - require_once( dirname(__FILE__).'/../class.fv-player-bunny_stream-api.php' ); - } + public function __construct() {} function display() { ?> diff --git a/models/bunny-stream-wizard/step_2_stream_libs.php b/models/bunny-stream-wizard/step_2_stream_libs.php index 4d9e2e092..57649dd4d 100644 --- a/models/bunny-stream-wizard/step_2_stream_libs.php +++ b/models/bunny-stream-wizard/step_2_stream_libs.php @@ -15,9 +15,7 @@ class FV_Player_Bunny_Stream_Wizard_Stream_Libs extends FV_Player_Wizard_Step_Ba ) ); - public function __construct() { - require_once( dirname(__FILE__).'/../class.fv-player-bunny_stream-api.php' ); - } + public function __construct() {} function display() { ?> diff --git a/models/class.fv-player-bunny_stream-browser.php b/models/class.fv-player-bunny_stream-browser.php index 9aa641973..f9520f30a 100644 --- a/models/class.fv-player-bunny_stream-browser.php +++ b/models/class.fv-player-bunny_stream-browser.php @@ -2,8 +2,6 @@ if( !class_exists('FV_Player_Bunny_Stream_Browser') && class_exists('FV_Player_Media_Browser') ) : -require_once( dirname(__FILE__).'/class.fv-player-bunny_stream-api.php' ); - class FV_Player_Bunny_Stream_Browser extends FV_Player_Media_Browser { function init() { diff --git a/models/class.fv-player-bunny_stream.php b/models/class.fv-player-bunny_stream.php index 7decd6e00..9b53ab4b3 100644 --- a/models/class.fv-player-bunny_stream.php +++ b/models/class.fv-player-bunny_stream.php @@ -181,7 +181,6 @@ protected function job_check( $pending_job ) { $job_id = $job_details->guid; } - require_once( dirname( __FILE__ ) . '/class.fv-player-bunny_stream-api.php' ); $api = new FV_Player_Bunny_Stream_API(); $job = $api->api_call( 'https://video.bunnycdn.com/library/' . $fv_fp->_get_option( array( 'bunny_stream', @@ -274,8 +273,6 @@ function job_submit( $id ) { 'title' => $target_name, ); - require_once( dirname( __FILE__ ) . '/class.fv-player-bunny_stream-api.php'); - $api = new FV_Player_Bunny_Stream_API(); // check if we have collection @@ -452,7 +449,6 @@ function email_notification() { // check if we have this job in the DB and if not, add it there if ( ! $wpdb->get_var( $wpdb->prepare( "SELECT count(id) FROM " . $this->table_name . " WHERE job_id = %s", $job_id ) ) ) { // get info about this job first, so we can set up DB data correctly - require_once( dirname( __FILE__ ) . '/class.fv-player-bunny_stream-api.php' ); $api = new FV_Player_Bunny_Stream_API(); $job = $api->api_call( 'https://video.bunnycdn.com/library/' . $fv_fp->_get_option( array( 'bunny_stream', From d9edb495d83dc994c4bef90436bf738031906648 Mon Sep 17 00:00:00 2001 From: Michal Date: Wed, 26 Jul 2023 12:20:44 +0200 Subject: [PATCH 2/3] caption: filter pass also $this --- models/db-video.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/db-video.php b/models/db-video.php index 1fac72e67..85a0ca0e4 100644 --- a/models/db-video.php +++ b/models/db-video.php @@ -67,7 +67,7 @@ public function getCaptionFromSrc() { $caption = end($arr); } - $caption = apply_filters( 'fv_flowplayer_caption_src', $caption , $src ); + $caption = apply_filters( 'fv_flowplayer_caption_src', $caption , $src, $this ); return urldecode($caption); } From 4ada6b239649a25fff53114a0e460037b2dc0e84 Mon Sep 17 00:00:00 2001 From: Michal Date: Wed, 26 Jul 2023 12:34:04 +0200 Subject: [PATCH 3/3] Revert "bunny stream: load from flowplayer.php" This reverts commit 78eefc2836ccc4928150cb22b7e3f6d2cd442054. --- flowplayer.php | 2 -- models/bunny-stream-wizard/step_1_api_key.php | 4 +++- models/bunny-stream-wizard/step_2_stream_libs.php | 4 +++- models/class.fv-player-bunny_stream-browser.php | 2 ++ models/class.fv-player-bunny_stream.php | 4 ++++ 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/flowplayer.php b/flowplayer.php index ee65fd887..030ab5f5c 100644 --- a/flowplayer.php +++ b/flowplayer.php @@ -122,8 +122,6 @@ include_once(dirname( __FILE__ ) . '/models/youtube.php'); -include_once(dirname( __FILE__ ) . '/models/class.fv-player-bunny_stream-api.php' ); - add_action('plugins_loaded', 'fv_player_bunny_stream_include' ); if( !function_exists( 'fv_player_bunny_stream_include' ) && version_compare(PHP_VERSION, '5.2.17') >= 0 ) { diff --git a/models/bunny-stream-wizard/step_1_api_key.php b/models/bunny-stream-wizard/step_1_api_key.php index ebd193cf7..b9455b658 100644 --- a/models/bunny-stream-wizard/step_1_api_key.php +++ b/models/bunny-stream-wizard/step_1_api_key.php @@ -16,7 +16,9 @@ class FV_Player_Bunny_Stream_Wizard_API_Key extends FV_Player_Wizard_Step_Base_C ) ); - public function __construct() {} + public function __construct() { + require_once( dirname(__FILE__).'/../class.fv-player-bunny_stream-api.php' ); + } function display() { ?> diff --git a/models/bunny-stream-wizard/step_2_stream_libs.php b/models/bunny-stream-wizard/step_2_stream_libs.php index 57649dd4d..4d9e2e092 100644 --- a/models/bunny-stream-wizard/step_2_stream_libs.php +++ b/models/bunny-stream-wizard/step_2_stream_libs.php @@ -15,7 +15,9 @@ class FV_Player_Bunny_Stream_Wizard_Stream_Libs extends FV_Player_Wizard_Step_Ba ) ); - public function __construct() {} + public function __construct() { + require_once( dirname(__FILE__).'/../class.fv-player-bunny_stream-api.php' ); + } function display() { ?> diff --git a/models/class.fv-player-bunny_stream-browser.php b/models/class.fv-player-bunny_stream-browser.php index f9520f30a..9aa641973 100644 --- a/models/class.fv-player-bunny_stream-browser.php +++ b/models/class.fv-player-bunny_stream-browser.php @@ -2,6 +2,8 @@ if( !class_exists('FV_Player_Bunny_Stream_Browser') && class_exists('FV_Player_Media_Browser') ) : +require_once( dirname(__FILE__).'/class.fv-player-bunny_stream-api.php' ); + class FV_Player_Bunny_Stream_Browser extends FV_Player_Media_Browser { function init() { diff --git a/models/class.fv-player-bunny_stream.php b/models/class.fv-player-bunny_stream.php index 9b53ab4b3..7decd6e00 100644 --- a/models/class.fv-player-bunny_stream.php +++ b/models/class.fv-player-bunny_stream.php @@ -181,6 +181,7 @@ protected function job_check( $pending_job ) { $job_id = $job_details->guid; } + require_once( dirname( __FILE__ ) . '/class.fv-player-bunny_stream-api.php' ); $api = new FV_Player_Bunny_Stream_API(); $job = $api->api_call( 'https://video.bunnycdn.com/library/' . $fv_fp->_get_option( array( 'bunny_stream', @@ -273,6 +274,8 @@ function job_submit( $id ) { 'title' => $target_name, ); + require_once( dirname( __FILE__ ) . '/class.fv-player-bunny_stream-api.php'); + $api = new FV_Player_Bunny_Stream_API(); // check if we have collection @@ -449,6 +452,7 @@ function email_notification() { // check if we have this job in the DB and if not, add it there if ( ! $wpdb->get_var( $wpdb->prepare( "SELECT count(id) FROM " . $this->table_name . " WHERE job_id = %s", $job_id ) ) ) { // get info about this job first, so we can set up DB data correctly + require_once( dirname( __FILE__ ) . '/class.fv-player-bunny_stream-api.php' ); $api = new FV_Player_Bunny_Stream_API(); $job = $api->api_call( 'https://video.bunnycdn.com/library/' . $fv_fp->_get_option( array( 'bunny_stream',