ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Custom fields in xml file for flash video

November 01, 2010 2:31pm

Subscribe [4]
  • #1 / Nov 01, 2010 2:31pm

    illustrationdan

    26 posts

    Im embedding flash video into a page and I want to the user to be able to add video themselves, the current workflow i have is:

    This is the code I have to use to embed into the page:

    [removed]
            // <![CDATA[
                    
            var so = new SWFObject("videos/VPlayer.swf", "flash", "428", "275", "8", "#fff");
            so.addVariable("xml", "videos/settings.xml");
            so.write("flashcontent");
            
            // ]]>
    [removed]

    With the settings.xml like this:

    <settings>
        <!-- path to the flv file -->
        <set name="flv" value="users_uploaded_video_here.flv" >
    Mute|Volume" >
    </settings>

    Is it possible to use a custom entry field in the external xml file like this?:

    <settings>
        <!-- path to the flv file -->
        <set name="flv" value="{custom_field_name}" >
    Mute|Volume" >
    </settings>

    Im not sure how to go about doing this because you cant use a custom field for a variable pair in a different template correct?

    Any help would be appreciated.

  • #2 / Nov 02, 2010 4:20am

    John Henry Donovan

    12339 posts

    illustrationdan,


    If you want it dynamic I would do something like the following.

    {exp:weblog:entries weblog="video" limit="1"}
    [removed]
            // <![CDATA[
                    
            var so = new SWFObject("videos/VPlayer.swf", "flash", "428", "275", "8", "#fff");
            so.addVariable("xml", "videos/settings.xml?flv={custom_field_name}");
            so.write("flashcontent");
            
            // ]]>
    [removed]  
    {/exp:weblog:entries}

    Then in your settings.xml template turn PHP on and set it to parse on Input

    <?php global $IN; ?>
    <settings>
        <!-- path to the flv file -->
        <set name="flv" value="<?=$IN->GBL('flv', 'GET');?>" >
    Mute|Volume" >
    </settings>


    Does that help?

    I am going to move this to the CodeShare Corner where this thread is more appropriate

  • #3 / Nov 05, 2010 1:09pm

    illustrationdan

    26 posts

    Just implemented and works perfectly. Thanks for your help!

  • #4 / Dec 20, 2010 11:59am

    chrcollins

    77 posts

    I have a similar question and it seems to be a recurring theme for me.  I use (EE 2) the flash carousel player flshow and I want my users to select the photos in the carousel.  It uses a xml file to define the location of the images. 

    swfobject.embedSWF("carousel.swf",  // flash file
            "mySlideShowDiv",   // div id
            "622", "319",  // width and height
            "9.0.0",       // flash player version
            false,         // autoinstall 
            {xmlfile:"carousel.xml", loaderColor:"#000000"},  // flashvars
            {bgcolor: "#000000"},  // parameter
            {});                   // attributes

    the xml photo stuff looks like this for now (hard coded images) ...

    /nest/proj/images/art/p0002.jpg</photo>
    /nest/proj/images/art/p0003.jpg</photo>
    ../images/art/p0004.jpg</photo>
    ../images/art/p0005.jpg</photo>
    ../images/art/p0006.jpg</photo>
    ../images/art/p0007.jpg</photo>
    ../images/art/p0008.jpg</photo>

    Any suggestions as how to handle this sort of arrangement?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases