yanwsh / videojs-panorama

a plugin for videojs run a full 360 degree panorama video.
http://yanwsh.github.io/videojs-panorama/
Other
483 stars 160 forks source link

Marker questions #128

Open mikelevy opened 6 years ago

mikelevy commented 6 years ago

Hello, Im using the beta version and i have some questions about using the markers:

  1. Is there a way to attach an event to them? EX: I have a marker that says "CLICK", I would like to have it open an overlay or something. How would I do that?
  2. How do you make the markers go away? Is there a way to set a duration on how long they stay for and when they come up? So if I want a marker to appear at 2:00, disappear at 3:00 and then at 4:00 have another marker appear. Is that possible?

Thanks

yanwsh commented 6 years ago

Hello, the marker's element property can not only bind text, but also bind htmlelement, for your case, you can bind htmlelement and then use jquery to bind click function.

Answer your second question, since each marker can bind html element, so you can add javascript on your end.

like

var player = videojs("playerid");

player.on("timeupdate", function(){
   var time = player.currentTime;
});
yanwsh commented 6 years ago

hey, answer your second question, you can set up 'keypoint' and 'duration' property

like

       {
                    id: "custom-hotspot-text-1",
                    location: {
                        lat: -10,
                        lon: 190
                    },
                    radius: 500,
                    element: "text 1",
                    keyPoint: 10,
                    duration: 2000
                },