MediaView question

Post

Posted
Rating:
#1 (In Topic #1457)
Avatar
Administrator
sholzy is in the usergroup ‘unknown’
I've had a lot of extra time on my hands this past week so I've had time to work on some of my coding projects (Gambas and Android). The project I've been struggling with the most is using the MediaView. This project is the first time using MediaView and has been the most challenging for me.

My project is a front end viewer for my security camera feeds. Some of my cameras are set to self maintain (reboot) at certain times which stops the video feed. I haven't been able to figure out how to "watch" the stream to know when the video feed has stopped. Currently I just hit a "refresh" button to restart the feed. I could hard code in the times to restart the video when the cameras come back online, but the program pulls from a db as to which video feed goes to which MediaView display (there can be up to 6 displays available). I would like for the program to be able to automatically restart the feed  on it's own when the feed stops.

I've seen the MediaView.State, but that started on 3.19 and I'm still on 3.18 with no way to update yet. I've seen in a post awhile back about using MediaView.Status, but I don't see anything like that for a Media.View.

Any suggestions or ideas short of hard coding in the times?

Thanks!

sholzy
Gambas One Site Director

To report bugs in the Gambas IDE:
Official Gambas Bug Tracker
Online now: No Back to the top

Post

Posted
Rating:
#2
Banned
MediaView can be limited.

Does MediaView_AboutToFinish() event not trigger?

I would suggest for any advanced usage import the MediaView component files from the latest gb.media.form source and remove built in gb.media.form from the properties.
comp/src/gb.media.form/.src · master · Gambas / gambas · GitLab
(you do not need FTest.class / FTest.form)

Then edit/modify at will.

there can be many advantages to importing components.
at least you can have the .State property if you import the latest version :)

At best you can add your own events/methods :)
Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Administrator
gbWilly is in the usergroup ‘unknown’
gbWilly leads the usergroup ‘GambOS Contributor’
gbWilly is in the usergroup ‘Blogger’

sholzy said

I've seen the MediaView.State, but that started on 3.19 and I'm still on 3.18 with no way to update yet.
Thanks!
What mysterious system are you running that you can't update?
If it is debian, try my local file repo's and select whatever version you wanna stick to for now.
3.19.6 is one of the options…

gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories


… there is always a Catch if things go wrong!
Online now: No Back to the top

Post

Posted
Rating:
#4
Avatar
Administrator
sholzy is in the usergroup ‘unknown’

BruceSteers said

MediaView can be limited.

Does MediaView_AboutToFinish() event not trigger?

I haven't tried the _AboutToFinish() event since my thinking is it would need to know the total length of the video in order to trigger near the end of the video.


BruceSteers said

I would suggest for any advanced usage import the MediaView component files from the latest gb.media.form source and remove built in gb.media.form from the properties.
comp/src/gb.media.form/.src · master · Gambas / gambas · GitLab
(you do not need FTest.class / FTest.form)

Then edit/modify at will.

there can be many advantages to importing components.
at least you can have the .State property if you import the latest version :)

At best you can add your own events/methods :)

I never knew I could do something like that. I'll have to look into that. Do I import it directly into my project, or into my Gambas install? Being able to have .State would be perfect.

My only other option would be to add fields to the db to be able to set "refresh" times for each camera. (a kludge)

sholzy
Gambas One Site Director

To report bugs in the Gambas IDE:
Official Gambas Bug Tracker
Online now: No Back to the top

Post

Posted
Rating:
#5
Avatar
Administrator
sholzy is in the usergroup ‘unknown’

gbWilly said

sholzy said

I've seen the MediaView.State, but that started on 3.19 and I'm still on 3.18 with no way to update yet.
Thanks!
What mysterious system are you running that you can't update?
If it is debian, try my local file repo's and select whatever version you wanna stick to for now.
3.19.6 is one of the options…

Ha! I was just thinking about those when your post popped up!

sholzy
Gambas One Site Director

To report bugs in the Gambas IDE:
Official Gambas Bug Tracker
Online now: No Back to the top

Post

Posted
Rating:
#6
Avatar
Administrator
gbWilly is in the usergroup ‘unknown’
gbWilly leads the usergroup ‘GambOS Contributor’
gbWilly is in the usergroup ‘Blogger’

sholzy said

Ha! I was just thinking about those when your post popped up!
I'm currently building the renewed 3.20.2 binaries, so by end of tomorrow I might have all tested and published.
But all before 3.20.2 recipes and repo's have been renewed.

Matter of extracting archive and excuting script and it is installed.
Hint: Use some common place (like /usr/share/<some dir> to unpack)

gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories


… there is always a Catch if things go wrong!
Online now: No Back to the top

Post

Posted
Rating:
#7
Banned

sholzy said

BruceSteers said

MediaView can be limited.

Does MediaView_AboutToFinish() event not trigger?

I haven't tried the _AboutToFinish() event since my thinking is it would need to know the total length of the video in order to trigger near the end of the video.


BruceSteers said

I would suggest for any advanced usage import the MediaView component files from the latest gb.media.form source and remove built in gb.media.form from the properties.
comp/src/gb.media.form/.src · master · Gambas / gambas · GitLab
(you do not need FTest.class / FTest.form)

Then edit/modify at will.

there can be many advantages to importing components.
at least you can have the .State property if you import the latest version :)

At best you can add your own events/methods :)

I never knew I could do something like that. I'll have to look into that. Do I import it directly into my project, or into my Gambas install? Being able to have .State would be perfect.

My only other option would be to add fields to the db to be able to set "refresh" times for each camera. (a kludge)

Either put the files directly in you projects .src folder or in their own folder (in .src/)
Ie. yes it's project independent and does not effect your main gambas installation.
Online now: No Back to the top

Post

Posted
Rating:
#8
Banned
Here's an example…

It's a project with it's own MediaView (latest version) that fires End and Stop events..

you'll have to use diff or meld to see the additions i made.

To test it, use the IDE and set your own URL in the MediaView

It mostly involves adding the Events and a _RaiseEvent(sName) method to MediaView.class

Then from FMediaPlayer.class I can use something like the following to trigger the event..

Code (gambas)

  1. GetParent()._RaiseEvent("End")
  2.  

Attachment
Online now: No Back to the top

Post

Posted
Rating:
#9
Avatar
Administrator
sholzy is in the usergroup ‘unknown’

BruceSteers said

Either put the files directly in you projects .src folder or in their own folder (in .src/)
Ie. yes it's project independent and does not effect your main gambas installation.

That's easy enough, thanks!


BruceSteers said

Here's an example…

It's a project with it's own MediaView (latest version) that fires End and Stop events..

you'll have to use diff or meld to see the additions i made.

To test it, use the IDE and set your own URL in the MediaView

It mostly involves adding the Events and a _RaiseEvent(sName) method to MediaView.class

Then from FMediaPlayer.class I can use something like the following to trigger the event..

Code (gambas)

  1. GetParent()._RaiseEvent("End")
  2.  

I'll try this out when I get some more free time.

sholzy
Gambas One Site Director

To report bugs in the Gambas IDE:
Official Gambas Bug Tracker
Online now: No Back to the top
1 guest and 0 members have just viewed this.