mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-21 11:42:05 +00:00
Merge pull request #513 from edde746/add-iina-mpv
Add IINA & mpv as external players
This commit is contained in:
commit
0027ce8236
3 changed files with 23 additions and 19 deletions
|
|
@ -16,7 +16,13 @@ if (platform.name === 'ios') {
|
||||||
{ label: 'Just Player', value: 'justplayer' },
|
{ label: 'Just Player', value: 'justplayer' },
|
||||||
{ label: 'MX Player', value: 'mxplayer' }
|
{ label: 'MX Player', value: 'mxplayer' }
|
||||||
]);
|
]);
|
||||||
} else if (['windows', 'macos', 'linux'].includes(platform.name)) {
|
} else if (platform.name === 'macos') {
|
||||||
|
options = options.concat([
|
||||||
|
{ label: 'IINA', value: 'iina' },
|
||||||
|
{ label: 'mpv', value: 'mpv' },
|
||||||
|
{ label: 'VLC', value: 'vlc' }
|
||||||
|
]);
|
||||||
|
} else if (['windows', 'linux'].includes(platform.name)) {
|
||||||
options = options.concat([
|
options = options.concat([
|
||||||
{ label: 'VLC', value: 'vlc' }
|
{ label: 'VLC', value: 'vlc' }
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
|
|
@ -15,19 +15,13 @@ const Stream = ({ className, videoId, videoReleased, addonName, name, descriptio
|
||||||
const { core } = useServices();
|
const { core } = useServices();
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const href = React.useMemo(() => {
|
const href = React.useMemo(() => {
|
||||||
const haveStreamingServer = streamingServer.settings !== null && streamingServer.settings.type === 'Ready';
|
if (!deepLinks) return null;
|
||||||
return deepLinks ?
|
|
||||||
profile.settings.playerType && profile.settings.playerType !== 'internal' ?
|
if (profile.settings.playerType && profile.settings.playerType !== 'internal') {
|
||||||
platform.isMobile() || !haveStreamingServer ?
|
return (deepLinks.externalPlayer.openPlayer || {})[platform.name] || deepLinks.externalPlayer.href;
|
||||||
(deepLinks.externalPlayer.openPlayer || {})[platform.name] || deepLinks.externalPlayer.href
|
}
|
||||||
: null
|
|
||||||
:
|
return typeof deepLinks.player === 'string' ? deepLinks.player : null;
|
||||||
typeof deepLinks.player === 'string' ?
|
|
||||||
deepLinks.player
|
|
||||||
:
|
|
||||||
null
|
|
||||||
:
|
|
||||||
null;
|
|
||||||
}, [deepLinks, profile, streamingServer]);
|
}, [deepLinks, profile, streamingServer]);
|
||||||
const markVideoAsWatched = React.useCallback(() => {
|
const markVideoAsWatched = React.useCallback(() => {
|
||||||
if (typeof videoId === 'string') {
|
if (typeof videoId === 'string') {
|
||||||
|
|
|
||||||
|
|
@ -211,11 +211,15 @@ const useProfileSettingsInputs = (profile) => {
|
||||||
}
|
}
|
||||||
}), [profile.settings]);
|
}), [profile.settings]);
|
||||||
const playInExternalPlayerSelect = React.useMemo(() => ({
|
const playInExternalPlayerSelect = React.useMemo(() => ({
|
||||||
options: externalPlayerOptions.map((opt) => {
|
options: externalPlayerOptions.map((opt) => ({
|
||||||
opt.label = t(opt.label);
|
value: opt.value,
|
||||||
return opt;
|
label: t(opt.label),
|
||||||
}),
|
})),
|
||||||
selected: [`${profile.settings.playerType || 'internal'}`],
|
selected: [profile.settings.playerType],
|
||||||
|
renderLabelText: () => {
|
||||||
|
const selectedOption = externalPlayerOptions.find(({ value }) => value === profile.settings.playerType);
|
||||||
|
return selectedOption ? t(selectedOption.label, { defaultValue: selectedOption.label }) : profile.settings.playerType;
|
||||||
|
},
|
||||||
onSelect: (event) => {
|
onSelect: (event) => {
|
||||||
core.transport.dispatch({
|
core.transport.dispatch({
|
||||||
action: 'Ctx',
|
action: 'Ctx',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue