Play YouTube Video in Javascript Metro App
-
2012年7月12日 20:06
Hi!
I'm looking for the best/easiest way to play a YouTube video in a Javascript Metro App? I tried the PlayerFramework, but I didn't succeed with that. I got a "unsupported video format or invalid path" error. When I tried to IFrame it, I got a problem with winControl.
Any pointers in the right direction are appreciated!
/Anders
Bratland
全部回复
-
2012年7月12日 20:56版主
Are you trying to play a Flash video or an HTML5 video? By default YouTube uses Flash, but some (not all!) videos are available in HTML5 format if sign up for their HTML5 beta at www.youtube.com/html5 .
Metro style apps cannot play Flash videos, but shouldn't have trouble with the HTML5 ones.
--Rob
-
2012年7月13日 10:23版主
HI
So what's the problem with wincontrol?
Use this for Youtobe.html:
<iframe width="853" height="480" src="http://www.youtube.com/embed/JW5meKfy3fY" frameborder="0" allowfullscreen>
</iframe>And in default html
HTML: <div id="Youtubevedio"></div> js: WinJS.UI.Pages.render("/Youtube.html",document.getElementById("Youtubevedio"));That's work fine.
- 已标记为答案 Dino HeModerator 2012年7月19日 13:32
- 已编辑 Dino HeModerator 2012年8月13日 2:29 Fix some typo
- 取消答案标记 Rob CaplanMicrosoft Employee, Moderator 2012年8月13日 5:30
-
2012年8月12日 9:45
HI
So what's the problem with wincontrol?
Use this for Youtobe.html:
<iframe width="853" height="480" src="http://www.youtube.com/embed/JW5meKfy3fY" frameborder="0" allowfullscreen>
</iframe>And in default html
HTML: <div id="YoutoBeVedio"></div> js: WinJS.UI.Pages.render("/Youtobe.html",document.getElementById("YoutoBeVedio"));That's work fine.
sorry,i follow step don't work,
Is not ?
default html in add
1.default HTML: <div id="YoutoBeVedio"></div>
2.default js:WinJS.UI.Pages.render("/Youtobe.html",document.getElementById("YoutoBeVedio"));
and new Youtobe.html in add
<iframe width="853" height="480" src="http://www.youtube.com/embed/JW5meKfy3fY" frameborder="0" allowfullscreen>
</iframe> -
2012年8月13日 2:32版主
Hi
Fix some typo, Please try again.
And not all the video support this.
Please refer to this link:
-
2012年8月13日 8:45
Thanks Dino for the reply,
That's work fine,but don't play.
Because ActiveX Plug-in,Adobe Flash Player not install in Metro app.
js metro app:
- 已编辑 andylin5 2012年8月13日 12:17
-
2012年8月14日 14:13版主
Are you trying to play a Flash video or an HTML5 video? By default YouTube uses Flash, but some (not all!) videos are available in HTML5 format if sign up for their HTML5 beta at www.youtube.com/html5 .
Metro style apps cannot play Flash videos, but shouldn't have trouble with the HTML5 ones.
--Rob
This only work for HTML5 videos. -
2012年8月15日 3:31
i did join the html5 trial,but youtube still in flash mode in windows8 ie.
i upload mp4 file on youtube.- 已编辑 andylin5 2012年8月15日 3:32
-
2012年8月16日 19:01版主
See this:
http://apiblog.youtube.com/2010/07/new-way-to-embed-youtube-videos.html
Jeff Sanders (MSFT)
- 已建议为答案 Jeff SandersMicrosoft Employee, Moderator 2012年8月16日 19:01
-
2012年9月20日 7:34版主
Hi
As Rob said, it's only support html5 vedio not Flash vedio.
please refer to this thread:

