Skip to content

Commit 4f07aab

Browse files
authored
Bump javascript dependencies (#1914)
Also update linting rules to match other community repositories.
1 parent f0867d7 commit 4f07aab

File tree

6 files changed

+54
-45
lines changed

6 files changed

+54
-45
lines changed

.eslintrc

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
{
2-
"extends": "airbnb",
3-
"parser": "babel-eslint"
2+
"extends": "@react-native-community",
43
}

.prettierrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"requirePragma": true,
3+
"singleQuote": true,
4+
"trailingComma": "all",
5+
"bracketSpacing": false,
6+
"jsxBracketSameLine": true,
7+
"parser": "flow"
8+
}

FilterType.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ export default {
1414
PROCESS: 'CIPhotoEffectProcess',
1515
TONAL: 'CIPhotoEffectTonal',
1616
TRANSFER: 'CIPhotoEffectTransfer',
17-
SEPIA: 'CISepiaTone'
17+
SEPIA: 'CISepiaTone',
1818
};

TextTrackType.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export default {
22
SRT: 'application/x-subrip',
33
TTML: 'application/ttml+xml',
4-
VTT: 'text/vtt'
4+
VTT: 'text/vtt',
55
};

Video.js

+33-30
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default class Video extends Component {
2323
showPoster: !!props.poster,
2424
androidFullScreen: false,
2525
videoContainerLayout_x: 0,
26-
videoContainerLayout_y: 0
26+
videoContainerLayout_y: 0,
2727
};
2828
this.getDimension();
2929
}
@@ -46,9 +46,9 @@ export default class Video extends Component {
4646
UIManager.measure(findNodeHandle(this._videoContainer), (x, y) => {
4747
this.setState({
4848
videoContainerLayout_x: x,
49-
videoContainerLayout_y: y
50-
})
51-
})
49+
videoContainerLayout_y: y,
50+
});
51+
});
5252
}
5353

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

5858
toTypeString(x) {
5959
switch (typeof x) {
60-
case "object":
60+
case 'object':
6161
return x instanceof Date
6262
? x.toISOString()
6363
: JSON.stringify(x); // object, null
64-
case "undefined":
65-
return "";
64+
case 'undefined':
65+
return '';
6666
default: // boolean, number, string
6767
return x.toString();
6868
}
@@ -79,14 +79,14 @@ export default class Video extends Component {
7979
}
8080

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

8484
if (Platform.OS === 'ios') {
8585
this.setNativeProps({
8686
seek: {
8787
time,
88-
tolerance
89-
}
88+
tolerance,
89+
},
9090
});
9191
} else {
9292
this.setNativeProps({ seek: time });
@@ -172,7 +172,7 @@ export default class Video extends Component {
172172
};
173173

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

187187
_onFullscreenPlayerWillDismiss = (event) => {
188-
Platform.OS === 'android' && this.setState({ androidFullScreen: false })
188+
Platform.OS === 'android' && this.setState({ androidFullScreen: false });
189189
if (this.props.onFullscreenPlayerWillDismiss) {
190190
this.props.onFullscreenPlayerWillDismiss(event.nativeEvent);
191191
}
@@ -201,7 +201,7 @@ export default class Video extends Component {
201201
if (!this.props.audioOnly) {
202202
this._hidePoster();
203203
}
204-
204+
205205
if (this.props.onReadyForDisplay) {
206206
this.props.onReadyForDisplay(event.nativeEvent);
207207
}
@@ -271,7 +271,7 @@ export default class Video extends Component {
271271
render() {
272272
const resizeMode = this.props.resizeMode;
273273
const source = resolveAssetSource(this.props.source) || {};
274-
const shouldCache = !Boolean(source.__packager_asset)
274+
const shouldCache = !source.__packager_asset;
275275

276276
let uri = source.uri || '';
277277
if (uri && uri.match(/^\//)) {
@@ -310,7 +310,7 @@ export default class Video extends Component {
310310
type: source.type || '',
311311
mainVer: source.mainVer || 0,
312312
patchVer: source.patchVer || 0,
313-
requestHeaders: source.headers ? this.stringsOnlyObject(source.headers) : {}
313+
requestHeaders: source.headers ? this.stringsOnlyObject(source.headers) : {},
314314
},
315315
onVideoLoadStart: this._onLoadStart,
316316
onVideoLoad: this._onLoad,
@@ -350,14 +350,17 @@ export default class Video extends Component {
350350
width: this.width,
351351
height: this.height,
352352
backgroundColor: '#ffffff',
353-
justifyContent: "center",
353+
justifyContent: 'center',
354354
zIndex: 99999,
355355
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.
356-
marginLeft: -1 * (this.state.videoContainerLayout_x ? parseFloat(this.state.videoContainerLayout_x) : 0)
357-
} : {}
356+
marginLeft: -1 * (this.state.videoContainerLayout_x ? parseFloat(this.state.videoContainerLayout_x) : 0),
357+
} : {};
358358

359359
return (
360-
<View ref={(videoContainer) => this._videoContainer = videoContainer} style={[nativeProps.style, videoStyle]}>
360+
<View ref={(videoContainer) => {
361+
this._videoContainer = videoContainer;
362+
return videoContainer;
363+
}} style={[nativeProps.style, videoStyle]}>
361364
<RCTVideo
362365
ref={this._assignRoot}
363366
{...nativeProps}
@@ -388,14 +391,14 @@ Video.propTypes = {
388391
FilterType.PROCESS,
389392
FilterType.TONAL,
390393
FilterType.TRANSFER,
391-
FilterType.SEPIA
394+
FilterType.SEPIA,
392395
]),
393396
filterEnabled: PropTypes.bool,
394397
/* Native only */
395398
src: PropTypes.object,
396399
seek: PropTypes.oneOfType([
397400
PropTypes.number,
398-
PropTypes.object
401+
PropTypes.object,
399402
]),
400403
fullscreen: PropTypes.bool,
401404
onVideoLoadStart: PropTypes.func,
@@ -417,10 +420,10 @@ Video.propTypes = {
417420
/* Wrapper component */
418421
source: PropTypes.oneOfType([
419422
PropTypes.shape({
420-
uri: PropTypes.string
423+
uri: PropTypes.string,
421424
}),
422425
// Opaque type returned by require('./video.mp4')
423-
PropTypes.number
426+
PropTypes.number,
424427
]),
425428
minLoadRetryCount: PropTypes.number,
426429
maxBitRate: PropTypes.number,
@@ -434,22 +437,22 @@ Video.propTypes = {
434437
type: PropTypes.string.isRequired,
435438
value: PropTypes.oneOfType([
436439
PropTypes.string,
437-
PropTypes.number
438-
])
440+
PropTypes.number,
441+
]),
439442
}),
440443
selectedVideoTrack: PropTypes.shape({
441444
type: PropTypes.string.isRequired,
442445
value: PropTypes.oneOfType([
443446
PropTypes.string,
444-
PropTypes.number
445-
])
447+
PropTypes.number,
448+
]),
446449
}),
447450
selectedTextTrack: PropTypes.shape({
448451
type: PropTypes.string.isRequired,
449452
value: PropTypes.oneOfType([
450453
PropTypes.string,
451-
PropTypes.number
452-
])
454+
PropTypes.number,
455+
]),
453456
}),
454457
textTracks: PropTypes.arrayOf(
455458
PropTypes.shape({
@@ -460,7 +463,7 @@ Video.propTypes = {
460463
TextTrackType.TTML,
461464
TextTrackType.VTT,
462465
]),
463-
language: PropTypes.string.isRequired
466+
language: PropTypes.string.isRequired,
464467
})
465468
),
466469
paused: PropTypes.bool,

package.json

+10-11
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,21 @@
2828
"url": "[email protected]:react-native-community/react-native-video.git"
2929
},
3030
"devDependencies": {
31-
"babel-eslint": "5.0.0-beta8",
32-
"eslint": "1.10.3",
33-
"eslint-config-airbnb": "4.0.0",
34-
"eslint-plugin-react": "3.16.1",
35-
"react": "^16.7.0",
36-
"react-dom": "^16.7.0",
37-
"react-hot-loader": "^4.6.3",
38-
"react-native": "^0.57.8"
31+
"babel-eslint": "10.0.3",
32+
"eslint": "6.8.0",
33+
"@react-native-community/eslint-config": "0.0.7",
34+
"react": "^16.12.0",
35+
"react-dom": "^16.12.0",
36+
"react-hot-loader": "^4.12.19",
37+
"react-native": "^0.61.5"
3938
},
4039
"dependencies": {
4140
"keymirror": "^0.1.1",
42-
"prop-types": "^15.5.10",
43-
"shaka-player": "^2.4.4"
41+
"prop-types": "^15.7.2",
42+
"shaka-player": "^2.5.9"
4443
},
4544
"scripts": {
46-
"test": "node_modules/.bin/eslint *.js"
45+
"lint": "yarn eslint *.js"
4746
},
4847
"files": [
4948
"android-exoplayer",

0 commit comments

Comments
 (0)