root/trunk/install/php/mp4player.php

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

文字コードをUTF-8からEUC-JPに変更

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