A lot of work.
Thank you very much!
At the first try of the example, I saw nothing.
Then I noticed, that vlc_loadlibvlc() returns nothing.
So I modified it a bit:
Code: Select all
Procedure.i vlc_loadlibvlc(libvlcpath.s)
	Protected cd.s = GetCurrentDirectory()
	SetCurrentDirectory(GetPathPart(libvlcpath))
	vlc_libisloaded = libvlc_loadapi(OpenLibrary(#PB_Any, GetFilePart(libvlcpath)))
	SetCurrentDirectory(cd)
	
	ProcedureReturn vlc_libisloaded 
	
EndProcedure
And modified the example:
Code: Select all
IncludeFile "vlc.pb"
CompilerIf Not #PB_Compiler_Thread
  CompilerError "You have to enable thread save!"
CompilerEndIf
If vlc_loadlibvlc("C:\Program Files\VideoLAN\VLC\libvlc.dll") ; select vlc dll
  OpenWindow(0, 0, 0, 800, 700, "")
  CanvasGadget(1, 0, 0, 800, 700)
  vlc = vlc_createplayer(GadgetID(1), #True)
  vlc_setvolume(vlc, 80)
  ; vlc_play(vlc,"https://www.youtube.com/watch?v=sOlP10fDclE&ab_channel=ClassicMrBean") ; not work for youtube video
  vlc_addplaylist(vlc,"https://www.youtube.com/watch?v=sOlP10fDclE&ab_channel=ClassicMrBean")
  vlc_playplaylist(vlc)
  While WaitWindowEvent() <> #PB_Event_CloseWindow
  Wend
  vlc_freeplayer(vlc)
Else
  Debug "Was not able to load libvlc.dll"
EndIf
So I was able to see that the dll was not loaded, but the path was correct.
Then I remebered that I used PB x86. So the dll was not usable.
I started it with PB x64 and ...
it worked.
Btw.: the CompilerIf should be placed in vlc.pb, which should be a vlc.pbi  
Oh and you should use
Code: Select all
CompilerIf #PB_Compiler_IsMainFile
  EnableExplicit
CompilerEndIf
In your files, else you 'force' a user to use EnableExplicit.  
