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

Bump javascript dependencies #1914

Merged
merged 1 commit into from
Feb 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
3 changes: 1 addition & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"extends": "airbnb",
"parser": "babel-eslint"
"extends": "@react-native-community",
}
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"requirePragma": true,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": false,
"jsxBracketSameLine": true,
"parser": "flow"
}
2 changes: 1 addition & 1 deletion FilterType.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ export default {
PROCESS: 'CIPhotoEffectProcess',
TONAL: 'CIPhotoEffectTonal',
TRANSFER: 'CIPhotoEffectTransfer',
SEPIA: 'CISepiaTone'
SEPIA: 'CISepiaTone',
};
2 changes: 1 addition & 1 deletion TextTrackType.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default {
SRT: 'application/x-subrip',
TTML: 'application/ttml+xml',
VTT: 'text/vtt'
VTT: 'text/vtt',
};
63 changes: 33 additions & 30 deletions Video.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class Video extends Component {
showPoster: !!props.poster,
androidFullScreen: false,
videoContainerLayout_x: 0,
videoContainerLayout_y: 0
videoContainerLayout_y: 0,
};
this.getDimension();
}
Expand All @@ -46,9 +46,9 @@ export default class Video extends Component {
UIManager.measure(findNodeHandle(this._videoContainer), (x, y) => {
this.setState({
videoContainerLayout_x: x,
videoContainerLayout_y: y
})
})
videoContainerLayout_y: y,
});
});
}

