implement callbacks ?
kresimirfijacko opened this issue · comments
Hi,
when are you going to support callbacks such as:
onSourceEstablished, onSourceCompleted
?
There are two ways to call callback methods:
- Set
hooks
options:
new JSMpeg.VideoElement(videoWrapper, videoUrl , {
hooks: {
play: () => console.log('onPlay'),
pause: () => console.log('onPause'),
stop: () => console.log('onStop'),
load: () => console.log('onSourceEstablished or onSourceCompleted')
},
...otherOptions
});
- Use callbacks of the original jsmpeg such as
onSourceEstablished
,onSourceCompleted
to override the settings. (Set the fourth parameter)
new JSMpeg.VideoElement(videoWrapper, videoUrl, options , {
onSourceEstablished: (source) => console.log('onSourceEstablished'),
onSourceCompleted: (source) => console.log('onSourceCompleted'),
...otherOptions
});