sampotts / plyr

A simple HTML5, YouTube and Vimeo player
https://plyr.io
MIT License
26.51k stars 2.93k forks source link

I need video-marker in plyr.js #1507

Open AlpacaBi opened 5 years ago

AlpacaBi commented 5 years ago

Hey guys,have you ever heard of videojs-markers??

A plugin that displays customizable markers upon progress bars of the video with Video.js. This could be used to show video breaks and show overlaid text on the video when playback reaches the specific break point.

I use plyr.js in my project, but it seems plyr.js doesn‘t support video-marker .

I think that video-marker is an important function on video compontent.

At last,plyr help me a lot,thanks for you job!!!!

Please advise : )

ghost commented 1 year ago

I believe this will help, but videojs support custom class in markers

player = new Plyr('#player', {
    markers: { 
        enabled: true, 
        points: [
            { 
                time: 60,
                label: "Test" 
            },
        ] 
    },
    volume: 0,
    invertTime: false,
});

and than programatically

let points = [...player.config.markers.points];
points.push( {time: 10, label: "Test"} );
player.config.markers.points = points;

from topic https://github.com/sampotts/plyr/issues/2465