How to Redirect from Flash Video to another Website?

  • skyfrance
  • Newbie
  • Newbie
  • skyfrance
  • Posts: 6

Post 3+ Months Ago

Hi All, I need some help in creating a way to create a redirect at the end of a flash movie so that it will be redirected to another website.

Can this be done in Dreamweaver?

I have both, AF2 and AF3. I have tried to do this in AF2 from a video that I saw, and when I open my flash video in AF2 there is only one layer and nothing on the timeline. I don't know if this is because it is compressed or not. But in the video, they show to move the time line to the very end and then add info for a redirect. But, since I only have one layer and the timeline doesn't show anything, I can't do these steps.

Maybe there is some html or java code that I can add to get this to work.

I just don't know where to turn.

Any information, (and I am a bit of a dummy with code etc. so need detail explanations) would be greatly appreciated.

I am working on a Mac. running 10.5 and as stated, I have AF2 and AF3 but would love to be able to do this in Dreamweaver.

Thanks Again,

Mike
  • pascalmagat
  • Born
  • Born
  • pascalmagat
  • Posts: 4
  • Loc: France

Post 3+ Months Ago

Hello,

A player controlled by javascript and voila...
  • skyfrance
  • Newbie
  • Newbie
  • skyfrance
  • Posts: 6

Post 3+ Months Ago

Can you give me an example of a player controlled by javascript? Will it work with Dreamweaver or is it a player that you buy and then use to add the redirect?

Sorry, not knowledgeable with this. If you could share a little more info it would really be appreciated.

Thanks

Mike
  • pascalmagat
  • Born
  • Born
  • pascalmagat
  • Posts: 4
  • Loc: France

Post 3+ Months Ago

and see on our site (gallery)

we use flowplayer, longtailvideo players who are driven by open source javascript

we have solutions for streaming video


Best regards
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

Are you working with an FLV file, or an SWF file ?
  • pascalmagat
  • Born
  • Born
  • pascalmagat
  • Posts: 4
  • Loc: France

Post 3+ Months Ago

the swf is a player but the video can be streamée flv, mpeg4 h264, wmv
  • skyfrance
  • Newbie
  • Newbie
  • skyfrance
  • Posts: 6

Post 3+ Months Ago

I am working with flv.
  • skyfrance
  • Newbie
  • Newbie
  • skyfrance
  • Posts: 6

Post 3+ Months Ago

Pascal,

Thanks for the info, but when I go to your website, well, it is all in French. I apologize because I don't speak or read French.

Mike
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

Hopefully someone can prove me wrong, but I don't believe you can embed navigation to other sites in an FLV. You should be able to use cue points to trigger the player to go to a URL, but the FLV itself only has navigation cue points to go to certain keyframes within the video.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23454
  • Loc: Woodbridge VA

Post 3+ Months Ago

Well first of all you lost me on AF2 and AF3. What is that?

I don't think it's at all possible in Dreamweaver. Even with this Flash Video Player Extension for Dreamweaver, none of the 35 configurable parameters give you that option.

You'd need a Flash authoring tool like, Flash. Normally using Flash, you would add a cuepoint at the end of the FLV when you encode it. If you can't do that, you can create a cuepoint with actionscript. Then using action script you'd set up an event listener for the cuepoint which you could use to load the URL of your external page.

//and Joebert, you are correct on the cuepoints. You can embed both navigation and event cuepoints when encoding the FLV but they are only for the FLV itself.
  • rgoedhart
  • Born
  • Born
  • rgoedhart
  • Posts: 1

Post 3+ Months Ago

Hi All,

i've got the same problem, only i'm a motion-graphic designer and absoultely not a flashprogrammer.

i made a cuepoint but have no idea what for code i must insert.
after the movie is finished to redirect to for example index2.html
but this can not be work with an timer, cause if someone set the pauze it will not work right?

see, this site is only a small part of the video.
http://www.iconicbranding.nl/ichap2/
The official video is 10minutes long.

I have no idea, i've watched all over the internet to find a solution but hopelfully you can help me out..
and show me as file, cause i've got no idea what i'm doiing

Thanks,

Roderick
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23454
  • Loc: Woodbridge VA

Post 3+ Months Ago

I'll try to throw up an example sometime today.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23454
  • Loc: Woodbridge VA

Post 3+ Months Ago

OK, here's how to do this, in both AS3 and AS2

First some basics.
I used Flash CS3 Video Encoder to encode the FLV so I could embed my own cuepoints. What you name them doesn't matter. Just make certain you adjust the action script below to the cuepoint name you choose. In most cases I'll put one at the beginning (as a navigation) and one at the end (as an event). In this case I called the one at the beginning "begin" and the one at the end "finished". Here's a screen shot:
Attachments:
cuepoints.jpg


It's so much easier to create your own cuepoints as you encode your video. Unfortunately, sometimes you are just handed an FLV without cuepoints. Fortunately you can create your own using ActionScript. I've never had to do it that way, but there's plenty of tutorials out there that explain how if you need to.

One last note - remember that your FLV HAS to be imported to the first frame of your timeline. If you can't do that in your movie you'll have to create it in it's own movie and then load that movie into your main one.

Now that I have my FLV encoded with cuepoints added, simply open a new blank Flash file (AS3 or AS2, whichever you prefer) and import your FLV to stage using the FLVPlayback component (requires Flash 8 or higher).

