[Gambas-user] MediaPlayer bug with AboutToFinish and URL?

Benoît Minisini gambas at ...1...
Sun Oct 9 02:54:21 CEST 2016


Le 09/10/2016 à 02:53, Benoît Minisini a écrit :
> Le 09/10/2016 à 01:23, Piper984 a écrit :
>> Hi:I have been playing with the Gambas MediaPlayer and the related Gambas
>> wrappers of GStreamer libs recently hoping that I can find enough
>> functionality in the gb.media libraries to be able to construct my and
>> not
>> have to ever go back to doing my GUIs in C.I have used the Playbin
>> plugin in
>> the past w/ PyGST and also C.  When the video is about done playing an
>> event
>> can fire that lets the hosting application set the URL property to a new
>> video should the app want to play another video at the end of the current
>> video.I am seeing two weird *bugs* w/ the Gambas MediaPlayer.  I
>> looked at
>> the C code
>> herehttps://sourceforge.net/p/gambas/code/HEAD/tree/gambas/trunk/gb.media/src/c_mediaplayer.cand
>>
>> see that for the most part the MediaPlayer is a very slick wrapper of the
>> Playbin element.  So hopefully the issue will be easy to find /
>> correct for
>> someone with some deeper background of the gb.media library.The
>> issues:#1)
>> Even though the "AboutToFinish" event fires successfully, setting the URL
>> makes no effect here, and the "END" event will then fire at the end of
>> the
>> current video. The 'Video_Changed' event does not fire.  If after
>> starting
>> starting a video, I manually change the .URL property (from a button
>> click
>> event) then at the end of the first video I will get a 'Video_Changed'
>> event
>> and the second video will start.  #2) When I am able to get the
>> MediaPlayer
>> to set the .URL property to the second value, and the video does start to
>> play at the end of the first video, the audio plays but the video does
>> not
>> update until I invoke the .Pause() method and even then it's just
>> displays
>> that frame and when I invoke .Play() after  .Pause() the video does not
>> continue but the audio does.  Codec issue?I am using Ubuntu 14.04, Gambas
>> 3.9.0.  GStreamer 1.2.4 (kinda old, but playbin works as I'd expect under
>> Python and C).Here is some of the code:' Gambas class filePublic
>> objMedia1
>> As New MediaPlayer As "MP1"Public Sub Button1_Click()  objMedia1.URL =
>> "file:///home/chris/Desktop/big-buck-bunny_trailer.webm"
>> objMedia1.SetWindow(DrawingArea1, DrawingArea1.X, DrawingArea1.Y,
>> DrawingArea1.Width, DrawingArea1.Height)  objMedia1.Play()EndPublic Sub
>> btnNewURL_Click()  ' invoking this 10-15 seconds into the video clip
>> seems
>> to have the desired effect.  objMedia1.URL =
>> "file:///home/chris/Desktop/sintel_trailer-480p.webm"End Public Sub
>> MP1_End()  Print "Video Ended."EndPublic Sub MP1_AboutToFinish() ' this
>> doesn't have any effect.  objMedia1.URL =
>> "file:///home/chris/Desktop/sintel_trailer-480p.webm"EndPublic Sub
>> MP1_VideoChanged()' This only fires when @ the end of the first video
>> when
>> I've manually set the URL property from a button click.  If I set' the
>> URL
>> property from the _AboutToFinish() event Sub then nothing happens (other
>> then _END firing when video #1 has completed).  Print "Video
>> Changed."EndHopefully that's semi-clear. I hope this is something that
>> can
>> be easily reproduced and fixed!  I really enjoy how productive I can
>> be w/
>> Gambas and now that I've gotten used to doing GUIs and semi-complex
>> application business logic with Gambas I really don't ever want to
>> have to
>> do those in C again.  :)Thanks!Piper
>>
>
> Do you have a more readable version of your mail?
>

And can you post your project too? Or at least the media player part.

-- 
Benoît Minisini




More information about the User mailing list