Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Flash works in Firefox not IE
Old 03-15-2009, 06:25 AM Flash works in Firefox not IE
Junior Talker

Posts: 2
Trades: 0
Hi there i have a flash player from LongTailVideo

Im using it inside of a Javascript (.js) with a swfobject (.js)

then the div code to place it on the .php website.

But the thing is only Firefox seems to show the player while IE doesnt want to show the player of course i have tired reinstalling the Flash player but didnt work so im guessing there is something wrong in the .js file.

Also is there a way to add the WMV to this player? i have tried to add it into it but it wouldnt work.

Below is my code for the video player swf.
(it's using a drop down menu to select each XML playlist)

Quote:
var player = null;
var playlist = null;
var original_playlist = null;
var newPlaylist = true;
var multiple = false;
var multipleLocations = [];
var currentML = -1;
var currentItem = -1;


function playerReady(obj)
{
player = gid(obj.id);
player.addModelListener('STATE', 'stateMonitor');
player.addViewListener('ITEM', 'itemMonitor');
player.addControllerListener('PLAYLIST', 'playlistMonitor');
};


function stateMonitor(obj)
{
if(obj.newstate == 'COMPLETED')
{
if(multiple == true)
{
currentML++;

if(currentML > multipleLocations.length)
{
// reset multiple flag
multiple = false;
}
else

{
// load the playlist with location + currentML as the location
playlist[currentItem]['file'] = multipleLocations['location' + currentML];
playlist[currentItem]['description'] = multipleLocations['subtitle' + currentML];
player.sendEvent('LOAD', playlist);






player.sendEvent('PLAY', 'true');
}

}

if((multiple == false) && (currentItem + 1 < playlist.length))
{
// advance to the next track
setTimeout("player.sendEvent('ITEM', currentItem + 1)", 100);
}
}
};


function itemMonitor(obj)
{
if(currentItem != obj.index)
{
// reset multiple locations counter
currentML = 0;
count = 0;

//...reload the original playlist here so a selection of another track will play the original location
newPlaylist = false;
player.sendEvent('LOAD', original_playlist);

// check track for multiple locations
for(j in playlist[obj.index])
{
if(j.match('location') == 'location')
{
// store in multipleLocations object
multipleLocations[j] = playlist[obj.index][j];
// reset multiple locations flag
multiple = true;
count++;
}
else if(j.match('subtitle') == 'subtitle')
{
// store in multipleLocations object
multipleLocations[j] = playlist[obj.index][j];
}
}
multipleLocations['length'] = count;
}
currentItem = obj.index;
};


function playlistMonitor(obj)
{
// load the playlist once
if(newPlaylist)
{
playlist = player.getPlaylist();
original_playlist = player.getPlaylist();
newPlaylist = false;
multiple = false;
multipleLocations = [];
currentML = -1;
currentItem = -1;

if(flashvars.autostart == 'true')
{
player.sendEvent('ITEM', 0);
player.sendEvent('PLAY', 'true');
}
else
{
player.sendEvent('ITEM', 0);
player.sendEvent('PLAY', 'false');
// change the next line to 'true' to enable autostart on new playlist load
flashvars.autostart = 'false';
}
}
};


function gid(name)
{
return document.getElementById(name);
};

var flashvars =

{
//file: '/xml/Welcome.xml',
file: '/xml/Welcome.xml',
playlist: 'right',
playlistsize: '250',
shuffle: 'false',
repeat: 'false',
stretching: 'exactfit',
volume: '100',
autostart: 'true'
};

var params =
{
allowfullscreen: 'true',
allowscriptaccess: 'always',
wmode: 'transparent',

};

var attributes =
{
id: 'playerId',
name: 'playerId'
};

swfobject.embedSWF('/files/player.swf?skin=/files/skins/snel.swf', 'player', '920', '385', '9.0.124', false, flashvars, params, attributes);
Thank You for reading! and Thank You for the help!
Dragon25 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-16-2009, 04:43 AM Re: Flash works in Firefox not IE
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Which .js file is first in the source code?
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-17-2009, 08:51 AM Re: Flash works in Firefox not IE
Junior Talker

Posts: 2
Trades: 0
I have changed my .js file and now it displays in both FireFox and Internet Explorer but even so, I have a issue in Internet Explorer now.

Here's my currently updated .js file

Quote:
var player = null;
var playlist = null;
var original_playlist = null;
var newPlaylist = true;
var multiple = false;
var multipleLocations = [];
var currentML = -1;
var currentItem = -1;


function playerReady(obj)
{
player = gid(obj.id);
player.addModelListener('STATE', 'stateMonitor');
player.addViewListener('ITEM', 'itemMonitor');
player.addControllerListener('PLAYLIST', 'playlistMonitor');
};


function stateMonitor(obj)
{
if(obj.newstate == 'COMPLETED')
{
if(multiple == true)
{
currentML++;

if(currentML > multipleLocations.length)
{
// reset multiple flag
multiple = false;
}
else

{
// load the playlist with location + currentML as the location
playlist[currentItem]['file'] = multipleLocations['location' + currentML];
playlist[currentItem]['description'] = multipleLocations['subtitle' + currentML];
player.sendEvent('LOAD', playlist);






player.sendEvent('PLAY', 'true');
}

}

if((multiple == false) && (currentItem + 1 < playlist.length))
{
// advance to the next track
setTimeout("player.sendEvent('ITEM', currentItem + 1)", 100);
}
}
};


function itemMonitor(obj)
{
if(currentItem != obj.index)
{
// reset multiple locations counter
currentML = 0;
count = 0;

//...reload the original playlist here so a selection of another track will play the original location
newPlaylist = false;
player.sendEvent('LOAD', original_playlist);

// check track for multiple locations
for(j in playlist[obj.index])
{
if(j.match('location') == 'location')
{
// store in multipleLocations object
multipleLocations[j] = playlist[obj.index][j];
// reset multiple locations flag
multiple = true;
count++;
}
else if(j.match('subtitle') == 'subtitle')
{
// store in multipleLocations object
multipleLocations[j] = playlist[obj.index][j];
}
}
multipleLocations['length'] = count;
}
currentItem = obj.index;
};


function playlistMonitor(obj)
{
// load the playlist once
if(newPlaylist)
{
playlist = player.getPlaylist();
original_playlist = player.getPlaylist();
newPlaylist = false;
multiple = false;
multipleLocations = [];
currentML = -1;
currentItem = -1;

if(flashvars.autostart == 'true')
{
player.sendEvent('ITEM', 0);
player.sendEvent('PLAY', 'true');
}
else
{
player.sendEvent('ITEM', 0);
player.sendEvent('PLAY', 'false');
// change the next line to 'true' to enable autostart on new playlist load
flashvars.autostart = 'false';
}
}
};


function gid(name)
{
return document.getElementById(name);
};

var fo = new FlashObject("/files/player.swf?skin=/files/skins/snel.swf", "player", "916", "385", "9.0.124", "#FFFFFF");
fo.addVariable("file", "/xml/Welcome.xml");
fo.addVariable("playlist", "right");
fo.addVariable("playlistsize", "250");
fo.addVariable("shuffle", "false");
fo.addVariable("repeat", "false");
fo.addVariable("stretching", "exactfit");
fo.addVariable("volume", "100");
fo.addVariable("autostart", "true");
fo.addParam("allowScriptAccess", "always");
fo.addParam("allowfullscreen", "true");
fo.addParam("wmode", "transparent");
fo.addParam("quality", "high");
fo.addParam("scale", "noscale");
fo.addParam("loop", "false");
fo.write("player");
Now the issue is that when using Internet Explorer the drop down list will not change the player to the next XML playlist for the swf to play.

I hope this is understandable to you
Dragon25 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Flash works in Firefox not IE
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.45464 seconds with 12 queries