WordPress.org

Ready to get started?Download WordPress

Forums

Video.js - HTML5 Video Player for WordPress
[resolved] [Plugin: VideoJS - HTML5 Video Player for WordPress] Mixed content on HTTPS pages (8 posts)

  1. Ian Dunn
    Member
    Posted 2 years ago #

    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/

  2. Ian Dunn
    Member
    Posted 2 years ago #

    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.

  3. Ian Dunn
    Member
    Posted 1 year ago #


  4. Ian Dunn
    Member
    Posted 1 year ago #

    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>
    	';
    }
  5. Dustin Lammiman
    Member
    Plugin Author

    Posted 1 year ago #

    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).

  6. Dustin Lammiman
    Member
    Plugin Author

    Posted 1 year ago #

    Fixed in the latest update.

  7. Ian Dunn
    Member
    Posted 1 year ago #

    Awesome, thanks :)

  8. skd_sam
    Member
    Posted 1 year ago #

    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...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic