Flash CS3 - Flash CS4

Free tutorials and scripts for all.
Actionscript 3.0

Streaming sound with AS3 and PHP

This is a discussion on Streaming sound with AS3 and PHP within the advanced Actionscript 3.0 forums, part of the Flash CS3 eng category; Hi all, I am currentlly coding a website all flash an coded in AS3. I have coded a fully customized ...


Go Back   Forum Flash CS3 Flash CS4 > English Forums > Flash CS3 eng > advanced Actionscript 3.0

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 25-09-08, 10:14
g82 g82 is offline
Junior Member
 
Join Date: Feb 2008
Posts: 1
Rep Power: 0
g82 is on a distinguished road
Streaming sound with AS3 and PHP

Hi all,

I am currentlly coding a website all flash an coded in AS3.
I have coded a fully customized mp3 player which uses XML data from the server to access the playlist. It is all working fine, tested it many times and no problems.

The thing is that the tunes which are streamed from the server should not really reside anywhere within the publicly accessible folder since my client doesn't want anyone to just go around his public directory and download them without first loging-in to the members page (where the player is) . So I have created a folder outside the public folder in my home directory (which cannot be accessed publicly) to store all the songs there . Now to play the songs in the player I needed to stream them somehow to the browser so I am using a PHP script (literally four lines of code) that strreams a given tune from that outside folder. Here is where the problem lies:

When a user chooses a tune to be played the AS3 code calls the PHP code on the server passing it the title of the song (which it earlier got from the XML playlist file) which in turn starts streaming the song. And here I am becoming confused how the things actually run and how to fix the following. The sound will actually start playing normally in the player (as it is in AS3 a new Sound object is created and so on) and I can still stop, pause and play from the paused moment again . But tere are things that won't work : for example... the load progress bar along with the search slider do not work any more. Now I understand (and have already confirmed by testing it in flash) that the fact that the sound is streamed through PHP from the server has got to do with the fact that the Sound object in my AS3 code somehow doesn't have information necessary to calculate all the things that are used by the load bar and search - it doesn't have the lenght of the song. So my code cannot also calculate the progress loaded and so on ... So it looks as if the flash player has some control over the played sound but not entirely .. however weird or it may sound ..

Perhaps there is some other better way to do it (stream the tunes from outside my public folder) , or maybe a change to the PHP code could solve this problem. Is there any way that would make it work 100% as it did when the songs where loaded straight into the payer straight from the public folder just with AS3 ..

As I am not an AS3/PHP expert any help will be much appreciated. Posted this already a week ago on the Adobe Flash Support forum but didn't get a single post back.

K
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #2 (permalink)  
Old 15-10-08, 04:43
badboykilla's Avatar
Junior Member
 
Join Date: Oct 2008
Posts: 12
Rep Power: 0
badboykilla is on a distinguished road
Re: Streaming sound with AS3 and PHP

sorry i got a little lost while reading...lolz..if u show me the website or a sample of whats the problem i can understand better.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads

Thread Thread Starter Forum Replies Last Post
Actionscript 2 AS2 streaming flv cue point help natenorbie Actionscript 3.0 newbies 0 13-07-08 20:08
Actionscript 3 Streaming e bitrate Faycal Actionscript 3.0 avanzato 0 08-07-08 14:18
Streaming ip cam Enzuccio Actionscript 3.0 base 1 07-02-08 09:50
streaming mp3 da un mio sito pianetaoscuro Actionscript 3.0 base 3 22-01-08 05:55


All times are GMT. The time now is 21:02.


Powered by vBulletin versione 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC4
Forum SiteMap


FlepStudio
by Filippo Lughi
P.IVA 03605860406