Skip to content

Commit

Permalink
Merge pull request #1 from lindenle/master
Browse files Browse the repository at this point in the history
added discontinuity
  • Loading branch information
lindenle committed Dec 9, 2013
2 parents 9587350 + fdd24f0 commit c35fff7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ well as additional capabilities defined by Apple:
resolution: '640x480',
});

// EXT-X-DISCONTINUITY: Indicates that the player should expect the next video segment to be a different resolution or have a different audio profile than the last.
writer.discontinuity();

console.log(writer.toString());

## Todo
Expand All @@ -103,7 +106,6 @@ Stuff I probably won't have time to do myself, and would love to get patches for
* Implement the ability to read m3u files
* Support node.js's writeable stream interface for the writers
* `HttpLiveStreamingWriter#key()` (EXT-X-KEY)
* `HttpLiveStreamingWriter#discontinuity()` (EXT-X-DISCONTINUITY)
* Support JS date objects for `HttpLiveStreamingWriter#programDateTime()`

## License
Expand Down
4 changes: 4 additions & 0 deletions lib/writer/http_live_streaming_writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ HttpLiveStreamingWriter.prototype.playlist = function(uri, attributes) {
this.file(uri);
};

HttpLiveStreamingWriter.prototype.discontinuity = function() {
this.comment('EXT-X-DISCONTINUITY');
};

HttpLiveStreamingWriter.prototype.endlist = function() {
this.comment('EXT-X-ENDLIST');
};
Expand Down
1 change: 1 addition & 0 deletions test/fixture/http_live_streaming_writer.m3u8
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ simple.m3u
another.m3u
#EXT-X-ENDLIST
#EXT-X-VERSION:3
#EXT-X-DISCONTINUITY
4 changes: 4 additions & 0 deletions test/integration/test-http-live-streaming-writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,8 @@ writer.endlist();
// (optional)
writer.version(3);

// EXT-X-DISCONTINUITY: Indicates there is a change coming.
// (optional)
writer.discontinuity();

fixture.compare(writer, 'http_live_streaming_writer.m3u8');

0 comments on commit c35fff7

Please sign in to comment.