Go
Not registered? Sign up!

Hide media urls with ID script?

Google Translate
40 posts | return to the Modules forum | get the rss feed for this thread

Dec. 15, 2007iM1

All my music is from external hosts, is it possible to make it look like there from this site by using link ID's?
e.g. http://mydomain.com/get-file.php?id=1234

Can this be done?

Dec. 15, 2007iM1

Bump

Jan. 09, 2008Tchit

Hi, I would like to do the same !
Some idea ?

Ty

Jan. 09, 2008andersen

the true address will still show in the browser cache...

Jan. 09, 2008touchIt

<?php

// get-file.php
// call with: http://domain/path/get-file.php?id=1

$id = (isset($_GET["id"])) ? strval($_GET["id"]) : "1";

// lookup
$url[1] = 'http://domain/path/music_01.mp3';
$url[2] = 'http://domain/path/music_02.mp3';
$url[3] = 'http://domain/path/music_03.mp3';
$url[4] = 'http://domain/path/music_04.mp3';

header("Location: $url[$id]");
exit;

?>

s1.addVariable('file', encodeURIComponent('http://domain/path/get-file.php?id=1'));
s1.addVariable('type', 'mp3');


Tested with YouTube URIs.

Lookup can be an array, external file, database, or scribbled notes on the back of your hand.

Jan. 10, 2008Tchit

Thank you very much touchIt !

Jan. 14, 2008markus

type for videos is "flv"?

Jan. 16, 2008kazama40

its cool

Feb. 15, 2008sunny

hey touchIt

i have copied this script and make a file like mp3-songs.php ..
but i dont understand..
where i put these line .." s1.addVariable('file', encodeURIComponent('http://domain/path/get-file.php?id=1'));
s1.addVariable('type', 'mp3');
could you please tell me ?

Feb. 15, 2008touchIt

@sunny,

The two lines beginning with "s1.add" go in your player code.

Feb. 15, 2008Sunny

@touchIt

please see this image http://www.masti2much.com/asd.jpeg
and please let me know how it is possible..
sunnyjaffri@hotmail.com this is my id

Feb. 16, 2008touchIt

You would have to host the file on your server, then use the correct URI to the file on your server in the file flashvar, like this: so.addVariable('file', 'http://domain/path/music.mp3'); or for embed code: flashvars="file=http://domain/path/music.mp3&...the rest of the flashvars"

Feb. 23, 2008ASP

Can this be done in ASP as well?? If it can... How?

Feb. 23, 2008AJAX

Try a PHP to ASP converter on the script posted above, should get you close enough since it's such a short, simple script. [url=http://www.google.com/search?hl=en&q=converter+PHP+to+ASP]PHP to ASP converter[/url]

Feb. 25, 2008dadada

adadad

Mar. 03, 2008marko

touchIt, could you be so kind and put complete player code for this two lines. shoudl there be special id of player, enabled javascript etc....

s1.addVariable('file', encodeURIComponent('http://domain/path/get-file.php?id=1'));
s1.addVariable('type', 'mp3');

I can't get it work.

thanx so much,
marko

Mar. 03, 2008touchIt

@marko,

Adjust http:/domain/path for your site.<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">

<head>

  <title>Basic JW Player - MP3s</title>

  <script type="text/javascript" src="http://domain/path/swfobject.js"></script>

  <script type='text/javascript'>
    function createPlayer()
    {
      var s1 = new SWFObject('http://domain/mediaplayer.swf', 'playlist', '400', '66', '7');
          s1.addVariable('width',            '400');
          s1.addVariable('height',           '66');
          s1.addVariable('displayheight',    '0');
          s1.addVariable('file',              encodeURIComponent('http://domain/path/get-file.php?id=1'));
          s1.addVariable('type',             'mp3');
          s1.addVariable('showdigits',       'true');
          s1.addVariable('autostart',        'true');
          s1.addVariable('thumbsinplaylist', 'false');
          s1.addVariable('backcolor',        '0xFFFFFF'); // face of buttons
          s1.addVariable('frontcolor',       '0x404040'); // button symbols & playlist text
          s1.addVariable('lightcolor',       '0x808080'); // highlighted playlist item
          s1.addVariable('screencolor',      '0x000000'); // screen background color
          s1.write('player');
    };
  </script>

</head>

<body onload="createPlayer();">

  <div id="player">
    <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Get the Flash Player</a> 
    to play this music.
  </div>

</body>

</html>

Mar. 04, 2008marko

thanx touchit for a quick reply but I still have problems. it just keeps on trying to get my file but no luck.

this is my get-file.php

<?php

$id = (isset($_GET["id"])) ? strval($_GET["id"]) : "1";

// lookup
$url[1] = 'http://mydomainblabla.com/movies/12.flv';

header("Location: $url[$id]");
exit;

?>


this is my html:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">

<head>

<title>Basic JW Player - MP3s</title>

