MM-27711 Play YouTube video using expanded link (#4666)

This commit is contained in:
Elias Nahum 2020-08-13 14:22:37 -04:00 committed by GitHub
parent 66a8f8a55f
commit d1d7b7f9d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -238,9 +238,10 @@ export default class PostBodyAdditionalContent extends ImageViewPort {
};
playYouTubeVideo = () => {
const {link} = this.props;
const videoId = getYouTubeVideoId(link);
const startTime = this.getYouTubeTime(link);
const {expandedLink, link} = this.props;
const videoLink = expandedLink || link;
const videoId = getYouTubeVideoId(videoLink);
const startTime = this.getYouTubeTime(videoLink);
if (Platform.OS === 'ios') {
YouTubeStandaloneIOS.
@ -258,7 +259,7 @@ export default class PostBodyAdditionalContent extends ImageViewPort {
startTime,
}).catch(this.playYouTubeVideoError);
} else {
Linking.openURL(link);
Linking.openURL(videoLink);
}
}
};