Add id prop & autoplay handling, support DASH & HLS via Shaka Player

This commit is contained in:
Hampton Maxwell
2018-10-12 13:41:01 -07:00
parent 864da19d41
commit f0e0e555dd
3 changed files with 66 additions and 31 deletions

View File

@@ -18,6 +18,7 @@ class RCTVideoManager extends RCTViewManager {
return super
.describeProps()
.addBooleanProp("controls", this.setControls)
.addStringProp("id", this.setId)
.addBooleanProp("muted", this.setMuted)
.addBooleanProp("paused", this.setPaused)
.addNumberProp("progressUpdateInterval", this.setProgressUpdateInterval)
@@ -28,11 +29,16 @@ class RCTVideoManager extends RCTViewManager {
.addObjectProp("src", this.setSource)
.addNumberProp("volume", this.setVolume)
.addDirectEvent("onVideoEnd")
.addDirectEvent("onVideoError")
.addDirectEvent("onVideoLoad")
.addDirectEvent("onVideoLoadStart")
.addDirectEvent("onVideoProgress");
}
dismissFullscreenPlayer() {
// not currently working
}
presentFullscreenPlayer() {
// not currently working
}
@@ -41,6 +47,10 @@ class RCTVideoManager extends RCTViewManager {
view.controls = value;
}
setId(view: RCTVideo, value: string) {
view.id = value;
}
setMuted(view: RCTVideo, value: boolean) {
view.muted = value;
}