From b07d57d348a0fbd104d9b60e8774873ccf2da08d Mon Sep 17 00:00:00 2001 From: Jonathan Bossenger Date: Wed, 7 Feb 2018 10:19:37 +0200 Subject: [PATCH 1/5] Only load media file once play is clicked Comment clean up --- includes/class-ssp-frontend.php | 126 ++++++++++++-------------------- 1 file changed, 48 insertions(+), 78 deletions(-) diff --git a/includes/class-ssp-frontend.php b/includes/class-ssp-frontend.php index 5212fc6c..aef131e5 100644 --- a/includes/class-ssp-frontend.php +++ b/includes/class-ssp-frontend.php @@ -108,7 +108,7 @@ public function __construct( $file, $version ) { add_action( 'wp_enqueue_scripts', array( $this, 'load_styles_and_scripts' ) ); // Enqueue HTML5 scripts only if the page has an HTML5 player on it - add_action( 'wp_print_footer_scripts', array( $this, 'html5_player_conditional_scripts' ) ); + add_action( 'wp_print_footer_scripts', array( $this, 'html5_player_conditional_scripts' ) ); // Add overridable styles to footer add_action( 'wp_footer', array( $this, 'ssp_override_player_styles' ) ); @@ -122,13 +122,13 @@ public function __construct( $file, $version ) { public function html5_player_conditional_scripts(){ global $largePlayerInstanceNumber; if( (int) $largePlayerInstanceNumber > 0 ){ - echo ''; - echo ''; - echo ''; + echo ''; + echo ''; + echo ''; echo ''; - echo ''; - } - } + echo ''; + } + } public function ssp_override_player_styles(){ $player_wave_form_progress_colour = get_option( 'ss_podcasting_player_wave_form_progress_colour', false ); @@ -425,7 +425,7 @@ private function get_no_album_art_image_array(){ * Load media player for given file * @param string $srcFile Source of file * @param integer $episode_id Episode ID for audio file - * @param string $player_size mini or large + * @param string $player_size mini or large * @return string Media player HTML on success, empty string on failure */ public function media_player ( $srcFile = '', $episode_id = 0, $player_size = "large" ) { @@ -459,7 +459,7 @@ public function media_player ( $srcFile = '', $episode_id = 0, $player_size = "l $player_style = (string) get_option( 'ss_podcasting_player_style' ); if( $player_size == "large" ){ $player_style = "larger"; - } + } if( "larger" !== $player_style || "mini" === $player_size ){ $player = wp_audio_shortcode( $params ); @@ -481,10 +481,10 @@ public function media_player ( $srcFile = '', $episode_id = 0, $player_size = "l ?>
> -
+
- +
@@ -499,10 +499,10 @@ public function media_player ( $srcFile = '', $episode_id = 0, $player_size = "l
- - - -
+ + + +
 
@@ -554,7 +554,7 @@ public function media_player ( $srcFile = '', $episode_id = 0, $player_size = "l