Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to embed Windows Media Player into php file ?

Posted on 2008-06-16
4
Medium Priority
?
1,450 Views
Last Modified: 2012-08-13
Hi

I want to embed windows media player or any free flash mp3 player but the main point is

we will pass the file location to player via php_varible.

this variable contains the full path to the audio file ( e.g http://www.manindersingh.com/audio/fileaudio.mp3).

We want to make player size very slim, thanks.
no autoplay.

-- plz provide popup player coding as xtra feature.
0
Comment
Question by:theredcode
  • 2
  • 2
4 Comments
 
LVL 31

Expert Comment

by:Frosty555
ID: 21796067
just embed media player or your flash player exactly as you would were you doing it using regular HTML. In place of where you would normally have specified the filename, instead put

<?PHP echo $yourvarname ?>

If you want to put it as a popup, put the embedding HTML into a new page, open the page with a parameter (e.g. miniplayer.php?file=somepathtoafile.mp3), and then in place of the mp3 to play in your html, put

<?PHP echo $_GET["file"] ?>
0
 

Author Comment

by:theredcode
ID: 21796091
i need coding for embedding, can u plz provide working code for this. thnx.. appricated/
0
 
LVL 31

Accepted Solution

by:
Frosty555 earned 2000 total points
ID: 21796207
<?PHP
    $filename = "somemusicfile.mp3";
?>
...
<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" name="mediaplayer1" ShowStatusBar="true" EnableContextMenu="false" autostart="false" width="320" height="240" loop="false" src="<?PHP echo $filename ?>" />

And if you wanted it in a popup, change $filename to

$filename = $_GET["file"]

and then specify the filename in the "file" parameter of the popup page when you link to it, e.g.

<a target="_blank" href="popupplayer.php?file=somemp3file.mp3">Open Player</a>
0
 

Author Closing Comment

by:theredcode
ID: 31467708
thnx
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses
Course of the Month21 days, 1 hour left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question