• Hey , How’s it going?

    First of all, your plugin is great sir!
    A few days ago after I installed it, I was searching on google if someone make it through to insert Ads on your video player, and I did found the answer I guess in your forum (Link For The Question In Forum) , but the thing now is… how can I implement this and use it because I don’t know how to implement this on your WordPress plugin and use it.

    Here’s the code that I have found:

    <!DOCTYPE html>
    <html>
    <head>
      <title>Video.js | HTML5 Video Player</title>
    
      <!-- Chang URLs to wherever Video.js files will be hosted -->
      <link href="video-js.css" rel="stylesheet" type="text/css">
      <!-- video.js must be in the <head> for older IEs to work. -->
      <script src="video.js"></script>
        <script src="jquery-1.8.1.min.js" type="text/javascript" charset="utf-8"></script>
    
      <!-- Unless using the CDN hosted version, update the URL to the Flash SWF -->
      <script>
            $(document).ready(function(){
                // get the sources for the preroll and the real video
                var adSrc = $.parseJSON($("#video_1").attr("preroll"));
                var vSrc = $.parseJSON($("#video_1").attr("source"));
    
                // replace the preroll with the source video
                function playSrc() {
                    var myPlayer = _V_("video_1");
                    myPlayer.src(vSrc);
                    $(".vjs-default-skin .vjs-controls").toggle();
                    myPlayer.removeEvent("ended", playSrc);
                    myPlayer.play();
                }
    
                // when preroll is finished, load th real video
                _V_("video_1").addEvent("ended", playSrc); 
    
                // when the player is ready
                _V_("video_1").ready(function(){
                    var myPlayer = this;
                    // Replace the source by the preroll
                    myPlayer.src(adSrc);
                    $(".vjs-default-skin .vjs-controls").toggle();
                    myPlayer.play();
                });
    
            });
    
      </script>
    </head>
    <body>
    
      <video id="video_1" class="video-js vjs-default-skin" controls preload="auto" width="640" height="264"
          poster="http://video-js.zencoder.com/oceans-clip.png"
                preroll='[{ "type": "video/mp4", "src": "preroll.mp4" }]'
                source='[{ "type": "video/mp4", "src": "video.mp4" }]' >
        <source src="video.mp4" type='video/mp4' />
        <source src="video.webm" type='video/webm' />
        <source src="video.ogv" type='video/ogg' />
      </video>
    
    </body>
    </html>

    although it would be great to insert image ads or whatever as well when we don’t have video campaigns.
    Thanks in advance, and I think this could be a very cool update and help for your plugin

    Best Regards

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

  • The topic ‘Video Ads Update’ is closed to new replies.