WhoKnows
WhoKnows

Reputation: 100

Using Dynamic flashVars with HTML5

Hello all, i have a theoretical question.

With flash you can dynamically load flashvars to a video or audio flashobject. But: I would already have a flash video which loads the flashvars like that. But i want to create html5 code (either audio/video) around it. Can i use the flash vars outside of the element/flash object?

Like loading the flash source (mp3) also to the HTML5 audio element, which surrounds the flash element?

To make it more visual:

Contains a flash object, nested within a HTML5 audio/video element.

Dynamically loads the flashvars & params to the flash object. For example mp3source.

Problem: Can i also load the mp3source flashvar/param to the HTML5 video/audio in some way?

To load the vars i would use htmlgenericcontrols. If someone has an idea about how/if i could create something like this... Please share it! :)

Thanks for the answers!

PS: Some Code (!Not working, just to give you a clue!)

C# Param

var mp3param = new HtmlGenericControl("param");
mp3param.Attributes.Add("name", "thevars");
var thevars= "mp3=" + src;

HTML Output

<audio id="htmlaudio" controls="">
    <source src="thisshouldbetheflashmp3source" type="audio/mpeg">
    <object type="application/x-shockwave-flash" data="audioplayer.swf" width="xx" height="xx" id="flashaudio" style="visibility: visible;">
    <param name="thevars" value="mp3=Theflashmp3sourcethatdoesworkbutshouldalsobeusedinhtmlaudio">
</object>
</audio>

Upvotes: 0

Views: 745

Answers (1)

Tariqulazam
Tariqulazam

Reputation: 4585

Lets assume, this is your object tag

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="400" id="movie_name" align="middle">
    <param name="movie" value="<%=MovieName%>"/>
    <!--[if !IE]>-->
    <object type="application/x-shockwave-flash" data="<%=MovieName%>" width="550" height="400">
        <param name="movie" value="<%=MovieName%>"/>
    <!--<![endif]-->
        <a href="http://www.adobe.com/go/getflash">
            <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player"/>
        </a>
    <!--[if !IE]>-->
    </object>
    <!--<![endif]-->
</object>

You can now create a property in the code behind to grab the data dynamically. Sample code below

public string MovieName{
    get { return "Movie_name.swf"; }
}

Upvotes: 1

Related Questions