Play/Pause buttons don't work
stellamarkop opened this issue · 1 comments
Hello! My issue is that I cannot play or pause the video when clicking on the canvas as seen on the demo. I have followed the documentation and I have managed to build my own buttons for this functionality, but it would be great to use the build in way similar to the demo. This is my code. Am I missing something?
this.player = new JSMpeg.VideoElement( this.streamingcanvas.nativeElement, myurl, {
autoplay: true,
loop: true,
audio: true,
control: true,
hooks: {
play: () => console.log('onPlay'),
pause: () => console.log('onPause'),
stop: () => console.log('onStop'),
load: () => console.log('onSourceEstablished')
} } )
(In the 'control' I have tried setting in to true and false but I doesn't work.)
Thank you in advance!
the hooks don't control the video but are listeners to whenever one of those events are triggered, if you see in the docs
`JSMpeg.VideoElement instance supports the following methods:
play(): Start playback
pause(): Pause playback
stop(): Stop playback and seek to the beginning
destroy(): Stop playback and empty video wrapper`
those are the methods to control the video