root/trunk/install/php/mp4player.php

リビジョン 116, 4.2 kB (コミッタ: sorshi, コミット時期: 14 年 前)

HTML Video5 Player対応。
http://videojs.com/ のライブラリを./video-js/ディレクトリに入れて下さい。

Line 
1 <?php
2 /*
3  Anime recording system foltia
4  http://www.dcc-jpl.com/soft/foltia/
5
6 mp4player.php
7
8 ���
9 HTML5 Video Player��戎�c�MP4�����������
10 based HTML5 Video Player | VideoJS http://videojs.com/
11
12 綣��
13 f:�������ゃ���
14  DCC-JPL Japan/foltia project
15
16 */
17
18 include("./foltialib.php");
19 $con = m_connect();
20
21 if ($useenvironmentpolicy == 1){
22     if (!isset($_SERVER['PHP_AUTH_USER'])) {
23         header("WWW-Authenticate: Basic realm=\"foltia\"");
24         header("HTTP/1.0 401 Unauthorized");
25         redirectlogin();
26         exit;
27     } else {
28     login($con,$_SERVER['PHP_AUTH_USER'],$_SERVER['PHP_AUTH_PW']);
29     }
30 }//end if login
31
32 $pid = getgetnumform(p);
33
34 if ($pid != ""){
35 $query = "
36 SELECT title,countno,subtitle,foltia_subtitle.tid,PSPfilename 
37 FROM foltia_subtitle,foltia_program
38 WHERE pid = ? AND foltia_subtitle.tid = foltia_program.tid";
39 $rs = sql_query($con, $query, "DB������紊掩�������",array($pid));
40 $rowdata = $rs->fetch();
41
42 $title = htmlspecialchars(mb_convert_encoding($rowdata[0],"UTF-8", "EUC-JP"));
43     if ($rowdata[1] == ""){
44     $countno = "";
45     }else{
46     $countno = "膃�.htmlspecialchars($rowdata[1])."荅�;
47     }
48 $subtitle = htmlspecialchars(mb_convert_encoding($rowdata[2],"UTF-8", "EUC-JP"));
49 $tid htmlspecialchars($rowdata[3]);
50 $filename = htmlspecialchars($rowdata[4]);
51
52 }else{//綣���������弱���
53 header("Status: 404 Not Found",TRUE,404);
54 print "<!DOCTYPE html>
55 <html>
56 <head>
57   <meta charset=\"utf-8\" />\n";
58     print "  <title>foltia HTML5 Video Player</title></head><body>No pid.</body></html>";
59     exit ;
60 }
61
62 if ($filename == "") {//����ゃ�����������弱���header("Status: 404 Not Found",TRUE,404);
63 print "<!DOCTYPE html>
64 <html>
65 <head>
66   <meta charset=\"utf-8\" />\n";
67     print "  <title>foltia HTML5 Video Player</title></head><body>File not found.</body></html>";
68     exit ;
69 }
70
71
72 print "<!DOCTYPE html>\n<html>\n<head><meta charset=\"utf-8\" />\n\n
73 <title>foltia HTML5 Video Player / $title $countno $subtitle</title>\n";
74 $mp4videofileurl "http://". getserverfqdn() ."$httpmediamappath/$tid.localized/mp4/$filename";
75 ?>
76
77
78
79   <!-- Include the VideoJS Library -->
80   <script src="./video-js/video.js" type="text/javascript" charset="utf-8"></script>
81
82   <script type="text/javascript" charset="utf-8">
83     // Run the script on page load.
84
85     // If using jQuery
86     // $(function(){
87     //   VideoJS.setup();
88     // })
89
90     // If using Prototype
91     // document.observe("dom:loaded", function() {
92     //   VideoJS.setup();
93     // });
94
95     // If not using a JS library
96     window.onload = function(){
97       VideoJS.setup();
98     }
99
100   </script>
101   <!-- Include the VideoJS Stylesheet -->
102   <link rel="stylesheet" href="./video-js/video-js.css" type="text/css" media="screen" title="Video JS" charset="utf-8">
103 </head>
104 <body>
105
106 <?php
107 print "
108   <!-- Begin VideoJS -->
109   <div class=\"video-js-box\">
110     <!-- Using the Video for Everybody Embed Code http://camendesign.com/code/video_for_everybody -->
111     <video class=\"video-js\" width=\"480\" height=\"272\" poster=\"./img/videoplayer.png\" controls preload>
112       <source src=\"$mp4videofileurl\" type='video/mp4; codecs=\"avc1.42E01E, mp4a.40.2\"'>
113       <!-- Flash Fallback. Use any flash video player here. Make sure to keep the vjs-flash-fallback class. -->
114       <object class=\"vjs-flash-fallback\" width=\"480\" height=\"272\" type=\"application/x-shockwave-flash\"
115         data=\"http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf\">
116         <param name=\"movie\" value=\"http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf\" />
117         <param name=\"allowfullscreen\" value=\"true\" />
118         <param name=\"flashvars\" value='config={\"clip\":{\"url\":\"$mp4videofileurl\",\"autoPlay\":false,\"autoBuffering\":true}}' />
119         <!-- Image Fallback -->
120         <img src=\"./img/videoplayer.png\" width=\"640\" height=\"264\" alt=\"Poster Image\"
121           title=\"No video playback capabilities.\" />
122       </object>
123     </video>
124     <!-- Download links provided for devices that can't play video in the browser. -->
125     <p class=\"vjs-no-video\"><strong>Download Video:</strong>
126       <!-- Support VideoJS by keeping this link. -->
127       <a href=\"http://videojs.com\">HTML5 Video Player</a> by <a href=\"http://videojs.com\">VideoJS</a>
128     </p>
129   </div>
130   <!-- End VideoJS -->
131 "
132 ?>
133 </body>
134 </html>
135
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。
track feed