Hello All,

I need a small help. I have an application built in php which stores images and videos as in gallery. A user can click on the video , it will play as in streaming way. This part is ok. now, we have a limitation that we cannot play .vob files using our embedded player. so I just put an href tag to the location of that video thus user can download/play according to the client browser settings. this is again ok. but the issue arise , when I go for seeing source code. since href is a direct url , it shows complete path of video including all dir which is not good for security.. I am just wondering, how can I mask this?

I know URL encoding but issue is

my code for external client side video play is like this

Syntax: [ Download ] [ Hide ]
<a href ="/rootfolder/videofolder/video.vob"></a>
. from my knowledge href tag only accept non-formatted values right?/ I mean can I put some thing like this ??

<a href="#8743854358jsdsad76as"></a>.. I dont think so...am I so dump?:D

okies.. my requirement is , when client go for seeing source code, the source url of video should be masked/encrypted....any help???/


thanx

try this

<?php
$userinput = "hi.wmv";
echo '<a href="showvideo.php?video=', urlencode($userinput), '">';
?>

have you tried doing it on .htaccess?

given: actualDirectory and dummyDirectory.

If we provide a link in this form <a href="YourDomainDotCom/dummyDirectory/somevideo.wmv" target="_blank"/>Download Here</a>, then we can add a simple entry to our .htaccess like this;

Redirect /dummyDirectory/ http://YourDomainDotCom/actualDirectory/

If they view the source code of the page, they will only see this <a href="YourDomainDotCom/dummyDirectory/somevideo.wmv" target="_blank"/>Download Here</a> , and NOT <a href="YourDomainDotCom/actualDirectory/somevideo.wmv" target="_blank"/>Download Here</a>

Another method is to convert all of your videos to flv, inject metadata on them with flvtool2. Stream the video by way of pseudostreaming using xmoov. In fact, you can assign token on the xmoov streaming to filter who gets to watch your videos, but that's another lengthy process.

Big adult sites, the video url's are stored in the database, and then a view key is assigned with time limits. So, for every view key, a time limit is set on how long the url remains to be valid and accessible. For example,

table
| id | title | down_url | viewkey | expiration |
| 50 | | someVid | |this.wmv | |123564 | | 3600 |

You can then send a query for video from $_GET, to pull out other information.


You can also create an xml file using php , and then just extract the download url from xml file hidden from your viewers view.

thanx a ton!!!! for these replies.... really grateful. once again DaniWeb and members rocks!!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.