예제 #1
0
 function display_entity()
 {
     $this->start_table();
     // Embedded preview
     $avd = new reasonAVDisplay();
     $avd->disable_automatic_play_start();
     if ($image_info = reason_get_media_placard_image_info($this->_entity)) {
         $avd->set_placard_image($image_info['url']);
         $avd->set_placard_image_dimensions($image_info['width'], $image_info['height']);
     }
     $embed_markup = $avd->get_embedding_markup($this->_entity);
     if (!empty($embed_markup)) {
         $this->show_item_default('File Preview', $embed_markup);
         if ($embed_markup == strip_tags($embed_markup, REASON_DEFAULT_ALLOWED_TAGS)) {
             $this->show_item_default('Embed Code', '<textarea rows="7">' . htmlspecialchars($embed_markup) . '</textarea>');
         } else {
             $this->show_item_default('Embed Code', 'Not available<div class="smallText">(The code used to embed ' . $this->_entity->get_value('media_format') . ' files may not be accepted in a Reason content area.)</div>');
         }
     }
     $link_url = REASON_HTTP_BASE_PATH . 'displayers/av_display.php?id=' . htmlspecialchars($this->_entity->id());
     $this->show_item_default('Link', '<a href="' . $link_url . '" target="_blank">Link to video</a>');
     // Everything Else
     $this->show_all_values($this->_entity->get_values());
     $this->end_table();
 }
 /**
  * Returns the html markup that can embed the media on a page.
  * @return string
  */
 public function get_embed_markup()
 {
     if (!$this->media_work) {
         return '';
     }
     if ($this->current_media_file) {
         $avd = new reasonAVDisplay();
         $height = $this->get_embed_height();
         $width = $this->get_embed_width();
         $avd->set_video_dimensions($width, $height);
         $avd->set_audio_dimensions(0, 0);
         if (!$this->show_controls) {
             $avd->set_parameter('flv', 'controlbar', 'false');
             $avd->set_parameter('qt', 'controller', '0');
             $avd->set_parameter('wmv', 'ShowControls', 'false');
         }
         if (!$this->autostart) {
             $avd->disable_automatic_play_start();
         }
         if ($image_info = reason_get_media_placard_image_info($this->current_media_file)) {
             $avd->set_placard_image($image_info['url']);
             $avd->set_placard_image_dimensions($image_info['width'], $image_info['height']);
         }
         $this->latest_tech_note = $avd->get_tech_note($this->current_media_file);
         $embed_markup = $avd->get_embedding_markup($this->current_media_file);
         return $embed_markup;
     } else {
         return '';
     }
 }