Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> jak zabezpieczyć streaming video, Możliwość oglądania tylko dla zalogowanych
scorpimen
post
Post #1





Grupa: Zarejestrowani
Postów: 15
Pomógł: 0
Dołączył: 13.10.2007

Ostrzeżenie: (0%)
-----


Witam,

Pomagam w prowadzeniu strony koledze. Strona to www.tv-polmusic.com kolega chce sobie teraz odpalić taki kanał live.
Myślałem żeby odpalić go w postaci wmv lub flash. Teraz mam jednak taki problem że chciałbym tą transmisję zabezpieczyć.
Generalnie jak podam żródło transmisji bezposrednio w kodzie strony to nie ma problemu żeby ktos sobie takie źródełko podpioł pod swoją stronę.

Czy istnieją jakies sposoby żeby tą transmisje udostepniać tylko dla zalogowanych użytkowników i tylko dla domeny tv-polmusic.com (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
scorpimen
post
Post #2





Grupa: Zarejestrowani
Postów: 15
Pomógł: 0
Dołączył: 13.10.2007

Ostrzeżenie: (0%)
-----


w manualu znalazlem takie cos

  1. <?php
  2. function dl_file($file){
  3.  
  4.     //First, see if the file exists
  5.     if (!is_file($file)) { die(&#092;"404 File not found!\"); }
  6.  
  7.     //Gather relevent info about file
  8.     $len = filesize($file);
  9.     $filename = basename($file);
  10.     $file_extension = strtolower(substr(strrchr($filename,&#092;".\"),1));
  11.  
  12.     //This will set the Content-Type to the appropriate setting for the file
  13.     switch( $file_extension ) {
  14.         case &#092;"mp3\": $ctype=\"audio/mpeg\"; break;
  15.       case &#092;"wav\": $ctype=\"audio/x-wav\"; break;
  16.       case &#092;"mpeg\":
  17.       case &#092;"mpg\":
  18.       case &#092;"mpe\": $ctype=\"video/mpeg\"; break;
  19.       case &#092;"mov\": $ctype=\"video/quicktime\"; break;
  20.       case &#092;"avi\": $ctype=\"video/x-msvideo\"; break;
  21.  
  22.       default: $ctype=&#092;"application/force-download\";
  23.     }
  24.  
  25.     //Begin writing headers
  26.     header(&#092;"Pragma: public\");
  27.     header(&#092;"Expires: 0\");
  28.     header(&#092;"Cache-Control: must-revalidate, post-check=0, pre-check=0\");
  29.     header(&#092;"Cache-Control: public\"); 
  30.     header(&#092;"Content-Description: File Transfer\");
  31.     
  32.     //Use the switch-generated Content-Type
  33.     header(&#092;"Content-Type: $ctype\");
  34.  
  35.     //Force the download
  36.     $header=&#092;"Content-Disposition: attachment; filename=\".$filename.\";\";
  37.     header($header );
  38.     header(&#092;"Content-Transfer-Encoding: binary\");
  39.     header(&#092;"Content-Length: \".$len);
  40.     @readfile($file);
  41.     exit;
  42. }
  43.  
  44. ?>



tylko niewiem czy takie cos sie wogóle nadaje. czy nie zapcham tym serwera itp.
Może znajdzie się ktoś z doświadczeniem w tych kwestiach. 

// tak na boku chce zrobić sobie playlist plików video w mysql jakby ktoś znał gotowca to bym sie ucieszył

Ten post edytował scorpimen 24.11.2008, 00:42:42
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 8.10.2025 - 08:49