Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Process to hide my URLs (php session) - help plugin "hd"


Hello,

I'm sorry, I do not speak English very well because I am French.

I need help with the integration of JW Player on my site.

I want to use the code below in order to "hide" the "url of my video.

Everything works fine but I do not know how to file "hd":

I have a two part process to hide my URLs

1) I have a video.php file :

bc.. <?php
session_start ();
header ('Location:'.$_SESSION['VIDEO']);
session_unset('VIDEO');
?>


2) and a main file with the player - (example 360.php) :

bc.. <?php
session_start();
$_SESSION['VIDEO']="http://www.mysite.fr/jwplayer/360.flv";
?>

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

<script type="text/javascript" src="http://www.mysite.fr/jwplayer/swfobject.js"></script>
<div id="mediaspace">This text will be replaced</div>

<script type="text/javascript">
var so = new SWFObject('http://www.mysite.fr/jwplayer/player.swf','mpl','768','432','9');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addParam('wmode','opaque');
so.addVariable('file',encodeURIComponent('http://www.mysite.fr/jwplayer/video.php'));
so.addVariable('plugins','hd-1');
so.addVariable('hd.file',encodeURIComponent('http://www.mysite.fr/jwplayer/video.php'));
so.addVariable('type', 'video');
so.write('mediaspace');
</script>
</body></html>


Indeed, a php session is already open when the video is playing but how do you switch to HD?

As you will understand, my video is in two versions:
File size "360" 360.flv
File size "hd": 360-hd.flv

I do not know or include the file "hd" (360-hd.flv)

Thank you in advance for your help.

9 Community Answers

Pablo

JW Player Support Agent  
0 rated :

@Remy69 -

I would create a second php file – video-hd.php, which does the same thing as video.php but uses a different PHP session variable:

<?php   
    session_start  (); 
    header ('Location:'.$_SESSION['VIDEO_HD']);
    session_unset('VIDEO_HD'); 
?>



Then on your player page:
<?php
    session_start();
    $_SESSION['VIDEO']="http://www.mysite.fr/jwplayer/360.flv";
    $_SESSION['VIDEO_HD']="http://www.mysite.fr/jwplayer/360-hd.flv";
?>



It's important to remember that this will not stop people from discovering the location of your video file.  Anyone with a browser traffic inspector (like Firebug for Firefox or the built-in tools in Webkit and Internet Explorer) can discover the true location of your video files.  There's nothing you can do to prevent people from accessing the "real" location.

JW Player

User  
0 rated :

Thank you very much for your fast response.

Will have one small problem though, when I click on "hd" the following message appears:
Video not found or access denied: http://www.mysite.fr/jwplayer/video-hd.php

By cons, if I refresh my page, load the video far "hd".

He not only lacks a code to automatically refresh the page when you press "hd" and vice versa?

Pablo

JW Player Support Agent  
0 rated :

@Remy -

The problem is not with the player, but with your new php page (video-hd.php). It looks like this page is not available on your server — you get an error when you try to access it:

http://www.mysite.fr/jwplayer/video-hd.php

JW Player

User  
0 rated :

Yes but if I refresh the page manually it works.

Do you know what I can do to automatically refresh the php page when you click on the button "HD"?

thank you very much

Pablo

JW Player Support Agent  
0 rated :

@Remy -

This is not possible actually. The HD plugin doesn’t refresh the page – it simply loads a new video into the player.

JW Player

User  
0 rated :

Hello,

Is it possible to refresh the page by adding a php code when you click on HD?

It's really complicated, I would hide the original URLs even though I know it will not be fully effective.

Pablo

JW Player Support Agent  
0 rated :

@remy69 -

No, it is not possible to modify your PHP code to change the behavior of the HD plugin.

JW Player

User  
0 rated :

I am getting a 2032 error when I try to use php instead of direct link.

html code is:

<script type='text/javascript'>
jwplayer('mediaspace').setup({
'flashplayer': 'scripts/mediaplayer-5.8/player.swf',
'type': 'sound',
'file': encodeURIComponent('http://www.mydomain.com/links.php?id=useme'),
'backcolor': '000000',
'frontcolor': 'FFFFFF',
'lightcolor': 'CCCCFF',
'controlbar': 'bottom',
'width': '570',
'height': '174'
});
</script>

php code is:

<?php
$path = array(
'useme' => 'http://www.mydomain.com/UseMe.mp3');
if (array_key_exists($_GET['id'], $path)) header('Location: ' . $path[$_GET['id']]);
?>

Can you please let me know what is wrong

Pablo

JW Player Support Agent  
0 rated :

@lilcube-

You don’t need to URL encode your file property. The embedder will do that for you.

Just set:

'file': 'http://www.mydomain.com/links.php?id=useme',


This question has received the maximum number of answers.