navarr/youtube 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

navarr/youtube

最新稳定版本:v2.0

Composer 安装命令:

composer require navarr/youtube

包简介

A helper for generating an audio player flash object's HTML

README 文档

README

Build Status Code Coverage Scrutinizer Code Quality Latest Stable Version Total Downloads Latest Unstable Version License

YTAudio is a helper designed to help generate a "YouTube audio embeddable" - a version of the YouTube flash player that is small enough that only the audio controls show.

YTAudio does not extract the audio from YouTube videos, nor does it eliminate the overhead of processing YouTube videos when playing the files.

Most of the class allows daisy-chaining, since it is primarily controlled through setters and is intended as a helper class. Below are two examples of rendering a YTAudio object.

use Navarr\YouTube\AudioPlayer;

AudioPlayer::create('http://www.youtube.com/watch?v=dvgZkm1xWPE&ob=av2n')
    ->size(AudioPlayer::SIZE_LARGE)
    ->theme(AudioPlayer::THEME_DARK)
    ->hd() // Force HD
    ->loop() // Loop
    ->progressBar() // Show Progress Bar
    ->timeCode() // Show Time Code
    ->autoplay() // Autoplay
    ->render(); // Output XHTML

This method uses daisy-chaining for setting. Any daisy-chain function that turns a feature on or off takes a boolean, with the default value being true.

use Navarr\YouTube\AudioPlayer;

AudioPlayer::create(
    'http://www.youtube.com/watch?v=dvgZkm1xWPE&ob=av2n',
    [
        'size' => AudioPlayer::SIZE_LARGE,
        'theme' => AudioPlayer::THEME_DARK,
        'hd',
        'loop',
        'autoplay',
        'progressbar',
        'timecode',
    ]
)->render();

This method accepts the configuration as an array. You can daisy chain after it, but you probably will not need to.

统计信息

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

GitHub 信息

  • Stars: 46
  • Watchers: 5
  • Forks: 16
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-02-17