php1 Posted September 1, 2008 Share Posted September 1, 2008 Dear all , is it possible to play a wav file without downloading it. is there any built-in flash media player to achieve this? I want to play a wav file without downloading the file to clients machine. Quote Link to comment https://forums.phpfreaks.com/topic/122207-how-to-play-a-wav-file-without-downloading-it/ Share on other sites More sharing options...
valtido Posted September 1, 2008 Share Posted September 1, 2008 every web page downloads data on a local machine b4 displaying it lol u can use embed and object HTML tag to play the wav file if ur going to use flash then the video needs to be a .flv Quote Link to comment https://forums.phpfreaks.com/topic/122207-how-to-play-a-wav-file-without-downloading-it/#findComment-630923 Share on other sites More sharing options...
php1 Posted September 1, 2008 Author Share Posted September 1, 2008 then in youtube it is playing the music without downloading. i just want to implement that method. is there any way to achieve this Quote Link to comment https://forums.phpfreaks.com/topic/122207-how-to-play-a-wav-file-without-downloading-it/#findComment-630928 Share on other sites More sharing options...
valtido Posted September 1, 2008 Share Posted September 1, 2008 well if u see it properly on the play time line you see a red thing that goes by that is the downloading thing lol. it downloads that file on your temporary files. you can do that youtube thing but u need a lot of knowledge. first of all you need to learn ActionScript which is a flash language. then you will need to allow users to upload their video n convert their videos into flv in order for them to be played on flash. and this conversion should be on server side. also you will need loads of space if u plannin to do that lol. otherwise you could just use php to hide the true directory root of the file by manipulating the headers. e.g. the file real file root could be something like this http://domain.com/wavfiles/mywav.wav so now u could jus make a php file that has manipulated the headers e.g. http://domain.com/getFile.php?fileName=mywav on the play.php you could have the <object></object> with the src = http://domain.com/getFile.php?fileName=mywav you can do the same with images to hide their directory roots that way users can't really download them well unless they are experts i could find a way or two lol but could be an possible thing ur lookin for ... Quote Link to comment https://forums.phpfreaks.com/topic/122207-how-to-play-a-wav-file-without-downloading-it/#findComment-630938 Share on other sites More sharing options...
waynew Posted September 1, 2008 Share Posted September 1, 2008 I don't think you understand how the Internet works. Everytime you view a Youtube video, you are in fact downloading it. Every image, webpage etc that you view, is downloaded to your computer. That's why your computer has temporary Internet files. Have you looked at your cache? Even CSS files are downloaded. Quote Link to comment https://forums.phpfreaks.com/topic/122207-how-to-play-a-wav-file-without-downloading-it/#findComment-630941 Share on other sites More sharing options...
valtido Posted September 1, 2008 Share Posted September 1, 2008 lol i did try to explain but he insited on the youtube thinkin flash files are an exception lol Quote Link to comment https://forums.phpfreaks.com/topic/122207-how-to-play-a-wav-file-without-downloading-it/#findComment-630943 Share on other sites More sharing options...
php1 Posted September 1, 2008 Author Share Posted September 1, 2008 Thank you very much for your reply. So we can't play the file without downloading it right? So it will be stored in temporary folder also. is there any way to delete the wav file from temporary folder after the user hear the music. if i said anything wrong please clarify me. thank u so much Quote Link to comment https://forums.phpfreaks.com/topic/122207-how-to-play-a-wav-file-without-downloading-it/#findComment-630945 Share on other sites More sharing options...
php1 Posted September 1, 2008 Author Share Posted September 1, 2008 is there any useful links for using action script. i did'nt understand all the thinks Quote Link to comment https://forums.phpfreaks.com/topic/122207-how-to-play-a-wav-file-without-downloading-it/#findComment-630949 Share on other sites More sharing options...
valtido Posted September 1, 2008 Share Posted September 1, 2008 go to internet option then settings under the browser history then view files you might understand it. http://gotoandlearn.com/ is an ok website for flash to learn a few tricks lol Quote Link to comment https://forums.phpfreaks.com/topic/122207-how-to-play-a-wav-file-without-downloading-it/#findComment-630954 Share on other sites More sharing options...
php1 Posted September 1, 2008 Author Share Posted September 1, 2008 thank u so much for your reply. you say we can hide the root directory and play the wav file. can you please explain it a little more. i did'nt understand the logic Quote Link to comment https://forums.phpfreaks.com/topic/122207-how-to-play-a-wav-file-without-downloading-it/#findComment-630959 Share on other sites More sharing options...
valtido Posted September 1, 2008 Share Posted September 1, 2008 readFile.php <?php header('Content-type: audio/wav'); readfile('music/'.$_GET[filename'].'.wav'); ?> play.php <?php if(!$_GET['filename']==''){ echo ' <OBJECT id="VIDEO" width="320" height="240" style="position:absolute; left:0;top:0;" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject"> <PARAM NAME="URL" VALUE="http://www.yourdomain.com/readFile.php?filename=M-jackson"> <PARAM NAME="SendPlayStateChangeEvents" VALUE="True"> <PARAM NAME="AutoStart" VALUE="True"> <PARAM name="uiMode" value="none"> <PARAM name="PlayCount" value="9999"> </OBJECT> '; } ?> on your directory there should be a file like. http://youdomain.com/music/M-jackson.wav then you know there you have it by the way you will need to go to youwebsite www.yourwebsite.com/play.php to get to play the song lol Quote Link to comment https://forums.phpfreaks.com/topic/122207-how-to-play-a-wav-file-without-downloading-it/#findComment-630970 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.