How to handle “Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first.” on Desktop with Chrome 64? - playback

How to handle “Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first.” on Desktop with Chrome 64 and HTML5 Video tag.

In modern versions of Chrome, you can’t have videos autoplay with sound enabled by default.
You need to add the muted property to your HTML5 tag:
muted="muted"

Related

How do I use SDK Inspect tool/UIAutomation with Opera browser?

I'm trying to use SDK Inspect tool to set value in the address bar of Opera but it keep getting error:
Value.SetValue
Called with parameters:
val: abcd.com
Result:
ERROR - [Error: hr=0x80004005 - Unspecified error]
I can set value it with Firefox and Other Chromium browser but not Opera. Does Opera has something prevent other process access its UI and how can I bypass it ?

Unhandled Promise Rejection: Error: Untrusted URL when I load Youtube video inside WebView on JavaFX

When I load a Youtube video using WebView directly from YT, I get all the page data, but the video stays charging without showing the video itself. This issue is new because the previous week that worked adequately.
I suppose that Youtube has made some changes to prevent embedding video pages inside JavaFX WebView component.
Please use the following repository to see a test.
https://bitbucket.org/diegoluisr/javafx-webview-youtube-test/src/master/enter link description here
WebKit browser prints in the console the following lines...
Console: [https://www.youtube.com/yts/jsbin/player_ias-vflPI0brM/en_US/base.js:39] Unhandled Promise Rejection: Error: Untrusted URL: https://r3---sn-qpgxju8jva-cvbe.googlevideo.com/videoplayback?expire=1564559165&ei=3PJAXYPFN7n6j-8Podm9WA&ip=191.102.199.174&id=o-AFpZ9-9BjKhhYLbO9zoBJ-koAlgU4_rl5mhm-RAcZPp2&itag=22&source=youtube&requiressl=yes&mm=31%2C29&mn=sn-qpgxju8jva-cvbe%2Csn-hp57knly&ms=au%2Crdu&mv=m&mvi=2&pl=24&ctier=L&initcwndbps=236250&mime=video%2Fmp4&ratebypass=yes&dur=10.100&lmt=1563964109911459&mt=1564537439&fvip=2&c=WEB&txp=5316222&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cctier%2Cmime%2Cratebypass%2Cdur%2Clmt&sig=ALgxI2wwRgIhAND23sayeeFGInqso6n2wt5VI1-8CmEwn3BS7KEqdFZ0AiEAokZIzzORQLnQLDhnoUmK6gSJP1FxDnpJAIcPNOVxoxg%3D&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHylml4wRQIgH9Mxi8qnf2E1yvcvfA8gjeJTBKe_kKBklEhjz82gWK4CIQCX6D8qZbu-Dpy-NkCRcluo-OOLSzuu8mgEwgni5_8RFA%3D%3D
Console: [https://www.youtube.com/yts/jsbin/player_ias-vflPI0brM/en_US/base.js:39] Unhandled Promise Rejection: Error: Untrusted URL: https://r4---sn-qpgxju8jva-cvbe.googlevideo.com/videoplayback?expire=1564559175&ei=5_JAXe6MCoS2lAOI14eoBA&ip=191.102.199.174&id=o-ALfOT4rp_IeL6a86s4a2nTlmva4YgQkA9yc_o-ma4_hG&itag=22&source=youtube&requiressl=yes&mm=31%2C29&mn=sn-qpgxju8jva-cvbe%2Csn-hp57knzz&ms=au%2Crdu&mv=m&mvi=3&pl=24&ctier=L&initcwndbps=236250&mime=video%2Fmp4&ratebypass=yes&dur=119.559&lmt=1563514693761974&mt=1564537439&fvip=4&c=WEB&txp=5316222&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cctier%2Cmime%2Cratebypass%2Cdur%2Clmt&sig=ALgxI2wwRQIhAI-C_mVNjdJNzAK249RkB62Blm7jw1_FjwQvkebmhCMUAiBOzmlsdMCZriM9VSmcAVM-BzxzGpcK49kHGg8izPQfVA%3D%3D&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHylml4wRAIgMRZJB2yOLTSlIgblsfaMsK56HcO6MQ6bklYQDnLczM4CIGXeJsTlmhBTDodytkm2jO5Gc6SmY6Q6sjQmwVrUXnvH
Console: [https://www.youtube.com/yts/jsbin/player_ias-vflPI0brM/en_US/base.js:39] Unhandled Promise Rejection: Error: Untrusted URL: https://r2---sn-qpgxju8jva-cvbe.googlevideo.com/videoplayback?expire=1564559162&ei=2vJAXYWoHOXbj-8Prs-DgAo&ip=191.102.199.174&id=o-AO7C5x6ZIyPXAr2qK_vIPflPjs-AOMY2IJVZliAV72Cp&itag=18&source=youtube&requiressl=yes&mm=31%2C29&mn=sn-qpgxju8jva-cvbe%2Csn-hp57kn6e&ms=au%2Crdu&mv=m&mvi=1&pl=24&initcwndbps=236250&mime=video%2Fmp4&gir=yes&clen=19015393&ratebypass=yes&dur=348.856&lmt=1537207191333104&mt=1564537439&fvip=2&c=WEB&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cmime%2Cgir%2Cclen%2Cratebypass%2Cdur%2Clmt&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHylml4wRQIgW0bSjfFcOWJAwx2_jlafwhDh5-QSE4QaHLllKQUCoXgCIQCcEWzrSiuhAAj9ibUukTnM9_Z7Ln8u8ZbxH4gfqid-fw%3D%3D
You could notice three console lines, that is because the player tried to load 2 Advertising video before the "Alice in Chains" video.
I solve my problem working around it; I have to use a commercial component named JxBrowser. This component uses a chromium implementation (version 69) that allows the embed player to work, and disable gestures required to autoplay.
You could find more information on the component website
https://www.teamdev.com/jxbrowser

How can I pass/create a fake media stream to Edge/IE WebDriver?

There are some flags to create a fake media stream for web camera recording. For example:
'--use-fake-device-for-media-stream', '--use-fake-ui-for-media-stream' (Chrome);
'make.navigator.streams.fake' (Firefox).
Are there any flags for Edge/IE browser to pass them to WebDriver capability (Selenium::WebDriver.new :remote, { url: url, desired_caps: caps })?
Currently, there is no such BrowserStack specific custom capability to pass fake media stream on IE and edge. However, you can use the same on chrome and firefox as you have mentioned above. The Chrome Option 'use-fake-device-for-media-stream' is used to grant camera access. However, you can use the 'use-fake-ui-for-media-stream' Chrome Option that will handle the scenarios for 'use-fake-device-for-media-stream' as well('Use you Microphone' OR 'Use your camera' popup).

Creating a player app on chromecast

I've had lots of progress on this and wanted to implement the "invisible player" on the chromecast receiver as explained here:Deezer invisible player
I have my demo app running, and am able to pass from the sender to the receiver my access token and my token expires.
Instanciating the DZ player like so:
DZ.init({
appId : deezer_app_id,
channelUrl : deezer_channel_url,
player : {
onload : onPlayerLoaded,
token : {
accessToken:event.message.accessToken,
expire:event.message.expire
}
}
});
the onPlayerLoaded function just logs a message for the time being.
I am currently getting:
Unsafe JavaScript attempt to access frame with URL http://mydomain/chrome/myreceiver.html from frame with URL http://www.deezer.com/es/plugins/player.php?channel=http://Mydomain/chrome/channel.php&app_id=IDVALUE&emptyPlayer=true. Domains, protocols and ports must match.
external-v00202097.js:40
FB.getLoginStatus() called before calling FB.init(). vb.js:56
Flash is not installed or is too old vb.js:56
Unsafe JavaScript attempt to access frame with URL http://mydomain/chrome/myreceiver.html from frame with URL http://static.ak.facebook.com/connect/xd_arbiter.php?version=27#channel=f3a…Ffb_xd_fragment%23xd_sig%3Df2d6a19d8%26&origin=http%3A%2F%2Fwww.deezer.com. The frame requesting access set 'document.domain' to 'facebook.com', but the frame being accessed did not. Both must set 'document.domain' to the same value to allow access.
xd_arbiter.php:18
Unsafe JavaScript attempt to access frame with URL http://Mydomain/chrome/myreceiver.html from frame with URL https://s-static.ak.facebook.com/connect/xd_arbiter.php?version=27#channel=…Ffb_xd_fragment%23xd_sig%3Df2d6a19d8%26&origin=http%3A%2F%2Fwww.deezer.com. The frame requesting access has a protocol of 'https', the frame being accessed has a protocol of 'http'. Protocols must match.
now the first one does not make sense, as I have my channelURL set to the same domain, looking with the inspector I can guarantee both on the channelURl and on the chrome cast receiver that we have the same document.domain .
the second error seems to be from deezer loading something in flash (weird as the example does not state anything in flash).
the third error would be deezer calling FB for some reason.
I know the youtube api through Iframe has been made to work with chromecast, so I think this is possible, however the flash problem and cross domain seems to be an issue.
Any advice?
About the domain, sometimes you get errors when the domain you specified for your app on http://developers.deezer.com contains http:// as it shouldn't.
About Flash, the Deezer player is based on Flash for encryption so you need to install it to get it to work.
Facebook is included in the Deezer player (for sharing, login purposes) and you get warnings when your page is loaded within iframes. You can ignore these warnings.
I am not familiar with Deezer so won't be able to comment on Deezer related issues but the "Unsdafe ..." message can also be caused by trying to use file://*; this is an additional security measure in Chrome. In addition, what are the sanbox properties of the iframe? Does it include "allow-same-origin" ?

Strange error with canvas context getImageData function in Firefox 13

I have some canvas code that works great in safari and chrome, but fails in firefox.
The firefox console reads:
[17:44:13.372] uncaught exception: [Exception... "Operation is not supported" code: "9" nsresult: "0x80530009 (NotSupportedError)" location: "http://REDACTED.js Line: 703"]
Firebug gives the slightly-more-useful-to-humans:
Operation is not supported
var data = ctx.getImageData(x,y,1,1);
I am indeed calling .getImageData on line 703.
I have read that similar errors have been reported with regards to origin policies. This project is hosted on a web server (not local), and I haven't loaded any images from a different domain and put them on the canvas. In fact, I get the error even if the canvas is blank.
The webkit-based browsers give me the pixel data as asked, what can be done about firefox? Thanks.
Don't pass NaN to .getImageData.

Resources