Sample project attached. Works fine on MacOS, but not on Windows 11, tested on two different systems.
Can anyone confirm? Anyone know any workarounds?
MoviePlayerStop.zip (5.0 KB)
Sample project attached. Works fine on MacOS, but not on Windows 11, tested on two different systems.
Can anyone confirm? Anyone know any workarounds?
MoviePlayerStop.zip (5.0 KB)
Here is the workaround I came up with. It’s an absolute hack, and I hate it. But it works.
Public Sub ForceStop(MoviePlayer as DesktopMoviePlayer)
#If TargetWindows Then
if MoviePlayer.Position = 0 then Return //It's already stopped.
var bs as BinaryStream, data as MemoryBlock, f as FolderItem = SpecialFolder.Temporary.Child("empty.wav")
data = DecodeBase64("UklGRiQAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQAAAAA=")
bs = BinaryStream.Create(f, True)
If bs <> Nil Then
bs.Write(data)
bs.Close
end if
MoviePlayer.Movie = Movie.Open (f)
f.Remove
#Else
MoviePlayer.Stop
#EndIf
End Sub
Change the Stop button Action event to the below code.
MoviePlayer1.Position = MoviePlayer1.Duration
MoviePlayer1.Stop
Windows 11; Xojo 2024r2.21
or this works at my Windows 11 and Xojo 2024r1.1
MoviePlayer1.Stop
MoviePlayer1.Movie = New Movie
or
MoviePlayer1.Movie = New Movie
MoviePlayer1.Stop
seems it belongs the Movie.OpenURL, please add a issue
Thanks guys. I opened an issue for it. It seems that .Stop is actually calling Pause in the Windows Media Player API, and since WMP can’t pause some files, it just does nothing.
Why it wouldn’t be able to pause a flat aac/m4a file, I have no idea.
The current behavior is less that desirable both for obvious reasons but also because once the file has been downloaded, it should remain cached if you need to play it again. Loading another file discards the downloaded file from memory and it will need to be retrieved again if it is to be played. You can of course download it yourself with a UrlConnection but then you have to wait for the download before you begin playback.
It can if the file is local to your computer, but not if the file is streamed from a URL, which I believe yours is.