Skip to content

Commit

Permalink
update readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
SomiFrame committed Jun 5, 2017
1 parent a636aa7 commit b261412
Showing 1 changed file with 35 additions and 8 deletions.
43 changes: 35 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,52 @@ How to create a onDemand dash video?
===============
> __Please go to see this__[Dash Support in MP4Box](https://gpac.wp.imt.fr/mp4box/dash/)
>__After you dashify you video you will get the manifest.mpd and dashvideo__
> the mpd file like below
```xml
<?xml version="1.0"?>
<!-- MPD file Generated with GPAC version 0.6.2-DEV-rev1219-g4007cec-master at 2017-05-18T04:06:16.663Z-->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500S" type="static" mediaPresentationDuration="PT0H4M2.091S" maxSegmentDuration="PT0H0M10.000S" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011">
<ProgramInformation moreInformationURL="http://gpac.io">
<Title>manifest.mpd generated by GPAC</Title>
</ProgramInformation>

<Period duration="PT0H4M2.091S">
<AdaptationSet segmentAlignment="true" maxWidth="1280" maxHeight="720" maxFrameRate="25" par="16:9" lang="und" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
<ContentComponent id="1" contentType="video" />
<ContentComponent id="2" contentType="audio" />
<Representation id="1" mimeType="video/mp4" codecs="avc1.4d401f,mp4a.40.2" width="1280" height="720" frameRate="25" sar="1:1" audioSamplingRate="44100" startWithSAP="1" bandwidth="1280527">
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
<BaseURL>VivaLaVida_dashinit.mp4</BaseURL>
<SegmentBase indexRangeExact="true" indexRange="1437-1900">
<Initialization range="0-1436"/>
</SegmentBase>
</Representation>
</AdaptationSet>
</Period>
```

Usage
================
```javascript
// this is es5 version

var dash = require("somi-dashjs").default;
var segmentUrl = '/video/new_video_dashinit.mp4';
var videoMimeTypeCodecs = 'video/mp4;codecs="avc1.640015,mp4a.40.2"';
var initRange = { start: 0, end: 1440 };
var sidxRange = { start: 1441, end: 1580 };
var segmentUrl = '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

import dash from "somi-dashjs";
let segmentUrl = '/video/new_video_dashinit.mp4';
let videoMimeTypeCodecs = 'video/mp4;codecs="avc1.640015,mp4a.40.2"';
let initRange = { start: 0, end: 1440 };
let sidxRange = { start: 1441, end: 1580 };
let segmentUrl = '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);
```

Expand Down

0 comments on commit b261412

Please sign in to comment.