Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Making a flash mp3 player, but I have a couple a problems

Community Beginner ,
Jun 27, 2008 Jun 27, 2008
So this is a streaming flash music player, with an xml based playlist playing mp3s anywhere off the web. Everything works fine, but I am trying to fine tune this thing to make it work even better before I add more features and make it easy to be skinable. The scrubber even works to fast forward through the song.

The main issue I am facing (i believe) is that while loading the file, the full duration of the file is unknown so my progress bar is going crazy thing it may be done with the song, when in fact it just hasn't loaded yet. I am thinking I could possible use some ID3 tag information to find the length of the song? If that were the case how could i go about doing that.

EDIT: I had an issue with onSoundComplete, but I fixed it. I think it was a combo of using the wrong name for the variable and using attachSound hahaha.....
TOPICS
ActionScript
283
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 27, 2008 Jun 27, 2008
also if you would like to see the player go to www.parrisstudios.com and it is the first post there. You need to scroll down to the bottom of that post. I had to fill up some space because the player was too wide for the top of the page I need to shrink it down.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 27, 2008 Jun 27, 2008
After doing a little more research. I found that there is a way to estimate the length of a song. Of course it is off a little bit until the end of the song. It will continually become more accurate.

onClipEvent(enterFrame){
//get an estimate of how long the sound is becase
//_parent.soundToLoad.duration will only give the loaded duration
var kbps:Number = (((_parent.soundToLoad.getBytesLoaded()*8)/1000)/(_parent.soundToLoad.duration))*1000;
var num:Number = int(((_parent.soundToLoad.getBytesLoaded()*8)/kbps)/1000);
//calculate the progress amount
progressamount = Math.round(((_parent.soundToLoad.position /(num*1000)) * 100));
this.gotoAndStop(progressamount);
}
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 27, 2008 Jun 27, 2008
LATEST
still not completely accurate although it is better than before. Anyone have any suggestions?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines