mirror of
https://github.com/jeffvli/feishin.git
synced 2024-11-20 06:27:09 +01:00
Add --idle to default mpv parameters (#76)
This commit is contained in:
parent
fe59011882
commit
7dd56bfb9b
@ -315,7 +315,7 @@ const prefetchPlaylistParams = [
|
||||
];
|
||||
|
||||
const DEFAULT_MPV_PARAMETERS = (extraParameters?: string[]) => {
|
||||
const parameters = [];
|
||||
const parameters = ['--idle=yes'];
|
||||
|
||||
if (!extraParameters?.some((param) => prefetchPlaylistParams.includes(param))) {
|
||||
parameters.push('--prefetch-playlist=yes');
|
||||
@ -330,6 +330,7 @@ const createMpv = (data: { extraParameters?: string[]; properties?: Record<strin
|
||||
const { extraParameters, properties } = data;
|
||||
|
||||
const params = uniq([...DEFAULT_MPV_PARAMETERS(extraParameters), ...(extraParameters || [])]);
|
||||
console.log('Setting mpv params: ', params);
|
||||
|
||||
mpvInstance = new MpvAPI(
|
||||
{
|
||||
@ -341,6 +342,7 @@ const createMpv = (data: { extraParameters?: string[]; properties?: Record<strin
|
||||
params,
|
||||
);
|
||||
|
||||
console.log('Setting mpv properties: ', properties);
|
||||
mpvInstance.setMultipleProperties(properties || {});
|
||||
|
||||
mpvInstance.start().catch((error) => {
|
||||
|
@ -42,7 +42,7 @@ export const App = () => {
|
||||
const extraParameters = useSettingsStore.getState().playback.mpvExtraParameters;
|
||||
const properties = {
|
||||
...getMpvProperties(useSettingsStore.getState().playback.mpvProperties),
|
||||
volume: usePlayerStore.getState().volume,
|
||||
volume: usePlayerStore.getState().volume || 50,
|
||||
};
|
||||
|
||||
mpvPlayer?.initialize({
|
||||
|
Loading…
Reference in New Issue
Block a user