PHP - How To Hide The Video Url?
In my php web site the video player appears and plays the video. In Chrome you can right click on the player screen and choose 'inspect element' etc, but another choice is 'Copy video URL'. How can I block that, or hide (or disguise/rename) video URLs?
Similar TutorialsI am working on an page where I have a video playing in a div, using jwplayer. I have a form in another div below the player div that appears by changing the display:none property at a certain time, but this requires my users to scroll down to see it below the video div. I would prefer this form div to appear and the video div to disappear simultaneously, which is simple enough, but I need the audio from the video div to continue playing uninterrupted, then the divs would switch back after a period of time. I guess another option would be to have the form div appear and float over the video div, but I'm not sure how to do that. Any nifty suggestions? Hoping someone could help me with hiding a video player if a video is not present in the db. I have split up the code to make it easier to understand. Thanks in advance (int) $ListId=$_GET['ListID']; function mysql_resultTo2DAssocArray ( $result) { $i=0; $ret = array(); while ($row = mysql_fetch_assoc($result)) { foreach ($row as $key => $value) { $ret[$i][$key] = $value; } $i++; } return ($ret); -------------------------------------------------------------------------------------------- $querys = mysql_query("SELECT * FROM video WHERE listingID = '$ListId' "); $Details_video=mysql_resultTo2DAssocArray ($querys); -------------------------------------------------------------------------------------------- <div class="right_col"> <p id='preview'>The player will show in this paragraph</p> <script type='text/javascript' src='/flvPlayer/swfobject.js'></script> <script type='text/javascript'> var s1 = new SWFObject('/flvPlayer/player-viral.swf','player','280','200','9'); s1.addParam('allowfullscreen','true'); s1.addParam('allowscriptaccess','always'); s1.addParam('autostart','true'); s1.addParam('image','/flvfiles/<?php echo $Details_video[0]['imagePath']?>'); s1.addParam('flashvars','&file=/flvfiles/<?php echo $Details_video[0]['videoPath']?>&image=/flvfiles/<?php echo $Deatls_video[0]['imagePath']?>&dock=false&autostart=true'); s1.write('preview'); </script> hi all How we can read the id of an element tag on the html page to use it in a sql query for selecting a particular record. or else how we can simply connect a link to jwplayer to play in the specific area defined for it. That we just click that link and it will play a video in that area. how it is implement in php Hello, i just joined the forums, nice forum . Well im looking for a solution. I want download the videos from a site, but i cant find a solution how to get the location of the video, cause its dynamic. Here is a sample video: http://www.collegehumor.com/video:1946215 And here is the link to the video: http://8.media.collegehumor.cvcdn.com/21/12/a8cc907f5e150fe77ce7c0c47b1b9d31.mp4 That link i got via a FIREFOX Addon called "DownloadHelper" this addon finds the location with help of http headers. So is it possible way to find the videos with php? Thanks for help. hello, i have read topic on the internet that says i have to buy an adobe media interactive server and moyea so that you can have a video on the internet (without using you tube). how can i install a software like this to the webhost? thanks everyone. Hi,i m confused php developer (beginner bt i wnt to do advance things with php and mysql) i want to make video website for myself and i also have 10000s of video in my pc and can any one help me to complete this project 1. when user clik on some video thumbnail the video player(jw or flow player) pop-up and start the video without go to different page(if possible) 2.do i need to upload all my video first to my server or i upload it with php mysql then how is it possible to link and make thumbnail of all the 10000s videos with video player so all the video will play without error and i knw i cant make these 10000s videos thumbnails and video link and pages for each videos so how can i start my thing please help me in this a BIG THANKS in advance Hi guys, My first post here. I would like to seek you guys help about playing video from mysql. I wanted to upload video to database and also play it inside my webpage using the media player format. Thank in advance Hi, I want to restrict my registered user to see video only once per day... Can anyone guide me how can i do this with php??? Thanks Ok, this is killing me, So I'm finally asking for help. I'm working on a website, which streams videofiles from external links. The site plays & allows you to download the videos from the same external link. I need to mask the url of these videos. At the moment, I have successfully masked the url when downloading. If you click the download image, rather than the path being http://externalsite.com/videofile.avi its http://mysitename.com/external.php?id=xx&mid=xx So that is nicely hidden. However, I am having a problem when it comes to the embedded player on the page. At the moment i am using flowplayer for flv & mp4 videos, and just the usual embed for avi videos. Flow players embed code is like this --------------------------------------------------- <a href="<?=$videoFile?>" style="display:block;width:740px;height:400px;" id="player"> </a> <script language="JavaScript"> flowplayer("player", "<?=url::base()?>flowplayer-3.2.5.swf", { clip: { autoPlay: false, autoBuffering: true } }); </script> ----------------------------------------- At the moment, the player only works if i put the url in this format: http://externalsite.com/videofile.avi and wont work in this format http://mysitename.com/external.php?id=xx&mid=xx all download.php does is check the file exists, sets the headers and prompts users to open or save. Why isnt this working with the player? Please see the attached external.php file for my heade info etc to hopefully shed some light on this So i have a large video files, 1.5 gigs even. I made an html5 video player where the source is a php file. The php file is supposed to go below the web root and serve the video file to the html5 video tag. This all works just fine if the video using a script that uses HTTP_RANGE to serve the file in parts to the client. The problem is, once one video is playing - i can't do anything else. Its like the server locks up. I mean i can scrub that video, i can do anything to that page. I just can't navigate away. But i can open a new browser and play a new video. But again, once that first one is playing, or even paused, i can't do anything else. That is of course until i restart apache. Any ideas on how to stream these large files better? I have a feeling they are set to stream and never stop. This is the code for that Code: [Select] function rangeDownload($file) { $fp = @fopen($file, 'rb'); $size = filesize($file); // File size $length = $size; // Content length $start = 0; // Start byte $end = $size - 1; // End byte // Now that we've gotten so far without errors we send the accept range header /* At the moment we only support single ranges. * Multiple ranges requires some more work to ensure it works correctly * and comply with the spesifications: http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.2 * * Multirange support annouces itself with: * header('Accept-Ranges: bytes'); * * Multirange content must be sent with multipart/byteranges mediatype, * (mediatype = mimetype) * as well as a boundry header to indicate the various chunks of data. */ header("Accept-Ranges: 0-$length"); // header('Accept-Ranges: bytes'); // multipart/byteranges // http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.2 if (isset($_SERVER['HTTP_RANGE'])) { $c_start = $start; $c_end = $end; // Extract the range string list(, $range) = explode('=', $_SERVER['HTTP_RANGE'], 2); // Make sure the client hasn't sent us a multibyte range if (strpos($range, ',') !== false) { // (?) Shoud this be issued here, or should the first // range be used? Or should the header be ignored and // we output the whole content? header('HTTP/1.1 416 Requested Range Not Satisfiable'); header("Content-Range: bytes $start-$end/$size"); // (?) Echo some info to the client? exit; } // If the range starts with an '-' we start from the beginning // If not, we forward the file pointer // And make sure to get the end byte if spesified if ($range == '-') { // The n-number of the last bytes is requested $c_start = $size - substr($range, 1); } else { $range = explode('-', $range); $c_start = $range[0]; $c_end = (isset($range[1]) && is_numeric($range[1])) ? $range[1] : $size; } /* Check the range and make sure it's treated according to the specs. * http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html */ // End bytes can not be larger than $end. $c_end = ($c_end > $end) ? $end : $c_end; // Validate the requested range and return an error if it's not correct. if ($c_start > $c_end || $c_start > $size - 1 || $c_end >= $size) { header('HTTP/1.1 416 Requested Range Not Satisfiable'); header("Content-Range: bytes $start-$end/$size"); // (?) Echo some info to the client? exit; } $start = $c_start; $end = $c_end; $length = $end - $start + 1; // Calculate new content length fseek($fp, $start); header('HTTP/1.1 206 Partial Content'); } // Notify the client the byte range we'll be outputting header("Content-Range: bytes $start-$end/$size"); header("Content-Length: $length"); // Start buffered download $buffer = 1024 * 8; while(!feof($fp) && ($p = ftell($fp)) <= $end) { if ($p + $buffer > $end) { // In case we're only outputtin a chunk, make sure we don't // read past the length $buffer = $end - $p + 1; } set_time_limit(0); // Reset time limit for big files echo fread($fp, $buffer); flush(); // Free up memory. Otherwise large files will trigger PHP's memory limit. } fclose($fp); } Hi I am having an issue searching videos from youtube when ever I do a search i keep getting an page not found error. here is my code Code: [Select] <? class Youtube { var $dom, $idvideo, $title, $video; //function for video title function videoTitle() { return $this->title; } function pagination() { return true; } function tag($tag, $page = 1) { if ($page <= 0) $page = 1; $start = ($page-1)*10 + 1; $tag = str_replace(' ', '+', $tag); $feed = ('http://gdata.youtube.com/feeds/api/videos?vq='.$tag.'&start-index='.$start.'&max-results=10&orderby=updated&alt=rss'); $this->dom = getFeed($feed); } function video($id) { $this->idvideo = $id; $feed = ("http://gdata.youtube.com/feeds/api/videos/".$id); $this->dom = getFeed($feed); $this->video = $this->dom->getElementsByTagName('entry')->item(0); $this->title = $this->video->getElementsByTagName('title')->item(0)->textContent; } function player() { ?> <object width="425" height="355"> <param name="movie" value="http://www.youtube.com/v/<?=$this->idvideo?>" /> <param name="wmode" value="transparent" /> <embed src="http://www.youtube.com/v/<?=$this->idvideo?>" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed> </object> <? } function view($tag) { $videos = $this->dom->getElementsByTagName('item'); foreach ($videos as $video) { $id = $video->getElementsByTagName('guid')->item(0)->textContent; $id = explode('/', $id); $id = $id[6]; echo '<div class="video">'; $title = $video->getElementsByTagName("title")->item(0)->textContent; echo '<p><a href="'.BASE_URL.'/0/video/'.$tag.'/'.$id.'.html">'.$title.'</a></p>'; $fotos = $video->getElementsByTagNameNS("http://search.yahoo.com/mrss/", "thumbnail"); $tiempo = $video->getElementsByTagNameNS("http://gdata.youtube.com/schemas/2007", "duration"); $tiempo = $tiempo->item(0)->getAttribute("seconds"); $i = 0; echo '<div class="img">'; foreach ($fotos as $foto) { $url = $foto->getAttribute("url"); echo '<a href="'.BASE_URL.'/0/video/'.$tag.'/'.$id.'.html"><img src="'.$url.'" alt="'.$title.'"/></a>'; $i++; if ($i > 2) break; } echo '</div>'; echo '<p class="links"><a href="'.BASE_URL.'/0/video/'.$tag.'/'.$id.'.html">'._VIEW.'</a> '._DURATION.': '.minutes($tiempo).'</p>'; echo '<p>'.cut($video->getElementsByTagName("description")->item(0)->textContent).'</p>'; $tags = $video->getElementsByTagName("category"); echo '<div class="tags">'; echo 'tags: '; foreach ($tags as $palabra) { if (strpos($palabra->textContent, "http") === FALSE) echo '<a href="'.BASE_URL.'/0/tag/'.$palabra->textContent.'.html">'.$palabra->textContent.'</a> '; } echo '</div>'; echo '</div>'; } } function videoInfo() { $id = $this->video->getElementsByTagName("id")->item(0)->textContent; $id = explode("/", $id); $id = $id[6]; echo '<div class="video">'; $title = $this->video->getElementsByTagName("title")->item(0)->textContent; $tiempo = $this->video->getElementsByTagNameNS("http://gdata.youtube.com/schemas/2007", "duration"); $tiempo = $tiempo->item(0)->getAttribute("seconds"); echo '<p class="links">'._DURATION.': '.minutes($tiempo).'</p>'; echo '<p>'.$this->video->getElementsByTagName("description")->item(0)->textContent.'</p>'; $tags = $this->video->getElementsByTagNameNS("http://www.w3.org/2005/Atom", "category"); echo '<div class="tags">'; echo 'tags: '; foreach ($tags as $palabra) { if (strpos($palabra->getAttribute("term"), "http") === FALSE) echo '<a href="'.BASE_URL.'/0/tag/'.$palabra->getAttribute("term").'.html">'.$palabra->getAttribute("term").'</a> '; } echo '</div>'; echo '</div>'; } } ?> Hiya! Is it possible to play an avi or mpg video file with php? If not is there any other recommeded scripts out there be it jquery, ajax, js ect that will do this? Many thanks, James. i need to load advertisemtn and after that video. how it is possible to do example link is belove. i need to load random commercials on random vidoes. please guide me thanks http://sports.yahoo.com/nfl/blog/shutdown_corner/post/Enjoy-special-teams-failures-Merry-Christmas-fr?urn=nfl-295573 I am practicing php with a local server running and I created a class that uses curl to open pages, fetch the html, put it into a DOMDocument, parse it, etc...I began following links and downloading images and checking their mime types so I know how to handle it. There isn't really much information about doing it with video files though like mpeg, mov, etc...When I try simply following the link and downloading it locally it works, but I get no mime type, or a wierd mime type that doesn't make sense and it will only store a blank file (but it all downloads ok) I just can't play it. Anybody know anything about doing video stuff with php? Hello there, I am going around and thinking of this is possible. Let's say I have a flash video player or something, and the thing I want to do is, that when the flash video is DONE playing, a PHP script/function will be made. How can that be done? I guess it should be a little bit like Lockerz. You know, when the video is done, you get credited. Any suggestions? Regards. I have a mobile app. They visit a web site where they login. The videos live above web root, thus making it impossible for anyone to directly link to the video file. On iOS, I made a PHP script that checks if they are logged in first and if they are I use a range download method that acts like streaming. Works great! On android however, the script isn't working..lame. So I was trying to think of other methods to deliver the video, but first checking if they are logged in. My idea was to check if they are logged in, if they are, copy the video from above web root to a temp directory in web root and give it a uniqid name and insert it into the DB. That ID will then expire after two hours and I would delete the video. Ok that sounds like it would work for both phones, except with high traffic, that could be problematic. My next idea was symlinks, but I don't know much about them other than they are a shortcut. Could I potentially use a symlink to give the logged in user a video file that lives above web root? I have some videos stored above web root. I then have a PHP file that acts as a proxy to hand the videos to the user. The reason for this is so not just anybody can download the videos. They have to be authenticated. If I am on the PC, it prompts for a download so I know the script is working. When I try it on my iPad, I get the big play button but with a cross through it. When I try it on my iPhone, the movie interface loads, but I am then prompted with "Cannot play movie: The server is not correctly configured" What could that be referring to? My script is below: <?php include("config.php"); //just includes session_start and db connection if ($_SESSION['user']['authed'] == true) { session_write_close(); $id = $_GET['id']; $query = mysql_query("SELECT filename FROM episodes WHERE id = '$id'"); $row = mysql_fetch_array($query); $filename = "../../media/".$row['filename']; header( 'Content-Description: File Transfer' ); header( 'Content-Type: application/octet-stream' ); header( 'Content-Disposition: attachment; filename='.basename( $filename ) ); header( 'Content-Transfer-Encoding: binary' ); header( 'Expires: 0' ); header( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' ); header( 'Pragma: public' ); header( 'Content-Length: ' . filesize( $filename ) ); ob_clean(); flush(); readfile( $filename ); exit; } ?> Hi, How to play any website's video using php.I searched many website.All are mention code for play video using a particular website like youtube only or VEOH only or Vimo only and etc. I need play video using any website's URL when we give input as valid url.Send me reply quick please......... hello guys i am a newbie want help with how to upload a youtube in your script and in database i know about the $_files thing but how do i give a link please help me out !! Hi, I'm looking to create a PHP script that converts video files to MP4, WebM and OGG but I don't know where to start. I've been searching on google and on these forums for that type of information but I didn't find anything. Is there any website or PHP library/framework that I should look at in order to find that kind of information? Any help is appreciated! |