Jitsi-meet: Share a youtube video with iFrame which shows CORS error

Created on 19 May 2020  路  9Comments  路  Source: jitsi/jitsi-meet

This Issue tracker is only for reporting bugs and tracking code related issues.

Before posting, please make sure you check community.jitsi.org to see if the same or similar bugs have already been discussed.
General questions, installation help, and feature requests can also be posted to community.jitsi.org.

Description

Similar issues #6721 . I am using the external_api.js. I have met trouble with Chrome on Mac OS Catalina. But I could not reproduce on Safari.

  1. When the participant A shares a youtube video and clicks start, the participant B could not load. The whole screen would stuck on the youtube preview.

Console detail as below,

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://www.youtube.com') does not match the recipient window's origin ('https://meet.jit.si').

  1. I found that it might miss a parameter which called _mute=1_ when playing the youtube video.

HTML Code as below,

<iframe id="sharedVideoIFrame" frameborder="0" allowfullscreen="1" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" title="YouTube video player" width="100%" height="100%" src="https://www.youtube.com/embed/uDVTm1Xbc9k?origin=https%3A%2F%2Fmeet.jit.si&amp;fs=0&amp;autoplay=0&_mute=1_&amp;controls=1&amp;rel=0&amp;widget_referrer=http%3A%2F%2Fgrwth.app360.cn%2Fh5%2Fmeeting%2F60&amp;enablejsapi=1&amp;widgetid=1" style="width: 1782px; height: 821px; opacity: 1;"></iframe>

But I could not find if there is any connection between para. 1 and para. 2

Current behavior

the participant B could not load the sharing video

Expected Behavior

All participants could load the youtube video

## Possible Solution

Steps to reproduce

2020-05-25
I tried some situations this morning.
Use chrome raising a meeting and share a youtube video on Windows 10. Then I participate it with different browsers on Mac.

Chrome 83 - Passed
Firefox 74 - Failed
Safari 13 - Failed

Then I tried to raise a meeting and share a youtube video with different browsers on Mac.
I found whatever browsers I share video on Mac, the screen would stuck on Windows. And I couldn't click the play button. It looks so weird.

Environment details

Mac OS 10.15.1 Catalina
Chrome 81.0.4044.138 Stable 64 Bit
Firefox 74 64 Bit (Mac)
Safari 13.0.1

api wontfix

Most helpful comment

Are you using the external API?

Yes. I use the external_api.js

All 9 comments

We have the same problem , Please help us to solve this problem .

Are you using the external API?

Are you using the external API?

Yes. I use the external_api.js

I am running into this issue as well. I get the same exact error message on participant B when they are in Chrome. The only thing I have to add is that it appears to work correctly in Firefox in addition to Safari. It's such a great feature.

Here is the youtube iframe on participant b's screen.
<iframe id="sharedVideoIFrame" frameborder="0" allowfullscreen="1" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" title="YouTube video player" width="100%" height="100%" src="https://www.youtube.com/embed/7iWwU4BT23A?origin=https%3A%2F%2Fmeet.jit.si&amp;fs=0&amp;autoplay=0&amp;controls=0&amp;rel=0&amp;widget_referrer=https%3A%2F%2F127.0.0.1%3A4000%2Fz%2Ffrom-us-finale&amp;enablejsapi=1&amp;widgetid=1" style="width: 702px; height: 509px; opacity: 1;"></iframe>

Here is a likely related issue report in the community forums: https://community.jitsi.org/t/share-a-youtube-video-not-auto-playing-for-the-participants/15537

I am running into this issue as well. I get the same exact error message on participant B when they are in Chrome. The only thing I have to add is that it appears to work correctly in Firefox in addition to Safari. It's such a great feature.

Here is the youtube iframe on participant b's screen.
<iframe id="sharedVideoIFrame" frameborder="0" allowfullscreen="1" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" title="YouTube video player" width="100%" height="100%" src="https://www.youtube.com/embed/7iWwU4BT23A?origin=https%3A%2F%2Fmeet.jit.si&amp;fs=0&amp;autoplay=0&amp;controls=0&amp;rel=0&amp;widget_referrer=https%3A%2F%2F127.0.0.1%3A4000%2Fz%2Ffrom-us-finale&amp;enablejsapi=1&amp;widgetid=1" style="width: 702px; height: 509px; opacity: 1;"></iframe>

Here is a likely related issue report in the community forums: https://community.jitsi.org/t/share-a-youtube-video-not-auto-playing-for-the-participants/15537

As far as I know, autoplay should be worked as usual. But I found that Chrome changed its policy about autoplay in console.

For more information, please click the below link.
https://developers.google.com/web/updates/2017/09/autoplay-policy-changes

A really hacky workaround I found was to serve up the iframe source from your local server and set the domain argument to JitsiMeetExternalAPI(domain, options). Chrome still logs the postMessage error, but the Youtube correctly player works as it does in Firefox and Safari.

I assume this is a less preferred workaround to installing and deploying jitsi-meet from scratch. This is for a small one time event, so standing up a whole debian instance doesn't make sense just to get youtube to work.

A really hacky workaround I found was to serve up the iframe source from your local server and set the domain argument to JitsiMeetExternalAPI(domain, options). Chrome still logs the postMessage error, but the Youtube correctly player works as it does in Firefox and Safari.

I assume this is a less preferred workaround to installing and deploying jitsi-meet from scratch. This is for a small one time event, so standing up a whole debian instance doesn't make sense just to get youtube to work.

Thanks for your reply. I have made a test with Safari and Chrome on Catalina 10.15.1 before. I have to click the play button to play the video. LOL. Maybe I should make another test about running on Firefox.

A really hacky workaround I found was to serve up the iframe source from your local server and set the domain argument to JitsiMeetExternalAPI(domain, options). Chrome still logs the postMessage error, but the Youtube correctly player works as it does in Firefox and Safari.

I assume this is a less preferred workaround to installing and deploying jitsi-meet from scratch. This is for a small one time event, so standing up a whole debian instance doesn't make sense just to get youtube to work.

@blainegarrett, what you did was to serve the iframe from your server app but you used meet.jit.si as the domain for JitsiMeetExternalAPI(domain, options)?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kangzhe0000 picture kangzhe0000  路  39Comments

kerpan picture kerpan  路  52Comments

kinnla picture kinnla  路  40Comments

svtagt picture svtagt  路  55Comments

Janhouse picture Janhouse  路  99Comments