Browse Source

remove youtube dep.

master
Pierre Bresson 3 years ago
parent
commit
97dad1c8d9
  1. 1
      android/app/build.gradle
  2. 4
      android/app/src/main/java/com/thinkerview/MainApplication.java
  3. 2
      android/settings.gradle
  4. 73
      app/screens/home/article/index.js
  5. 35
      ios/Cause Commune.xcodeproj/project.pbxproj
  6. 8
      package-lock.json
  7. 3
      package.json
  8. 11
      yarn.lock

1
android/app/build.gradle

@ -163,7 +163,6 @@ dependencies {
implementation project(':react-native-share')
implementation project(':react-native-vector-icons')
implementation project(':react-native-check-app-install')
implementation project(':react-native-youtube')
implementation project(':react-native-background-downloader')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"

4
android/app/src/main/java/com/thinkerview/MainApplication.java

@ -11,7 +11,6 @@ import cl.json.RNSharePackage;
import com.eko.RNBackgroundDownloaderPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.rpt.reactnativecheckpackageinstallation.CheckPackageInstallationPackage;
import com.inprogress.reactnativeyoutube.ReactNativeYouTube;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
@ -38,8 +37,7 @@ public class MainApplication extends Application implements ReactApplication {
new RNBackgroundDownloaderPackage(),
new RNSharePackage(),
new VectorIconsPackage(),
new CheckPackageInstallationPackage(),
new ReactNativeYouTube());
new CheckPackageInstallationPackage());
}
@Override

2
android/settings.gradle

@ -11,8 +11,6 @@ include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-check-app-install'
project(':react-native-check-app-install').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-check-app-install/android')
include ':react-native-youtube'
project(':react-native-youtube').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-youtube/android')
include ':react-native-background-downloader'
project(':react-native-background-downloader').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-background-downloader/android')

73
app/screens/home/article/index.js

