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
hello, I’ve try and follow this tutorial.
I download the source fla file above from the headers and downloaded it to my desktop. I try to edit it inside at videoWindow movie clip and got it at textbox & replace the filename where my sample FLa file from the desktop was save. And yeah it did play but when i try to keep it into one folder and arrange it all the files, the video wont play anymore.
I’m using Flash professional 8 & i doubt something i missed up.
I saw this tutorial video. So i tried to follow this tutorial. When i rich this part of exporting it into html, only the html is present, unlike in the video tutorial there are 2 files on it, Like the .js file.
I tried to open up the html source and i don’t see javascript code either. please help me, I’m a newbie with flash.
@M, It could have something to do with Flash Pro 8. I can’t remember because it was such a long time ago that I used it. All I can suggest is that you learn more about how Flash creates files and such and then maybe you’ll see what the problem is. I hope that helps.