Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

Embed Code or SWFobject & Stop/rewind button

20 replies [Last post]

Hi

I have read all the info including 'Embedding flash' but I am still unsure.

I am putting a video clip on a webpage, is it saying that in the new IE7 a grey box will appear round my clip that you have to click on unless you use the swfobject, or am I barking up the wrong tree?

If I am why are there two different types of code, how do you know which is best or what to use ?

I also want 'my viewers' to be told if they don't have the correct flash to be able to view it, I found this code on the site...type="application/x-shockwave-flash" pluginspage=
"http://www.macromedia.com/go/getflashplayer"

Is this correct for embeded code ? If yes WHY isn't it in any of the code on the wizard ? It seems to be included on the swfobject code. Sorry I'm dim I just find all this so confusing.

I have eventually got the player nearly how I want it (with the imbed code) the only thing I don't like is there is no 'stop/rewind' button. So if someone wants to restart the video half way through they can't, if they use the scroll bar then it doesn't ever go back to my 'splash page' Unless I am missing something this seems to be a really crazy omission. Since everything else on this player is just so good I'm sure there must be a way to do this ...

Thanks in advance for any help.
Kind regards
Andy :-)

p.s. Who ever does this forum there is no enough length for my web address !!

The best way to put a JW Player in your page is to use JavaScript with SWFObject. The <embed> / <object> code is only used on social networking sites (MySpace, etc.) that don't allow JavaScript.

SWFObject (with the <div>) also takes care of checking for the correct version of the Flash plugin.

Here's sample code for a basic install. I've included quite a few of the flashvars (including some for playlists) so you could see how they are used. If you don't need them, you can remove them or comment them out with double forward slashes "//".

<html>

<head>

  <title>Simple JW Player</title>

  <script type="text/javascript" src="swfobject.js"></script>

  <script type='text/javascript'>
    function createPlayer()
    {
      var s1 = new SWFObject('http://my.domain.com/mediaplayer.swf', 'playlist', '475', '450', '9');
          s1.addParam('allowfullscreen', 'true');
          s1.addVariable('width', '475');
          s1.addVariable('height', '450');
          s1.addVariable('displayheight', '350');
          s1.addVariable('file', 'http://my.domain.com/video.flv');
          s1.addVariable('overstretch', 'true');
          s1.addVariable('showdigits', 'true');
          s1.addVariable('autostart', 'true');
          s1.addVariable('shuffle', 'false');
          s1.addVariable('repeat', 'list');
          s1.addVariable('showicons', 'true');
          s1.addVariable('thumbsinplaylist', 'true');
          s1.addVariable('logo', 'http://my.domain.com/logo.png');
          s1.addVariable('backcolor', '0xFFFFFF');
          s1.addVariable('frontcolor', '0x404040');
          s1.addVariable('lightcolor', '0x0FFFF0');
          s1.write('player');
    };
  </script>

</head>

<body onload="javascript:createPlayer();">

  <div id="player">
    <a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Plugin</a>
    to see this gallery.
  </div>

</body>

</html>

Regarding "stop/rewind" and the hundreds of other options: The players have basic functionality and a JavaScript API that enables users to add the specific functions that they need for their application. Seems every user has something that they think should be in the players, but in my opinion (I'm NOT speaking for Jeroen here), adding all of those capabilities would make the players overly complex and buggy.

Many thanks Will that's just what I wanted to know :d

Trouble is it's taken me 2 days to sort out the code (embed) now I'm back to the 'drawing board'

Oh well at least you've been kind enough to give me a good start !

Thanks
Andy :)

Andy,

The good news is, it was a "learning experience".

Using the SWFObject method, you will be able to do a lot more with the player and help will be easier to get (examples abound on these forums) and best of all, I won't have to dig out old <embed> code that I'm no longer familiar with. :)

Is there a way to make this work with PHP?

Sure, just change the filename from player.html to player.php.

Then if you want to use PHP variables, just give them some value before you load the script and reference them in the script.

Like this:

<?php

$file

= 'http://my.domain.com/video.flv';

<

html>

...

lotsa code...

s1.addVariable('file', <?php echo $file; ?>
');

...lotsa more code...

</html>

?>

Does a site where the video (in my case a FLV) need to have the entire SWFObject script located on its server or somewhere?
In my case I'm hoping to allow visitors to embed my site's videos on their own site. Is it as simple as letting them copy the the html example above (with necessary changes of course) or is there more to it?
Any thoughts are greatly appreciated.

You can use anything from one line of embed code to a full SWFObject with dropdown menu from one line of script. See this thread [url=http://www.jeroenwijering.com/?thread=9166]PLAYER AS EXTERNAL FILE[/url]. Whatever suits our needs.

go to http://skapaid.webs.com
and mail them a comment
they can do it for sure!!!
they can build your full site!

object width="300" height="80"><param name="movie" value="http://media.imeem.com/m/skGM8ygV7f/aus=false/"></param><param name="wmode" value="transparent"></param><embed src="http://media.imeem.com/m/skGM8ygV7f/aus=false/" type="application/x-shockwave-flash" width="300" height="110" wmode="transparent"></embed></object>

Nice information guys.

I am working on a project which requires an <object><embed></embed></object> piece of code that users can highlight and use to embed videos elsewhere.

I can use this type of code with the jw player, but I also need to go through the process of grabbing the first frame of the video and display it instead of a black box.

Is there any way at all that I can implement this functionality while still using the object/embed method of embedding the flash player? Any help would be appreciated...

The object/embed code by itself won't allow you to stop the player soon after it starts. (Forget about the first frame, starting and then stopping the player takes 100s of milliseconds. You'll be lucky ot get the 6th or 8th or 10th frame, depending on how fast the client's computer is.)

If you have to have the first frame and you have to use object/embed code, then you need to extract the first frame on the server (only the first time, after that it's cached) and request it with the image flashvar.

Anybody has any idea how to download the video of IMEEM? Is is possible or not?

pretty good example... however, its not what I was looking for.. ^_^ ...I was in search of nothing and all I found were somethings... its really late here. 0_o I've been up for 101010100111111 days!!! :D What about a working example right next to the plaintext examples.. IDK.. I don't even remember how I got to this site... I have internet amnesia!! =D

that good thank you

<strong><strong><strong><blockquote><blockquote><blockquote><blockquote></blockquote></blockquote></blockquote></blockquote></strong></strong></strong>

ok guys i dont know any of the talk you guys are saying i just downloaded the JW player but how do i get it on my site saddiiope.com

Do You Know A Place Where I Can Test My Embed Codes

i want to know how to start and stop my video on my webpage using Xhtml...because when i open my webpage the video starts by itself and keeps on replaying. thank uuu

hi
i have a school project to make a website and i dont know how to add a video with the
features play ,pause,stop,volume,full screne,fast forward and rewind can anyone pls help me

@kanishk - Our player doesn't have fast forward, or rewind buttons, but it has all of the other features. You can download it here - http://www.longtailvideo.com/players/jw-flv-player/