Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/cue out duration #31

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
26 changes: 26 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Node CI

on: [push]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test
run: |
npm ci
npm run build --if-present
npm test
env:
CI: true
20 changes: 20 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Publish

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: npm install
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
4 changes: 3 additions & 1 deletion m3u/AttributeList.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ var dataTypes = AttributeList.dataTypes = {
'title' : 'enumerated-string',
'type' : 'enumerated-string',
'uri' : 'quoted-string',
'video' : 'quoted-string'
'video' : 'quoted-string',
'cueout' : 'decimal-integer',
'cuein' : 'boolean'
};

AttributeList.prototype.mergeAttributes = function mergeAttributes(attributes) {
Expand Down
2 changes: 1 addition & 1 deletion m3u/Item.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var Item = module.exports = function Item(attributes) {
discontinuity : null,
duration : null,
title : null,
uri : null
uri : null,
};
};

Expand Down
7 changes: 7 additions & 0 deletions m3u/PlaylistItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ PlaylistItem.prototype.toString = function toString() {
if (this.get('discontinuity')) {
output.push('#EXT-X-DISCONTINUITY');
}
if (this.get('cueout')) {
var duration = this.get('cueout');
output.push('#EXT-X-CUE-OUT:DURATION=' + duration);
}
if (this.get('cuein')) {
output.push('#EXT-X-CUE-IN');
}
if (this.get('date')) {
var date = this.get('date');
if (date.getMonth) {
Expand Down
Loading