Can someone please confirm this weird behaviour in gb.media?
Posted
#1
(In Topic #1031)
Regular

Code (gambas)
- myPlayer.SetWindow(DrawingArea1)
- myPlayer.URL = Media.URL("/home/user/first_vid.mp4")
- myPlayer.Play()
- ' myPlayer.Seek(...) ' Use this to save time if your video is long
- 'This code to launch second video only works if the previous video was not let to reach the end.
- myPlayer.URL = Media.URL("/home/user/second_vid.mp4")
- myPlayer.Play()
2) I also tried another aproach. I would expect this to second code to play two files one after the other. Unfortunately the playback stops at the end of the first video:
Posted
Regular

With this code I can loop once. But that's it. And it's not very reliable as the event won't fire if I used seek to get near the end of the video. Anyway for the second looping of the video it will freeze and I loose control for myPlayer nomatter what.
Posted
Guru

Also there is the myPlayer_End() event that fires when playback ends.
you can unload/reload media with that.
check out the MediaView source to see how Benoit does it…
comp/src/gb.media.form/.src · master · Gambas / gambas · GitLab
Posted
Guru

Posted
Regular

For me your code works: when the first video reached the end, by clicking on DrawingArea the second video starts regularly.JumpyVB said
1) When video playback reaches the end, I loose normal access to my instance of the MediaPlayer class.Code (gambas)
myPlayer.SetWindow(DrawingArea1) myPlayer.URL = Media.URL("/home/user/first_vid.mp4") myPlayer.Play() 'This code to launch second video only works if the previous video was not let to reach the end. myPlayer.URL = Media.URL("/home/user/second_vid.mp4") myPlayer.Play()
(I use QT graphic Component)
Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Posted
Regular

vuott said
For me your code works: when the first video reached the end, by clicking on DrawingArea the second video starts regularly. (I use QT graphic Component)
Thank you for trying and reporting back. The problem must be related to the video files then.
I tried this again on my computer by making a new QT application but the behaviour is the same: myPlayer will simply stop responding to any attemps to load a new video file once the first video file has reached the end. I tried this in two different operating systems Linux Mint Cinnamon and EndeavourOs (with two different desktop environments Cinnamon and Plasma).
Then I tried random webm files downloaded from the internet. And they seem to work just fine without crashing at the end. I wonder what I could do next? The problem is present with all my home videos recorded using different android phones over the years (*.mp4 files) and a canon digital camera aswell (*.mov files). This might not be a Gambas issue but a GStreamer issue (although I have latest version on EdevourOS). Is there an alternative to gb.media in Gambas3 for showing video files?
Posted
Guru

JumpyVB said
Is there an alternative to gb.media in Gambas3 for showing video files?
Only a MovieBox (gb.gui) but no sound.
Posted
Guru

maybe your MediaPlayer code is wrong somewhere.
Try MediaView instead of MediaPlayer and see if that works?
If it does work then study differences as to why Benoits MediaView works and your code does not.
Posted
Regular

You can see these pages of italian forum wiki:JumpyVB said
Is there an alternative to gb.media in Gambas3 for showing video files?
Eseguire un file video mediante l'oggetto MediaView del componente gb.media.form - Gambas-it.org - Wikipedia
Riproduzione standard dei file video con le funzioni esterne di GStreamer - Gambas-it.org - Wikipedia
Eseguire i file video con le funzioni esterne del API di VLC - Gambas-it.org - Wikipedia
Eseguire un file Video con le funzioni esterne del API di Libmpv - Gambas-it.org - Wikipedia
https://www.gambas-it.org/wiki/index.php/Eseguire_un_file_Video_mediante_il_Metodo_.Open()_della_Classe_Desktop
Eseguire un file Video con il codice HTML - Gambas-it.org - Wikipedia
Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Posted
Regular

However new questions arose: https://forum.gambas.one/viewtopic.php?t=1530
1 guest and 0 members have just viewed this.


