Lytheum Posted August 2, 2007 Share Posted August 2, 2007 How can I embed media that is located outside of my root directory? For instance: Public_html is my root, where "play.php" is located... 'Songs' is located up one directory from root. In play.php, <object id=mediaPlayer codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 type=application/x-oleobject height=45 width=300 align=absmiddle classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95> <param name="FileName" value="../songs/music.mp3"> <PARAM NAME="animationatStart" VALUE="false"> <PARAM NAME="transparentatStart" VALUE="true"> <PARAM NAME="autoStart" VALUE="false"> <PARAM NAME="showControls" VALUE="true"> <embed src="../songs/music.mp3" autostart=0 loop=0 align="absmiddle" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/download/default.asp" showcontrols=1 showdisplay=1 showstatusbar=1 > </embed></object> You would think that would work, but it doesn't. The path is correct. If I put a file (blah.txt) in the same folder and run and include, it works just fine. Quote Link to comment https://forums.phpfreaks.com/topic/62994-embed-media-outside-root-directory/ Share on other sites More sharing options...
ToonMariner Posted August 2, 2007 Share Posted August 2, 2007 to play that stuff via the site it needs to be accessible to the world - so either temporarily copy the file into a directory that is in the root. The alternative is use a flash player... Swap the path to the mp3 to a php script that can parse the mp3 and it back to the flash player to be played... Quote Link to comment https://forums.phpfreaks.com/topic/62994-embed-media-outside-root-directory/#findComment-313770 Share on other sites More sharing options...
Lytheum Posted August 2, 2007 Author Share Posted August 2, 2007 I was hoping there was another way, as I'm trying to prevent them from direct download access. I suppose I'll have to find another solution for that then. Or use a flash player. Thanks for the help. Quote Link to comment https://forums.phpfreaks.com/topic/62994-embed-media-outside-root-directory/#findComment-313934 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.