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


PHP Video::get方法代码示例

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


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

示例1: getVideoList

 /**
  * Videos function.
  * 
  * @access public
  * @return void
  */
 public function getVideoList()
 {
     $filter = '"ParentID" = ' . $this->ID;
     $limit = 3;
     // Build a list of all IDs for VideoGroups that are children
     $holderIDs = $this->VideoGroupIDs();
     if ($holderIDs) {
         if ($filter) {
             $filter .= ' OR ';
         }
         $filter .= '"ParentID" IN (' . implode(',', $holderIDs) . ")";
     }
     $order = '"SiteTree"."Title" ASC';
     $entries = Video::get()->where($filter)->sort($order);
     $list = new PaginatedList($entries, Controller::curr()->request);
     $list->setPageLength($limit);
     return $list;
 }
开发者ID:jsirish,项目名称:silverstripe-html5video,代码行数:24,代码来源:VideoGroup.php

示例2: getVideoList

 /**
  * Method that returns a DataList of all
  * Video pages in the current VideoGroup
  * and all child VideoGroup pages.
  * Note: this isn't recursive through child
  * VideoGroup pages of the current VideoGroup
  * page.
  *
  * @access public
  * @param bool $all
  *
  * @return DataList
  */
 public function getVideoList($all = false)
 {
     $groupIDS = $this->getVideoGroupIDS($all);
     $groupIDS[] = $this->ID;
     return Video::get()->filter('ParentID', $groupIDS);
 }
开发者ID:helpfulrobot,项目名称:dynamic-silverstripe-html5video,代码行数:19,代码来源:VideoGroup.php

示例3: all

 /**
  * @return mixed
  */
 public function all()
 {
     return $this->video->get();
 }
开发者ID:phillipmadsen,项目名称:app,代码行数:7,代码来源:VideoRepository.php

示例4: video

 public function video()
 {
     $banners = $this->banners;
     $videos = Video::get();
     return View::make('pages.video')->with(compact('banners', 'videos'));
 }
开发者ID:PuchkaTs,项目名称:ganbaatar,代码行数:6,代码来源:PagesController.php

示例5: oembed

 public function oembed(SS_HTTPRequest $request)
 {
     /*{
      * "thumbnail_height": 360, 
      * "author_name": "ZackScott", 
      * "title": "Amazing Nintendo Facts", 
      * "height": 270, 
      * "provider_name": "YouTube", 
      * "width": 480, 
      * "html": "\u003ciframe width=\"480\" height=\"270\" src=\"http:\/\/www.youtube.com\/embed\/M3r2XDceM6A?feature=oembed\" frameborder=\"0\" allowfullscreen\u003e\u003c\/iframe\u003e", 
      * "provider_url": "http:\/\/www.youtube.com\/", 
      * "thumbnail_url": "http:\/\/i.ytimg.com\/vi\/M3r2XDceM6A\/hqdefault.jpg", 
      * "type": "video", 
      * "thumbnail_width": 480, 
      * "author_url": "http:\/\/www.youtube.com\/user\/ZackScott", 
      * "version": "1.0"
      * }
      */
     /* {
     		"version": "1.0",
     		"type": "video",
     		"provider_name": "YouTube",
     		"provider_url": "http://youtube.com/",
     		"width": 425,
     		"height": 344,
     		"title": "Amazing Nintendo Facts",
     		"author_name": "ZackScott",
     		"author_url": "http://www.youtube.com/user/ZackScott",
     		"html":
     			"<object width=\"425\" height=\"344\">
     				<param name=\"movie\" value=\"http://www.youtube.com/v/M3r2XDceM6A&fs=1\"></param>
     				<param name=\"allowFullScreen\" value=\"true\"></param>
     				<param name=\"allowscriptaccess\" value=\"always\"></param>
     				<embed src=\"http://www.youtube.com/v/M3r2XDceM6A&fs=1\"
     					type=\"application/x-shockwave-flash\" width=\"425\" height=\"344\"
     					allowscriptaccess=\"always\" allowfullscreen=\"true\"></embed>
     			</object>",
     		}*/
     // get video object by ID
     if ($this->request->param('ID') && ($vid = Video::get()->byID((int) $this->request->param('ID')))) {
         // get some references
         $thumbnail = $vid->Poster();
         $html = $vid->renderWith('VideoTag');
         // build embed
         $embed = new stdClass();
         $embed->version = "1.0";
         $embed->type = "video";
         $embed->title = $vid->Name;
         $embed->width = $thumbnail->getWidth();
         $embed->height = $thumbnail->getHeight();
         $embed->html = "{$html}";
         $embed->thumbnail_height = $thumbnail->getWidth();
         $embed->thumbnail_width = $thumbnail->getHeight();
         $embed->thumbnail_url = $thumbnail->getAbsoluteURL();
         // Format response with json
         $response = new SS_HTTPResponse(Convert::raw2json($embed));
         $response->addHeader('Content-Type', 'application/json');
         return $response;
     } else {
         return $this->httpError(404);
     }
 }
开发者ID:helpfulrobot,项目名称:micschk-silverstripe-html5-media,代码行数:62,代码来源:Video.php


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