• Hi there,

    I’ve been using this plugin for about a month now and have pretty much centered my website around its functions and it’s a great plugin.

    Now I’ve come to the point where I need to (with permission) make some customisations but I’m really not sure how to go about them. I’m hoping that by listing them here, I can find some assistance. The first one or two customisations could actually be future features maybe?

    1. Pre-roll ads. I’d love to be able to add these but I don’t even know where to begin. I did sign up to a company that does this sort of thing and they issued some code but I’ve not the foggiest how to integrate it with this plugin :/

    2. The download link below the video – Is there anyway to change this so that only registered users can actually download the video file? By this I mean still display the download link to all but maybe divert a non-registered user to the register or login page.

    3. A frame overlay to surround the player instead of a watermark.
    I’ve toyed around with this idea but the biggest issue I’ve found is not been able to solve is resizing the frame for the videos.

    To do what I did with the video frame I uploaded a 1920×1080 frame png which was transparent in the center and used that as a watermark. In the CSS file I changed the size to 100% and background as transparent and sure enough it surrounds the video with the video showing in the middle but when resizing (e.g. full screen or videos that are larger or smaller than the specified ratio) it doesn’t fit.

    Just wondering if there is a way to do this with this plugin?

    I hope I’ve come across clearly in what I’m looking to do. All I need now is some assistance if anyone can?

    Thank you!

    https://www.ads-software.com/plugins/video-embed-thumbnail-generator/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter pervbox

    (@pervbox)

    Sorry one other thing I forgot to add which would be REALLY cool to see is video stats in the media library so that when I click on media library and filter by videos, as well as the usual information that’s displayed such as thumbnail, title, author etc it could also show just basically how many views it’s had.

    Far easier than going through each video espeically when you have a lot of videos to go through. Just a thought!

    Many thanks again for this amazing plugin. Without it I wouldn’t be able to run my site or control my media the way I want to.

    Plugin Author Kyle Gilman

    (@kylegilman)

    Pre-roll ads are a frequent request, but to be honest I’m not that enthusiastic about making a free plugin to help other people make money. At some point I might offer a premium add-on, but I don’t have the time to dedicate to programming it right now.

    I haven’t tested this and it could be full of errors, but for the download link, you can use is_user_logged_in() to determine if a user is logged in, then modify line 1895

    $code .= '<a href="'.site_url('/').'?attachment_id='.$id.'&kgvid_video_embed[download]=true">'.__('Click on this link to download', 'video-embed-thumbnail-generator').'</a>';

    to something like this

    if ( is_user_logged_in() ) { $code .= '<a href="'.site_url('/').'?attachment_id='.$id.'&kgvid_video_embed[download]=true">'.__('Click on this link to download', 'video-embed-thumbnail-generator').'</a>'; }
    else { $code .= '<a href="'.site_url('/').'registration_url/">'.__('Join now to download this video', 'video-embed-thumbnail-generator').'</a>'; }

    I can’t really picture what you’re trying to do with the frame. Can you post a link to a page on your site that demonstrates the issue?

    Adding video stats on the media library page sounds nice. I’ll add it in a future release. I’ve created a new issue on Github to track the feature. Keep in mind you can use Google Analytics to get video stats also.

    Thread Starter pervbox

    (@pervbox)

    Hi Kyle,

    Many thanks for getting back to me.

    I totally understand about the pre-roll / post-roll ads. Hopefully you’ll find time in the not too distant future where I’ll no doubt still be around ready to buy that plugin.

    Thank you also for the is user logged in code snippet. Now that I have a something to work with to give me ideas, I’ll do some testing.

    RE The frame I was talking about. I’d love to link you to a page however I’m not able to apply the idea to a single isolated video so I’ve uploaded an image of my proposed frame here: https://postimg.org/image/yplxonsud/

    The idea being that the video (not the player) is encased if you like by the frame so that the frame sits over the video which is playing behind the overlaid frame. Sort of gives the video a custom player look and feel while adding a watermark or logo at the same time.

    Unfortunately when I toyed with the idea, I pretty much just uploaded a larger version of that image (1920 x 1080), set it as the watermark and adjusted your watermark CSS code so that it filled 100% however the frame wouldn’t resize to fit all videos. In full screen the frame surrounded the entire video perfectly.

    When not in full screen, i.e. watching the videos on the web page, the frame would only fit around certain videos of that aspect ratio while others videos which were wider or taller it wouldn’t fit and would makie it look like the videos were over-hanging the frame or popping out of the top of the frame where the videos were taller or wider than the frame.

    No matter what I tried with the CSS, I could only get the frame to surround the videos one way or the other but not both together. When I got the frame to surround the video neatly in full screen it wouldn’t fit properly around the videos when viewed on the page and vice versa.

    I know it was never designed for what I’m trying to do but I thought it was worth a shot. When it did work, and where it did fit it looked really good too! Probably my warped idea of what does and doesn’t look good I guess but it really made the video player my own if you like.

    There probably isn’t much demand for an idea like this but if it isn’t currently possible to do this, I’d love to see something in a future update or as a plugin or something.

    Thank you again!

    Plugin Author Kyle Gilman

    (@kylegilman)

    This is web design that is not specific to my plugin, but I’ll point you in a better direction. Make them two separate elements. Create a CSS outline for the .kg-video-js-skin or .video-js class. Something like outline: 5px solid red will get you started but I’m sure you can make a fancier gradient pretty easily. Then overlay the logo on its own as a watermark image with bottom: 0 and right: 0 .

    Also, you don’t have to pay for my plugin, but I always appreciate donations.

    Thread Starter pervbox

    (@pervbox)

    Hello,

    Me again…

    I’ve been looking more into pre-roll ads for Video.js and have found on git-hub videojs-contrib-ads which seems to integrate pre-roll ads into video.js. I figure it’s a starting point for me to look at implementing somethning for my site but I’ve got a problem..

    Full description: https://github.com/videojs/videojs-contrib-ads

    Aparently, I need to somehow recreate this structure:

    <video id="video" src="movie.mp4" controls></video>
    <script src="video.js"></script>
    <script src="videojs.ads.js"></script>
    <script>
    videojs('video', {}, function() {
      var player = this;
      player.ads(); // initialize the ad framework
      // your custom ad integration code
    });
    </script>

    But obviously your plugin doesn’t work that simplistically.
    I’ve been looking around the area of line 1895 of your plugin but I’m baffled as to how to fit the required script and player.ads call in :/

    Don’t suppose you have any ideas?

    Thanks!

    Plugin Author Kyle Gilman

    (@kylegilman)

    Add the JavaScript stuff (player.ads(); and whatever your custom ad integration code is) to the JavaScript function that sets up the player after line 193 in kgvid_video_embed.js var player = videojs('video_'+id);

    Enqueue the videojs.ads.js after line 1405 in the main plugin file wp_enqueue_script( 'video-js', plugins_url("", __FILE__).'/video-js/video.js', '', '4.10.2', true );
    the line would read something like this
    wp_enqueue_script( 'video-js', plugins_url("", __FILE__).'/video-js/videojs.ads.js', '', '4.10.2', true );

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Help with some custom modification’ is closed to new replies.