0

So im trying to work out a way to possibly load a window with maybe VLC or something to play a .m3u8/rtmp stream. (Some streams will also be http://:

But you get the drift. I just basically want to make a very limited and Mini VLC Player inside my Windows VB.NET/.NetFramework app.

I heard about some way of using Flash or JW Player but how?

Thanks!

  • Have you taken a look at http://stackoverflow.com/questions/7382793/does-vlc-media-player-have-a-c-sharp-interface? – rskar Apr 08 '16 at 15:33
  • @rskar I have now but it doesnt look helpful. I just want a quick and dirty way of loading a Player with support for .m3u8/rtmp e.t.c VLC supports it but whenever I try add it with ActiveX it just crashes Visual Studio. –  Apr 08 '16 at 15:37
  • Does it have to be ActiveX, when .NET compatible ways are out there? Google-ing "vb.net vlc plugin" shows a lot of ideas out there, such as https://www.daniweb.com/programming/software-development/threads/479726/trying-to-embed-vlc-in-vb-net-app – rskar Apr 08 '16 at 15:55
  • I have no idea how to use that thing tryna work it out but no idea. I just want some way to just load it in really quickly. –  Apr 08 '16 at 16:10
  • Like is there anyway to use Adobe Flash or sometime? Like just a really Lightweight quick way that supports .m3u/.m3u8 –  Apr 08 '16 at 16:12
  • Or maybe JWplayer as it supports it but how?! –  Apr 08 '16 at 16:18

1 Answers1

0

G'day, I had problems when trying to get live streams myself to work with the VLC plugin, so i ended up using the WindowsMediaPlayer tool.

Here is a basic idea of how i got the streams to work with it. This is for the Australian News live streams.

I did this with a combobox and a few buttons as the mediaplayer that i dragged to my form already has pre configured buttons but of course you can create your own too like i did.

Public Class Form1
Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged

    Select Case ComboBox1.Text
        Case Is = "The Today Show"
            AxWindowsMediaPlayer1.URL = "http://admin.brightcove.com/viewer/us20150514.1307/BrightcoveBootloader.swf?playerID=3050067370001&playerKey=AQ%7E%7E%2CAAAAmtNDn-E%7E%2Ca88FbwlXndgt5aaCZ3_mONsLNdk8RWwF&purl=http%3A%2F%2Fwww.9jumpin.com.au%2Fshow%2Ftoday%2Fvideos%2F2203579080001%2F&%40videoPlayer=2203579080001&autoStart=&bgcolor=%23000000&debuggerID=&dynamicStreaming=true&flashID=BC_43776&height=542&includeAPI=true&isUI=true&isVid=true&originalTemplateReadyHandler=BC_43776_readyCallback&player=%5Bobject+Object%5D&startTime=1439674731737&templateErrorHandler=BC_43776_errorCallback&templateLoadHandler=BC_43776_loadCallback&tem"
        Case Is = "9 News - 6PM - Melbourne"
            AxWindowsMediaPlayer1.URL = "http://admin.brightcove.com/viewer/us20150514.1307/BrightcoveBootloader.swf?playerID=2613830501001&playerKey=AQ%7E%7E%2CAAAAmtNDn-E%7E%2Ca88FbwlXndjkNXs7kVhY8KSUT5PUV5xA&purl=http%3A%2F%2Fwww.9news.com.au%2Fvictoria&%40videoPlayer=3658070243001&autoStart=&bgcolor=%23000000&debuggerID=&dynamicStreaming=true&flashID=BC_13923&height=383&includeAPI=true&isUI=true&isVid=true&originalTemplateReadyHandler=BC_13923_readyCallback&startTime=1439713462826&templateErrorHandler=BC_13923_errorCallback&templateLoadHandler=BC_13923_loadCallback&templateReadyHandler=brightcove%5B%22templateReadyHandlerBC_1392"
        Case Is = "9 News - 6PM - Sydeny"
            AxWindowsMediaPlayer1.URL = "http://admin.brightcove.com/viewer/us20150514.1307/BrightcoveBootloader.swf?playerID=2613830501001&playerKey=AQ%7E%7E%2CAAAAmtNDn-E%7E%2Ca88FbwlXndjkNXs7kVhY8KSUT5PUV5xA&purl=http%3A%2F%2Fwww.9news.com.au%2Fnew-south-wales&%40videoPlayer=3658070232001&autoStart=&bgcolor=%23000000&debuggerID=&dynamicStreaming=true&flashID=BC_8934&height=383&includeAPI=true&isUI=true&isVid=true&originalTemplateReadyHandler=BC_8934_readyCallback&startTime=1439714221245&templateErrorHandler=BC_8934_errorCallback&templateLoadHandler=BC_8934_loadCallback&templateReadyHandler=brightcove%5B%22templateReadyHandlerBC_8"

    End Select

End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    AxWindowsMediaPlayer1.fullScreen = 100
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
    AxWindowsMediaPlayer1.URL = ComboBox1.Text
End Sub
End Class

The hardest part about doing this was scanning the websites for the live stream url's, If you have any problems let me know and I'll do my best to help you out :) Happy Coding!

P.S you might have to add the Windows Media Player Tool to your toolbar, do this by right clicking on a tab within the toolbar and select "Choose Items" after that a new window will open, select "Com Components" and search for "Windows Media Player" and add it.

user1234433222
  • 976
  • 2
  • 10
  • 21
  • Alright looks good! Working and crashing less then VLC and it supports .ts Streams. Testing .m3u8 now. EDIT: .m3u8 files work but theres an issue. Since .m3u8 files use generated 4 second each .ts files to keep up with the stream it, Windows Media Player like ends the video and starts playing the next one with a bit of a delay making it not look smooth at all. Any fix? Heres what I mean: https://youtu.be/b9YA_aYZoMM –  Apr 09 '16 at 05:25
  • Also Loop is enabled. It just stops after 4 seconds if I dont enable loop. –  Apr 09 '16 at 05:43
  • Ok so I went back to using VLC and it seems to work now. It does crash some times but I just save my files before Testing the app and it works. BUT theres a SMALL issue. Whenever the Livestream pauses/buffers (While Fullscreen) it completely freezes VLC. Like it wont go out of fullscreen by double clicking or pressing esc. The only way to get out of it would be to ALT+TAB and close the app completely, reopen and watch again. Obviously for the average user using this app wont know how to do this. Even so its annoying. Any fix? EDIT: If im not in fullscreen when it buffers I cant go fullscreen. –  Apr 09 '16 at 09:47
  • perhaps you can enable multi threading and have the vlc code running from that, so that if it does freeze, you will still have control over your app. – user1234433222 Apr 09 '16 at 15:26
  • Tried that but like the only code I need to run is just to add the Stream to the Playlist and run basically .play to get VLC itself to play the Stream so adding that code to a BackgroundWorker or Delegates wont really do anything unless I can somehow add the whole ActiveX VLC into the BackgroundWorker –  Apr 09 '16 at 20:51