Advertisement
Guest User

events.eyecode

a guest
Feb 8th, 2015
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. <?php
  2. /* eyeOS project
  3. Internet Based Operating System
  4. Version 1.0
  5. www.eyeOS.org - www.eyeOS.info
  6. -----------------------------------------------------------------
  7. eyeOS Team
  8. http://www.eyeos.org/whoarewe
  9. -----------------------------------------------------------------
  10. eyeOS is released under the GNU General Public License - GPL
  11. provided with this release in license.txt
  12. or via web at www.gnu.org/licenses/gpl.txt
  13.  
  14. Copyright 2005-2007 eyeOS Team (team@eyeos.org)
  15.  
  16. To help continued development please consider a donation at
  17. http://www.eyeos.org/donations
  18. */
  19.  
  20. function mediaplayer_on_Message($params='') {
  21. reqLib('eyeWidgets','updateContent',$params);
  22. }
  23.  
  24. function mediaplayer_on_Resize($params= '') {
  25. $width = $params['arg'][0];
  26. $height = $params['arg'][1];
  27. $width = intval($width);
  28. $height = intval($height);
  29. $GLOBALS['GmailFrame']->setWidth($width-10);
  30. $GLOBALS['GmailFrame']->setHeight($height-28);
  31. }
  32.  
  33. function mediaplayer_on_Close($params = ''){
  34. global $myPid;
  35. service('proc','close',array($myPid));
  36. }
  37.  
  38. function mediaplayer_on_getFile($params = null) {
  39. // Get the input URL back from the "Hidden" widget
  40. $url = $GLOBALS['mediaplayer_Hidden']->text;
  41.  
  42. // Clean some path relevant things
  43. $filename = basename($url);
  44. $path = eyeFiles('cleanPath', array(substr(trim($url, '/\\'), 0, -strlen($filename)))); // utf8
  45.  
  46. // Specify the file's content length
  47. header('Accept-Ranges: bytes');
  48. if ($path[1] === 'real') {
  49. header('Content-Length: ' . vfs('real_filesize', array($path[0] . '/' . $filename)));
  50. } else {
  51. header('Content-Length: ' . vfs('filesize', array($path[0] . '/' . $filename)));
  52. }
  53.  
  54. // Specify the file's content type
  55. header('Content-Type: video/mp4');
  56.  
  57. // Echo the file content
  58. if ($path[1] === 'real') {
  59. vfs('printFile', array($path[0] . '/' . $filename));
  60. } else {
  61. vfs('readFile', array($path[0] . '/' . $filename));
  62. }
  63.  
  64. // Exit the HTTP request
  65. exit;
  66. }
  67.  
  68. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement