mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27: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: '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([
|
||||
{ label: 'VLC', value: 'vlc' }
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -15,19 +15,13 @@ const Stream = ({ className, videoId, videoReleased, addonName, name, descriptio
|
|||
const { core } = useServices();
|
||||
const toast = useToast();
|
||||
const href = React.useMemo(() => {
|
||||
const haveStreamingServer = streamingServer.settings !== null && streamingServer.settings.type === 'Ready';
|
||||
return deepLinks ?
|
||||
profile.settings.playerType && profile.settings.playerType !== 'internal' ?
|
||||
platform.isMobile() || !haveStreamingServer ?
|
||||
(deepLinks.externalPlayer.openPlayer || {})[platform.name] || deepLinks.externalPlayer.href
|
||||
: null
|
||||
:
|
||||
typeof deepLinks.player === 'string' ?
|
||||
deepLinks.player
|
||||
:
|
||||
null
|
||||
:
|
||||
null;
|
||||
if (!deepLinks) return null;
|
||||
|
||||
if (profile.settings.playerType && profile.settings.playerType !== 'internal') {
|
||||
return (deepLinks.externalPlayer.openPlayer || {})[platform.name] || deepLinks.externalPlayer.href;
|
||||
}
|
||||
|
||||
return typeof deepLinks.player === 'string' ? deepLinks.player : null;
|
||||
}, [deepLinks, profile, streamingServer]);
|
||||
const markVideoAsWatched = React.useCallback(() => {
|
||||
if (typeof videoId === 'string') {
|
||||
|
|
|
|||
|
|
@ -211,11 +211,15 @@ const useProfileSettingsInputs = (profile) => {
|
|||
}
|
||||
}), [profile.settings]);
|
||||
const playInExternalPlayerSelect = React.useMemo(() => ({
|
||||
options: externalPlayerOptions.map((opt) => {
|
||||
opt.label = t(opt.label);
|
||||
return opt;
|
||||
}),
|
||||
selected: [`${profile.settings.playerType || 'internal'}`],
|
||||
options: externalPlayerOptions.map((opt) => ({
|
||||
value: opt.value,
|
||||
label: t(opt.label),
|
||||
})),
|
||||
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) => {
|
||||
core.transport.dispatch({
|
||||
action: 'Ctx',
|
||||
|
|
|
|||
Loading…
Reference in a new issue