Alright, let me word my post a little differently. Hopefully I can find some help that way.
How can I have call a video to play based on its "title" rather than its item position in the XML document with the getQueryParamValue?
I currently need the link by a number for one part of my site but would like to have the additional option to call by the title.
My current code based off of another post here:
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
var player = null;
var playItem = null;
var file = null;
if(!(playItem = swfobject.getQueryParamValue('item')))
{
// default is first item (array counting starts at 0)
playItem = 0;
}
if(!(file = swfobject.getQueryParamValue('playlist')))
{
// default playlist
file = 'playlist.xml';
}
//alert('Play Item: ' + playItem + '\nFile: ' + file);
function playerReady(obj)
{
player = document.getElementById(obj.id);
playAway();
};
// start the player on the query parameter item
function playAway()
{
if(player)
{
//alert('playAway:\nPlayer: ' + player.id + '\nplayAway - playItem:' + playItem);
setTimeout("player.sendEvent('ITEM', playItem)", 200);
setTimeout("player.sendEvent('PLAY', 'true')", 400);
}
else
{
setTimeout("playAway()", 200);
}
};
</script>
<script type="text/javascript">
var flashvars = {
file:file,
autostart:"true",
shuffle:"false",
playlistsize:"200",
playlist:"bottom",
skin:"stylish/modieus.swf",
frontcolor:"cccccc",
lightcolor:"6e1f84",
backcolor:"111111",
repeat:"list"
//logo:"logo_overlay.png"
}
var params = {
allowfullscreen:"true",
allowscriptaccess:"always"
}
var attributes = {
id:"player1",
name:"player1"
}
swfobject.embedSWF("player.swf", "placeholder1", "570", "570", "9.0.115", false, flashvars, params, attributes);
</script>
</head>
<body>
<div id="wrapper">
<div id="placeholder1">
<a href="http://www.macromedia.com/go/getflashplayer">Get flash</a> to see this player.
</div>
</div>
</body>
Use this code: removeIt(removeItTitle) from this thread, except instead of removing the title, play it. You will have to update the code for teh v4.x players.
http://www.longtailvideo.com/support/forum/JavaScript-Interaction/9232/remove-item-by-file-title