mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-24 06:31:20 -08:00
fix: update loadTimeout default value to 0 in README, MediaBunnyEngine, and TypeScript definitions
This commit is contained in:
1 parent
d892685a25
commit
4a0fbda3c4
5 files changed
+7
-7
No files matched your search
@@ -44,7 +44,7 @@ const art = new Artplayer({
|
||||
|
||||
| Option | Type | Default | Description |
|
||||
|--------|------|---------|-------------|
|
||||
| `loadTimeout` | `number` | `12000` | Timeout for loading media (ms) |
|
||||
| `loadTimeout` | `number` | `0` | Timeout for loading media (ms) |
|
||||
| `timeupdateInterval` | `number` | `250` | Interval for timeupdate events (ms) |
|
||||
| `avSyncTolerance` | `number` | `0.12` | Audio-video sync tolerance (seconds) |
|
||||
| `dropLateFrames` | `boolean` | `false` | Drop late video frames |
|
||||
|
||||
@@ -53,12 +53,12 @@ export default class MediaBunnyEngine {
|
||||
|
||||
const loadTimeout = Number.isFinite(this.option.loadTimeout)
|
||||
? this.option.loadTimeout
|
||||
: 12000
|
||||
: 0
|
||||
|
||||
try {
|
||||
await Promise.race([
|
||||
this.performLoad(src, id),
|
||||
loadTimeout > 0 ? this.createTimeout(loadTimeout) : Promise.resolve(),
|
||||
loadTimeout > 0 ? this.createTimeout(loadTimeout) : new Promise(() => {}),
|
||||
])
|
||||
}
|
||||
catch (err) {
|
||||
|
||||
@@ -3,7 +3,7 @@ import type Artplayer from 'artplayer'
|
||||
interface Option {
|
||||
/**
|
||||
* Timeout for loading media in milliseconds
|
||||
* @default 12000
|
||||
* @default 0
|
||||
*/
|
||||
loadTimeout?: number
|
||||
|
||||
|
||||
Reference in new issue
Block a user