embed.php

Gesponsorde koppelingen

PHP script bestanden

  1. voorbeeld.php
  2. embed.php

« Lees de omschrijving en reacties

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?php
class video_embed{

   function
embed($raw, $auto)
   {
      
      //raw data schoonmaken
      $raw = trim($raw);
      
      //check auto play
      
      //de vershillende hosts gebruikt van een host http:// en http://www. om te zorgen dat hij werkt

      $hosts = array("http://youtube.com/watch?v=", "http://www.youtube.com/watch?v=", "http://video.google.com/videoplay?docid=-", "http://www.video.google.com/videoplay?docid=-",
      "http://one.revver.com/watch/", "http://www.one.revver.com/watch/", "http://www.metacafe.com/watch/", "http://metacafe.com/watch/", "http://www.liveleak.com/view?i=", "http://liveleak.com/view?i=");
      $code = str_replace($hosts, "", $raw);
      
  
      //host zoeken
      $host1 = strpos($raw, "youtube.com", 1);
      $host2 = strpos($raw, "video.google.com", 1);
      $host3 = strpos($raw, "one.revver.com", 1);
      $host4 = strpos($raw, "www.metacafe.com", 1);
      $host5 = strpos($raw, "www.liveleak.com", 1);
      
      if($host1 != null) {$host .= "youtube";}
      if($host2 != null) {$host .= "google";}
      if($host3 != null) {$host .= "revver";}
      if($host4 != null) {$host .= "metacafe";}
      if($host5 != null) {$host .= "liveleak";}
      
      //error
      if($host != "youtube" && $host != "google" && $host != "revver" && $host != "metacafe" && $host != "liveleak")
      {

         $error = true;
         echo "Error Embedding<br/>";
      }

      
      if($host == "youtube")
      {

         //autoplay
         $you_auto = "";
         if($auto == "play") { $you_auto = "&autoplay=1"; }
      
         echo "
         <object width='425' height='353'><param name='movie' value='http://www.youtube.com/v/$code$you_auto'></param>
         <param name='wmode' value='transparent'></param>
         <embed src='http://www.youtube.com/v/$code$you_auto' type='application/x-shockwave-flash' wmode='transparent' width='425' height='353'>
         </embed></object><br/>"
;
      }

      
      if($host == "google")
      {

         //autoplay
         $google_auto = "";
         if($auto == "play") { $google_auto = "&autoPlay=true"; }
      
         echo "
         <embed style='width:400px; height:326px;' id='VideoPlayback' type='application/x-shockwave-flash'
         src='http://video.google.com/googleplayer.swf?docId=-$code$google_auto&hl=en' flashvars=''></embed><br/><br/>"
;
      }

      
      if($host == "revver")
      {

         //code
         $code = str_replace("/flv", "", $code);
        
         //autoplay
         $rev_auto = "";
         if($auto == "play") { $rev_auto = "&autoStart=true"; }
        
         echo "<script src='http://flash.revver.com/player/1.0/player.js?mediaId:$code;affiliateId:0;height:392;width:480;' type='text/javascript'>
         </script><br/>"
;
      }

      
      if($host == "metacafe")
      {

         //code
         $code = strrev($code);
         $code = trim($code, "/");
         $code = strrev($code);
      
         echo "<embed src='http://www.metacafe.com/fplayer/$code.swf'
         width='400' height='345' wmode='transparent' pluginspage='http://www.macromedia.com/go/getflashplayer'
         type='application/x-shockwave-flash'> </embed><br/><br/>"
;
      }

      
      if($host == "liveleak")
      {

         //code
         $code = str_replace("&p=1", "", $code);
      
      
         echo "<object type='application/x-shockwave-flash' width='450' height='370'='transparent'
         data='http://www.liveleak.com/player.swf?autostart=$live_auto&token=$code'>
         <param name='movie' value='http://www.liveleak.com/player.swf?autostart=$live_auto&token=$code'>
         <param name='wmode' value='transparent'><param name='quality' value='high'></object><br/><br/>"
;
      }

      
      //variablen
      $raw = null;
      $code = null;
      $host = null;      
   }
}

?>

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.