PDA

View Full Version : How to Embed Windows Media Player Into My Script


tzinyii
09-23-2006, 06:21 AM
I would like to embed a window media player in my site using php script.

<PARAM NAME="filename" VALUE="video.php?option=1">

Would appreciate if someone could help me with the video.php script. Thank you.

vinyl-junkie
09-23-2006, 06:28 PM
Welcome to CodingForums, tzinyii. :D

Have you tried Google (http://www.google.com/search?sourceid=navclient&ie=UTF-8&rls=GBSA,GBSA:2006-38,GBSA:en&q=embed+%22windows+media+player%22)? There's a wealth of information there. ;) This search result (http://www.mioplanet.com/rsc/embed_mediaplayer.htm) seems to be a good one.

Also, please make your help topic titles more descriptive. We know you need PHP help. That's why you're here. Just state what kind of help you need in the title; e.g., "How to Embed Windows Media Player Into My Script".

tzinyii
09-25-2006, 04:38 AM
Thanks for your input, Vinyl-junkie. I apologise for the unclear topic title.

I am looking for a php sample script to embed a video in my site so that the source of the video file is not easily traced such as the one that I googled and found on this site :
http://www.conversysinternational.com.au/mytv/index.php?channel=test

I thought of consulting the author of this site for the script but no contactable information was found. Tried learning from scratch from PHP.net but :( . I have already activated my server to support PHP.

I googled and found two scripts which I thought could be modified for my purpose, one of which is from this forum.
I would very much appreciate if someone could help me with the modification:
------------------------------------
<?php
$file_name = $_GET['file'];
header('Content-type: application/force-download');
header('Content-Disposition: attachment; filename="' . basename($file_name) . '";');
readfile($file_name);
?>

-------------------------------------
<? if(file_exist($row['filename'])) { ?>
<embed src="<? echo if(isset($row['filenamevideo']); ?>">
<? } else { echo "not valid "; } ?>

vinyl-junkie
09-25-2006, 04:13 PM
This would probably work. If you're concerned about making the file not directly accessible from the web, just put it in a folder above that. For example, I have some secure files on the same directory level as public_html. No one can access those directly by typing a URL into their browser.

tzinyii
10-09-2006, 04:45 AM
Thanks to vinyl-junkie. Would appreciate if you could elaborate a liitle bit further.

Say if the webpage for embedding the video file (001.wmv) is http://melody.freeprohost.com/video/clip1.htm

May I know where should I upload my 001.wmv to and where should I create the new folder?
Sorry, i didn't quite understand what you meant by "just put it in a folder above that".

vinyl-junkie
10-09-2006, 05:02 AM
Sorry, i didn't quite understand what you meant by "just put it in a folder above that".
OK, here's an example, but bear in mind that the directory structure on your own web server may be different from mine. My publicly accessible files are located in the following directory:

/<home>/public_html/

That means if someone knows where a file is located, they can type into the address bar:

http://www.mysite.com/myfile.php

or whatever file they might want to access. If I wanted to keep them from accessing the file as described above, I could make a new folder that is actually on the same directory level as public_html. For example:

/<home>/my_secure_folder/

No one can get to the contents of that folder by typing an http address into their address bar. It is above, or outside, the publicly accessible address space.

Hope this makes a little more sense. :)

tzinyii
10-09-2006, 05:28 AM
Many thanks for your explanation. I really appreciate it.
I have to go to work now. Will try it out when I am back in the evening.

tzinyii
10-09-2006, 04:15 PM
Hi vinyl-junkie,
I have created a new folder "my_secure_folder" that is actually on the same directory level as one of my subdomain created-namely http://melody.freeprohost.com.

I have uploaded a sample video clip "001.wmv" to this folder - "my_secure_folder/001.wmv"

In the webpage "http://melody.freeprohost.com/video/clip1.htm" embedding the clip, may I know what should I enter as value? I tried using the following value but all without success:confused: :
<PARAM NAME="fileName" VALUE="../my_secure_folder/001.wmv">
<PARAM NAME="fileName" VALUE="/my_secure_folder/001.wmv">
<PARAM NAME="fileName" VALUE="my_secure_folder/001.wmv">

vinyl-junkie
10-09-2006, 04:27 PM
I've been thinking about this a little more, and I'm wondering why you want the source not to be easily traced. When someone plays your video, they download it to their browser's cache. Why then does it matter where the file is on your server when they can fairly easily find it on their own PC?

tzinyii
10-09-2006, 04:46 PM
I notice that most online news stations use php script for their clips where people can't easily download them.
I came across one that is nicely done:
http://www.conversysinternational.com.au/mytv/index.php?channel=test

I wrote to the company and was told that "The codes are available to purchase on special price $75.00 until 30.10.2006. After this date, the normal price will be $100.":(

I am only a student-fan intending to share some video clips of a beloved actress with other fans. I hope to hide the source of the clip so that it is not easily traceable for downloading.

vinyl-junkie
10-09-2006, 04:53 PM
I am only a student-fan intending to share some video clips of a beloved actress with other fans. I hope to hide the source of the clip so that it is not easily traceable for downloading.
What you're wanting to do is probably copyright infringement. The beloved actress you mention might take a dim view of having your video clips on your website. You also run the risk of getting your site shut down if your ISP gets wind of it.

tzinyii
10-09-2006, 05:04 PM
It's just a very short clips of about a couple of minutes out of a 2 hours show.
I have also kept her informed via her godsister.:D

vinyl-junkie
10-09-2006, 05:41 PM
You might want to get it in writing that you have her permission to have those videos on your site.

tzinyii
11-22-2006, 12:52 AM
I have got a written permission to embed the video already.
Would appreciate if someone could let me know how to embed video clip using PHP code.
Thanks in advance.

mlseim
11-22-2006, 01:52 AM
This is what I'm guessing is happening ....
They are storing their video (and it works with photos too) in a
database such as MySQL. Those are not accessible by anyone,
only by the PHP script that accesses the database.

For playing videos and embedded, you might want to try
a free Flash Video Player. There is one detail though .... you need
to convert your .avi format to .flv format using either a free convert
program, or a shareware program.

Here's a free video player:
http://flowplayer.sourceforge.net/

I mention using Flash because it's more common across all systems,
browsers and PC/Mac.

tzinyii
11-24-2006, 03:26 AM
Thanks a lot mlseim. I tried converting to flash, but the file size is 3 times that of wmv.

If say the link is :
<embed src=http://www.abc.com.php?file=news&date=12062006></embed>

could someone advise on how to do so using PHP script? Many thanks in advance.