diff --git a/jw-player/include/shortcode.php b/jw-player/include/shortcode.php index 4dcfbf6..d0e12aa 100644 --- a/jw-player/include/shortcode.php +++ b/jw-player/include/shortcode.php @@ -3,7 +3,6 @@ // We use a global variable to keep track of all the players that are embedded // on a page. If multiple videos with the same player are embedded on the // same page the library only needs to be injected once. -$jwplayer_shortcode_embedded_players = array(); // Regular shortcode function. function jwplayer_shortcode_handle( $atts ) { @@ -185,19 +184,12 @@ function jwplayer_shortcode_filter_player_params( $atts ) { // Create the JS embed code for the jwplayer player function jwplayer_shortcode_create_js_embed( $media_hash, $player_hash = null, $params = array() ) { - global $jwplayer_shortcode_embedded_players; $player_hash = ( null === $player_hash ) ? get_option( 'jwplayer_player' ) : $player_hash; $content_mask = jwplayer_get_content_mask(); $protocol = ( is_ssl() && JWPLAYER_CONTENT_MASK === $content_mask ) ? 'https' : 'http'; - if ( in_array( $player_hash, $jwplayer_shortcode_embedded_players, true ) ) { - $player_script = ''; - } else { - // Injecting script tag because there's no way to properly enqueue a javascript - // at this point in the process :'-( - $player_script = true; - $jwplayer_shortcode_embedded_players[] = $player_hash; - } + // Injecting script tag because there's no way to properly enqueue a javascript + // at this point in the process :'-( if ( 'local' == $media_hash ) { $element_id = "jwplayer_" . wp_generate_password( 12, false ) . "_div"; @@ -243,8 +235,7 @@ function jwplayer_shortcode_create_js_embed( $media_hash, $player_hash = null, $ // Redeclare fitVids to stop it from breaking the JW Player embedding. if ( JWPLAYER_DISABLE_FITVIDS ) { - if ( $player_script ) { - return " + return "
"; - } else { // no player script - return " -
- - "; - } } else { - // no fitvids script here. - if ( $player_script ) { - return " + return "
"; - } else { // no player script - return " -
- - "; - } } }