a simple one track and onDemand video dash player
npm install somi-dashjsSomi-dashjs
================
A small library that Video tag use MediaSource Extension to Load video stream.
>__中文文档__
>__online demo__ https://somiframe.github.io/vue-video/
About issue
================
> __If you have some problem in using Somi-dashjs or create a dash video?__
> __Please comment on the git issue to let me know:)__
Installation
================
``shell`
npm install somi-dashjs
How to create a onDemand dash video?
===============
> __You need to install the MP4Box__
> __And here is the simple command line example like below__
`shell`
MP4Box -dash 3000 -profile onDemand -out manifest.mpd VivaLaVida.mp4
> __If you want to know more information about MP4Box Please go to see this__ Dash Support in MP4Box
> __After you dashify you video you will get the manifest.mpd and dashvideo__
> __The dash video name maybe like VivaLaVida_dashinit.mp4__
> __The manifest.mpd mpd file like below__
`xml
`
Usage
================
`javascript
// this is es5 version
// cmd version need browserify
var dash = require("somi-dashjs");
if(dash.isSupportDash()){
var segmentUrl = '/video/VivaLaVida_dashinit.mp4';
var videoMimeTypeCodecs = 'video/mp4;codecs="avc1.4D401F,mp4a.40.2"';
var initRange = {start: 0, end: 1436};
var sidxRange = {start: 1437, end: 1900};
new dash('#vid1',segmentUrl,videoMimeTypeCodecs,initRange,sidxRange);
}
// this is es6 version
// es6 version need babelify
import dash from "somi-dashjs";
if(dash.isSupportDash()){
let segmentUrl = '/video/VivaLaVida_dashinit.mp4';
let videoMimeTypeCodecs = 'video/mp4;codecs="avc1.4D401F,mp4a.40.2"';
let initRange = {start: 0, end: 1436};
let sidxRange = {start: 1437, end: 1900};
new dash('#vid1',segmentUrl,videoMimeTypeCodecs,initRange,sidxRange);
}
`
Tests
================
First
----------------
* clone the code to your local environment
``
git clone https://github.com/SomiFrame/somi-dashjs.git`
* or`
git clone git@github.com:SomiFrame/somi-dashjs.git
Second
---------------
* enter directory which you just cloned
``
cd somi-dashjs`
* install the devDependencies`
npm install`
* compile the source file to public directory`
gulp`
* start a node server and listen the port 3031``
node server.js
Third
---------------
* now you can open a browser and enter URL like below
__localhost:3031__