A closer inspection reveals that both examples fail at LoadMovie() because the Linux version of PB is seemingly not able to read in and initialize MPG or MID files correctly. Although the documentation states that music files like MID are not officially supported:PB help for [url=http://www.purebasic.com/documentation/movie/loadmovie.html][color=#0040FF]LoadMovie()[/color][/url] wrote:Return value
Returns nonzero if the movie was loaded correctly and zero if loading the movie failed (format not supported or file not found). If #PB_Any was used for the #Movie parameter then the generated number is returned on success.
As a further proof I have written the following example code which loads a MPG or AVI file (always comment out one of them) from an internet address and checks every possible error condition. I have tested with PB 5.31 and PB 4.61 on Ubuntu 14.04 x64 with KDE and with PB 5.31 on Lubuntu 14.04 x86 with LXDE and in all cases it was not possible to load the movie successfully with LoadMovie() although in each test it was possible to view the movie using the distribution specific videoplayer by double clicking the movie in the respective file manager. The developer version of libxine (needed for video playback) was installed in both distributions. So it seems indeed that the movie functions in PB's Linux version are broken...PB help for [url=http://www.purebasic.com/documentation/movie/index.html][color=#0040FF]Movie[/color][/url] wrote:Note: on some OS, music files can also played by this library but it is not officially supported and somewhat broken. Better use the sound library for this.
Code: Select all
#VideoURL = "http://home.arcor.de/frogspace/aliensg.mpg"
; #VideoURL = "http://www.onlinewahn.de/mentos.avi"
Define VideoFile.S = GetTemporaryDirectory() + "AlienSong.mpg"
; Define VideoFile.S = GetTemporaryDirectory() + "Mentos.avi"
If InitNetwork() = 0
MessageRequester("Error", "InitNetwork() failed!")
Else
If FileSize(VideoFile) <= 0
If ReceiveHTTPFile(#VideoURL, VideoFile) = 0
MessageRequester("Error", "Download of movie failed!")
EndIf
EndIf
If InitMovie() = 0
MessageRequester("Error", "InitMovie() failed!")
Else
If LoadMovie(0, VideoFile) = 0
MessageRequester("Error", "LoadMovie() failed!")
Else
OpenWindow(0, 100, 100, MovieWidth(0), MovieHeight(0), "Movie")
While WindowEvent() : Wend
PlayMovie(0, WindowID(0))
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
EndIf
EndIf