Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove apache2 dependencies #6

Merged
merged 2 commits into from
Apr 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions VideoResizeMode.js
Original file line number Diff line number Diff line change
@@ -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",
};
22 changes: 4 additions & 18 deletions dom/RCTVideo.js
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -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();
}
}

Expand All @@ -182,7 +168,7 @@ class RCTVideo extends RCTView {
onEnd = () => {
this.onProgress();
this.sendEvent("topVideoEnd", null);
this.stopProgressTimer();
this.stopProgressTimer();
}

onError = error => {
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@
"react-native": "^0.57.8"
},
"dependencies": {
"keymirror": "^0.1.1",
"prop-types": "^15.5.10",
"shaka-player": "^2.4.4"
"prop-types": "^15.5.10"
},
"scripts": {
"test": "node_modules/.bin/eslint *.js"
Expand Down