Skip to content

Commit

Permalink
upgrade hls to 1.6 beta as this fixes one of my seeking bugs for larg…
Browse files Browse the repository at this point in the history
…er video stream. refactor boolean value setting as setting false did not disable some attributes
  • Loading branch information
jgensler8 committed Jan 15, 2025
1 parent 9c0dddb commit 2c5ca62
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"@grafana/runtime": "^11.3.2",
"@grafana/schema": "^11.3.2",
"@grafana/ui": "^11.3.2",
"hls.js": "^1.5.18",
"hls.js": "^1.6.0-beta.2",
"react": "18.2.0",
"react-dom": "18.2.0"
},
Expand Down
19 changes: 14 additions & 5 deletions src/components/HLSPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,20 @@ export const HLSPanel: React.FC<Props> = ({ options, data, width, height, fieldC
} else {
video.removeAttribute('crossorigin');
}
video.setAttribute('disablepictureinpicture', options.disablepictureinpicture ? 'true' : 'false');
video.setAttribute('disableremoteplayback', options.disableremoteplayback ? 'true' : 'false');
video.setAttribute('loop', options.loop ? 'true' : 'false')
video.setAttribute('muted', options.muted ? 'true' : 'false')
video.setAttribute('playsinline', options.playsinline ? 'true' : 'false')
let boolean_attributes = [
'disablepictureinpicture',
'disableremoteplayback',
'loop',
'muted',
'playsinline'
];
for(let attribute of boolean_attributes) {
if(options[attribute] === true) {
video.setAttribute(attribute, 'true');
} else {
video.removeAttribute(attribute);
}
}
if(options.poster) {
video.setAttribute('poster', options.poster);
} else {
Expand Down

0 comments on commit 2c5ca62

Please sign in to comment.