예제 #1
0
 /**
  * Functaion: appendRow
  *
  * Append new video node
  *
  * @param $thumbnailLoc
  * @param $title
  * @param $description
  * @param $url
  * @param VideoPlayerLoc $videoPlayerLoc
  * @param $duration
  * @param null $tag
  * @param null $expirationDate
  * @param null $rating
  * @param null $viewCount
  * @param null $publicationDate
  * @param null $familyFriendly
  * @param null $category
  * @param null $restriction
  * @param VideoGalleryLoc $videoGalleryLoc
  * @param VideoPrice $videoPrice
  * @param null $requiresSubscription yes|no
  * @param VideoUploader $videoUploader
  * @param VideoPlatform $videoPlatform
  * @param null $live yes|no
  */
 public function appendRow($thumbnailLoc, $title, $description, $url, VideoPlayerLoc $videoPlayerLoc, $duration, $tag = null, $expirationDate = null, $rating = null, $viewCount = null, $publicationDate = null, $familyFriendly = null, $category = null, $restriction = null, VideoGalleryLoc $videoGalleryLoc = null, VideoPrice $videoPrice = null, $requiresSubscription = null, VideoUploader $videoUploader = null, VideoPlatform $videoPlatform = null, $live = null)
 {
     if ($this->rowsControl() === false) {
         return;
     }
     $video = $this->doc->createElement('video:video');
     $video->appendChild($this->doc->createElement('video:thumbnail_loc', $thumbnailLoc));
     $video->appendChild($this->doc->createElement('video:title', $title));
     $video->appendChild($this->doc->createElement('video:description', $description));
     $video->appendChild($this->doc->createElement('video:content_loc', $url));
     $playerLoc = $this->doc->createElement('video:player_loc', $videoPlayerLoc->getContent());
     $playerLoc->setAttribute('allow_embed', $videoPlayerLoc->getAllowEmbed());
     $playerLoc->setAttribute('autoplay', $videoPlayerLoc->getAutoPlay());
     $video->appendChild($playerLoc);
     $video->appendChild($this->doc->createElement('video:duration', $duration));
     if ($tag !== null) {
         $video->appendChild($this->doc->createElement('video:tag', $tag));
     }
     if ($expirationDate !== null) {
         $video->appendChild($this->doc->createElement('video:expiration_date', $expirationDate));
     }
     if ($rating !== null) {
         $video->appendChild($this->doc->createElement('video:rating', $rating));
     }
     if ($viewCount !== null) {
         $video->appendChild($this->doc->createElement('video:view_count', $viewCount));
     }
     if ($publicationDate !== null) {
         $video->appendChild($this->doc->createElement('video:publication_date', $publicationDate));
     }
     if ($familyFriendly !== null) {
         $video->appendChild($this->doc->createElement('video:family_friendly', $familyFriendly));
     }
     if ($category !== null) {
         $video->appendChild($this->doc->createElement('video:category', $category));
     }
     if ($restriction !== null) {
         $video->appendChild($this->doc->createElement('video:restriction', $restriction));
     }
     if ($videoPrice !== null) {
         $galleryLoc = $this->doc->createElement('video:price', $videoPrice->getContent());
         $galleryLoc->setAttribute('currency', $videoPrice->getCurrency());
         $video->appendChild($galleryLoc);
     }
     if ($videoGalleryLoc !== null) {
         $galleryLoc = $this->doc->createElement('video:gallery_loc', $videoGalleryLoc->getContent());
         $galleryLoc->setAttribute('title', $videoGalleryLoc->getTitle());
         $video->appendChild($galleryLoc);
     }
     if ($requiresSubscription !== null) {
         if (in_array($requiresSubscription, array('yes', 'no'))) {
             $video->appendChild($this->doc->createElement('video:requires_subscription', $requiresSubscription));
         }
     }
     if ($videoUploader !== null) {
         $uploader = $this->doc->createElement('video:uploader', $videoUploader->getContent());
         $uploader->setAttribute('info', $videoUploader->getInfo());
         $video->appendChild($uploader);
     }
     if ($live !== null) {
         if (in_array($live, array('yes', 'no'))) {
             $video->appendChild($this->doc->createElement('video:live', $live));
         }
     }
     if ($videoPlatform !== null) {
         $platform = $this->doc->createElement('video:uploader', $videoPlatform->getContent());
         if (in_array($videoPlatform->getRelationship(), array('allow', 'deny'))) {
             $platform->setAttribute('relationship', $videoPlatform->getRelationship());
         }
         $video->appendChild($platform);
     }
     $this->url->appendChild($video);
     $this->rowsCount++;
 }
 function __construct($input_name, $output_file_name, $upload_directory = LIBRARY_UPLOAD_DIR)
 {
     parent::__construct($input_name, $output_file_name);
     $this->setUploadDirectory($upload_directory);
     $this->setSupportedMIME_types(VideoUploader::MIME());
 }