brightcove / videojs-thumbnails

A video.js plugin that displays thumbnail images over the scrubber.
Other
169 stars 97 forks source link

Upgrade to videojs 5 #30

Open doublex opened 8 years ago

doublex commented 8 years ago

Are there any plans to upgrade this great plugin to videojs 5?

iraniamir commented 8 years ago

its not working on 5.4.4

tahola commented 8 years ago

Yes, not working on 5.4.4, the seconds doenst match.

gkatsev commented 8 years ago

Yeah, this needs to get updated to videojs. Anyone want to take a crack at it? See https://github.com/videojs/video.js/wiki/5.0-Change-Details for the changes.

tahola commented 8 years ago

For anyonye interested, changing this line

mouseTime = Math.floor((left - progressControl.el().offsetLeft) / progressControl.width() * duration);

by

mouseTime = Math.floor(event.offsetX / progressControl.width() * duration);

worked for me.

iraniamir commented 8 years ago

On 5.4.5 says : Uncaught TypeError: Cannot read property 'progressControl' of undefined

progressControl = player.controlBar.progressControl;
cryptiklemur commented 8 years ago

Same issue that @Tavousi has, here

xbgmsharp commented 8 years ago

Works for me using. http://docs.brightcove.com/en/video-cloud/brightcove-player/guides/thumbnails-plugin.html

ali-idrizi commented 8 years ago

For Video.js 5, in videojs.thumbnails.js I replaced this line:

mouseTime = Math.floor((left - progressControl.el().offsetLeft) / progressControl.width() * duration);

with this

var mouseTimeHMS  = $(".vjs-mouse-display").attr("data-current-time").split(":");
var mouseTime = 0;
for(var i = mouseTimeHMS.length - 1; i >= 0; i--)
    mouseTime += parseInt((i == mouseTimeHMS.length-1) ? (mouseTimeHMS[i]) : ((i == mouseTimeHMS.length-2) ? (mouseTimeHMS[i] * 60) : ((i == mouseTimeHMS.length-3) ? (mouseTimeHMS[i] * 60 * 60) : (0))));

And it is working perfectly in any way now.

ghost commented 7 years ago

@iraniamir about the

Uncaught TypeError: Cannot read property 'progressControl' of undefined

in my case me the error triggers if I init the player and add the plugin within the same statement

var player = videojs("video", {
    plugins: {
        thumbnails: {
            // plugin settings here
        }
 });

but doesn't if I separate the player initialization from the plugin's one

player = videojs("myVideojsId");

player.thumbnails({
    // plugin settings
});

I'm using videojs 5.13.2 minified version.

bernardoadc commented 6 years ago

Thanks @mrcointreau , the same worked here, using player.options.children

trisys3 commented 6 years ago

By now, you would need to be compatible with VideoJS 6-7, as well. To be clear, I'm not sure if adding compatibility with 5 won't automatically add compatibility with 6-7, just putting it out there.