-
Notifications
You must be signed in to change notification settings - Fork 21
Description
Hi,
I am working on a private H5P library based on H5P.Question. For this custom question I would like to add some interactivity to it, for example play a certain part of the video on a wrong answer, and another part for a correct answer. For my custom question this could be extended to specific feedback on specific mistakes. To do this I need to control the video instance which is unfortenately private
in sections.video.instance
. Only the play
and pause
functions are available to me.
I see two possible solutions:
-
We add a getter function to access the media instance. This could be a function
getVideoInstance
andgetImageInstance
, or with a little bit complexity agetMediaInstance
function. This way child libraries will be able to control the media instances. A possible danger might be that child libraries have access to the media instance and might mess things up. -
Now the functions
play
andpause
exists. Likewise we could add functionsseek
andgetCurrentTime
. Below is the list of possible functions to add:
seek
getCurrentTime
getDuration
getBuffered
mute
unmute
isMuted
getVolume
setVolume
getPlaybackRates
getPlaybackRate
setPlaybackRate
setCaptionsTrack
getCaptionsTrack
For my requirementsseek
,getCurrentTime
andgetDuration
would suffice. The remaining functions might not be meaningful to add to a question.
I would like feedback on my feature request. I am willing to provide code for both modifications in a pull request if you like the idea.