@ -16,7 +16,6 @@ import {
shareSocialAction,
savePodcastOffline
} from "../../../actions";
import YouTube, { YouTubeStandaloneAndroid } from "react-native-youtube";
import TrackPlayer from "react-native-track-player";
import IconEntypo from "react-native-vector-icons/Entypo";
import FontAwesome from "react-native-vector-icons/FontAwesome";
@ -27,79 +26,8 @@ import _ from "lodash";
class ArticleScreen extends React.Component {
constructor(props) {
super(props);
this.state = {
youtubeNativePlayer: false
};
}
componentWillMount() {
if (Platform.OS === "ios") {
this.setState({
youtubeNativePlayer: true
});
} else {
AppInstalledChecker.isAppInstalled("youtube").then(isInstalled => {
if (isInstalled) {
this.setState({
youtubeNativePlayer: true
});
}
});
}
}
_playVideo = video_id => {
YouTubeStandaloneAndroid.playVideo({
apiKey: config.privateKeys.youtube_api_token,
videoId: video_id,
autoplay: true,
startTime: 0
})
.then(() => console.log("Standalone Player Exited"))
.catch(errorMessage => console.error(errorMessage));
};
renderVideoAndroid = (img_url, video_id) => {
if (Platform.OS === "android")
if (this.state.youtubeNativePlayer)
return (
<View style={{ flex: 1 }}>
<FastImage source={{ uri: img_url }} style={styles.img} />
<TouchableOpacity
style={styles.btn}
onPress={() => this._playVideo(video_id)}
>
<IconEntypo
name={"video"}
size={40}
color={config.colors.thinkerGreen}
style={styles.iconShare}
/>
<Text style={styles.btnText}>
{config.strings.articleScreen.playVideo}
</Text>
</TouchableOpacity>
</View>
);
};
renderVideoIOS = video_id => {
if (Platform.OS === "ios")
return (
<YouTube
videoId={video_id}
play={false}
fullscreen={true}
onReady={e => this.setState({ isReady: true })}
onChangeState={e => this.setState({ status: e.state })}
onChangeQuality={e => this.setState({ quality: e.quality })}
onError={e => this.setState({ error: e.error })}
style={{ alignSelf: "stretch", height: 220 }}
apiKey={config.privateKeys.youtube_api_token}
/>
);
};
_playPodcast = async (audio_link, img_url, title) => {
TrackPlayer.reset();
await TrackPlayer.add({
@ -180,7 +108,6 @@ class ArticleScreen extends React.Component {
let {
title,
body,
video_id,
img_url,
audio_link
} = this.props.article.articleSelected;

35
ios/Cause Commune.xcodeproj/project.pbxproj

@ -50,10 +50,8 @@
6B852D1A9CE34A9885E228DA /* libFastImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 12DCD125ED7A4C7198A2CD55 /* libFastImage.a */; };
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
97B988D3FA3340DFADABBA7A /* FontAwesome5_Brands.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1EAF536AC79F43D08938DB9D /* FontAwesome5_Brands.ttf */; };
9E9040CD2251011100E31047 /* libRCTYouTube.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9E9040CC2251010200E31047 /* libRCTYouTube.a */; };
9EA7BC8A2250F939005F4C73 /* dummy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EA7BC892250F939005F4C73 /* dummy.swift */; };
9EA7BC8C2250FD86005F4C73 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9EA7BC8B2250FD86005F4C73 /* JavaScriptCore.framework */; };
9ED950112251020600AD7E0A /* YTPlayerView-iframe-player.html in Resources */ = {isa = PBXBuildFile; fileRef = 9ED94FE42251020600AD7E0A /* YTPlayerView-iframe-player.html */; };
ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */; };
AEC6A4BEB6C74ED6B363452B /* Gilroy-Light.ttf in Resources */ = {isa = PBXBuildFile; fileRef = BE046BEF0DD1488192B1B4D5 /* Gilroy-Light.ttf */; };
B4BDF5291D5C4180B347CC53 /* Lato-HairlineItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 76EE94BE53CA435191BD5801 /* Lato-HairlineItalic.ttf */; };
@ -314,13 +312,6 @@
remoteGlobalIDString = 58B5119B1A9E6C1200147676;
remoteInfo = RCTText;
};
9E9040CB2251010200E31047 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 9E9040C72251010200E31047 /* RCTYouTube.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 8BDB9BC91B4289AE00EF9FEF;
remoteInfo = RCTYouTube;
};
9EA7BC142250F3D5005F4C73 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
@ -452,11 +443,9 @@
904C91DE16434739AF5CDD63 /* RNFS.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNFS.xcodeproj; path = "../node_modules/react-native-fs/RNFS.xcodeproj"; sourceTree = "<group>"; };
91E06D84F8BA4D01897E1429 /* FastImage.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = FastImage.xcodeproj; path = "../node_modules/react-native-fast-image/ios/FastImage.xcodeproj"; sourceTree = "<group>"; };
9A21EDD14EEE42A0BBE8ED21 /* Lato-LightItalic.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Lato-LightItalic.ttf"; path = "../assets/fonts/Lato-LightItalic.ttf"; sourceTree = "<group>"; };
9E9040C72251010200E31047 /* RCTYouTube.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTYouTube.xcodeproj; path = "../node_modules/react-native-youtube/RCTYouTube.xcodeproj"; sourceTree = "<group>"; };
9EA7BC882250F938005F4C73 /* thinkerview-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "thinkerview-Bridging-Header.h"; sourceTree = "<group>"; };
9EA7BC892250F939005F4C73 /* dummy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = dummy.swift; sourceTree = "<group>"; };
9EA7BC8B2250FD86005F4C73 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
9ED94FE42251020600AD7E0A /* YTPlayerView-iframe-player.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = "YTPlayerView-iframe-player.html"; path = "../node_modules/react-native-youtube/assets/YTPlayerView-iframe-player.html"; sourceTree = "<group>"; };
A7458D243A3E4118850B19B3 /* Feather.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Feather.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Feather.ttf"; sourceTree = "<group>"; };
A914660E1E264382B49F02C2 /* SimpleLineIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = SimpleLineIcons.ttf; path = "../node_modules/react-native-vector-icons/Fonts/SimpleLineIcons.ttf"; sourceTree = "<group>"; };
AA9D16FEB9E545F58F7D706C /* RNVectorIcons.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNVectorIcons.xcodeproj; path = "../node_modules/react-native-vector-icons/RNVectorIcons.xcodeproj"; sourceTree = "<group>"; };
@ -503,7 +492,6 @@
00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */,
139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */,
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,
9E9040CD2251011100E31047 /* libRCTYouTube.a in Frameworks */,
00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,
139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,
00F12E107AF04C50ADB29DF3 /* libRNBackgroundDownloader.a in Frameworks */,
@ -623,7 +611,6 @@
13B07FAE1A68108700A75B9A /* Cause Commune */ = {
isa = PBXGroup;
children = (
9ED94FE42251020600AD7E0A /* YTPlayerView-iframe-player.html */,
008F07F21AC5B25A0029DE68 /* main.jsbundle */,
13B07FAF1A68108700A75B9A /* AppDelegate.h */,
9EA7BC892250F939005F4C73 /* dummy.swift */,
@ -690,7 +677,6 @@
832341AE1AAA6A7D00B99B32 /* Libraries */ = {
isa = PBXGroup;
children = (
9E9040C72251010200E31047 /* RCTYouTube.xcodeproj */,
5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */,
146833FF1AC3E56700842450 /* React.xcodeproj */,
00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */,
@ -749,14 +735,6 @@
name = Products;
sourceTree = "<group>";
};
9E9040C82251010200E31047 /* Products */ = {
isa = PBXGroup;
children = (
9E9040CC2251010200E31047 /* libRCTYouTube.a */,
);
name = Products;
sourceTree = "<group>";
};
9EA7BC412250F6B1005F4C73 /* Recovered References */ = {
isa = PBXGroup;
children = (
@ -1026,10 +1004,6 @@
ProductGroup = 139FDEE71B06529A00C62182 /* Products */;
ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
},
{
ProductGroup = 9E9040C82251010200E31047 /* Products */;
ProjectRef = 9E9040C72251010200E31047 /* RCTYouTube.xcodeproj */;
},
{
ProductGroup = 146834001AC3E56700842450 /* Products */;
ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */;
@ -1290,13 +1264,6 @@
remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
9E9040CC2251010200E31047 /* libRCTYouTube.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libRCTYouTube.a;
remoteRef = 9E9040CB2251010200E31047 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
9EA7BC152250F3D5005F4C73 /* libjsi.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
@ -1400,7 +1367,6 @@
1E9101EBAF174440A5F3C60C /* Gilroy-ExtraBold.ttf in Resources */,
AEC6A4BEB6C74ED6B363452B /* Gilroy-Light.ttf in Resources */,
ECA4EC6AF4354EF8996FDA4E /* Lato-Black.ttf in Resources */,
9ED950112251020600AD7E0A /* YTPlayerView-iframe-player.html in Resources */,
4989447DC27F428BB63DC20D /* Lato-BlackItalic.ttf in Resources */,
30A2471B27CD42C790FA766A /* Lato-Bold.ttf in Resources */,
5671647CDA55436892EB339D /* Lato-BoldItalic.ttf in Resources */,
@ -1555,7 +1521,6 @@
"$(SRCROOT)/../node_modules/react-native-share/ios",
"$(SRCROOT)/../node_modules/react-native-track-player/ios/RNTrackPlayer/**",
"$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
"$(SRCROOT)/../node_modules/react-native-youtube/**",
"$(SRCROOT)/../node_modules/react-native-fast-image/ios/FastImage/**",
);
INFOPLIST_FILE = thinkerviewTests/Info.plist;

8
package-lock.json generated

@ -7606,14 +7606,6 @@
}
}
},
"react-native-youtube": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/react-native-youtube/-/react-native-youtube-1.1.0.tgz",
"integrity": "sha512-/+xy09Bq4rdoUyMsDAVtflOje6mh6MK8V8D4+qC0d8EM7mSyrdrmo9rtlfQwCsGtnb+Uak46ILevyJb0FTFeHg==",
"requires": {
"prop-types": "^15.5.0"
}
},
"react-navigation": {
"version": "2.5.5",
"resolved": "https://registry.npmjs.org/react-navigation/-/react-navigation-2.5.5.tgz",

3
package.json

@ -15,13 +15,12 @@
"react-native": "0.59.3",
"react-native-background-downloader": "2.0.1",
"react-native-check-app-install": "0.0.4",
"react-native-fast-image": "^5.2.0",
"react-native-fast-image": "5.2.0",
"react-native-fs": "2.13.3",
"react-native-share": "1.0.23",
"react-native-slider": "0.11.0",
"react-native-track-player": "1.1.3",
"react-native-vector-icons": "5.0.0",
"react-native-youtube": "1.1.0",
"react-navigation": "2.5.5",
"react-redux": "5.0.7",
"redux": "3.7.2",

11
yarn.lock

@ -5244,7 +5244,7 @@ prompts@^0.1.9:
kleur "^2.0.1"
sisteransi "^0.1.1"
prop-types@^15.5.0, prop-types@^15.5.10, prop-types@^15.5.6, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2:
prop-types@^15.5.10, prop-types@^15.5.6, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2:
version "15.6.2"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102"
integrity sha512-3pboPvLiWD7dkI3qf3KbUe6hKFKa52w+AE0VCqECtf+QHAKgOL37tTaNCnuX1nAAQ4ZhyP+kYVKf8rLmJ/feDQ==
@ -5371,7 +5371,7 @@ react-native-drawer-layout@1.3.2:
dependencies:
react-native-dismiss-keyboard "1.0.0"
react-native-fast-image@^5.2.0:
react-native-fast-image@5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/react-native-fast-image/-/react-native-fast-image-5.2.0.tgz#6730eb06951ea6f9a79abe02a733bc05b7a73412"
integrity sha512-S+2gmv9HfLc7CGjjnQ3kO/QoZD9BJnjfwWhsJWgjEvaeOPbpHZaXSUkINSqLcHD5KIHcYidu+U2lgXdEv4Jamg==
@ -5438,13 +5438,6 @@ react-native-vector-icons@5.0.0:
prop-types "^15.5.10"
yargs "^8.0.2"
react-native-youtube@1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/react-native-youtube/-/react-native-youtube-1.1.0.tgz#efa30c4f7385d1951af643188e30760efd6c0784"
integrity sha512-/+xy09Bq4rdoUyMsDAVtflOje6mh6MK8V8D4+qC0d8EM7mSyrdrmo9rtlfQwCsGtnb+Uak46ILevyJb0FTFeHg==
dependencies:
prop-types "^15.5.0"
react-native@0.59.3:
version "0.59.3"
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.59.3.tgz#b984bbe457f63d5515046d32ea5721fd22843548"

Loading…
Cancel
Save