nativescript-videoplayer
nativescript-videoplayer copied to clipboard
Question: How to detect video is playing or paused
In documentation does not stated if there is API like this
this._vid = args.object;
If(this._vid.isPlaying()) {
this._vid.pause()
} else {
this._vid.play()
}
is there possibility to hook current video status.
NS7 + Vue
Thanks.
I don't think there's a way to do this. I'm currently saving the state of the video to a variable so I can control it.
Late response but hope this might help someone.
There is not a property which is built into the plugin stating if a video is playing or paused. But as @andresilva-cc suggest, you can make such a property yourself. Then set it based on the following callback functions:
This is the pure JS version:
const videoPlayer = page.getViewById('YourVideoPlayerID');
videoPlayer.on('playbackStartEvent', args => {
// Your property here
});
videoPlayer.on('pausedEvent', args => {
// Your property here
});