From 148b6177469f629538f4dc5539c741d0bb633020 Mon Sep 17 00:00:00 2001 From: Maxime Biais Date: Thu, 6 Feb 2020 10:56:19 +0100 Subject: [PATCH 1/2] Remove keymirror dependency --- VideoResizeMode.js | 12 +++++------- package.json | 1 - 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/VideoResizeMode.js b/VideoResizeMode.js index 15a897739e..f79bfde9b6 100644 --- a/VideoResizeMode.js +++ b/VideoResizeMode.js @@ -1,7 +1,5 @@ -import keyMirror from 'keymirror'; - -export default keyMirror({ - contain: null, - cover: null, - stretch: null, -}); +export default { + contain: "contain", + cover: "cover", + stretch: "stretch", +}; diff --git a/package.json b/package.json index 7bcb784ef2..c0436f28e6 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,6 @@ "react-native": "^0.57.8" }, "dependencies": { - "keymirror": "^0.1.1", "prop-types": "^15.5.10", "shaka-player": "^2.4.4" }, From 5c6697afc5244883615acc84f054a1ed2a0c6ed0 Mon Sep 17 00:00:00 2001 From: Maxime Biais Date: Thu, 6 Feb 2020 11:10:14 +0100 Subject: [PATCH 2/2] Remove shaka-player dependency --- dom/RCTVideo.js | 22 ++++------------------ package.json | 3 +-- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/dom/RCTVideo.js b/dom/RCTVideo.js index 321289736c..4ac5856306 100644 --- a/dom/RCTVideo.js +++ b/dom/RCTVideo.js @@ -1,7 +1,6 @@ // @flow import { RCTEvent, RCTView, type RCTBridge } from "react-native-dom"; -import shaka from "shaka-player"; import resizeModes from "./resizeModes"; import type { VideoSource } from "./types"; @@ -26,8 +25,6 @@ class RCTVideo extends RCTView { this.eventDispatcher = bridge.getModuleByName("EventDispatcher"); - shaka.polyfill.installAll(); - this.onEnd = this.onEnd.bind(this); this.onLoad = this.onLoad.bind(this); this.onLoadStart = this.onLoadStart.bind(this); @@ -41,7 +38,6 @@ class RCTVideo extends RCTView { this.videoElement.addEventListener("loadstart", this.onLoadStart); this.videoElement.addEventListener("pause", this.onPause); this.videoElement.addEventListener("play", this.onPlay); - this.player = new shaka.Player(this.videoElement); this.muted = false; this.rate = 1.0; @@ -154,19 +150,9 @@ class RCTVideo extends RCTView { uri = URL.createObjectURL(blob); } - if (!shaka.Player.isBrowserSupported()) { // primarily iOS WebKit - this.videoElement.setAttribute("src", uri); - if (!this._paused) { - this.requestPlay(); - } - } else { - this.player.load(uri) - .then(() => { - if (!this._paused) { - this.requestPlay(); - } - }) - .catch(this.onError); + this.videoElement.setAttribute("src", uri); + if (!this._paused) { + this.requestPlay(); } } @@ -182,7 +168,7 @@ class RCTVideo extends RCTView { onEnd = () => { this.onProgress(); this.sendEvent("topVideoEnd", null); - this.stopProgressTimer(); + this.stopProgressTimer(); } onError = error => { diff --git a/package.json b/package.json index c0436f28e6..7248580eb0 100644 --- a/package.json +++ b/package.json @@ -38,8 +38,7 @@ "react-native": "^0.57.8" }, "dependencies": { - "prop-types": "^15.5.10", - "shaka-player": "^2.4.4" + "prop-types": "^15.5.10" }, "scripts": { "test": "node_modules/.bin/eslint *.js"