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