定制 frandieguez/panorama-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

frandieguez/panorama-php

Composer 安装命令:

composer require frandieguez/panorama-php

包简介

Wrapper class for accessing video services information in a standarized way

关键字:

README 文档

README

Build Status

What is this!

With this wrapper class you can manage any video service in a uniformed and unique way. You only need the URL from the video service you are going to use.

A quick example:

To include this video in a post you only need to know the url of the video. With Panorama-PHP API you get this information:

    $video = new \Panorama\Video("http://www.youtube.com/watch?v=GPQnbtldFyo")
    $video.getTitle() => "paradon del portero"
    $video.getThumbnail() => "http://i4.ytimg.com/vi/GPQnbtldFyo/default.jpg"
    $video.getEmbedUrl() => "http://www.youtube.com/v/GPQnbtldFyo"
    $video.getEmbedHTML()(width, height) => "<object [...]</object>"
    $video.getFLV() => "http://...flv"
    # all together :)
    $video.getVideoDetails(width, height) => {
                                            'title' => ...,
                                            'thumbnail' => ...,
                                            'embed_url' => ...,
                                            'embed_html' => ...,
                                            'flv' => ...
                                          }

Install it!

  1. Just put in one of your include_path folders, and make sure to use an PSR-0-compatible autoloader.

Dependencies

This library only depends on PHP 5.6, you have to use namespaces and some other goodies of 5.4 version.

Please don't ask for PHP < 5.6 support, you shouldn't use it. In the near future we will move to 7.0 as minimum version.

Use it!

The idea is make it as simple as possible. For a URL video like http://vimeo.com/1785993:

    $video = new \Panorama\Video("http://vimeo.com/1785993")

Then you have methods to know information about the video in your application.

  • getTitle: A method to know the title of the video of the service.

      $video.getTitle()
      => "Beached"
    
  • getService: A method to know the name of the video provider service.

    $video.getService()
    => "Vimeo"
    
  • getThumbnail: An image representation of the video. Each service has a different size, but... it works :)

      $video.getThumbnail()
      => "http://bc1.vimeo.com/vimeo/thumbs/143104745_640.jpg"
    
  • getEmbedUrl: The url (with flashvars) of the video player.

      $video.getEmbedUrl()
      => "http://vimeo.com/moogaloop.swf?clip_id=1785993 [...] &show_portrait=1"
    
  • getEmbedHTML(width, height): Uses the embed_url to build an oembed string. The default width x height is 425 x 344, but we can specify a different one.

      $video.getEmbedHTML(400, 300)
      => "<object width='400' height='300'><param name='mo [...] 300'></embed></object>"
    
  • getFLV: Gets the flv url. Not all the services has this option. Remember that in some services the flv url expires and in their terms don't allow using the flv without its player.

      $video.getFLV
      => "http://www.vimeo.com/moogaloop/play/clip:1785993/ [...] 8ee400/video.flv"
    
  • getVideoDetails(width, height): All together :), returns all the previous elements in a hash. Width and height can be specified to build the embed_html.

      $video.getVideoDetails()
      => "array( [...] )"
    

Supported services

At this moment we support the following video services:

Broken services

These services were included in this API but, due changes in their website, don't work anymore. Any patch for fixing them are welcome. ;)

If you detect new broken services by running the tests please let me know.

We are always open to incude new services.

Test it!

Help us to mantain this library updated. Run our behaviour tests with behat to give us feedback about what services don't work anymore.

For running tests:

  1. Install composer in your system https://getcomposer.org/doc/00-intro.md
  2. Install dependencies: composer install
  3. Execute the tests: bin/behat features

Build Status

And... what else?

If you find a bug or want to suggest a new video service, please let us know in a ticket.

Thanks!!

统计信息

  • 总下载量: 11.22k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 19
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 19
  • Watchers: 2
  • Forks: 9
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2012-06-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固