svelte-plyr icon indicating copy to clipboard operation
svelte-plyr copied to clipboard

Fixed options in Plyr.svelte, so passed in options are used

Open MartinElsaesser opened this issue 4 years ago • 5 comments

The passed in options to <Plyr> are not used. This is because you are not passing the options object to the plyr class but rather the opts() function which adds properties to the options object. Alternatively you could also replace the formerly used opts with opts(). I just think it is more meaningful to actually pass in the options object.

P.S.: I reworked as little as needed to get it working for me. But I could see this code getting a lot neater by replacing

$: opts();

function opts() {
	if (!options.hasOwnProperty('hideYouTubeDOMError')) {
		options.hideYouTubeDOMError = true;
	}
	return options;
}

with

$: {
	if (!options.hasOwnProperty('hideYouTubeDOMError')) {
		options.hideYouTubeDOMError = true;
	}
}

MartinElsaesser avatar Jun 11 '20 11:06 MartinElsaesser