Using Nightwatchjs To Detect Video Play - javascript

I'm testing an app that includes a video player. I'd like Nightwatch to identify that the video is playing after it hits the play button and pauses when it hits the pause button. I'm not talking about detecting a play or pause event that the player sends but detecting if the video is actually playing. Any ideas how to detect if the video is indeed playing or paused?

Here can be the answare you are looking for: https://www.w3.org/2010/05/video/mediaevents.html
with video.paused event you can see if the video is paused or not..

Related

Is there a way to pause video in WKWebview when app is running background

When I play a video in WKWebView.
At this point I retired the app to run in the background, at this time the video was still playing, after a few seconds I executed a js code to pause the video. But the video doesn't really pause, it continues to play.
Is it possible for me to actually pause the video in this case?

Video element pause while phone call

I've got an issue with my app and I could reproduce it on this sample: https://webrtc.github.io/samples/src/content/getusermedia/record/
During a phone call, if I open a tab with a video with audio element, the video automatically pause (and can see a pause event on the element)
This does not happen if the video element was loaded and played before the phone call start, or if the video has no audio.
Is this a normal behaviour, and can it be tracked (by an event other than the pause one) ? Is there any way to know there is a phone call ongoing, or any way to restart the video during the phone call (element.play() works, but a pause event immediately happens) ?
To reproduce:
On a mobile (iOS or Android)
Start a phone call
Open https://webrtc.github.io/samples/src/content/getusermedia/record/
The video is paused
If you manually launch element.play(), you can see the frame in the video updating, and then pause again
The record works correctly
what (likely) happens is that the video element (which needs to synchronize audio and video) is waiting for audio data but doesn't get any from the underlying layers when a phone call is active.
A possible workaround would be to change how you display audio and video, each in their own elements with MediaStream as srcObject that only have the respective audio and video track of the original stream.
Can you file a specification issue on https://github.com/w3c/mediacapture-main/ please? This is a rather interesting case that warrants some discussion.

IOS Low Power mode stops video autoplay in react

I am developing a website and I am using a video as my hero container in my main page. The video is set to autoplay as soon as the page loads. On IOS low battery mode, I found out that it stops video autoplay in order to save battery life. What are my possible solutions to fix this problem.
The play button is shown on the video. Is it possible to force the video to play or even hide the playbutton of the video?
Is there any event listeners that work aside from suspend because that did not work for me.

Video Paused but its sound still trailing

I'm building a winstore app and building a skip-able intro (dynamically added it through JavaScript code).
However, if i skip it and set
this.video.pause();
in the button click function, even though the video is paused, the sound of the video is still trailing for a few sec before it stopped.
How could i make the sound stop right there with the images?
It's just weird that the video is already paused but the sound still can be heard when it should've been paused too (the video contain mp4 and mp3 in it).
It's weird because if a video is really paused it off the image and sound.
You can try this following command (it cut the sound) :
this.video.setAttribute("muted", "muted");
But it's not the solution because pause() method should work, so checks if you don't have 2 videos elements in your page.

If the user pauses a video, I need to know the exact point where it was paused and to store it. How?

If I am running a youtube video with javascript, I can have an event fire every time the user pauses the video. But how do I capture the point in the video where he hit PAUSE? I need a number that reflects how far he was into the video before he paused.
Thanks,

Categories

Resources