mirror of
https://github.com/zoriya/react-native-video.git
synced 2025-12-06 07:16:12 +00:00
Map source
This commit is contained in:
@@ -23,6 +23,7 @@ class VideoPlayer extends VideoPlayerEvents implements VideoPlayerBase {
|
|||||||
super(new WebEventEmiter(video));
|
super(new WebEventEmiter(video));
|
||||||
this.video = video;
|
this.video = video;
|
||||||
this.player.attach(this.video);
|
this.player.attach(this.video);
|
||||||
|
this.replaceSourceAsync(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -229,11 +230,10 @@ class VideoPlayer extends VideoPlayerEvents implements VideoPlayerBase {
|
|||||||
| NoAutocomplete<VideoPlayerSource>
|
| NoAutocomplete<VideoPlayerSource>
|
||||||
| null,
|
| null,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
await this.wrapPromise(
|
this.video.src =
|
||||||
this.player.replaceSourceAsync(
|
typeof source === "object" && "uri" in source
|
||||||
source === null ? null : createSource(source),
|
? source.uri
|
||||||
),
|
: source;
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Text Track Management
|
// Text Track Management
|
||||||
|
|||||||
Reference in New Issue
Block a user