From ee6bc2ffa1fc3a1f72a0f3133c410b9c7f1b4671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9ssica=20Schissato?= Date: Tue, 6 Sep 2016 12:26:40 -0300 Subject: [PATCH 1/2] extra attributes in playlist item --- m3u/PlaylistItem.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/m3u/PlaylistItem.js b/m3u/PlaylistItem.js index d58d8f8..a63113a 100644 --- a/m3u/PlaylistItem.js +++ b/m3u/PlaylistItem.js @@ -14,7 +14,13 @@ PlaylistItem.create = function createPlaylistItem(data) { }; PlaylistItem.prototype.toString = function toString() { - var output = []; + var attributes = this.attributes; + var output = Object.keys(attributes.serialize()).map(function(key) { + var tag = key.toUpperCase(); + var value = attributes.getCoerced(key); + return value.length ? [tag, value].join('=') : tag; + }); + if (this.get('discontinuity')) { output.push('#EXT-X-DISCONTINUITY'); } From c6b77c605da8d502e6208348b244a20ce32a9b2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9ssica=20Schissato?= Date: Tue, 6 Sep 2016 15:45:46 -0300 Subject: [PATCH 2/2] fix extra attributes --- m3u/PlaylistItem.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/m3u/PlaylistItem.js b/m3u/PlaylistItem.js index a63113a..4b7c3bf 100644 --- a/m3u/PlaylistItem.js +++ b/m3u/PlaylistItem.js @@ -18,9 +18,9 @@ PlaylistItem.prototype.toString = function toString() { var output = Object.keys(attributes.serialize()).map(function(key) { var tag = key.toUpperCase(); var value = attributes.getCoerced(key); - return value.length ? [tag, value].join('=') : tag; + return value.length ? [tag, value].join(':') : tag; }); - + if (this.get('discontinuity')) { output.push('#EXT-X-DISCONTINUITY'); }