code need help working!
BlitzMax Forums/BlitzMax Beginners Area/code need help working!
| ||
using bmx ng win x64
Import maxgui.drivers
' LibVLC functions...
Global libvlc_new:Byte Ptr (argc:Int, argv:Byte Ptr)
Global libvlc_release (instance:Byte Ptr)
Global libvlc_media_new_path:Byte Ptr (instance:Byte Ptr, path:Byte Ptr)
Global libvlc_media_new_location:Byte Ptr (instance:Byte Ptr, path:Byte Ptr)
Global libvlc_media_release (media:Byte Ptr)
Global libvlc_media_player_new_from_media:Byte Ptr (media:Byte Ptr)
Global libvlc_media_player_set_hwnd (player:Byte Ptr, hwnd:Byte Ptr)
Global libvlc_media_player_play:Int (player:Byte Ptr)
Global libvlc_media_player_stop (player:Byte Ptr)
Global libvlc_media_player_release (player:Byte Ptr)
Global libvlc_set_fullscreen (hwnd:Byte Ptr,winmode:Int)
Local file:String = "http://www.quirksmode.org/html5/videos/big_buck_bunny.mp4"
' Assign functions from DLL...
LoadLib()
Global libvlc:Byte Ptr = LoadLibraryA ("libvlc.dll")
If libvlc
libvlc_new = GetProcAddress (libvlc, "libvlc_new")
libvlc_release = GetProcAddress (libvlc, "libvlc_release")
libvlc_media_new_path = GetProcAddress (libvlc, "libvlc_media_new_path")
libvlc_media_new_location = GetProcAddress (libvlc, "libvlc_media_new_location")
libvlc_media_player_new_from_media = GetProcAddress (libvlc, "libvlc_media_player_new_from_media")
libvlc_media_release = GetProcAddress (libvlc, "libvlc_media_release")
libvlc_media_player_set_hwnd = GetProcAddress (libvlc, "libvlc_media_player_set_hwnd")
libvlc_media_player_play = GetProcAddress (libvlc, "libvlc_media_player_play")
libvlc_media_player_stop = GetProcAddress (libvlc, "libvlc_media_player_stop")
libvlc_media_player_release = GetProcAddress (libvlc, "libvlc_media_player_release")
libvlc_media_player_release = GetProcAddress (libvlc, "libvlc_set_fullscreen")
Local instance:Byte Ptr
Local media:Byte Ptr
Local player:Byte Ptr
' Create VLC instance...
instance = libvlc_new (0, Null)
If instance
' Load media from filename...
media = libvlc_media_new_location (instance, file.ToCString ())
If media
' Create VLC player...
player = libvlc_media_player_new_from_media (media)
If player
' Blitz window...
Local window:TGadget = CreateWindow ("Video Server "+language$+" V"+version$, 320, 200, 640, 480)
If window
' Inner client area of window...
Local hwnd:Byte Ptr = QueryGadget (window, QUERY_HWND_CLIENT)
libvlc_set_fullscreen player,1
' Tell VLC to render into client area...
libvlc_media_player_set_hwnd player, hwnd
' Play!
libvlc_media_player_play player
Repeat
Select WaitEvent ()
Case EVENT_WINDOWCLOSE
Exit
End Select
Forever
' Stop and release VLC player...
If player
libvlc_media_player_stop player
libvlc_media_player_release player
EndIf
EndIf
EndIf
' Release media...
libvlc_media_release media
EndIf
' Release VLC instance...
libvlc_release instance
EndIf
EndIf
Please fix code I don't know how to get full screen function to work. and how do I use something to detect video is done then reload the video - kind of reply video function. |