Support » Plugin: Video.js - HTML5 Video Player for WordPress » [Plugin: VideoJS – HTML5 Video Player for WordPress] Mixed content on HTTPS pages

  • Resolved Ian Dunn

    (@iandunn)


    You’re hard-coding http:// instead of generating it dynamically based on the current page protocal (see is_ssl()) or just using protocal-relative URLs. This causes mixed-content warnings on HTTPS pages.

    <!-- Flash Fallback. Use any flash video player here. Make sure to keep the vjs-flash-fallback class. -->
          <object class="vjs-flash-fallback" width="{$width}" height="{$height}" type="application/x-shockwave-flash"
            data="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf">
            <param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" />
            <param name="allowfullscreen" value="true" />
            <param name="flashvars" value='config={"playlist":[$flow_player_poster{"url": "$mp4" $flow_player_autoplay $flow_player_preload }]}' />
            {$image_fallback}
          </object>

    http://wordpress.org/extend/plugins/videojs-html5-video-player-for-wordpress/

Viewing 7 replies - 1 through 7 (of 7 total)
  • It looks like releases.flowplayer.org doesn’t have SSL enabled, so you can’t just link to https://releases.flowplayer.org/swf/flowplayer-3.2.1.swf or //releases.flowplayer.org/swf/flowplayer-3.2.1.swf. I ended up having to host a local copy of Flowplayer on my server and modifying the plugin to link to it instead of the remote copy.

    The new self-hosting option is working really well, except that one part is left out. In Chrome, VideoJS loads an SWF file from the CDN, which causes mixed-content warnings on SSL pages. To fix it, you need to do something like this:

    } else { //use the self hosted version
    	echo '
    	<link href="' . plugins_url( 'videojs/video-js.min.css' , __FILE__ ) . '" rel="stylesheet">
    	<script src="' . plugins_url( 'videojs/video.min.js' , __FILE__ ) . '"></script>
    	<script type="text/javascript">
    		VideoJS.options.flash.swf = "'. plugins_url( 'videojs/video-js.swf' , __FILE__ ) .'";
    	</script>
    	';
    }
    Plugin Author Dustin Lammiman

    (@nosecreek)

    Thanks for the heads up and fix, I’ll be sure to update this in the next version (not sure when that will be yet).

    Plugin Author Dustin Lammiman

    (@nosecreek)

    Fixed in the latest update.

    Awesome, thanks 🙂

    Would it be better to use wp_enqueue_script for adding your css/script files as its the corret way to do it in wordpress?

    wp_deregister_script( ‘jquery’ ); // or another custom added script
    wp_register_script( ‘jquery’, ‘http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js’);
    wp_enqueue_script(‘myjqueryscript’,’mypluginscript’,array(‘jquery’),’1.7′,false);
    wp_deregister_script( ‘myjqueryscript’ ); // remove the script.

    Might help not sure…

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: VideoJS – HTML5 Video Player for WordPress] Mixed content on HTTPS pages’ is closed to new replies.