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

feat: play unprotected SRG SSR contents from urns #26

Merged
merged 8 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
}
]
]
}
}
30 changes: 25 additions & 5 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"env": {
"browser": true,
"es2021": true,
"jest/globals": true
"jest/globals": true,
"node": true
},
"plugins": [
"jest"
Expand All @@ -18,7 +19,10 @@
],
"rules": {
"max-lines-per-function": "off",
"max-statements": "off"
"max-statements": "off",
"max-nested-callbacks": "off",
"max-len": "off",
"no-conditional-expect": "off"
}
}
],
Expand All @@ -27,7 +31,13 @@
"sourceType": "module"
},
"rules": {
"jest/no-disabled-tests": "warn",
"jest/no-focused-tests": "error",
"jest/no-identical-title": "error",
"jest/prefer-to-have-length": "warn",
"jest/valid-expect": "error",
"jest/no-mocks-import": "off",
"jest/no-conditional-expect": "off",
// https://eslint.org/docs/latest/rules/array-bracket-spacing
"array-bracket-spacing": [
"error",
Expand Down Expand Up @@ -56,7 +66,7 @@
"complexity": [
"error",
{
"max": 2
"max": 5
}
],
// https://eslint.org/docs/latest/rules/function-paren-newline
Expand Down Expand Up @@ -100,7 +110,10 @@
// https://eslint.org/docs/latest/rules/max-lines-per-function
"max-lines-per-function": [
"error",
20
{
"max": 35,
"skipComments": true
}
],
// https://eslint.org/docs/latest/rules/max-nested-callbacks
"max-nested-callbacks": [
Expand All @@ -110,7 +123,7 @@
// https://eslint.org/docs/latest/rules/max-statements
"max-statements": [
"error",
5
10
],
// https://eslint.org/docs/latest/rules/newline-after-var
"newline-after-var": [
Expand Down Expand Up @@ -146,6 +159,13 @@
"allowForLoopAfterthoughts": true
}
],
// https://eslint.org/docs/latest/rules/no-unused-vars
"no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_"
}
],
// https://eslint.org/docs/latest/rules/object-curly-spacing
"object-curly-spacing": [
"error",
Expand Down
7 changes: 6 additions & 1 deletion .parcelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"extends": "@parcel/config-default"
"extends": "@parcel/config-default",
"transformers": {
"*.{js,mjs,jsx,cjs,ts,tsx}": [
"@parcel/transformer-js"
]
}
}
18 changes: 14 additions & 4 deletions demo/src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Pillarbox from '../../src/pillarbox.js';
import '../../src/middleware/srgssr.js';

// Get pillarbox version
document.querySelector('.version').textContent = Pillarbox.VERSION.pillarbox;
Expand All @@ -15,8 +16,17 @@ window.pillarbox = Pillarbox;
// Expose the player in the window object
window.player = player;

// Source examples
window.sourceExamples = {
bipbop: {
src: 'https://devstreaming-cdn.apple.com/videos/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8',
type: 'application/x-mpegURL',
},
urn: {
src: 'urn:rts:video:14160770',
type: 'srgssr/urn',
},
};

// Load the source
player.src({
src: 'https://d2zihajmogu5jn.cloudfront.net/bipbop-advanced/bipbop_16x9_variant.m3u8',
type: 'application/x-mpegURL',
});
player.src(window.sourceExamples.bipbop);
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"start": "parcel -p 6969 demo/*.html",
"stylelint": "stylelint **/*.scss --custom-syntax",
"stylelint:fix": "stylelint **/*.scss --fix",
"test": "jest"
"test": "jest --verbose",
"test:watch": "jest --watch --verbose"
},
"keywords": [],
"author": "",
Expand Down
Loading