xibosignage / xibo-dotnetclient

Xibo for Windows .NET Player
GNU Affero General Public License v3.0
63 stars 91 forks source link

Embedded Youtube videos stop buffering unexpectedly #240

Closed mattgrimley closed 2 years ago

mattgrimley commented 2 years ago

Issue previously reported by others at https://community.xibo.org.uk/t/embedded-youtube-not-autoplaying/25897/6 and replicated by me.

CMS is version 3.0.5 CMS host is Windows Server 2019, manual Xibo install.

Xibo Client is v3 R301.1 Xibo Client host is Windows 10 Education 21H1 64bit (with Edgemium Version 96.0.1054.62 (Official build) (64-bit) browser installed).

Problem: Embedded Youtube video is not displayed (blank black screen). Replicate: Insert an Embedded region with the following simple embedded code (Sky News YouTube stream): <iframe width="600px" height="400px" src="https://www.youtube.com/embed/9Auq9mYxFEE?autoplay=1&cc_load_policy=1&controls=0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

Further information: The problem is present in all v3 clients that i have tried, but following advice in the thread above, i tested the v2 R203 client (xibo-client-v2-R203-win32-x86.exe) and can confirm that this plays fine. (though i expect other compatibility problems to arise with an old client).

I followed information on this page: https://xibo.org.uk/docs/setup/autoplay-embedded-youtube-videos but neither of those examples worked either.

Kind Regards, Matt

dasgarner commented 2 years ago

Thanks for reporting this Matt - I've responded to your original community post to chase up the documentation change.

I will leave this issue open (with an edited title), as it would be interesting to find the root cause for the buffering failure.

mattgrimley commented 2 years ago

Thanks v much for the update Dan. Should that script (https://community.xibo.org.uk/t/embedded-youtube-not-autoplaying/25897/9) work despite the buffering issue? I've tried it on my test build and get the same blank screen.

I'll good to roll back to the old client for now as i can crack on with some more of my migration from 1.85 to 3.05.

dasgarner commented 2 years ago

Ah interesting - that script worked for us a month ago so we will take another look.

dasgarner commented 2 years ago

We've retested that script here and it seems to work reliably. If you're able to open up the developer tools on that widget when it runs, it would be useful to see the console logs from the script please.

Its easier if you enable the mouse in the display profile, then should should be able to right click to gain access to developer tools.

mattgrimley commented 2 years ago

We've retested that script here and it seems to work reliably. If you're able to open up the developer tools on that widget when it runs, it would be useful to see the console logs from the script please.

Its easier if you enable the mouse in the display profile, then should should be able to right click to gain access to developer tools.

Thanks for checking your end Dan. I'm rolling a fresh OS install for my next test to make sure i'm not inheriting some stupid policy setting or other such change. I'll configure a stand-alone client with a clean install and test again. Will update as soon as i have more.

Matt

mattgrimley commented 2 years ago

We've retested that script here and it seems to work reliably. If you're able to open up the developer tools on that widget when it runs, it would be useful to see the console logs from the script please.

Its easier if you enable the mouse in the display profile, then should should be able to right click to gain access to developer tools.

Hi Dan, I have built up a completely clean Windows 10 20H2 64bit client with the new 302.4 client installed (All windows updates to current date installed and Edge fully updated). I have also created a dedicated layout with an embedded window including the code you posted in the community thread in the "Head content to Embed" area and in the HTML to Embed:

<!-- BROWSER=edge -->
<div id="player"></div>

In the Layout Designer, the embedded stream works fine, however on the client, the region containing the embedded video is not visible.

This felt different to last time, but either way, looking at the Player Information and Stats, it reported: "Unhandled Exception Couldn't find a compatible Webview2 Runtime installation to host WebViews". Googling this led me to the Evergreen Bootstrapper at https://developer.microsoft.com/en-us/microsoft-edge/webview2/#download-section. After installing that, your example code loads on my test machine, so it just looks like a pre-requisite missing from the installer?

Ill now try and use your code (and the up to date client AND the webview2 bootstrapper) on one of my layouts, though i'm more optimistic! ;)

dasgarner commented 2 years ago

After installing that, your example code loads on my test machine, so it just looks like a pre-requisite missing from the installer?

:disappointed: ah, we do try and check for the runtime, but it seems to be hit and miss.

I'll make sure we update the installation doc to at least point this out!

Ill now try and use your code (and the up to date client AND the webview2 bootstrapper) on one of my layouts, though i'm more optimistic! ;)

:crossed_fingers: sounds like it might work though, which is great.

mattgrimley commented 2 years ago

Hey Dan, I can confirm that it does kinda work, but i can still also replicate my original problem, which i think might be a timing / speed issue. In a completely fresh layout, an identical copy of my embedded window (with subtitles added) loads consistently and autostarts playing, however, the same code, in the same window in my populated layout will load, but fails to auto-start. If i click start, it then plays.

I'm wondering if a busy page is just affecting loading speed on what is a slowish computer? Any suggestions how i can enable dev tools to troubleshoot a bit further? I have the mouse enabled, but i can't see any way to get information beyond pressing "i" for the XIBO stuff.

If you feel this is now more a scripting help issue rather than a bug connected to the webview implementation, we should probably move this back to the community forum and close this bug report. (though embedding the webview2 runtime in the Windows client would be fab!) :)

Just an aside to say that the progress from v1.x is immense. I'm really quite proud of my interface and that all comes from functions that you guys have worked so hard on developing. Really appreciate it!

Thanks in advance, Matt

dasgarner commented 2 years ago

Thank you for your kind comments, its great to hear! We're planning on forging ahead with more improvements, our next focus is to improve the developer experience in v4 :smile:

I'm wondering if a busy page is just affecting loading speed on what is a slowish computer?

It isn't clear to me why buffering sometimes fails. Each embedded widget should be isolated from the other in terms of its webview instance - but I suppose they are sharing underlying resources. You could try and increase the timeout in the script to see if delaying for longer helps.

I have the mouse enabled, but i can't see any way to get information beyond pressing "i" for the XIBO stuff.

The keyboard shortcut (F12 I believe) for opening developer tools in edge should work - as should right clicking on the widget area to access the context menu.

though embedding the webview2 runtime in the Windows client would be fab!

I've created an issue for it here https://github.com/xibosignage/xibo-dotnetclient/issues/243

we should probably move this back to the community forum and close this bug report

That would be great if you don't mind - I suspect others will benefit if discussion (and hopeful solution!) is on the community. I will hold me hand up to not checking community as often as here, but I do try and look once a week.

Thanks, Dan