Solved

How to embed Windows Media Player into php file ?

Posted on 2008-06-16
4
1,426 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 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 Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Suggested Solutions

Title # Comments Views Activity
Set a time limit on Wordpress Cookie function. 3 48
Get data from two MySQL tables 6 65
geting data from the array list 6 37
Form submit takes only for one form 23 51
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

732 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