diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..39a8c57 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,26 @@ +# Autodetect text files +* text=auto + +# ...Unless the name matches the following overriding patterns + +# Definitively text files +*.php text +*.css text +*.js text +*.txt text +*.md text +*.xml text +*.json text +*.bat text +*.sql text +*.xml text +*.yml text + +# Ensure those won't be messed up with +*.png binary +*.jpg binary +*.gif binary +*.ttf binary +*.svg binary +*.eot binary +*.woff binary diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b5c1623 --- /dev/null +++ b/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2014, Wanderson Bragança +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + +* Neither the name of the {organization} nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..248d46a --- /dev/null +++ b/README.md @@ -0,0 +1,81 @@ +yii2-videojs-widget +===================== +The yii2-videojs-widget is a Yii 2 wrapper for the [video.js](http://www.videojs.com/). A JavaScript and CSS library that makes it easier to work with and build on HTML5 video. This is also known as an HTML5 Video Player. + +Installation +------------ + +The preferred way to install this extension is through [composer](http://getcomposer.org/download/). + +Either run + +``` +php composer.phar require --prefer-dist wbraganca/yii2-videojs-widget "*" +``` + +or add + +``` +"wbraganca/yii2-videojs-widget": "*" +``` + +to the require section of your `composer.json` file. + + +How to use +---------- + +Example 1 - HTML5 + +```php + [ + 'class' => 'video-js vjs-default-skin vjs-big-play-centered', + 'poster' => "http://www.videojs.com/img/poster.jpg", + 'controls' => true, + 'preload' => 'auto', + 'width' => '970', + 'height' => '400', + ], + 'tags' => [ + 'source' => [ + ['src' => 'http://vjs.zencdn.net/v/oceans.mp4', 'type' => 'video/mp4'], + ['src' => 'http://vjs.zencdn.net/v/oceans.webm', 'type' => 'video/webm'] + ], + 'track' => [ + ['kind' => 'captions', 'src' => 'http://vjs.zencdn.net/vtt/captions.vtt', 'srclang' => 'en', 'label' => 'English'] + ] + ] + ]); +?> + +``` + +Example 2 - Real Time Messaging Protocol (RTMP) + +```php + [ + 'class' => 'video-js vjs-default-skin vjs-big-play-centered', + 'controls' => true, + 'preload' => 'auto', + 'width' => '420', + 'height' => '315', + 'data' => [ + 'setup' => [ + 'autoplay' => true, + 'techOrder' =>['flash', 'html5'] + ], + ], + ], + 'tags' => [ + 'source' => [ + ['src' => 'rtmp://cp67126.edgefcs.net/ondemand/&mp4:mediapm/ovp/content/test/video/spacealonehd_sounas_640_300.mp4', 'type' => 'rtmp/mp4'] + ] + ] + ]); +?> + +``` diff --git a/assets/font/vjs.eot b/assets/font/vjs.eot new file mode 100644 index 0000000..a2c0f5f Binary files /dev/null and b/assets/font/vjs.eot differ diff --git a/assets/font/vjs.svg b/assets/font/vjs.svg new file mode 100644 index 0000000..fa6aa7b --- /dev/null +++ b/assets/font/vjs.svg @@ -0,0 +1,28 @@ + + + +Generated by IcoMoon + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/font/vjs.ttf b/assets/font/vjs.ttf new file mode 100644 index 0000000..682a9b2 Binary files /dev/null and b/assets/font/vjs.ttf differ diff --git a/assets/font/vjs.woff b/assets/font/vjs.woff new file mode 100644 index 0000000..de98206 Binary files /dev/null and b/assets/font/vjs.woff differ diff --git a/assets/video-js.css b/assets/video-js.css new file mode 100644 index 0000000..a58f4da --- /dev/null +++ b/assets/video-js.css @@ -0,0 +1,904 @@ +/*! +Video.js Default Styles (http://videojs.com) +Version 4.6.3 +Create your own skin at http://designer.videojs.com +*/ +/* SKIN +================================================================================ +The main class name for all skin-specific styles. To make your own skin, +replace all occurances of 'vjs-default-skin' with a new name. Then add your new +skin name to your video tag instead of the default skin. +e.g.