locked
Embedding Youtube Videos Into a Metro App (Javascript app)

    Question

  • I'm making a Windows Store App  for a class and I'm kind of stuck. I am trying to embed a youtube video in my app but its not working. 

    I used the Javascript blank app (New project > Javascript > Blank App) so I need a solution that either works with the javascript app or a different solution I can incorporate into my app. I have seen some solutions for C# but haven't found any for JS. 

    I got the video frame in the app and where I want it, the problem is it says "Error unsupported video type or invalid file path".

    I am heading off to work and I will check back later to add additional information if needed. Thanks in advance!

    Also, I'm using Blend for Visual Studio 2013 Professional so help specific to that program would be awesome. 


    Thursday, April 17, 2014 9:45 PM

Answers

All replies

  • There are many previous threads about playing Youtube videos in a Windows Store app in HTML/JavaScript: http://social.msdn.microsoft.com/Forums/windowsapps/en-US/home?forum=winappswithhtml5&filter=alltypes&sort=relevancedesc&searchTerm=youtube

    Here's a quick code snippet I found from that search:

     <x-ms-webview src="http://www.youtube.com/embed/FhtYIAxLl8g" ></x-ms-webview>

    As always, if you need more specific help please post your code. An unsupported video type may mean that the video you're trying to show is in a type that isn't supported. Adding ?HTML5=1 to your URL may help.

    --Rob

    • Marked as answer by gatorfan1 Friday, April 18, 2014 5:22 AM
    Friday, April 18, 2014 1:33 AM
    Owner
  • Sorry about that, I looked at the suggested threads when I type in my title but everything was C# related. Im not incredibly familiar with this forum but that is a nice search feature. I have a feeling I'll be here more often as I get deeper into development. Anyway..

    The fix worked perfectly, thank you. 

    I've been searching a little but maybe you know exactly what I'm looking for. I want to add youtube videos in a div or box of sorts that scrolls left-right. Is there just an easy HTML/CSS solution or will there need to be some JS as well? Not looking for a code snippet or anything, maybe just the general direction I need to look? 


    • Edited by gatorfan1 Friday, April 18, 2014 5:51 AM
    Friday, April 18, 2014 5:25 AM