How to control a video's playback speed and other questions

LBP
Posts: 2
Joined: Fri May 19, 2017 4:05 pm

How to control a video's playback speed and other questions

Postby LBP » Fri May 19, 2017 4:51 pm

Hello:

We are developing a site with 360º video for which we need several things:

1) Being able to overlay a chart generated by another JS library on the scene.
2) Similar to the above: overlay a window with, say, an embedded Google Maps on the scene.
3) Sync the output of these two overlays with the video's timecode. (For example: show on Google Maps where we are in each given moment of the video).
4) Control the video's playback speed. The user needs to be able to fast forward the video, slow it down...

Now... as for 1) and 2), I'm pretty sure they can be done with a custom ForgeJS plugin, judging from the Performance Monitor plugin demo (which seems to be basically that). As for 3), I guess you can also do it, by using the "onCurrentTimeChange()" property in the VideoHTML5 object (though I wonder how do you access the VideoHTML5 object from a plugin; the example code I've seen is all about accesing the viewer object).
But 4)... how to do it? I know you can control an HTML5 video's playback speed in Javascript, but if it's loaded through ForgeJS... can you still do that? I didn't see any way to do it in the VideoHTML5's docs.

And also, if I am wrong about the other 3 points and you cannot in fact do them, please say so too.

jtanz
Posts: 28
Joined: Mon Mar 27, 2017 11:24 pm

Re: How to control a video's playback speed and other questions

Postby jtanz » Fri May 19, 2017 6:32 pm

1 : Check out how they added plugins into the vrrroom example, create a custom plugin for charting.
2, 3 : I would suggest looking at the samples/projects/vrrroom/plugins/GoogleMaps. Pretty sure the vrrroom example does exactly this, clicking on the maps overlay on the right side jumps to a specific spot in the video.
4 : Check out the samples/projects/video-controls, hacking the code might be able to get what you want.

LBP
Posts: 2
Joined: Fri May 19, 2017 4:05 pm

Re: How to control a video's playback speed and other questions

Postby LBP » Fri May 19, 2017 8:47 pm

Thank you. Yes, right after I posted, I found out about the "Vroom" project, and will definitely study it. However, I still have my doubts about controlling playback speed; this isn't just about putting a Play/Pause button, but actually making the video play faster or slower. And I just looked into the official docs, and found, in the description of the VideoHTML5 class (https://releases.forgejs.org/latest/doc ... HTML5.html), this in the "To Do" part:

"Deal with playback speeds."


So it looks to me like it can't be done. Can anybody confirm?

User avatar
rroux
ForgeJS Team
Posts: 91
Joined: Wed Oct 26, 2016 12:19 pm

Re: How to control a video's playback speed and other questions

Postby rroux » Mon May 22, 2017 12:50 pm

Hello,

playback speed is not implemented into our FORGE.Video class at the moment.
Maybe on a single quality video and by using the playbackRate property of the HTML video element you will be able to change the speed but I can't guarantee you that it will be fully functional!

On a video scene, try to play with:

  1. viewer.story.scene.media.displayObject.element.playbackRate = 0.5
- Raphaël

Who is online

Users browsing this forum: Google [Bot] and 2 guests