Video Tutorial : using FlashVars with the videoMaru API
January 31st, 2008 . by polyGeekSometimes you don’t know which video you want to play inside of videoMaru. Take the video player below for example. I don’t want to create a different video player for each tutorial I do, because I plan on doing lots of them.
The solution is to use FlashVars to pass a variable into videoMaru and tell it which video to play. Now I have one video player and each instance plays a specific video that I can change via the HTML containing page.
To make things easy you don’t have to write any code to make videoMaru play the video you indicate with FlashVars. It does that automatically.
I’ll also cover how you can pass variables into videoMaru via FlashVars to dynamically change things like the volume on startup through the API.
Here is some information about using the <object>/<embed> tags or SWFobject for FlashVars.
If you have a Wordpress blog and use the Kimili plugin to embed your SWFs then you can use code like this to pass FlashVars.
[kml_flashembed movie="/pgtv/_videoPlayerTemplate.swf" height="480" width="640" fvars="flvAddress=/pgtv/videos/68_flashVars.flv" /]
The code above is what was used to play the video tutorial on this page.







I have a quick question for you concerning the videoMaru.playVideo API call.
Do I need to invoke the videoMaruCreationComplete function before using this call or is this function already called when the play is invoked?
I’m grabbing video files from a database and loading i into an array. Then I call the videoMaruCreationComplete and run the play API call and it works great so far. I’m just wondering if the creation call is needed or not.
Thanks again for this wonderful component.
-Ryan