Made default resolution dynamic.

The first resolution listed in the first video stream is now the default.
This commit is contained in:
Erik Thuning 2022-01-26 11:53:24 +01:00
parent 94b2181e79
commit f011c7901b

@ -2,10 +2,6 @@ document.addEventListener('DOMContentLoaded', init)
function init() {
var cookies = getCookies()
var defaultres = 720
if('resolution' in cookies) {
defaultres = cookies.resolution
}
var mainstream = document.querySelector('.main > video')
setupLoader(mainstream)
@ -35,6 +31,13 @@ function init() {
var body = document.querySelector('body')
var mainstream = document.querySelector('.main > video')
// A bit too magic with all the [0] but what can you do...
var defaultres = Object.keys(presentation.sources[0].video)[0]
if('resolution' in cookies) {
defaultres = cookies.resolution
}
body.dataset.id = presentation.id
if(playlist) {