<script type="text/javascript" src="http://www.jeroenwijering.com/embed/swfobject.js"></script>

<script type='text/javascript'>
function createPlayer()
{
var s1 = new SWFObject('http://mydomainblabla.com/mediaplayer.swf', 'playlist', '400', '66', '7');
s1.addVariable('width', '400');
s1.addVariable('height', '66');
s1.addVariable('displayheight', '0');
s1.addVariable('file', encodeURIComponent('http://mydomainblabla.com/get-file.php?id=1'));
s1.addVariable('type', 'flv');
s1.addVariable('showdigits', 'true');
s1.addVariable('autostart', 'true');
s1.addVariable('thumbsinplaylist', 'false');
s1.addVariable('backcolor', '0xFFFFFF'); // face of buttons
s1.addVariable('frontcolor', '0x404040'); // button symbols & playlist text
s1.addVariable('lightcolor', '0x808080'); // highlighted playlist item
s1.addVariable('screencolor', '0x000000'); // screen background color
s1.write('player');
};
</script>

</head>

<body onload="createPlayer();">

<div id="player">
<a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Get the Flash Player</a>
to play this music.
</div>

</body>

</html>

i even tried your exact script for mp3 player, and same thing!

other questions:

is it possible to hide external url location (bottom left of browser).
i suppose it si ok to put xml files in get-file.php as well?

thanx a lot!
marko

Mar. 16, 2008Ltleg

