Rasa Rin Rasa Rin - 17 days ago 5
Vb.net Question

Embedded videos in VB.NET form - referenced from URL online and file

I am trying to implement a video player on VB.NET form that would play videos from both online URL (it could be from Youtube or any other URL that points to the video) or file location. I tried to add Windows Media Player and play videos from the file, which works fine, but I can’t play videos let's say from Youtube. I did some research and some of the articles suggested that Shockwave Flash Object control would play videos from online, but that would be two different controls on one form virtually doing the same thing.

I wanted to ask if there is a control to display videos that would handle both references - online URL and file location?

Sam Sam
Answer

In short, the Windows Media Player control will only play a video if the given URL actually points to a video file, for example,

http://www.example.com/files/videos/MyVid.mp4

C:\Users\John\Videos\MyVid.mp4.

You cannot directly play videos from YouTube, because Google do not display the direct URL of videos from YouTube, so you have to generate a URL to get to the video you want to stream (although I'm not entirely sure if that's legal).