How to get media infos?

Moderator: Moderator Group

How to get media infos?

Postby claude.rivet » Mon Jun 24, 2013 9:10 pm

I made a script that let me toggle between any number of videos seamlessly using CustomScriptButtons. The script basically uses two variables that let it toggle between two video channels. It loads the media referenced by the CustomScriptButton on one of the two devices and fade it in while fading out the other device and then resetting it. The problem I have is I cannot find a way to get the media duration to automatically fade out the media when it's done playing, right now if the media duration is over it freezes on the last frame and stays on it.

My solution was to get the media duration assign it to a variable and WDWait,mediaduration before fading out the corresponding device. However I cannot figure how to get this info.

At the very least I would be happy with a way to get the media to NOT freeze on the last frame and just end.

I hope I make sense, been programming for a while and my skull is numb :)

Thanks!
claude.rivet
 
Posts: 67
Joined: Tue Aug 07, 2012 5:40 pm

Re: How to get media infos?

Postby claude.rivet » Mon Jun 24, 2013 10:21 pm

Only workaround I found so far was to make an "all off" CustomScriptButton that fades both devices out and then reset them and click it when I see the video is over but it's not elegant, I'd rather have the functionallity imbeded in the CustomScriptButton referencing the video.
claude.rivet
 
Posts: 67
Joined: Tue Aug 07, 2012 5:40 pm

Re: How to get media infos?

Postby Dennis Kuypers » Tue Jun 25, 2013 12:50 pm

Hello,

The Widget Designer does not give you the possibility to query for media length. There is however a function callable through Pandoras Automation:
Code: Select all
AutoGetMediaInfo1(index As Integer,  MediaInfo As MediaType1)
That means that you can request it with a custom application or on a Pandoras Box webpage. WD is capable of doing so, but it is not yet implemented. I add it to the wishlist.

The workaround is to have multiple CustomScriptButtons and manually add a WDWait with the length of the clip to each button. You can also have a WDWaitCancelAll in each button to make sure no other buttons will mess around with the layers if you switch media before one has ended.

Best regards
Dennis
Dennis Kuypers
(former Product Developer, Software)
Dennis Kuypers
coolux Germany
 
Posts: 771
Joined: Thu Jul 05, 2012 12:18 pm

Re: How to get media infos?

Postby claude.rivet » Fri Jun 28, 2013 3:01 pm

Thank you for the answer! I was affraid it was not possible straight from WD and its the case but indeed there are a few workarounds, at least I will stop trying stuff :)
claude.rivet
 
Posts: 67
Joined: Tue Aug 07, 2012 5:40 pm


Return to Widget Designer V4.7

Who is online

Users browsing this forum: No registered users and 22 guests