Player not working on Safari
Hello !
I'm trying to use this component on Safari, version 12.0.2 on MacOS 10.14.2.
The <google-youtube> is present into HTML DOM but nothing is displayed on the webapp. I have not any error into the JavaScript console.
On Google Chrome, it's working fine.
The full html:
<link rel="import" href="bower_components/google-youtube/google-youtube.html">
<google-youtube class="googleYouTube" video-id="l_BWeuz1k4c"></google-youtube>
CSS:
.googleYouTube {
display: block;
width: 480px;
margin: 0 auto;
height: 270px;
}
There is specs to apply to be able to work on Safari brower ?
Thank you for reporting this. Note that the code in the master branch has been migrated off HTML imports now.
Can you confirm that you use what currently is in the 2.x branch?
Thank you for reporting this. Note that the code in the master branch has been migrated off HTML imports now.
Can you confirm that you use what currently is in the 2.x branch?
Yes, I'm using the 2.x version, imported with Bower:
I tried to use the newest version but if I've understood, NPM import seems to not working well. A solution is to build package with Polymer but I'm not using this framework. I'm on "raw" HTML & JS project.
Correct, with the npm version, you need to have a build step that replaces npm style imports with ones understood by browsers. Ideally, you want to bundle modules for production too. Anyway...
I tested the code from the 2.x branch in Safari 12.0.1, it works for me. Although, it is a different version, I don't expect large differences between them, because 12.0.2 was a security update - https://support.apple.com/en-us/HT209344.
What do you mean by "raw"? For Safari (and soon for Chrome) you need to include the required polyfills. Did you include them?
Also, could verify if <google-youtube> was registered with the browser, by doing: customElements.get('google-youtube')?