|
Flash works in Firefox not IE
03-15-2009, 06:25 AM
|
Flash works in Firefox not IE
|
Posts: 2
|
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!
|
|
|
|
03-16-2009, 04:43 AM
|
Re: Flash works in Firefox not IE
|
Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
|
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?
|
|
|
|
03-17-2009, 08:51 AM
|
Re: Flash works in Firefox not IE
|
Posts: 2
|
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
|
|
|
|
|
« Reply to Flash works in Firefox not IE
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|