defold / extension-videoplayer

Videoplayer for the Defold engine
MIT License
9 stars 6 forks source link

request for a few extra methods - set/get current time, get metadata(duration and other tags), set framerate speed #4

Open blurymind opened 6 years ago

blurymind commented 6 years ago

Thank you for adressing the compilation error issue btw. I will give it a try again in the weekend.

I really want to use this on a project, but I am missing a few features:

britzl commented 6 years ago

Can't you pass in a multiplied dt to achive a different framerate speed?

What kind of metadata do you need?

britzl commented 6 years ago

I updated the example with some on-screen controls to pause, stop and fast forward

blurymind commented 6 years ago

@britzl thank you for updating the example. Fast forward is not the same as seek. Seek method should be able to set the video playback to a specific position. Some seek methods use a float value to set it in seconds/ms. Example: https://www.appgamekit.com/documentation/Reference/Video/SetVideoPosition.htm

The seek should allow more interesting interaction methods with the video file - not just playing it. Scrubbing could be hooked with inputs, time ranges could be set to loop a number of times or until the player achieves somethings, etc. It will make the video player much more usable in the context of using it for gameplay mechanics/interactivity

For metadata I mean the ability to read meta tags, implaned by the user - all the metatags!

Ffmpeg for example can attach metatags to video files like this: ffmpeg -i input.webm -metadata key=value -codec copy output.webm With the caveat of not overwriting the original when doing that

It could be very cool if we were able to get these tags and use them

For debugging, try above command and to retrieve the metadata you inserted back, ffmpeg can also do that: ffmpeg -i output.webm -f ffmetadata metadata.txt Actually web browsers can also do that I think

blurymind commented 6 years ago

The metadata is not as important as a proper seek method. Setting the video to a specific position

blurymind commented 6 years ago

For the javascript implementation you can get and set currentTime very easily via the htmlmediaelement

https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/currentTime video.currentTime That allows for looping specific time ranges