|
|
@@ -9,7 +9,6 @@ import { connect } from '../../../base/redux';
|
|
9
|
9
|
import { ASPECT_RATIO_WIDE } from '../../../base/responsive-ui';
|
|
10
|
10
|
import { setToolboxVisible } from '../../../toolbox/actions';
|
|
11
|
11
|
import { setSharedVideoStatus } from '../../actions.native';
|
|
12
|
|
-import { getYoutubeId } from '../../functions';
|
|
13
|
12
|
|
|
14
|
13
|
import styles from './styles';
|
|
15
|
14
|
|
|
|
@@ -101,11 +100,11 @@ type Props = {
|
|
101
|
100
|
dispatch: Function,
|
|
102
|
101
|
|
|
103
|
102
|
/**
|
|
104
|
|
- * Youtube url of the video to be played.
|
|
|
103
|
+ * Youtube id of the video to be played.
|
|
105
|
104
|
*
|
|
106
|
105
|
* @private
|
|
107
|
106
|
*/
|
|
108
|
|
- youtubeUrl: string
|
|
|
107
|
+ youtubeId: string
|
|
109
|
108
|
};
|
|
110
|
109
|
|
|
111
|
110
|
/**
|
|
|
@@ -200,7 +199,7 @@ class YoutubeLargeVideo extends Component<Props, *> {
|
|
200
|
199
|
_isPlaying,
|
|
201
|
200
|
_playerHeight,
|
|
202
|
201
|
_playerWidth,
|
|
203
|
|
- youtubeUrl
|
|
|
202
|
+ youtubeId
|
|
204
|
203
|
} = this.props;
|
|
205
|
204
|
|
|
206
|
205
|
return (
|
|
|
@@ -221,7 +220,7 @@ class YoutubeLargeVideo extends Component<Props, *> {
|
|
221
|
220
|
play = { _isPlaying }
|
|
222
|
221
|
playbackRate = { 1 }
|
|
223
|
222
|
ref = { this.playerRef }
|
|
224
|
|
- videoId = { getYoutubeId(youtubeUrl) }
|
|
|
223
|
+ videoId = { youtubeId }
|
|
225
|
224
|
volume = { 50 }
|
|
226
|
225
|
webViewProps = {{
|
|
227
|
226
|
bounces: false,
|
|
|
@@ -244,7 +243,7 @@ class YoutubeLargeVideo extends Component<Props, *> {
|
|
244
|
243
|
_onReady() {
|
|
245
|
244
|
if (this.props?._isOwner) {
|
|
246
|
245
|
this.onVideoReady(
|
|
247
|
|
- this.props.youtubeUrl,
|
|
|
246
|
+ this.props.youtubeId,
|
|
248
|
247
|
this.playerRef.current && this.playerRef.current.getCurrentTime(),
|
|
249
|
248
|
this.props._ownerId);
|
|
250
|
249
|
}
|
|
|
@@ -267,11 +266,11 @@ class YoutubeLargeVideo extends Component<Props, *> {
|
|
267
|
266
|
_isStopped,
|
|
268
|
267
|
_ownerId,
|
|
269
|
268
|
_seek,
|
|
270
|
|
- youtubeUrl
|
|
|
269
|
+ youtubeId
|
|
271
|
270
|
} = this.props;
|
|
272
|
271
|
|
|
273
|
272
|
if (shouldSetNewStatus(_isStopped, _isOwner, status, _isPlaying, time, _seek)) {
|
|
274
|
|
- this.onVideoChangeEvent(youtubeUrl, status, time, _ownerId);
|
|
|
273
|
+ this.onVideoChangeEvent(youtubeId, status, time, _ownerId);
|
|
275
|
274
|
}
|
|
276
|
275
|
});
|
|
277
|
276
|
}
|
|
|
@@ -283,10 +282,10 @@ class YoutubeLargeVideo extends Component<Props, *> {
|
|
283
|
282
|
* @returns {void}
|
|
284
|
283
|
*/
|
|
285
|
284
|
saveRefTime() {
|
|
286
|
|
- const { youtubeUrl, _status, _ownerId } = this.props;
|
|
|
285
|
+ const { youtubeId, _status, _ownerId } = this.props;
|
|
287
|
286
|
|
|
288
|
287
|
this.playerRef.current && this.playerRef.current.getCurrentTime().then(time => {
|
|
289
|
|
- this.onVideoChangeEvent(youtubeUrl, _status, time, _ownerId);
|
|
|
288
|
+ this.onVideoChangeEvent(youtubeId, _status, time, _ownerId);
|
|
290
|
289
|
});
|
|
291
|
290
|
}
|
|
292
|
291
|
|