Skip to content

Commit

Permalink
feat(pillarbox-debug-panel): debug panel component for playback metrics
Browse files Browse the repository at this point in the history
Introduces a debug panel that provides real-time playback metrics for enhanced monitoring and
debugging of the video player.

This panel can be added to the player interface only when necessary, allowing developers to keep
track of key playback statistics during video streaming.

To integrate the debug panel into the player:

```javascript
import videojs from 'video.js';
import '@srgssr/pillarbox-debug-panel';

const player = videojs('my-player', { pillarboxDebugPanel: true });
```

Changes:

- Implemented a debug panel displaying metrics such as buffer size, media duration, playback
  position, bandwidth, bitrate, codecs, framerate, total frames, dropped frames, resolution, and
  timestamp.
- Added a canvas element to the panel for visualizing the evolution of buffer health, bitrate, and
  bandwidth.
- Used VHS API for data retrieval when supported, and native APIs for browsers utilizing native
  video playback (such as HLS in Safari).
  • Loading branch information
jboix committed Aug 13, 2024
1 parent 75f8f6b commit a2eb64b
Show file tree
Hide file tree
Showing 22 changed files with 1,173 additions and 4 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ <h1>Pillarbox Extensions</h1>
<ul>
<li><a href="packages/pillarbox-playlist/index.html">pillarbox-playlist</a></li>
<li><a href="packages/skip-button/index.html">skip-button</a></li>
<li><a href="packages/pillarbox-debug-panel/index.html">pillarbox-debug-panel</a></li>
</ul>
</body>
</html>
116 changes: 114 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"create": "plop --plopfile scripts/create.js",
"eslint": "eslint {packages/**/{src,test}/**/*.{js,jsx},scripts/*.{js,jsx}}",
"github:page": "npm run github:page --ws && vite build && node scripts/prepare-deployment.js",
"start": " vite --port 4200 --open",
"start": " vite --host --port 4200 --open",
"outdated": "npm outdated",
"prepare": "husky",
"stylelint": "stylelint **/*.{css,scss} --allow-empty-input",
Expand All @@ -36,6 +36,7 @@
"@commitlint/config-conventional": "^19.1.0",
"@parcel/transformer-sass": "^2.12.0",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-terser": "^0.4.4",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^12.0.0",
"@semantic-release/git": "^10.0.1",
Expand Down
3 changes: 3 additions & 0 deletions packages/pillarbox-debug-panel/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../babel.config.json"
}
111 changes: 111 additions & 0 deletions packages/pillarbox-debug-panel/.releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{
"branches": ["main"],
"extends": "semantic-release-monorepo",
"plugins": [
"@semantic-release/commit-analyzer",
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits",
"parserOpts": {
"noteKeywords": [
"BREAKING CHANGE",
"BREAKING CHANGES",
"BREAKING"
]
},
"presetConfig": {
"types": [
{
"type": "breaking",
"section": "Breaking Changes ❗",
"hidden": false
},
{
"type": "feat",
"section": "New Features 🚀",
"hidden": false
},
{
"type": "fix",
"section": "Enhancements and Bug Fixes 🐛",
"hidden": false
},
{
"type": "docs",
"section": "Docs 📖",
"hidden": false
},
{
"type": "style",
"section": "Styles 🎨",
"hidden": false
},
{
"type": "refactor",
"section": "Refactor 🔩",
"hidden": false
},
{
"type": "perf",
"section": "Performances ⚡️",
"hidden": false
},
{
"type": "test",
"section": "Tests ✅",
"hidden": false
},
{
"type": "ci",
"section": "CI 🔁",
"hidden": false
},
{
"type": "chore",
"section": "Chore 🧹",
"hidden": false
}
]
},
"writerOpts": {
"groupBy": "type",
"commitGroupsSort": [
"breaking",
"feat",
"fix"
]
}
}
],
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
"@semantic-release/npm",
[
"@semantic-release/git",
{
"assets": [
"package.json",
"package-lock.json",
"CHANGELOG.md"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
[
"@semantic-release/github",
{
"assets": [
{
"path": "dist/**/*"
}
]
}
]
]
}

21 changes: 21 additions & 0 deletions packages/pillarbox-debug-panel/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 SRG SSR

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit a2eb64b

Please sign in to comment.