Solved

How to embed Windows Media Player into php file ?

Posted on 2008-06-16
4
1,414 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 500 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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now