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


PHP Video::play_url方法代码示例

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


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

示例1: stream

 /**
  * stream
  * Streams a given media file.
  * Takes the file id in parameter with optional max bit rate, file format, time offset, size and estimate content length option.
  */
 public static function stream($input)
 {
     self::check_version($input, "1.0.0", true);
     $fileid = self::check_parameter($input, 'id', true);
     $maxBitRate = $input['maxBitRate'];
     $format = $input['format'];
     // mp3, flv or raw
     $timeOffset = $input['timeOffset'];
     $size = $input['size'];
     // For video streaming. Not supported.
     $estimateContentLength = $input['estimateContentLength'];
     // Force content-length guessing if transcode
     $params = '&client=' . rawurlencode($input['c']) . '&noscrobble=1';
     if ($estimateContentLength == 'true') {
         $params .= '&content_length=required';
     }
     if ($format && $format != "raw") {
         $params .= '&transcode_to=' . $format;
     }
     if ($maxBitRate) {
         $params .= '&bitrate=' . $maxBitRate;
     }
     if ($timeOffset) {
         $params .= '&frame=' . $timeOffset;
     }
     $url = '';
     if (Subsonic_XML_Data::isVideo($fileid)) {
         $url = Video::play_url(Subsonic_XML_Data::getAmpacheId($fileid), $params, 'api', function_exists('curl_version'));
     } elseif (Subsonic_XML_Data::isSong($fileid)) {
         $url = Song::play_url(Subsonic_XML_Data::getAmpacheId($fileid), $params, 'api', function_exists('curl_version'));
     } elseif (Subsonic_XML_Data::isPodcastEp($fileid)) {
         $url = Podcast_Episode::play_url(Subsonic_XML_Data::getAmpacheId($fileid), $params, 'api', function_exists('curl_version'));
     }
     if (!empty($url)) {
         self::follow_stream($url);
     }
 }
开发者ID:bl00m,项目名称:ampache,代码行数:42,代码来源:subsonic_api.class.php

示例2: library_parts

 public static function library_parts($params)
 {
     $n = count($params);
     if ($n > 0) {
         $key = $params[0];
         if ($n == 2) {
             $file = $params[1];
             $id = Plex_XML_Data::getAmpacheId($key);
             if (Plex_XML_Data::isSong($key)) {
                 $media = new Song($id);
                 if ($media->id) {
                     $url = Song::play_url($id, '', 'api', true);
                     self::stream_url($url);
                 } else {
                     self::createError(404);
                 }
             } elseif (Plex_XML_Data::isVideo($key)) {
                 $media = new Video($id);
                 if ($media->id) {
                     $url = Video::play_url($id, '', 'api', true);
                     self::stream_url($url);
                 } else {
                     self::createError(404);
                 }
             }
         } elseif ($n == 1) {
             if ($_SERVER['REQUEST_METHOD'] == 'PUT') {
                 if (isset($_GET['subtitleStreamID'])) {
                     $lang_code = dechex(hex2bin(substr($_GET['subtitleStreamID'], 0, 2)));
                     $_SESSION['iframe']['subtitle'] = $lang_code;
                 }
             }
         }
     }
 }
开发者ID:cheese1,项目名称:ampache,代码行数:35,代码来源:plex_api.class.php

示例3: _itemVideo

 private static function _itemVideo($video, $parent)
 {
     $api_session = AmpConfig::get('require_session') ? Stream::get_session() : false;
     $art_url = Art::url($video->id, 'video', $api_session);
     $fileTypesByExt = self::_getFileTypes();
     $arrFileType = $fileTypesByExt[$video->type];
     return array('id' => $parent . '/' . $video->id, 'parentID' => $parent, 'restricted' => '1', 'dc:title' => self::_replaceSpecialSymbols($video->f_title), 'upnp:class' => isset($arrFileType['class']) ? $arrFileType['class'] : 'object.item.unknownItem', 'upnp:albumArtURI' => $art_url, 'upnp:genre' => Tag::get_display($video->tags, false, 'video'), 'res' => Video::play_url($video->id, '', 'api'), 'protocolInfo' => $arrFileType['mime'], 'size' => $video->size, 'duration' => $video->f_time_h . '.0');
 }
开发者ID:nioc,项目名称:ampache,代码行数:8,代码来源:upnp_api.class.php

示例4:

    if (AmpConfig::get('share')) {
        ?>
                <?php 
        Share::display_ui('video', $video->id, false);
        ?>
            <?php 
    }
    ?>
        <?php 
}
?>
        <?php 
if (Access::check_function('download')) {
    ?>
            <a rel="nohtml" href="<?php 
    echo Video::play_url($video->id);
    ?>
"><?php 
    echo UI::get_icon('link', T_('Link'));
    ?>
</a>
            <a rel="nohtml" href="<?php 
    echo AmpConfig::get('web_path');
    ?>
/stream.php?action=download&video_id=<?php 
    echo $video->id;
    ?>
"><?php 
    echo UI::get_icon('download', T_('Download'));
    ?>
</a>
开发者ID:bl00m,项目名称:ampache,代码行数:31,代码来源:show_video.inc.php

示例5: videos

 /**
  * videos
  *
  * This builds the xml document for displaying video objects
  *
  * @param    array    $videos    (description here...)
  * @return    string    return xml
  */
 public static function videos($videos)
 {
     if (count($videos) > self::$limit or self::$offset > 0) {
         $videos = array_slice($videos, self::$offset, self::$limit);
     }
     $string = '';
     foreach ($videos as $video_id) {
         $video = new Video($video_id);
         $video->format();
         $string .= "<video id=\"" . $video->id . "\">\n" . "\t<title><![CDATA[" . $video->title . "]]></title>\n" . "\t<mime><![CDATA[" . $video->mime . "]]></mime>\n" . "\t<resolution>" . $video->f_resolution . "</resolution>\n" . "\t<size>" . $video->size . "</size>\n" . self::tags_string($video->tags) . "\t<url><![CDATA[" . Video::play_url($video->id, '', 'api') . "]]></url>\n" . "</video>\n";
     }
     // end foreach
     $final = self::_header() . $string . self::_footer();
     return $final;
 }
开发者ID:cheese1,项目名称:ampache,代码行数:23,代码来源:xml_data.class.php


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