Playing Youtube / Flash Videos
This is a simple example on how to play a youtube video from your visual basic project. After reading tutorial after tutorial about how to do this and none of them working i decided to figure this out
you will only need the video id so no need to get the whole url
if you can figure out how to parse the videos ID from a search please let me know how you did that
only problem is it doesnt play VEVO videos which i havent really messed with but im sure thats due to copyright stuff in the youtube tos so i wouldnt recommend doing that but i would like to know how to do that for educational purposes but other then that ... works great
Code:
'This program was coded by : Charlie Stallings
'If you use this code please give me credit for writing this
'If you make any improvements please let me know
'There is one problem i havent been able to figure out
'I can not get it to play videos on VEVO
'if you can figure this out please let me know
Private Sub Command1_Click()
'loads the video
ShockwaveFlash1.LoadMovie 0, "http://www.youtube.com/v/" & Text1.Text & "?version=3"
'plays the video
ShockwaveFlash1.Play
End Sub
Private Sub Command2_Click()
End Sub
Private Sub Text1_Click()
'clears the textbox
Text1.Text = ""
End Sub
Re: Playing Youtube / Flash Videos
Yeah, I found this out from one of your attachments previously posted on the forum. Just a word of warning though, use the above code with flash 10e or earlier, the other versions of flash 10 seem to have problems which, can be talked about in this thread.