nterms/yii2-mediaelement-widget

MediaElement.js widget for Yii2

1.0.2 2014-11-12 09:18 UTC

This package is not auto-updated.

Last update: 2024-11-09 16:48:00 UTC


README

MediaElement.js widget for Yii2

Usage

<?= \nterms\mediaelement\MediaElement::widget([
  'id' => 'video-id',
  'sources' => [
    ['src' => 'rtmp://stream.server.domain:1935/stream-name/mp4:video-file.mp4', 'type' => 'video/rtmp'],
    ['src' => 'http://stream.server.domain:1935/stream-name/mp4:video-file.mp4/playlist.m3u8', 'type' => 'application/x-mpegURL'],
    // Other source files goes here
    // ['type'=>"video/ogg", 'src'=>"myvideo.ogv"],
    // ['type'=>"video/webm", 'src'=>"myvideo.webm"],
    // ['type'=>"video/mp4", 'src'=>"myvideo.mp4"],
  ],
  'tracks' => [
    ['kind'=>"chapters", 'src'=>"chapters.srt", 'srclang'=>"en"],
    ['kind'=>"subtitles", 'src'=>"subtitles.srt", 'srclang'=>"en"]
  ],
  'width' => 320,
  'height' => 180,
  'poster' => 'http://image.url/sample.png',
]); ?>