Flash Player Frustration! Options
tkahn
Posted: Friday, September 28, 2007 2:51:09 PM

Rank: Fanatic

Joined: 11/24/2006
Posts: 323
Location: Stockholm, Sweden
This is very cool!
I'm looking for a way to present several images/banners in a single layout space on my page and found this (flashImageRotator).

I have some questions though:

1) If I want to fetch the images that are loaded into the rotator directly from a folder in the Umbraco media library, would that be possible? Let's say that I define a certain folder in the media library. Then I would like the image rotator to automatically load the images in that folder and rotate them.

2) If I want more transitions (for example "wipe left" and "wipe right") would that be possible to add? I'm guessing not without having the .fla-file and knowing how to modify it, right?

3) If I wanted to add a link to each image (thus making them more like banners) - would that be possible to add?

For now I'll just see if I can get it to work as-it-is and think about modifications later. I'd love some feedback on my questions though!





Web Developer at Kärnhuset - http://www.karnhuset.net - Stockholm, Sweden
tkahn
Posted: Friday, September 28, 2007 3:26:33 PM

Rank: Fanatic

Joined: 11/24/2006
Posts: 323
Location: Stockholm, Sweden
Okay - now I see that it's possible to add a link to an image, but the really cool thing would be if I could make the player look for images inside a certain media folder and generate an XML-playlist on-the-fly out of them. I'm thinking that you'd have to create a certain media type that would contain all the info that the image rotator needs:

Code:

<track>
<title>Grass by Night</title>
<creator>Jeroen Wijering</creator>
<location>/data/FlashImageRotator/image1.jpg</location>
<info>http://www.jeroenwijering.com</info>
</track>


Where would I start? :)

Web Developer at Kärnhuset - http://www.karnhuset.net - Stockholm, Sweden
tkahn
Posted: Friday, September 28, 2007 4:12:53 PM

Rank: Fanatic

Joined: 11/24/2006
Posts: 323
Location: Stockholm, Sweden
Here's what I'm going to try:

1) Create a template that looks like this:
Code:

<playlist version="1" xmlns="http://xspf.org/ns/0/">
    <trackList>
    
    </trackList>
</playlist>


2) Between the trackList-tags I will place a macro that, using XSLT and for-each, will fetch all the objects in a certain media folder and generate the correct XML-code. The objects will have all the necessary parameters to generate the XML.

3) Instead of passing "playlist.xml" as a paramter to the image rotator, I will give it the URL to an Umbraco page based on the template above.

In theory this should work, but I'm not finished yet. I'll keep you posted!

I know - it's not the most elegant way to solve the problem, but it's what I could come up with on my own. I'd love it if anyone had a more elegant solution. :)

Web Developer at Kärnhuset - http://www.karnhuset.net - Stockholm, Sweden
jHodgkinson
Posted: Friday, September 28, 2007 4:19:16 PM
Rank: Fanatic

Joined: 3/15/2007
Posts: 378
Location: Cary, NC USA
Thomas - that sounds like a good start. According to the documentation (http://www.jeroenwijering.com/extras/readme.html#flashvars), the image rotator can only handle a playlist reference so I think you are on to something:

Quote:
file* (url): The location of the file to play. It can be a single file (MP3/FLV/RTMP/JPG/SWF/PNG/GIF) or a playlist for the players. The rotator only accepts playlists.


Definitely keep us posted on how this turns out... If I have time later on, I'll take a crack at this as well... cool idea. thx!
jHodgkinson
Posted: Friday, September 28, 2007 4:40:03 PM
Rank: Fanatic

Joined: 3/15/2007
Posts: 378
Location: Cary, NC USA
Thomas - I think that should work. I just did a quick test and it appears to work via the templates, ie:

-added XML template with following static playlist info:

Code:


<?xml version="1.0" encoding="UTF-8"?>

<playlist version="1" xmlns="http://xspf.org/ns/0/">
    <trackList>

        <track>
            <title>Grass by Night</title>
            <creator>Jeroen Wijering</creator>
            <location>/data/FlashImageRotator/image1.jpg</location>
            <info>http://www.jeroenwijering.com</info>
        </track>

        <track>
            <title>At the Sidewalk</title>
            <creator>Jeroen Wijering</creator>
            <location>/data/FlashImageRotator/image2.jpg</location>
            <info>http://www.jeroenwijering.com</info>
        </track>

        <track>
            <title>Tio Pepe Madrid</title>
            <creator>Jeroen Wijering</creator>
            <location>/data/FlashImageRotator/image3.jpg</location>
            <info>http://www.jeroenwijering.com</info>
        </track>

    </trackList>
</playlist>



-referenced the template through the file flashvar attribute:

Code:


file=/media/image-rotator/XML.aspx



-below is the rendered flash var reference:

Code:


obj_rotate1.addVariable("file","/media/image-rotator/XML.aspx");
                


I wasn't sure if it would work or not since the file did have an .xml extension but it appears to as long as the file reference contains valid xml playlist data. way cool idea! please let us know how your code turns out...
jHodgkinson
Posted: Friday, September 28, 2007 5:06:41 PM
Rank: Fanatic

Joined: 3/15/2007
Posts: 378
Location: Cary, NC USA
Thomas:

In regards to your other questions:

Quote:


2) If I want more transitions (for example "wipe left" and "wipe right" would that be possible to add? I'm guessing not without having the .fla-file and knowing how to modify it, right?

3) If I wanted to add a link to each image (thus making them more like banners) - would that be possible to add?



2. You can get the full project source from here: http://www.jeroenwijering.com/?item=Flash_Image_Rotator

3. there is an info property that can be set on each track item, this will be the clickable link, ie:

Code:


<track>
  <title>Banner 1 Sample</title>
  <creator>Bob's Banner Shop</creator>
  <location>/media/365461/banner1.jpg</location>
  <info>http://www.BobsBannerShack.com/index.aspx</info>
</track>

tkahn
Posted: Tuesday, October 02, 2007 9:25:31 AM

Rank: Fanatic

Joined: 11/24/2006
Posts: 323
Location: Stockholm, Sweden
Now I have it working!
I did just like I described it, except I used Lefteris Multiple Media Picker to decide which banners to show, so the XSLT-script loops through the objects selected with the Multiple Media Picker.

One funny side effect is that the XML-playlist has the:

Code:
<title></title>


...tag and when rendered in an ASPX/HMTL page the browser thinks it's the HTML-tag. It doesn't matter though since the page is not ment to be displayed in a browser window.



Web Developer at Kärnhuset - http://www.karnhuset.net - Stockholm, Sweden
hieutc
Posted: Friday, December 28, 2007 8:51:03 AM
Rank: Newbie

Joined: 12/28/2007
Posts: 1
Hi,

Could you send me one copy of this to hieutc (at) gmail (dot) com

I need to play a bundle of the flv file.

BTW, Can we put subtitle together with a flv movie?

Regards,
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.