Show Youtube Video in Samsung Smart TV App

江枫思渺然 提交于 2019-12-20 04:54:15

问题


I want to just run a sample samsung smart tv application that show a youtube video, I tried everything I found in the internet and nothing worked, I'm searching for a way since a week and still didn't find, I always were seeing [[missing plug in]] on a white or black screen !! I'm using emulator 2014 with SDK 5, I know that samsung is not accepting flash based app since Feb so I need to find a way without using flash.

even I tried the below way, the video is played on starting but I can't replay or show full screen I can't control anything in it.

this is in my smart tv app:

        <iframe title="YouTube video player" class="youtube-player" type="text/html" width="640" height="390" src="http://192.168.1.6:8080/TestServer/index.jsp"

frameborder="0" allowFullScreen>

this is in index.jsp on tomcat on my machine:

       <iframe src="//www.youtube.com/embed/ZOco-gIY-g4?width=680&amp;height=382&amp;theme=dark&amp;autoplay=1&amp;hd=1&amp;rel=0&amp;showinfo=0&amp;modestbranding=1&amp;iv_load_policy=3&amp;autohide=1&amp;start=0&amp;wmode=opaque" allowfullscreen="" frameborder="0" height="382" width="680"></iframe>

please any working example that will work on tv and will accepted if I used in my application that will work on when submission to samsung is mostly appreciated.

Thanks,

SeeFoo


回答1:


I too had this issue playing videos from YouTube.
I am using object tag for this and it is working as expected. Hopefully it will help you too.

Code:

<div id="webElement" style="display: none;">  
<object type='text/html' width='1920' height='1080' data='http://www.youtube.com/embed/SEQ8jyvmYtw?rel=0&autoplay=1' > </object>  
</div>  



回答2:


Since 2014 and sdk 5.0 Samsung Smart TV doesn't support Flash player plugin. If you want embed youtube player, try html5 format like this:

<iframe class="youtube-player" type="text/html" width="640" height="385" src="http://www.youtube.com/embed/hzixp8s4pyg?rel=0&autoplay=1&hd=1&showinfo=0&modestbranding=1&autohide=1&start=0" frameborder="0">

BTW flv container also doesn't support. This specification describes the codecs supported by Samsung Smart TV pls see http://www.samsungdforum.com/Guide/rel00010/index.html

Hope this will help you!




回答3:


If you just want to play video no need of putting iframe in .jsp file and calling it here, just put the iframe with proper embed link of youtube.

something like this

   <iframe id="clientvideoplayer" class="youtube-player" type="text/html" width="960"  height="540" src="http://www.youtube.com/embed/Cq4RLyS0tz8?autoplay=1" allowfullscreen frameborder="0"></iframe>

However u will not be able to control play and pause of video as iframe are partially supported in Samsung Smart TV.



来源:https://stackoverflow.com/questions/22263275/show-youtube-video-in-samsung-smart-tv-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!