Give your FLVPlayback component whatever instance name you want. In this case I used "my_FLVPlybk" (which you'll see is pretty common if you ever look through tutes.)

If you are working with ActionScript 3, on the same frame as your FLV add this code:
Code: [ Select ]
import fl.video.*;
 
//set up the cuepoint listener
my_FLVPlybk.addEventListener(MetadataEvent.CUE_POINT, cp_listener);
function cp_listener(eventObject:MetadataEvent):void {
    //trace("Elapsed time in seconds: " + my_FLVPlybk.playheadTime);
    //trace("Cue point name is: " + eventObject.info.name);
    //trace("Cue point type is: " + eventObject.info.type);
   
    //listen for the end cuepoint which I named "finished" during encoding
    if (eventObject.info.name == "finished") {
        var URLReq:URLRequest = new URLRequest("http://www.xmission.com/~emailbox/whycat.htm");
        try {
    //here's our redirect
            navigateToURL(URLReq, "_self");
        } catch (e:Error) {
            trace(e);
        }
    }
}
  1. import fl.video.*;
  2.  
  3. //set up the cuepoint listener
  4. my_FLVPlybk.addEventListener(MetadataEvent.CUE_POINT, cp_listener);
  5. function cp_listener(eventObject:MetadataEvent):void {
  6.     //trace("Elapsed time in seconds: " + my_FLVPlybk.playheadTime);
  7.     //trace("Cue point name is: " + eventObject.info.name);
  8.     //trace("Cue point type is: " + eventObject.info.type);
  9.    
  10.     //listen for the end cuepoint which I named "finished" during encoding
  11.     if (eventObject.info.name == "finished") {
  12.         var URLReq:URLRequest = new URLRequest("http://www.xmission.com/~emailbox/whycat.htm");
  13.         try {
  14.     //here's our redirect
  15.             navigateToURL(URLReq, "_self");
  16.         } catch (e:Error) {
  17.             trace(e);
  18.         }
  19.     }
  20. }



If you are working with AS 2 here is your code:
Code: [ Select ]
//to use getURL it has to be in an on or onClipEvent so we use onClipEvent (load)
onClipEvent (load) {
import mx.video.*;
 
//set up the cuepoint listener
var listenerObject1:Object = new Object();
listenerObject1.cuePoint = function(eventObject:Object):Void {
     var cuePtName = eventObject.info.name; //variable for cuepoint name
     //listen for the end cuepoint which I named "finished" during encoding
     if (cuePtName == "finished") {
     //do the redirect
     getURL("http://www.xmission.com/~emailbox/whycat.htm", "_self");
     
     //trace("Elapsed time in seconds: " + my_FLVPlybk.playheadTime);
     //trace("Cue point name is: " + eventObject.info.name);
     //trace("Cue point type is: " + eventObject.info.type);
      }
  };
my_FLVPlybk.addEventListener("cuePoint", listenerObject1);
}
  1. //to use getURL it has to be in an on or onClipEvent so we use onClipEvent (load)
  2. onClipEvent (load) {
  3. import mx.video.*;
  4.  
  5. //set up the cuepoint listener
  6. var listenerObject1:Object = new Object();
  7. listenerObject1.cuePoint = function(eventObject:Object):Void {
  8.      var cuePtName = eventObject.info.name; //variable for cuepoint name
  9.      //listen for the end cuepoint which I named "finished" during encoding
  10.      if (cuePtName == "finished") {
  11.      //do the redirect
  12.      getURL("http://www.xmission.com/~emailbox/whycat.htm", "_self");
  13.      
  14.      //trace("Elapsed time in seconds: " + my_FLVPlybk.playheadTime);
  15.      //trace("Cue point name is: " + eventObject.info.name);
  16.      //trace("Cue point type is: " + eventObject.info.type);
  17.       }
  18.   };
  19. my_FLVPlybk.addEventListener("cuePoint", listenerObject1);
  20. }


I added a few comments to help explain what's going on.

The end result is the same in both cases:
AS 3 example
AS 2 example

(my apologies for the length of the video. It was the shortest one I had available. If you don't want to watch the whole thing just use the slider to scrub near the end - I set it to redirect to a related page on why cats do things).
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

Hey Mark that seems pretty complicated. Do you have a big benefit to using cuepoints over a video complete callback?

I would simply do flvplayback.onComplete = new url...
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23454
  • Loc: Woodbridge VA

Post 3+ Months Ago

Yep, I suppose you could do that as well. I'm just so used to working with cuepoints now, that it's almost second nature. I do a lot of multimedia in house at work, and need the navigation. I've actually never had a need to redirect to a new page at the end, but it was pretty simple. One cool thing I discovered today while I was doing a little looking around is that you can add a URL as a parameter during encoding so you can actually make your FLV into a hyperlink. I'd seen that done, but it never occurred to me to look into how.

So to answer Joeberts question above, yes you can
joebert wrote:
Hopefully someone can prove me wrong, but I don't believe you can embed navigation to other sites in an FLV.
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

Makes sense. I just didn't want to be left out of the cool club :-) The one distinct benefit to your solution is that each flv has the potential redirect to its own page, where as mine would always go to the same page regardless of the flv played.

Post Information

  • Total Posts in this topic: 16 posts
  • Users browsing this forum: No registered users and 4 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.