当前位置: 首页>>代码示例>>PHP>>正文


PHP Media类代码示例

本文整理汇总了PHP中Media的典型用法代码示例。如果您正苦于以下问题:PHP Media类的具体用法?PHP Media怎么用?PHP Media使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Media类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: postProcessFastStart

    /**
     * Specifically for creating fast starting files.
     * however it can also be used as a standalone function call from the H264Format object.
     *
     * @access public
     * @author Oliver Lillie
     * @param Media $media 
     * @return Media
     */
    public function postProcessFastStart(Media $media)
    {
        // TODO possibly look at setting -movflags faststart options on ffmpeg instead of this.
        //			set the yamdi input and output options.
        $output = $media->getMediaPath();
        $temp_output = $output . '.qtfaststart.' . pathinfo($output, PATHINFO_EXTENSION);
        //			build the qtfaststart process
        $qtfaststart_process = new ProcessBuilder('qtfaststart', $this->_config);
        $exec = $qtfaststart_process->add($output)->add($temp_output)->getExecBuffer();
        //			execute the process.
        $exec->setBlocking(true)->execute();
        //			check for any qt-faststart errors
        if ($exec->hasError() === true) {
            if (is_file($temp_output) === true) {
                //@unlink($temp_output);
            }
            if ($this->_enforce_qt_faststart_success === true) {
                //@unlink($output);
                throw new FfmpegProcessPostProcessException('qt-faststart post processing of "' . $output . '" failed. The output file has been removed. Any additional qt-faststart message follows: 
' . $exec->getExecutedCommand() . '
' . $exec->getBuffer());
            }
            // TODO, log or exception not sure as the original file is ok.
        } else {
            //				nope everything went ok. so delete ffmpeg file, and then rename yamdi file to that of the original.
            unlink($output);
            rename($temp_output, $output);
        }
        return $media;
    }
开发者ID:ravinderphp,项目名称:landlordv2,代码行数:39,代码来源:Mp4.php

示例2: combine

 public static function combine($type, $files, $compress = false)
 {
     $root = panel::instance()->roots()->assets() . DS . $type;
     $cache = new Media($root . DS . 'panel.' . $type);
     $media = new Collection(array_map(function ($file) use($root) {
         return new Media($root . DS . str_replace('/', DS, $file));
     }, $files));
     // get the max modification date
     $modified = max($media->pluck('modified'));
     if (is_writable($root) and (!$cache->exists() or $cache->modified() < $modified)) {
         $cache->remove();
         $content = '';
         foreach ($media as $asset) {
             $content .= $asset->read() . PHP_EOL;
         }
         if ($compress) {
             $content = static::compress($content);
         }
         f::write($root . DS . 'panel.' . $type, $content);
     }
     if ($cache->exists()) {
         return $type(panel()->urls()->{$type}() . '/panel.' . $type . '?v=' . panel()->version());
     }
     return $type(array_map(function ($item) use($type) {
         return 'panel/assets/' . $type . '/' . $item;
     }, $files));
 }
开发者ID:LucasFyl,项目名称:korakia,代码行数:27,代码来源:assets.php

示例3: getMediaFile

 /**
  * Download a media file
  * provided the content type
  * on successful response of content type
  * header
  */
 public function getMediaFile()
 {
     $content = $this->client->get($this->media, array(), FALSE);
     $media = new Media();
     $media->setData($content);
     return $media;
 }
开发者ID:robtro,项目名称:php-bandwidth,代码行数:13,代码来源:Recording.php

示例4: transform

 /**
  * Transforms an object (media) to a string (id).
  *
  * @param Media|null $media
  *
  * @return string
  */
 public function transform($media)
 {
     if (null === $media || !$media instanceof \Apoutchika\MediaBundle\Model\MediaInterface) {
         return '';
     }
     return $media->getId();
 }
开发者ID:Vooodoo,项目名称:MediaBundle,代码行数:14,代码来源:MediaToIdTransformer.php

示例5: InstallFiles

 public function InstallFiles()
 {
     $media = new Media();
     $media->addModuleFile('modules/preview/vendor/jquery-1.11.1.min.js');
     $media->addModuleFile('modules/preview/xibo-text-render.js');
     $media->addModuleFile('modules/preview/xibo-layout-scaler.js');
 }
开发者ID:fignew,项目名称:xibo-cms,代码行数:7,代码来源:finance.module.php

示例6: testUpdate

 /**
  * @group volume
  */
 public function testUpdate()
 {
     print "\n" . __METHOD__ . ' ';
     $this->_rootLogin();
     $volname = 'pool.file.7d.0001';
     // get info
     $media = new Media();
     $res = $media->getByName($volname);
     $mediaid = $res[0]['mediaid'];
     $poolid = $res[0]['poolid'];
     // update record
     $this->request->setPost(array('mediaid' => $mediaid, 'poolid' => 2, 'volstatus' => 'Append', 'volretention' => 365, 'recycle' => 1, 'slot' => 1, 'inchanger' => 0, 'maxvoljobs' => 99999999, 'maxvolfiles' => 99999, 'comment' => "\n\nmoved\nLorem ipsum dolor sit amet\n"));
     $this->request->setMethod('POST');
     $this->dispatch('volume/update');
     $this->logBody($this->response->outputBody());
     // debug log
     $this->assertController('volume');
     $this->assertAction('update');
     // back
     $this->resetRequest()->resetResponse();
     $this->request->setPost(array('mediaid' => $mediaid, 'poolid' => $poolid, 'volstatus' => 'Append', 'volretention' => 365, 'recycle' => 1, 'slot' => 1, 'inchanger' => 0, 'maxvoljobs' => 999, 'maxvolfiles' => 999, 'comment' => "\n\nback\nLorem ipsum dolor sit amet\n"));
     $this->request->setMethod('POST');
     $this->dispatch('volume/update');
     $this->logBody($this->response->outputBody(), 'a');
     // debug log
     $this->assertController('volume');
     $this->assertAction('update');
 }
开发者ID:staser,项目名称:webacula,代码行数:31,代码来源:VolumeControllerTest.php

示例7: updated

 public function updated(Media $media)
 {
     if (is_null($media->getOriginal('model_id'))) {
         return;
     }
     if ($media->manipulations != $media->previousManipulations) {
         app(FileManipulator::class)->createDerivedFiles($media);
     }
 }
开发者ID:robgeorgeuk,项目名称:laravel-medialibrary,代码行数:9,代码来源:MediaObserver.php

示例8: DoCheck

 public function DoCheck()
 {
     AssetLoadManager::register('tableList');
     // Search engine
     $vo_search_config_settings = SearchEngine::checkPluginConfiguration();
     $this->view->setVar('search_config_settings', $vo_search_config_settings);
     $this->view->setVar('search_config_engine_name', SearchEngine::getPluginEngineName());
     // Media
     $t_media = new Media();
     $va_plugin_names = $t_media->getPluginNames();
     $va_plugins = array();
     foreach ($va_plugin_names as $vs_plugin_name) {
         if ($va_plugin_status = $t_media->checkPluginStatus($vs_plugin_name)) {
             $va_plugins[$vs_plugin_name] = $va_plugin_status;
         }
     }
     $this->view->setVar('media_config_plugin_list', $va_plugins);
     // PDF Rendering
     $t_pdf_renderer = new PDFRenderer();
     $va_plugin_names = PDFRenderer::getAvailablePDFRendererPlugins();
     $va_plugins = array();
     foreach ($va_plugin_names as $vs_plugin_name) {
         if ($va_plugin_status = $t_pdf_renderer->checkPluginStatus($vs_plugin_name)) {
             $va_plugins[$vs_plugin_name] = $va_plugin_status;
         }
     }
     $this->view->setVar('pdf_renderer_config_plugin_list', $va_plugins);
     // Application plugins
     $va_plugin_names = ApplicationPluginManager::getPluginNames();
     $va_plugins = array();
     foreach ($va_plugin_names as $vs_plugin_name) {
         if ($va_plugin_status = ApplicationPluginManager::checkPluginStatus($vs_plugin_name)) {
             $va_plugins[$vs_plugin_name] = $va_plugin_status;
         }
     }
     $this->view->setVar('application_config_plugin_list', $va_plugins);
     // Barcode generation
     $vb_gd_is_available = caMediaPluginGDInstalled(true);
     $va_barcode_components = array();
     $va_gd = array('name' => 'GD', 'description' => _t('GD is a graphics processing library required for all barcode generation.'));
     if (!$vb_gd_is_available) {
         $va_gd['errors'][] = _t('Is not installed; barcode printing will not be possible.');
     }
     $va_gd['available'] = $vb_gd_is_available;
     $va_barcode_components['GD'] = $va_gd;
     $this->view->setVar('barcode_config_component_list', $va_barcode_components);
     // General system configuration issues
     if (!(bool) $this->request->config->get('dont_do_expensive_configuration_checks_in_web_ui')) {
         ConfigurationCheck::performExpensive();
         if (ConfigurationCheck::foundErrors()) {
             $this->view->setVar('configuration_check_errors', ConfigurationCheck::getErrors());
         }
     }
     $this->render('config_check_html.php');
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:55,代码来源:ConfigurationCheckController.php

示例9: getMediaItemMarkup

 public static function getMediaItemMarkup($mediaId, $userID, $tenantID)
 {
     $class = new Media($userID, $tenantID);
     try {
         $media = $class->getEntity($mediaId);
         return Display::getMediaMarkup($media);
     } catch (Exception $ex) {
         // do anything or just ignore if we can't load? Ignoring for now
         //echo '<p>unable to load: ' . $ex->getMessage() . '</p>';
         return '<p class="hidden">Unable to load media id=' . $mediaId . '<p>';
     }
 }
开发者ID:robertmoss,项目名称:foodfinder_main,代码行数:12,代码来源:display.php

示例10: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show()
 {
     $user_id = Auth::id();
     $media_model = new Media();
     $queue_items = QueueItem::where('user_id', '=', $user_id)->get()->toArray();
     foreach ($queue_items as $key => $queue_item) {
         $queue_items[$key] = $media_model->getMediaFromAPI($queue_item['imdb_id']);
     }
     $view_data['queue_items'] = $queue_items;
     $view_data['side_nav_page'] = 'queue';
     return View::make('queue', $view_data);
 }
开发者ID:jcanver,项目名称:seenjump,代码行数:18,代码来源:QueueController.php

示例11: allView

 public function allView($id_estabelecimento_id)
 {
     $sql = "SELECT `nome_media` FROM `nome_media` WHERE `id_estabelecimento_id` = {$id_estabelecimento_id} LIMIT 0,1;";
     $vai = new MySQLDB();
     $result = $vai->ExecuteQuery($sql);
     while ($dados = mysql_fetch_array($result)) {
         $cliente = new Media();
         $cliente->setnome_media(array('nome_media' => $dados['nome_media']));
         $arr[] = $cliente;
     }
     return $arr;
 }
开发者ID:GlauberF,项目名称:Portal-curso-Online,代码行数:12,代码来源:media.class.php

示例12: photoAttachment

 public function photoAttachment(CModel $model, $attr, Media $media)
 {
     static $count = 0;
     $count++;
     $html = '';
     $html .= CHtml::openTag('div', array('class' => 'photo-attachment-container'));
     $html .= $media->getImage(false, array('class' => 'photo-attachment dummy-attachment'));
     $html .= CHtml::tag('div', array('class' => 'remove-attachment-button', 'id' => 'remove-attachment-button-' . $count), X2Html::fa('circle') . X2Html::fa('times-circle-o'));
     $html .= $this->hiddenField($model, $attr . '[]', array('value' => $media->id));
     $html .= CHtml::closeTag('div');
     Yii::app()->clientScript->registerScript('MobileActiveForm::photoAttachment' . $count, "\n            \$('#remove-attachment-button-{$count}').click (function () {\n                \$(this).parent ().remove ();\n            });\n        ");
     return $html;
 }
开发者ID:tymiles003,项目名称:X2CRM,代码行数:13,代码来源:MobileActiveForm.php

示例13: getMediaMarkup

 public static function getMediaMarkup(\Media $Media)
 {
     switch ($Media->Class) {
         case 'AudioMedia':
             return '<a href="' . $Media->WebPath . '" title="' . htmlspecialchars($Media->Caption) . '" class="media-link audio-link">' . '<img src="' . $Media->getThumbnailRequest(static::$thumbWidth, static::$thumbHeight) . '" alt="' . htmlspecialchars($Media->Caption) . '">' . '</a>';
         case 'VideoMedia':
             return '<div title="' . htmlspecialchars($Media->Caption) . '" class="media-link video-link" id="player-' . $Media->ID . '" style="width:425px;height:300px;">' . '<img src="' . $Media->getThumbnailRequest(static::$thumbWidth, static::$thumbHeight) . '" alt="' . htmlspecialchars($Media->Caption) . '">' . '</div><script>flowplayer("player-' . $Media->ID . '", "/swf/flowplayer-3.2.15.swf",{playlist:["' . $Media->WebPath . '"]})</script>';
         case 'PDFMedia':
             return '<a href="' . $Media->WebPath . '" title="' . htmlspecialchars($Media->Caption) . '" class="media-link pdf-link">' . '<img src="' . $Media->getThumbnailRequest(static::$thumbWidth, static::$thumbHeight) . '" alt="' . htmlspecialchars($Media->Caption) . '">' . '</a>';
         case 'PhotoMedia':
         default:
             return '<figure class="media-figure">' . '<a href="' . $Media->WebPath . '" title="' . htmlspecialchars($Media->Caption) . '" class="media-link image-link">' . '<img class="media-img" src="' . $Media->getThumbnailRequest(static::$fullWidth, static::$fullHeight) . '" alt="' . htmlspecialchars($Media->Caption) . '">' . '</a>' . ($Media->Caption ? '<figcaption class="media-caption">' . htmlspecialchars($Media->Caption) . '</figcaption>' : '') . '</figure>';
     }
 }
开发者ID:nbey,项目名称:Emergence-Skeleton,代码行数:14,代码来源:Media.php

示例14: __toString

 public function __toString()
 {
     /** 
      * make a new file on catapult when we receive an anchor  
      * usage follows:
      *
      * @/storage/my.wav => https://api.catapult.inetwork.com/v1/users/u-xxx/media/my
      */
     if (preg_match("/^@/", $this->url, $m)) {
         $media = new Media();
         $media->create(array("file" => preg_replace("/^@/", "", $this->url), "mediaName" => $this->name));
     }
     return $this->url;
 }
开发者ID:robtro,项目名称:php-bandwidth,代码行数:14,代码来源:MediaURL.php

示例15: parse

 function parse($value)
 {
     if ($value == '') {
         return null;
     }
     // First attempt to create media with predefined name
     if (preg_match('/^(\\w+)(?:\\s+(portrait|landscape))?$/', $value, $matches)) {
         $name = $matches[1];
         $landscape = isset($matches[2]) && $matches[2] == 'landscape';
         $media =& Media::predefined($name);
         if (is_null($media)) {
             return null;
         }
         return array('size' => array('width' => $media->get_width(), 'height' => $media->get_height()), 'landscape' => $landscape);
     }
     // Second, attempt to create media with predefined size
     $parts = preg_split('/\\s+/', $value);
     $width_str = $parts[0];
     $height_str = isset($parts[1]) ? $parts[1] : $parts[0];
     $width = units2pt($width_str);
     $height = units2pt($height_str);
     if ($width == 0 || $height == 0) {
         return null;
     }
     return array('size' => array('width' => $width / mm2pt(1) / pt2pt(1), 'height' => $height / mm2pt(1) / pt2pt(1)), 'landscape' => false);
 }
开发者ID:dadigo,项目名称:simpleinvoices,代码行数:26,代码来源:css.size.inc.php


注:本文中的Media类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。