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

Forums

/

playing video on iframe and loading another video

5 replies [Last post]

Hi. I need some help regarding loading a video on iframe. It works pretty well. However, when I click other video thumbnails while the earlier video is still playing, it won't load the new video until I click the stop button. I've tried it on 2 different machine and also my friend's machine, it is doing the same behavior.

Is there a way to do a javascript code so that when I click on the other video thumbnail, it will send a stop command to the current playing JW player?

Thanks!

Post your player code or a link to your test page so we know where to start with the code.

I found this and it helped me a lot. It's fixed now.

http://home5.inet.tele.dk/nyboe/flash/mediaplayer4/JW_API_xmpl_6-1-0-0.html#

I'm doing this now to call the stop event from the parent document

print "<a href=\"#\" onClick=\"top.frames['fightiframe'].player.sendEvent('STOP');top.frames['fightiframe'].location.href = 'showvideo.php?fightno=$row[fightno]'; return false\"><img src=\"$row[thumbnailpath]/$row[thumbnailfilename]\" alt=\"\" border=\"0\" name=\"$row[fightno]\" width=\"120\" height=\"90\" id=\"vidthumb\" /></a>&nbsp;&nbsp;";

Then on my showvideo.php, I used the same technique mentioned from the link above

function createPlayer() {
var flashvars = {
file:"flv/displayvideo.flv",
autostart:"true"
}

var params = {
allowfullscreen:"true",
allowscriptaccess:"always"
}

var attributes = {
id:"player1",
name:"player1"
}

swfobject.embedSWF("player.swf", "placeholder1", "480", "270", "8", false, flashvars, params, attributes);
}

I have another question, how do I add a background of #000000? And also, I want the bottom control to be color black. Now, it's color gray. How do I make the rectangle color black and the play button, stop button color white?

I read up on implementing skin but the stop button disappeared. So I deleted that solution again.

Thanks,

Neil

To make the background of the Adobe Flash Player black, use the bgcolor parameter:

var params =
{
  allowfullscreen:        'true',
  allowscriptaccess:      'always',
  bgcolor:                '#000000'
}

For the JW FLV Media Player, there are four "color" flashvars that control the color of various elements of the player.

Reference: http://code.jeroenwijering.com/trac/wiki/FlashVars#Colors

var flashvars =
{
  file:                   'flv/displayvideo.flv',
  frontcolor:             'AAAAAA',
  backcolor:              'BBBBBB',
  lightcolor:             'CCCCCC',
  screencolor:            'DDDDDD',
  autostart:              'true'
}

NO "#" or other special characters for the "color" flashvars, just a 6-character hexadecimal number.

That is awesome!!! It worked flawlessly!!!

Thank you so much!!!

dear Neil,
I have a mother-page with other video thumbnail in a IFRAME; my player is in mother-page and
I need to do a javascript code that when I click on the other video thumbnail, it will send a stop command to the current playing JW player?

Please have you a solution??

I try this but don't work
top.document.player0.sendEvent('LOAD', {file:'public/Addante-01.flv', image:'public/preview.jpg'});