Hello everyone.
I have been using this player for quite sometime and it is wonderful, it has capabilities of not only playing media but also can be customised as a media manager.
Previously I have been only generating playlists without any description data such as "annotation", however recently a new requirement has been established. It is to display more details about the media, because I am only using mp3 files with nediaplayer I only require to extract details of ID3 tags of each file.
the playlist is designed with basic information such as the location and the title, I want to access the location parameter of each media as it gets accessed by the user while playin, this way I can process the files to get its ID3 tags and display it. I am having problems in getting the filenames of the file the user is currently playing. Each time I try to access the pointer from getUpdate typ is always equals to "time". I have no idea how I should go about in getting the item pointer so that I could than get "location" data from the playlist of the current track.
I have attached the code below for you guys to have a look and help, also I have not updated the player to new version. I think the new version has slightly different way of handling events, I would really appreciate if someone could help me in getting this to work.
<script type="text/javascript">
var currentItem;
function getUpdate(typ,pr1,pr2,pid) {
if(typ == "item") { currentItem = pr1; setTimeout("getItemData(currentItem)",100); }
};
function getItemData(idx) {
var obj = thisMovie("thePlayerId").itemData(idx);
document.getElementById("theCaption").innerHTML = obj["location"];
};
// This is a javascript handler for the player and is always needed.
function thisMovie(movieName) {
if(navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName];
} else {
return document[movieName];
}
};
function createplayer(xmlFile) {
var so = new SWFObject('http://www.gurbanivichar.com/multimedia/mediaplayer.swf','thePlayerID','450','310','8');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addVariable('height','310');
so.addVariable('width','450');
so.addVariable('file','http://www.gurbanivichar.com/multimedia/BV/playlist.xml');
so.addVariable('displaywidth','0');
so.addVariable('searchbar','false');
so.addVariable('thumbsinplaylist','false');
so.addVariable('volume','100');
so.addVariable("javascriptid","thePlayerId");
so.addVariable("enablejs","true");
so.write('player');
}
</script>
<div id="player" class="floatright"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div>
<script type="text/javascript">
createplayer('http://www.gurbanivichar.com/multimedia/BV/playlist.xml');
</script>
<div id="theCaption">captions</div>
If you want to see the webpage please go to the following address: http://www.gurbanivichar.com/multimedia/popup.php
The player is given playlist from the links in the website, using javascript technique as mentioned in the demos. Unfortunately I mistakenly forgot to change the playlist argument from the addVariable() function it should say xmlFile for its file and I do not have access to the server until this evening so it wont be changed by this evening but I do not think it will interfere with the problem I have described above.
I only require the location paramter to be handed over to me for each currently running track, I will be using JQuery and ID3tage to extract the id3 tags from the files and display it dynamically in the "theCaption" div.
I am keen to upgrade the player and also the SWFObject library as well as long as someone could help me with the events javascript code to extract the details of the currently playing track.
Thanks in advance and I very much look forward to getting it up and running again.
You can get the current file URL with:
var currentFile = null;function getItemData(idx)
{
var obj = thisMovie('thePlayerId').itemData(idx);
currentFile = obj['file'];
};
You can get the following data items with a call to itemData():
function itemData(idx)=========================
idx: 0=>duration (number-seconds.tenths) <duration>
idx: 1=>start (number-seconds.tenths) <start>
idx: 2=>description (text) <annotation>
idx: 3=>midroll (url) <meta rel='midroll'> ...doesn't work
idx: 4=>link (url) <info>
idx: 5=>id (text) <identifier>
idx: 6=>category (text) <album>
idx: 7=>audio (url) <meta rel='audio'>
idx: 8=>captions (url) <meta rel='captions'>
idx: 9=>image (url) <image>
idx: 10=>type (text) flv, jpg, etc. <meta rel='type'>
idx: 11=>file (url) <location>
idx: 12=>title (text) <title>
idx: 13=>author (text) <creator>
idx: nn=>fallback (url) <meta rel='fallback'>
**<meta rel='other flashvars'>