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

(cherry picked from commit d1d7b7f9d6)

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
This commit is contained in:
Mattermost Build 2020-08-15 11:21:43 -04:00 committed by GitHub
parent 1f47ba71cf
commit 034a9400c5
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);
}
}
};