I have the same problrem :(

Mar. 16, 2008Ltleg

How do you make If you want do display multiple files once.

May. 24, 2008Madero

Hello
I have a very important question
if i use the php script mentioned here
will my server consume bandwidth equal to the file size even if its hosted on another server ?
if yes are there any way to prevent that ?
Thanks alot

Jun. 11, 2008Plamenator

replace

header("Location: $url[$id]");
exit;


with


header('Content-Type: text/plain');
echo("$url[$id]");

Jul. 16, 2008parkland

I can't get the script to work on my site. Is it still working with v4?

Does anyone have a working example on the site? And, out of curiosity, why is the encodeURIComponent function needed?

Aug. 26, 2008mario

it's ok from single track
but, i need using playlist without write mp3 url
i'd like that player coulde read hide link from playlist (es. www.aaa.com/getfile.asxp?id=1)

Sep. 09, 2008PS3ubo(.)co(.)nr

how do you make the vid id so it automaticly adds itself (using a sql database) ???

Sep. 09, 2008rozmichelle

the s1 variables will depend on the mp3 player you are actually using i believe...i decided to use an XSPF player instead because it is easier to configure (although you can still use the swfobject to display it). for more info, go to http://musicplayer.sourceforge.net

Sep. 12, 2008boonchan

Anyone can help me? I am using stream script as below. it is working.

var so = new SWFObject('player.swf','mpl','450','330','9');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addVariable('backcolor','0x000000');
so.addVariable('file','testvideo.flv');// It is ok
so.addVariable('script','&amp;streamscript=stream.php');
so.write('play');

But I would like to use as below. coz i wanna change flv link in php as touchIt's idea
var so = new SWFObject('player.swf','mpl','450','330','9');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addVariable('backcolor','0x000000');
so.addVariable('file',encodeURIComponent('get-links.php?id=1')); // not working
so.addVariable('script','&amp;streamscript=stream.php');
so.write('play');



Thanks alot

Sep. 18, 2008db

use it as a PARAM instead of a VARIABLE and it should work. I can confirm that I am using this on 4 and it's working.

Not sure if it works with streaming. I have not ventured into that quite yet.

Sep. 18, 2008kLink

Did you modify the player code to accept the flashvar script 'cause I can't find it anywhere in the source?

And the Flash Player sure doesn't take it, so it won't work as a parameter.

Oct. 16, 2008Fuad

guys I just nee music to be played from database just like this please I need help

http://bbc.com/index.php?mod=music=id=662

Oct. 16, 2008Fuad

I mean just using id instead of real source
But I don't mean using flash

Oct. 23, 2008sxml2005

<a href="javascript:loadFile('jstest',{file: encodeURIComponent('http://***8.net.ru/mp3/mp3.php?id=2',image:'http://pic.yupoo.com/my7755/986456388ea8/opoy30sn.jpg'})">



The novice how to do?

Oct. 25, 2008<a href="#"

v.4

<div id="container">
<script src="http://***.net.ru/wp-content/themes/Infinity/mediaplayer/swfobject.js" type="text/javascript"></script>
<script type="text/javascript">
var so = new SWFObject('http://heipa.net.ru/wp-content/themes/Infinity/mp3/player.swf','jstest2','240','170','8');
so.addParam('allowscriptaccess','always'); so.addParam('allowfullscreen','true');
so.addVariable('width','240');
so.addVariable('height','170');
so.addVariable('file', encodeURIComponent('http://***.net.ru/mp3/get-file.php?id=<?php echo get_post_meta($post->ID, "flvmp3", true); ?>'));
so.addVariable('type', 'mp3');
so.addVariable('javascriptid','jstest2');
so.addVariable('enablejs','true');
so.addVariable('autostart','true');
so.addVariable("overstretch","fit");
so.addVariable("wmode","transparent");
so.write('container');
</script>



<a href="#" onclick="loadNplay(<?php echo get_post_meta($post->ID, "flvmp3", true); ?>);">



so.addVariable('file', encodeURIComponent('http://***/get-file.php?id=1'));


<a href="#" onclick="l ?????????????????????

How to load relief

Oct. 26, 2008sxml2005

External javascript control



<a href= Load media files??? http://***/get-file.php?id=1

Feb. 07, 2009Sami

I need also solution for this. I don't really know why this does not work?

This is my PHP code:

<?php
$id = (isset($_GET["id"])) ? strval($_GET["id"]) : "1";
$url = 'http://www.mydomain.com/temp/',$id,'.mp4';
header("Location: $url");
exit;
?>

..and thats how I call it:

s1.addVariable("file", encodeURIComponent("http://www.mydomain.com/get_file.php?id=145"));

I get only blank screen. Everything works fine without separate scripts..

I have multiple files under temp directory which URL I wanna hide out.

This problem have to be now small thing. I have tried all things what have been mentioned above.

Feb. 07, 2009lefTy

Use:$url = "http://www.mydomain.com/temp/$id.mp4";or:$url = 'http://www.mydomain.com/temp/' . $id . '.mp4';
If you use double quotes " then PHP will evaluate the variable $id in the expression. Otherwise, you must concatenate the string literals and the expression using the proper concatenation operator, which is the period symbol, not the comma symbol.

Be sure that you are setting the type in your player code:s1.addVariable('type', 'video');

Feb. 07, 2009Sami

Thanks a lot! Now it works.

Maybe my problem was that at I was missing this line:

s1.addVariable('type', 'video');

..on my code. Just wondering because it was working without that line with the single .mp4 -file (without this external .php code).

Would there be any idea to use e.g. md5 -encryption for hiding url? Or is it practical to use it?

Feb. 28, 2009Dalka

Hi everybody i am new with php script so i maked this player code and i want anyone can help me how to make or get id list like this

$mURL[1] = 'http://domain.com/path/music1.mp3';

and here are my all scripts.

link code:
<A HREF="javascript:void(1)"onclick="window.open('play media.php?id=<?php echo "music 1"; ?>','linkname','height=50, width=480, resizable=0, scrollbars=1')">Play</a>

and this is my media.player code
<?php
$mURL=$_REQUEST['id'];

?>
<html>
<head>
<title></title>

</head>

<body>

<div align="center">
<center>



<table align="center" border="3" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#0000FF" width="45" id="AutoNumber1">
<tr>
<td >
<p align="center">
<object id="p67"
height=45 width=434

classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
type="application/x-oleobject"
pluginspage="http://www.microsoft.com/Windows/MediaPlayer/">
<param name="URL" value="http://domain.com/<?php echo $mURL; ?>" ref>
<param name="autostart" value="-1">
<param name="rate" value="1">
<param name="balance" value="0">
<param name="currentPosition" value="0">
<param name="defaultFrame" value>
<param name="playCount" value="1">
<param name="currentMarker" value="0">
<param name="invokeURLs" value="-1">
<param name="baseURL" value>
<param name="volume" value="50">
<param name="mute" value="0">
<param name="uiMode" value="full">
<param name="stretchToFit" value="0">
<param name="windowlessVideo" value="0">
<param name="enabled" value="-1">
<param name="enableContextMenu" value="-1">
<param name="fullScreen" value="0">
<param name="SAMIStyle" value>
<param name="SAMILang" value>
<param name="SAMIFilename" value>
<param name="captioningID" value>
<param name="enableErrorDialogs" value="0">
<param name="_cx" value="7117">
<param name="_cy" value="1191">
<embed type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"
name="p12"
width=434
height=45
src="http://domain.com/<?php echo $mURL; ?>"
showcontrols="true"
autostart="false"> </embed>
</object>
</td>
</tr>
</table>



</html>

Good answer
thank you all.

Mar. 11, 2009selena

http://www.youtube.com/watch?v=4Nk8hkAcX1I&feature=related

Sep. 22, 2009I am cool dion

not like you

Add a reaction

You can also return to the category or try this search for related threads.


 

Search the Forums

Go

Support

Support Here are some helpful links to learn more about the JW Player™:

Monetize Your Video

Monetize Your Video Earn money with ads from LongTail's AdSolution. Watch our demos and sign up now!

Why Buy a License?

Why Buy a License? If you don’t buy a commercial license, you cannot use a JW Player™ on (i) a site that has ads; (ii) a corporate site; or a (iii) CMS. Our licenses are very inexpensive, so what are you waiting for? Buy a license today.