Click to See Complete Forum and Search --> : Flash + Windows Media Player


Dr. Script
April 30th, 2006, 11:36 AM
I'd guess that this is possible, although I'm not exactly sure. Currently, I have a page, playMedia.php. This page is invoked as: playMedia.php?loc=mediafile.wmv . The location can also be linked off the site, such as: playMedia.php?loc=http://codeguru.com/mediafiles/media.wmv .

What I'd like to do is remove this loc from view, or at least make it harder to get. Currently, I have it run on a JavaScript function, so the actual link is the loc, so the code is like this:

<a href="http://codeguru.com/mediafiles/media.wmv" media="true">Media</a>

When the page loads, it loops through links and if it is a media file (document.links[i].getAttribute("media") == "true"), it adds an onclick event handler that simply calls a JS function to open the playMedia.php page and then returns false so clicking the link doesn't alter the location of the page the link is on, just it opens the link in a new window.


What I'd like to do: Certain files I'd prefer would not appear in the url string as they are. Instead, I'd like something like a flash file that has a windows media player embedded in it with the location hardcoded.

To invoke this, I'd call playMedia2.php?loc=some fake location here. Delibertely only JS users could then use this, but that is OK. I might workaround that later. I could then call playMedia3.php?loc=some fake location. This would be the same as playMedia2, except the flash file on the page would have a windows media player embedded into it but have a different file playing.

Doing this would make it harded to find the URL (not as simply as right clicking the URL and clicking copy shortcut). Instead, you have to download the flash file, and decompile it or open it with a text editor ike Notepad and look for the source, which is fine.

Is what I want to do possible? Thanks for the help.

PeejAvery
April 30th, 2006, 09:41 PM
Well, I am not sure how you get the loc variable to be set but could you use POST instead of GET?

The other option you could do is...
1. Get loc as the very first thing on the PHP page.
2. Start a session and set a session variable to loc.
3. Redirect to the same page calling the session variable instead of having loc show up in the URL.

This is from the top of my head but should work.

<?php
$loc = @$_GET['loc'];
session_start();
if($loc == ""){
$loc = $_SESSION['loc'];
}
else{
$_SESSION['loc'] = $loc;
$thispage = $_SERVER['PHP_SELF'];
header('Location: $thispage');
}
?>

<html>
<head>
...

Dr. Script
May 1st, 2006, 08:27 PM
That would likely work, but the trouble is it justs plays in Windows Media Player embedded on this page, so a simply right click + properties is enough to do the trick to get the location.

I'd have to check with Flash.

PeejAvery
May 1st, 2006, 10:25 PM
Okay, I see what you are saying. You need it to play in flash to hide the location. Will a simple flash mp3 player do? I have seen many. Google should turn some up.

Dr. Script
May 1st, 2006, 10:58 PM
Depends. If I were to use such a player, could I

1) Not have the put the source as a paramter in the source code but rather hard coded in the flash mp3 player
2) use a third-party, different-source URL to play that is actually a file such as a radio feed that plays forever and is different everytime loading just like a radio feed is?

I'll look it up, it's just late now. Thanks for the help.