Solved

How to embed Windows Media Player into php file ?

Posted on 2008-06-16
4
1,415 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
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…
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 look for a specific file type in a local or remote server directory using PHP.

911 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

28 Experts available now in Live!

Get 1:1 Help Now