Can I embed YouTube in a WebOS app?

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:

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

Opening https://www.youtube.com/embed/HOsOTaXUg7c in PC Chrome browser shows the same error. Please try another video. Thank you.

This video URL type is mean for embedding, in accordance with YouTube’s embedding instructions. So you have to open it using an object or an iframe, like I showed in my code snippet.

You can see it working in this JSFiddle.

In the meanwhile, I tested it on my TV, and it doesn’t work there as well. Any idea why?

1 Like

For anyone else experiencing this, this happens because YouTube won’t allow embedding videos in a page with a file:// protocol, which is the case for a basic WebOS app.

Some possible solutions are:

  1. use a hosted app
  2. use a proxy iframe to load the video. I created a basic example here and it allows you to pass in a video ID and load it from any page.
1 Like

There are multiple factors contributing to this problem. Some possible reasons for encountering such errors include:

  • There is a possibility that the video violates YouTube policy.
  • The cache got corrupted and needs to be cleared.
  • There may be a reason for the poor quality of the video.
  • There may be an issue with the internet speed.

You can try out some options to avoid such situations of non-availability of your favorite videos. A few recommended options include:

  • Try to reinstall your web browser.
  • You can try a different browser to play the desired youtube video.
  • Enable Flash and JavaScript.
  • Deleting Cookies
  • Update GPU drivers

Remember to always ensure that you are compliant with YouTube’s terms of service and copyright policies when accessing and sharing videos.