youtubeembeddingwebos

WebOS web app won't show embedded youtube video


I have a web application in which I embed a youtube video.

<object width="1152" height="648">
    <param name="allowFullScreen" value="true">
    <param name="allowscriptaccess" value="always">
    <param name="movie" value="https://www.youtube.com/embed/HOsOTaXUg7c">
    <embed src="https://www.youtube.com/embed/HOsOTaXUg7c" width="100%" height="100%">
</object>

This code works perfectly in the browser, however on the WebOS simulator, the same code results in a Video Unavailable:

enter image description here

How to I make this video work on a WebOS TV?


Solution

  • While in many cases, this issue is a result of either trying to embed a video that prevents a embedding or using the wrong youtube path, in this particular case, this behavior occurred because YouTube won’t allow embedding videos in a page with a file:// protocol, which is the case for a basic WebOS app.

    Two possible solutions are:

    1. Use a WebOS hosted app
    2. Use a proxy iframe to load the video.

    I created a basic example of here and it allows you to pass in a video ID and it will load it from any page.