Source for file index.php

Documentation is available at index.php

  1. <?php
  2. session_start();
  3.  
  4. // Basic classes with helpers
  5. include_once("Settings.class.php");
  6. include_once("Formats.class.php");
  7. include_once("Utils.class.php");
  8.  
  9. // Dreambox part
  10. include_once("Dreambox.class.php");
  11. include_once("Boutique.class.php");
  12. include_once("Channel.class.php");
  13. include_once("ProgramGuide.class.php");
  14. include_once("Program.class.php");
  15. include_once("Recording.class.php");
  16.  
  17. // Server part
  18. include_once("VLCServer.class.php");
  19.  
  20. // Start the external player
  21. if (isset($_GET["external"]) && !Utils::isMobileDevice()) {
  22. $lVLCObj = new VLCserver(Settings::getEnigmaVersion());
  23. $lVLCObj->openExternal($_GET["external"]);
  24. exit;
  25. }
  26.  
  27. // Set defaults, first check url, then user default
  28. $lSelectedResolution = ($_GET["resolution"]!= "" ? $_GET["resolution"] : "512x288");
  29. $lSelectedFPS = ($_GET["fps"] != "" ? $_GET["fps"] : 25);
  30. $lSelectedBitrate = ($_GET["bitrate"] != "" ? $_GET["bitrate"] : "500");
  31. $lSelectedVideoCodec = ($_GET["video"] != "" ? $_GET["video"] : "WMV2");
  32. $lSelectedAudioCodec = ($_GET["audio"] != "" ? $_GET["audio"] : "mp3");
  33. $lSelectedTransport = ($_GET["transport"] != "" ? $_GET["transport"] : "mmsh");
  34. $lSelectedBoutique = ($_GET["boutiques"] != "" ? $_GET["boutiques"] : "Canal Digitaal NL");
  35. $lSelectedChannel = ($_GET["channels"] != "" ? rawurldecode($_GET["channels"]) : "1:0:1:FAB:451:35:C00000:0:0:0:"); // NED1
  36.  
  37. if (Utils::isMobileDevice() || $_GET["forcemobile"]) {
  38. include_once("index-mobile.php");
  39. exit;
  40. }
  41.  
  42. // XAJAX Framework part
  43. require_once ("xajax/xajax.inc.php"); // Basic xajax include. Should be somewhere in your php includes.... or on the drive...
  44. $xajax = new xajax();
  45. $xajax->registerExternalFunction("action","Ajax.class.php");
  46. $xajax->setFlag("debug",true);
  47. $xajax->processRequests();
  48. ?>
  49. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  50. <html>
  51. <head>
  52. <title><?php echo Settings::getProgramName() . " (" . Settings::getVersionNumber() . ")"; ?></title>
  53. <meta name="generator" content="Bluefish 1.0.7"/>
  54. <meta name="author" content="Joshua Rubingh"/>
  55. <meta name="copyright" content="2007 TheYOSH" />
  56. <meta name="keywords" content="Restream video from a Dreambox Satelite receiver" />
  57. <meta name="description" content="" />
  58. <?php $xajax->printJavascript('xajax/'); // XAJAX part 2 ?>
  59. <script language="javascript" type="text/javascript" src="js/jquery-latest.pack.js"></script>
  60. <script language="javascript" type="text/javascript" src="js/thickbox.js"></script>
  61. <script language="javascript" type="text/javascript" src="js/slider.js" ></script>
  62. <script language="javascript" type="text/javascript" src="js/swfobject.js" ></script>
  63. <script language="javascript" type="text/javascript" src="js/javascript.js" ></script>
  64.  
  65. <link rel="stylesheet" type="text/css" media="screen" href="css/sliders.css" />
  66. <link rel="stylesheet" type="text/css" media="screen" href="css/thickbox.css" />
  67. <link rel="stylesheet" type="text/css" media="screen" href="css/style.css" />
  68. </head>
  69. <body id="body">
  70. <h1><?php echo Settings::getProgramName() . " (" . Settings::getVersionNumber() . ")"; ?></h1>
  71. <p>Here you can watch live television. The channel will be converted to an internetstream in realtime. You can choose from about 2000 channels in about 6 different languages.<br /> Use the pulldown from the 'Boutigue' to change the channelspack. In the pulldown 'Channel' you can choose the channel to watch. Finaly press the button 'Change'. Wait for about 5 seconds and the player should start.</p>
  72. <p>If the stream doesn't start, or the image is black, than you have probably choosen a channel which I don't have access to. So change to an other channel. You should also have Video Lan Client installed as active plugin for Firefox.</p>
  73. <p>Flash can take up some more time. Wait for about 30 sec for flash starts playing</p>
  74. <form id="zapForm" name="zapForm">
  75. <table align="center" id="mainTable" border="1">
  76. <tr>
  77. <td align="center" valign="middle">
  78. <!-- Player -->
  79. <div id="PlayerDiv" >&nbsp;</div>
  80. </td>
  81. <td width="125px">
  82. <!-- Controls -->
  83. Resolution:<br /><?php echo Utils::makePulldown("resolution",Formats::getDimensions(),$lSelectedResolution) ?><br />
  84. FPS:<br /><?php echo Utils::makePulldown("fps",Formats::getFrameRates(),$lSelectedFPS) ?><br />
  85. Bitrate:<br /><?php echo Utils::makePulldown("bitrate",Formats::getVideoBitrates(),$lSelectedBitrate) ?><br />
  86. Video codec:<br /><?php echo Utils::makePulldown("video",Formats::getVideoCodecs(),$lSelectedVideoCodec) ?><br />
  87. Audio codec:<br /><?php echo Utils::makePulldown("audio",Formats::getAudioCodecs(),$lSelectedAudioCodec) ?><br />
  88. Transport:<br /><?php echo Utils::makePulldown("transport",Formats::getStreamTypes(),$lSelectedTransport) ?><br />
  89. Boutigue: <br />
  90. <div id="boutiquesSelector">
  91. <select name="boutiques" id="boutiques" onchange="xajax_action('loadChannels',this.value)">
  92. <option value="-1">Loading boutiques...</option>
  93. </select>
  94. </div>
  95. Channel:<br />
  96. <div id="channelsSelector">
  97. <select name="channels" id="channels" onchange="xajax_action('tvguide',this.value);">
  98. <option value="-1">Loading channels...</option>
  99. </select>
  100. </div>
  101. <br />
  102. <a href="javascript:void(0)" onclick="openExternal();">Open in external player</a><br />
  103. <a href="javascript:void(0)" onclick="xajax_action('loadRecordings');">Load recordings</a>
  104. </td>
  105. <td rowspan="3" width="260px">
  106. <!-- tv guide -->
  107. <div id="tvguide">&nbsp;</div>
  108. </td>
  109. </tr>
  110. <tr>
  111. <td id="serverStatus">Server status</td>
  112. <td >
  113. <input type="button" value="Change Channel" onclick="showZapWating();xajax_action('zap',xajax.getFormValues('zapForm'))">
  114. <input type="button" value="Kill server" onclick="xajax_action('killserver')">
  115. </td>
  116. </tr>
  117. <tr>
  118. <td colspan="2">Programma info:
  119. <div id="programmaInfo" style="width:600px">&nbsp;</div>
  120. </td>
  121. </tr>
  122. </table>
  123. </form>
  124. <p>
  125. <strong>Supported players:</strong><br />
  126. <table id="matrix">
  127. <tr>
  128. <th></th>
  129. <th>VLC</th>
  130. <th>Windows Media</th>
  131. <th>Flash (v. 9.0 r124)</th>
  132. </tr>
  133. <tr>
  134. <td>Resolution</td>
  135. <td>any</td>
  136. <td>any</td>
  137. <td>any</td>
  138. </tr>
  139. <tr>
  140. <td>FPS</td>
  141. <td>any</td>
  142. <td>any</td>
  143. <td>any</td>
  144. </tr>
  145. <tr>
  146. <td>Bitrate</td>
  147. <td>any</td>
  148. <td>any</td>
  149. <td>any</td>
  150. </tr>
  151. <tr>
  152. <td>Video codec</td>
  153. <td>DIV3, MP43, H263</td>
  154. <td>WMV1, WMV2</td>
  155. <td>x264</td>
  156. </tr>
  157. <tr>
  158. <td>Audio codec</td>
  159. <td>mpga, mp3</td>
  160. <td>mp3</td>
  161. <td>mp4a</td>
  162. </tr>
  163. <tr>
  164. <td>Transport</td>
  165. <td>http, rtp</td>
  166. <td>mms</td>
  167. <td>rtmp</td>
  168. </tr>
  169. <tr>
  170. <td>Boutique</td>
  171. <td>any</td>
  172. <td>any</td>
  173. <td>any</td>
  174. </tr>
  175. <tr>
  176. <td>Channel</td>
  177. <td>any</td>
  178. <td>any</td>
  179. <td>any</td>
  180. </tr>
  181. </table>
  182. </p>
  183. <div id="waitingMessage"><p>Please wait while we are loading the boutiques and channel data...<br /><br />Loading...<img src="images/loadingAnimation.gif" alt="Loading" align="center" /></p></div>
  184. <div id="zapWaitingMessage"><p>Please wait while we are changing the channel...<br /><br />Zapping...<img src="images/loadingAnimation.gif" alt="Loading" align="center" /></p></div>
  185. <div id="debug"><a href="javascript:void(0);" onclick="toggleDebug()">Debug..</a>
  186. <div id="debug-content">
  187. <?php
  188. $lVLCobj = new VLCServer();
  189. $lVLCobj->getCurrentStream();
  190. ?>
  191. </div>
  192. </div>
  193. </body>
  194. </html>

Documentation generated on Tue, 24 Jun 2008 18:59:34 +0200 by phpDocumentor 1.3.0RC3