Skip to content

Commit

Permalink
Merge branch 'development' into feat/player-move-subtitles-up-when-co…
Browse files Browse the repository at this point in the history
…ntrol-bar-is-shown
  • Loading branch information
kKaskak committed Jan 9, 2024
2 parents f1b6ac1 + c4611cc commit d91a143
Show file tree
Hide file tree
Showing 61 changed files with 3,164 additions and 15,495 deletions.
2 changes: 0 additions & 2 deletions .dockerignore

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build
on:
push:
branches:
- '*'
- '**'

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Stremio Node 14.x
# the node version for running Stremio Web
ARG NODE_VERSION=15-alpine
ARG NODE_VERSION=20-alpine
FROM node:$NODE_VERSION AS base

# Meta
Expand Down
16,272 changes: 1,542 additions & 14,730 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "stremio",
"displayName": "Stremio",
"version": "5.0.0-beta.0",
"version": "5.0.0-beta.4",
"author": "Smart Code OOD",
"private": true,
"license": "gpl-2.0",
Expand All @@ -15,7 +15,7 @@
"@babel/runtime": "7.16.0",
"@sentry/browser": "6.13.3",
"@stremio/stremio-colors": "5.0.1",
"@stremio/stremio-core-web": "0.45.0",
"@stremio/stremio-core-web": "0.46.0",
"@stremio/stremio-icons": "5.0.0-beta.3",
"@stremio/stremio-video": "0.0.26",
"a-color-picker": "1.2.1",
Expand All @@ -38,8 +38,8 @@
"react-focus-lock": "2.9.1",
"react-i18next": "^12.1.1",
"react-is": "18.2.0",
"spatial-navigation-polyfill": "git+ssh://git@github.com/Stremio/spatial-navigation.git#64871b1422466f5f45d24ebc8bbd315b2ebab6a6",
"stremio-translations": "git+ssh://git@github.com/Stremio/stremio-translations.git#8e30d9961402a7389f1a6209d9dab5592f32c9d7",
"spatial-navigation-polyfill": "github:Stremio/spatial-navigation#64871b1422466f5f45d24ebc8bbd315b2ebab6a6",
"stremio-translations": "github:Stremio/stremio-translations#12b1307f95249496960d2a257b371db5700721e6",
"url": "0.11.0",
"use-long-press": "^3.1.5"
},
Expand Down
6 changes: 4 additions & 2 deletions src/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,10 @@ const App = () => {
.catch((e) => console.error(e));
}
return () => {
window.removeEventListener('focus', onWindowFocus);
services.core.transport.off('CoreEvent', onCoreEvent);
if (services.core.active) {
window.removeEventListener('focus', onWindowFocus);
services.core.transport.off('CoreEvent', onCoreEvent);
}
};
}, [initialized]);
return (
Expand Down
19 changes: 14 additions & 5 deletions src/App/ErrorDialog/ErrorDialog.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
// Copyright (C) 2017-2023 Smart code 203358507

const React = require('react');
const { useTranslation } = require('react-i18next');
const PropTypes = require('prop-types');
const classnames = require('classnames');
const { Button, Image } = require('stremio/common');
const styles = require('./styles');

const ErrorDialog = ({ className }) => {
const { t } = useTranslation();

const [dataCleared, setDataCleared] = React.useState(false);
const reload = React.useCallback(() => {
window.location.reload();
Expand All @@ -22,13 +25,19 @@ const ErrorDialog = ({ className }) => {
src={require('/images/empty.png')}
alt={' '}
/>
<div className={styles['error-message']}>Something went wrong!</div>
<div className={styles['error-message']}>
{ t('GENERIC_ERROR_MESSAGE') }
</div>
<div className={styles['buttons-container']}>
<Button className={styles['button-container']} title={'Try again'} onClick={reload}>
<div className={styles['label']}>Try again</div>
<Button className={styles['button-container']} title={t('TRY_AGAIN')} onClick={reload}>
<div className={styles['label']}>
{ t('TRY_AGAIN') }
</div>
</Button>
<Button className={styles['button-container']} disabled={dataCleared} title={'Clear data'} onClick={clearData}>
<div className={styles['label']}>Clear data</div>
<Button className={styles['button-container']} disabled={dataCleared} title={t('CLEAR_DATA')} onClick={clearData}>
<div className={styles['label']}>
{ t('CLEAR_DATA') }
</div>
</Button>
</div>
</div>
Expand Down
25 changes: 16 additions & 9 deletions src/App/ErrorDialog/styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
flex-direction: column;
align-items: center;
justify-content: center;
gap: 1rem;

.error-image {
flex: none;
width: 12rem;
height: 12rem;
margin-bottom: 1rem;
object-fit: contain;
object-position: center;
opacity: 0.9;
Expand All @@ -24,7 +24,7 @@
font-size: 2rem;
max-height: 3.6em;
text-align: center;
color: @color-surface-light5-90;
color: var(--primary-foreground-color);
}

.buttons-container {
Expand All @@ -36,6 +36,8 @@
flex-wrap: wrap;
align-items: center;
justify-content: center;
gap: 1.5rem;
margin-top: 1rem;

.button-container {
flex-grow: 0;
Expand All @@ -45,18 +47,23 @@
flex-direction: row;
align-items: center;
justify-content: center;
margin: 2rem 1rem 0;
padding: 0 1rem;
padding: 0 2.5rem;
min-width: 8rem;
height: 3rem;
background-color: @color-accent3;
height: 3.5rem;
border-radius: 3.5rem;
background-color: var(--overlay-color);

&:hover {
background-color: @color-accent3-light1;
outline: var(--focus-outline-size) solid var(--primary-foreground-color);
background-color: transparent;
}

&:active {
outline: none;
}

&:global(.disabled) {
background-color: @color-surface-dark5;
opacity: 0.3;
}

.label {
Expand All @@ -67,7 +74,7 @@
font-size: 1.1rem;
font-weight: 500;
text-align: center;
color: @color-surface-light5-90;
color: var(--primary-foreground-color);
}
}
}
Expand Down
1 change: 0 additions & 1 deletion src/App/styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ html {
.loader-container, .error-container {
width: 100%;
height: 100%;
background-color: @color-background-dark2;
}
}
}
Expand Down
46 changes: 45 additions & 1 deletion src/common/CONSTANTS.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,49 @@ const ICON_FOR_TYPE = new Map([
['other', 'movies'],
]);

const EXTERNAL_PLAYERS = [
{
label: 'EXTERNAL_PLAYER_DISABLED',
value: null,
platforms: ['ios', 'android', 'windows', 'linux', 'macos'],
},
{
label: 'EXTERNAL_PLAYER_ALLOW_CHOOSING',
value: 'choose',
platforms: ['android'],
},
{
label: 'VLC',
value: 'vlc',
platforms: ['ios', 'android'],
},
{
label: 'MPV',
value: 'mpv',
platforms: ['macos'],
},
{
label: 'IINA',
value: 'iina',
platforms: ['macos'],
},
{
label: 'MX Player',
value: 'mxplayer',
platforms: ['android'],
},
{
label: 'Just Player',
value: 'justplayer',
platforms: ['android'],
},
{
label: 'Outplayer',
value: 'outplayer',
platforms: ['ios'],
},
];

module.exports = {
CHROMECAST_RECEIVER_APP_ID,
SUBTITLES_SIZES,
Expand All @@ -55,5 +98,6 @@ module.exports = {
SHARE_LINK_CATEGORY,
WRITERS_LINK_CATEGORY,
TYPE_PRIORITIES,
ICON_FOR_TYPE
ICON_FOR_TYPE,
EXTERNAL_PLAYERS,
};
90 changes: 90 additions & 0 deletions src/common/EventModal/EventModal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
// Copyright (C) 2017-2023 Smart code 203358507

const React = require('react');
const { useTranslation } = require('react-i18next');
const Button = require('stremio/common/Button');
const ModalDialog = require('stremio/common/ModalDialog');
const useEvents = require('./useEvents');
const styles = require('./styles');
const { default: Icon } = require('@stremio/stremio-icons/react');

const EventModal = () => {
const { t } = useTranslation();

const { events, pullEvents, dismissEvent } = useEvents();

const modal = React.useMemo(() => {
return events?.modal?.type === 'Ready' ?
events.modal.content
:
null;
}, [events]);

const onClose = React.useCallback(() => {
modal?.id && dismissEvent(modal.id);
}, [modal]);

React.useEffect(() => {
pullEvents();
}, []);

return (
modal !== null ?
<ModalDialog className={styles['event-modal']} onCloseRequest={onClose}>
{
modal.imageUrl ?
<img className={styles['image']} src={modal.imageUrl} />
:
null
}
<div className={styles['info-container']}>
<div className={styles['title-container']}>
{
modal.title ?
<div className={styles['title']}>{modal.title}</div>
:
null
}
{
modal.message ?
<div className={styles['label']}>{modal.message}</div>
:
null
}
</div>
{
modal?.addon?.name ?
<div className={styles['addon-container']}>
<Icon className={styles['icon']} name={'addons'} />
<div className={styles['name']}>
{ modal.addon.name }
</div>
</div>
:
null
}
{
modal?.addon?.manifestUrl ?
<Button className={styles['action-button']} href={`#/addons?addon=${encodeURIComponent(modal.addon.manifestUrl)}`} onClick={onClose}>
<div className={styles['button-label']}>
{ t('INSTALL_ADDON') }
</div>
</Button>
:
modal.externalUrl ?
<Button className={styles['action-button']} href={modal.externalUrl} target={'_blank'}>
<div className={styles['button-label']}>
{ t('LEARN_MORE') }
</div>
</Button>
:
null
}
</div>
</ModalDialog>
:
null
);
};

module.exports = EventModal;
5 changes: 5 additions & 0 deletions src/common/EventModal/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright (C) 2017-2023 Smart code 203358507

const EventModal = require('./EventModal');

module.exports = EventModal;
Loading

0 comments on commit d91a143

Please sign in to comment.