[Question] why getVideoPlaybackQuality function returns undefined for HTMLVideoElement?
See original GitHub issueHi, I’m trying to check in my test that video is playing. I decided to call getVideoPlaybackQuality function and get totalVideoFrames from VideoPlaybackQuality object.
My code is:
const videoStreamSelector = '//sd-webcam-player/sd-video-stream';
await adminPage.waitForSelector(videoStreamSelector);
const videoStream = await adminPage.$(videoStreamSelector);
const width = await videoStream.$eval('video', (node) => (node as HTMLVideoElement).videoWidth);
const quality = await videoStream.$eval(
'video',
(node) => (node as HTMLVideoElement).getVideoPlaybackQuality
);
console.log(JSON.stringify(width));
console.log(JSON.stringify(quality));
The result is:
pw:api waiting for selector "//sd-webcam-player/sd-video-stream" to be visible [] +1ms
pw:api selector resolved to visible <sd-video-stream muted="true" class="ng-isolate-scope" stream="$c…>…</sd-video-stream> [] +19ms
pw:api <= page.waitForSelector succeeded +18ms
640
undefined
So there is result for videoWidth property and no result for getVideoPlaybackQuality function.
I’m using Firefox with
"media.navigator.streams.fake": true,
"media.navigator.permission.disabled": true,
"media.gstreamer.enabled": false,
"media.mediasource.enabled": true,
What I’m doing wrong? Why the result is undefined? Can I maybe use another approach for this check?
Thanks!
Version: “playwright”: “^1.3.0”
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
HTMLVideoElement.getVideoPlaybackQuality() - Web APIs
The HTMLVideoElement method getVideoPlaybackQuality() creates and returns a VideoPlaybackQuality object containing metrics including how ...
Read more >Firefox video tag getVideoPlaybackQuality() is not a function
According to MDN documentation, getVideoPlaybackQuality() on HTMLVideoElement is available after version 25.0. However, I tried to call it on ...
Read more >WebMethod returns undefined, yet return value in response?
I've got the javascript to call the method using "var myValue = PageMethods.MyFunction();", however when I try and use myValue later within the ......
Read more >UDN Search
the htmlvideoelement method getvideoplaybackquality() creates and returns a ... true, null); see also htmlvideoelement microsoft api extensions .
Read more >Untitled
... "FUNC_ADD", "FUNC_REVERSE_SUBTRACT", "FUNC_SUBTRACT", "Function", "fx", "fy", ... "getVertexAttrib", "getVertexAttribOffset", "getVideoPlaybackQuality", ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@viraxslot The snippet you posted is how I would do it 😄 lodash will work as long as the page already uses it. However, if you reference lodash from the function passed to
evaluate()
, it won’t appear in the page. Learn more about execution contexts here.Overall, I meant that we’ll think about making this work out of the box. There are tradeoffs to be considered around own properties, but perhaps we can make it better.
@dgozman ok, got it 😃 this example works fine:
lodash.pick() doesn’t work inside the evaluate function.