52ca1ef6c2
Introduces isLiveBroadcast to VideoState and PlayerContext to detect live streams (duration is Infinity or 0). Updates ControlsLayer to show a 'LIVE' badge and hide progress/time for live broadcasts. Adjusts VideoElement to set and update isLiveBroadcast on metadata and duration changes. Adds related CSS for the live indicator and improves ESLint config for unused vars.
56 lines
1.4 KiB
JavaScript
56 lines
1.4 KiB
JavaScript
import js from '@eslint/js'
|
|
import tsParser from '@typescript-eslint/parser'
|
|
import tsPlugin from '@typescript-eslint/eslint-plugin'
|
|
import reactHooks from 'eslint-plugin-react-hooks'
|
|
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
import globals from 'globals'
|
|
|
|
export default [
|
|
{
|
|
ignores: ['dist/**', 'node_modules/**', 'public/**']
|
|
},
|
|
js.configs.recommended,
|
|
{
|
|
files: ['**/*.{ts,tsx}'],
|
|
languageOptions: {
|
|
parser: tsParser,
|
|
parserOptions: {
|
|
ecmaVersion: 2020,
|
|
sourceType: 'module',
|
|
ecmaFeatures: {
|
|
jsx: true
|
|
}
|
|
},
|
|
globals: {
|
|
...globals.browser,
|
|
...globals.es2021
|
|
}
|
|
},
|
|
plugins: {
|
|
'@typescript-eslint': tsPlugin,
|
|
'react-hooks': reactHooks,
|
|
'react-refresh': reactRefresh
|
|
},
|
|
rules: {
|
|
...tsPlugin.configs.recommended.rules,
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
'@typescript-eslint/ban-ts-comment': 'off',
|
|
'@typescript-eslint/no-unused-vars': ['error', {
|
|
argsIgnorePattern: '^_',
|
|
varsIgnorePattern: '^_'
|
|
}],
|
|
'react-hooks/rules-of-hooks': 'error',
|
|
'react-hooks/exhaustive-deps': 'warn',
|
|
'react-refresh/only-export-components': 'warn'
|
|
}
|
|
},
|
|
{
|
|
files: ['**/*.config.{js,ts}', '**/*.config.{cjs,mjs}', 'vite.config.*', 'eslint.config.js'],
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.node
|
|
}
|
|
}
|
|
}
|
|
]
|