Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to embed Windows Media Player into php file ?

Posted on 2008-06-16
4
Medium Priority
?
1,445 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
This article discusses how to implement server side field validation and display customized error messages to the client.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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

609 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