mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-19 19:31:54 +03:00
opening youtube app on android oreo
This commit is contained in:
parent
4dd56c0c8f
commit
23caaad5af
@ -23,6 +23,7 @@ import { toastNotification } from '../../../../redux/actions/uiAction';
|
||||
// Constants
|
||||
import { default as ROUTES } from '../../../../constants/routeNames';
|
||||
import getYoutubeId from '../../../../utils/getYoutubeId';
|
||||
import isAndroidOreo from '../../../../utils/isAndroidOreo';
|
||||
|
||||
const WIDTH = Dimensions.get('window').width;
|
||||
|
||||
@ -143,6 +144,10 @@ const PostBody = ({
|
||||
navigation.navigate(ROUTES.SCREENS.YOUTUBE, {
|
||||
videoId,
|
||||
});
|
||||
} else if (isAndroidOreo()) {
|
||||
//if android oreo, open youtube app instead to avoid app reload on back press.
|
||||
const interappLink = `vnd.youtube://${videoId}`;
|
||||
Linking.canOpenURL(interappLink) && Linking.openURL(interappLink);
|
||||
} else {
|
||||
YouTubeStandaloneAndroid.playVideo({
|
||||
apiKey: Config.YOUTUBE_API_KEY,
|
||||
|
Loading…
Reference in New Issue
Block a user