Example #1
0
 function getWebStreamURL($quality = null)
 {
     global $mvStreamFilesTable, $mvVideoArchivePaths, $mvDefaultVideoQualityKey;
     //@@todo mediawiki path for media (insted of hard link to $mvVideoArchive)
     //@@todo make sure file exisits
     if (!$quality) {
         $quality = $mvDefaultVideoQualityKey;
     }
     $anx_req = '';
     if ($this->getStartTime() != '' && $this->getEndTime() != '') {
         //undesa
         //was $anx_req  ='.anx?t='. $this->getStartTime() . '/' . $this->getEndTime();
         $anx_req = '?t=' . $this->getStartTime() . '/' . $this->getEndTime();
         //undesa
     }
     if ($this->doesStreamExist()) {
         //@@todo cache this / have a more organized store for StreamFiles in streamTitle
         //$dbr = & wfGetDB(DB_READ);
         //$result = $dbr->select($dbr->tableName($mvStreamFilesTable), array('path'), array (
         //	'stream_id' => $this->mvStream->id,
         //	'file_desc_msg'=>$quality
         //));
         //$streamFile  =$dbr->fetchObject($result);
         //make sure we have streamFiles (used to generate the link)
         $mvStreamFile = new MV_StreamFile($this->mvStream);
         //if link empty return false:
         if ($mvStreamFile->getFullURL() == '') {
             return false;
         }
         return $mvStreamFile->getFullURL() . $anx_req;
     } else {
         //@@todo throw ERROR
         return false;
     }
 }
 /**
  * function: getWebStreamURL
  *
  * returns full web accessible path to stream
  * (by default this is the web streameable version of the file)
  * web stream is file_desc_msg as: mv_ogg_low_quality
  * $mvDefaultVideoQualityKey in MV_Settings.php
  *
  */
 function getWebStreamURL($quality = null)
 {
     global $mvVideoArchivePaths, $mvDefaultVideoQualityKey;
     // @@todo mediawiki path for media (instead of hard link to $mvVideoArchive)
     // @@todo make sure file exists
     if (!$quality) {
         $quality = $mvDefaultVideoQualityKey;
     }
     if ($this->doesStreamExist()) {
         // @@todo cache this / have a more organized store for StreamFiles in streamTitle
         $dbr =& wfGetDB(DB_READ);
         $result = $dbr->select('mv_stream_files', '*', array('stream_id' => $this->mvStream->id, 'file_desc_msg' => $quality));
         if ($dbr->numRows($result) == 0) {
             return false;
         }
         $streamFile = $dbr->fetchObject($result);
         // print_r($streamFile);
         // make sure we have streamFiles (used to generate the link)
         $mvStreamFile = new MV_StreamFile($this->mvStream, $streamFile);
         // if link empty return false:
         if ($mvStreamFile->getFullURL() == '') {
             return false;
         }
         $time_req = '';
         if ($this->getStartTime() != '' && $this->getEndTime() != '') {
             if ($mvStreamFile->supportsURLTimeEncoding()) {
                 if ($mvStreamFile->path_type == 'url_anx') {
                     $time_req = '?t=' . $this->getStartTime() . '/' . $this->getEndTime();
                 }
                 if ($mvStreamFile->path_type == 'mp4_stream') {
                     $time_req = '?start=' . $this->getStartTimeSeconds() . '&end=' . $this->getEndTimeSeconds();
                 }
             }
         }
         return $mvStreamFile->getFullURL() . $time_req;
     } else {
         // @@todo throw ERROR
         return false;
     }
 }