setNativeProps(nativeProps) {
Expand All @@ -57,12 +57,12 @@ export default class Video extends Component {

toTypeString(x) {
switch (typeof x) {
case "object":
case 'object':
return x instanceof Date
? x.toISOString()
: JSON.stringify(x); // object, null
case "undefined":
return "";
case 'undefined':
return '';
default: // boolean, number, string
return x.toString();
}
Expand All @@ -79,14 +79,14 @@ export default class Video extends Component {
}

seek = (time, tolerance = 100) => {
if (isNaN(time)) throw new Error('Specified time is not a number');
if (isNaN(time)) {throw new Error('Specified time is not a number');}

if (Platform.OS === 'ios') {
this.setNativeProps({
seek: {
time,
tolerance
}
tolerance,
},
});
} else {
this.setNativeProps({ seek: time });
Expand Down Expand Up @@ -172,7 +172,7 @@ export default class Video extends Component {
};

_onFullscreenPlayerWillPresent = (event) => {
Platform.OS === 'android' && this.setState({ androidFullScreen: true })
Platform.OS === 'android' && this.setState({ androidFullScreen: true });
if (this.props.onFullscreenPlayerWillPresent) {
this.props.onFullscreenPlayerWillPresent(event.nativeEvent);
}
Expand All @@ -185,7 +185,7 @@ export default class Video extends Component {
};

_onFullscreenPlayerWillDismiss = (event) => {
Platform.OS === 'android' && this.setState({ androidFullScreen: false })
Platform.OS === 'android' && this.setState({ androidFullScreen: false });
if (this.props.onFullscreenPlayerWillDismiss) {
this.props.onFullscreenPlayerWillDismiss(event.nativeEvent);
}
Expand All @@ -201,7 +201,7 @@ export default class Video extends Component {
if (!this.props.audioOnly) {
this._hidePoster();
}

if (this.props.onReadyForDisplay) {
this.props.onReadyForDisplay(event.nativeEvent);
}
Expand Down Expand Up @@ -271,7 +271,7 @@ export default class Video extends Component {
render() {
const resizeMode = this.props.resizeMode;
const source = resolveAssetSource(this.props.source) || {};
const shouldCache = !Boolean(source.__packager_asset)
const shouldCache = !source.__packager_asset;

let uri = source.uri || '';
if (uri && uri.match(/^\//)) {
Expand Down Expand Up @@ -310,7 +310,7 @@ export default class Video extends Component {
type: source.type || '',
mainVer: source.mainVer || 0,
patchVer: source.patchVer || 0,
requestHeaders: source.headers ? this.stringsOnlyObject(source.headers) : {}
requestHeaders: source.headers ? this.stringsOnlyObject(source.headers) : {},
},
onVideoLoadStart: this._onLoadStart,
onVideoLoad: this._onLoad,
Expand Down Expand Up @@ -350,14 +350,17 @@ export default class Video extends Component {
width: this.width,
height: this.height,
backgroundColor: '#ffffff',
justifyContent: "center",
justifyContent: 'center',
zIndex: 99999,
marginTop: -1 * (this.state.videoContainerLayout_y ? parseFloat(this.state.videoContainerLayout_y) : 0), //margin: 0 - is not working properly. So, updated all the margin individually with 0.
marginLeft: -1 * (this.state.videoContainerLayout_x ? parseFloat(this.state.videoContainerLayout_x) : 0)
} : {}
marginLeft: -1 * (this.state.videoContainerLayout_x ? parseFloat(this.state.videoContainerLayout_x) : 0),
} : {};

return (
<View ref={(videoContainer) => this._videoContainer = videoContainer} style={[nativeProps.style, videoStyle]}>
<View ref={(videoContainer) => {
this._videoContainer = videoContainer;
return videoContainer;
}} style={[nativeProps.style, videoStyle]}>
<RCTVideo
ref={this._assignRoot}
{...nativeProps}
Expand Down Expand Up @@ -388,14 +391,14 @@ Video.propTypes = {
FilterType.PROCESS,
FilterType.TONAL,
FilterType.TRANSFER,
FilterType.SEPIA
FilterType.SEPIA,
]),
filterEnabled: PropTypes.bool,
/* Native only */
src: PropTypes.object,
seek: PropTypes.oneOfType([
PropTypes.number,
PropTypes.object
PropTypes.object,
]),
fullscreen: PropTypes.bool,
onVideoLoadStart: PropTypes.func,
Expand All @@ -417,10 +420,10 @@ Video.propTypes = {
/* Wrapper component */
source: PropTypes.oneOfType([
PropTypes.shape({
uri: PropTypes.string
uri: PropTypes.string,
}),
// Opaque type returned by require('./video.mp4')
PropTypes.number
PropTypes.number,
]),
minLoadRetryCount: PropTypes.number,
maxBitRate: PropTypes.number,
Expand All @@ -434,22 +437,22 @@ Video.propTypes = {
type: PropTypes.string.isRequired,
value: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number
])
PropTypes.number,
]),
}),
selectedVideoTrack: PropTypes.shape({
type: PropTypes.string.isRequired,
value: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number
])
PropTypes.number,
]),
}),
selectedTextTrack: PropTypes.shape({
type: PropTypes.string.isRequired,
value: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number
])
PropTypes.number,
]),
}),
textTracks: PropTypes.arrayOf(
PropTypes.shape({
Expand All @@ -460,7 +463,7 @@ Video.propTypes = {
TextTrackType.TTML,
TextTrackType.VTT,
]),
language: PropTypes.string.isRequired
language: PropTypes.string.isRequired,
})
),
paused: PropTypes.bool,
Expand Down
21 changes: 10 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,21 @@
"url": "git@github.com:react-native-community/react-native-video.git"
},
"devDependencies": {
"babel-eslint": "5.0.0-beta8",
"eslint": "1.10.3",
"eslint-config-airbnb": "4.0.0",
"eslint-plugin-react": "3.16.1",
"react": "^16.7.0",
"react-dom": "^16.7.0",
"react-hot-loader": "^4.6.3",
"react-native": "^0.57.8"
"babel-eslint": "10.0.3",
"eslint": "6.8.0",
"@react-native-community/eslint-config": "0.0.7",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-hot-loader": "^4.12.19",
"react-native": "^0.61.5"
},
"dependencies": {
"keymirror": "^0.1.1",
"prop-types": "^15.5.10",
"shaka-player": "^2.4.4"
"prop-types": "^15.7.2",
"shaka-player": "^2.5.9"
},
"scripts": {
"test": "node_modules/.bin/eslint *.js"
"lint": "yarn eslint *.js"
},
"files": [
"android-exoplayer",
Expand Down