Exemple #1
0
 public function fixMetadata($increment_version = true, $content = null, $total_duration = null, $specific_version = null)
 {
     // check that the file of the desired version really exists
     $content_dir = myContentStorage::getFSContentRootPath();
     if (!$content) {
         $content = $this->getMetadata($specific_version);
     }
     if ($increment_version) {
         // 	increment the counter of the file
         $this->setData(parent::getData());
     }
     $file_name = kFileSyncUtils::getLocalFilePathForKey($this->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_DATA, $specific_version));
     // replaced__getDataPath
     $duration = $total_duration ? $total_duration : myMetadataUtils::getDuration($content);
     $this->setLengthInMsecs($duration * 1000);
     $total_duration = null;
     $editor_type = null;
     $version = myContentStorage::getVersion($file_name);
     $fixed_content = myFlvStreamer::fixMetadata($content, $version, $total_duration, $editor_type);
     $this->save();
     $sync_key = $this->getSyncKey(self::FILE_SYNC_ENTRY_SUB_TYPE_DATA, $version);
     kFileSyncUtils::file_put_contents($sync_key, $fixed_content, false);
     // replaced__setFileContent
     return $fixed_content;
 }