Skip to content

Commit 1e3c74f

Browse files
authored
Merge pull request #10 from srfaytkn/ios-dev
podspec for rn 60
2 parents c838f84 + 7ab7764 commit 1e3c74f

File tree

2 files changed

+38
-10
lines changed

2 files changed

+38
-10
lines changed

README.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,8 @@
55

66
![Example Gif](https://sharelist2me.s3-eu-west-1.amazonaws.com/repo/example.gif)
77

8-
## Progress
9-
10-
- [x] ios (implemented %99 using https://github.com/malkouz/youtube-ios-player-helper-swift)
11-
- [x] android (implemented https://github.com/PierfrancescoSoffritti/android-youtube-player)
12-
138
## Note
14-
- your android app needs to be using the androidx libraries instead of the old support libraries.
15-
- iOS under development but you can use
9+
- Your android app needs to be using the androidx libraries instead of the old support libraries.
1610

1711
## Video is unavailable problem
1812
- Origin is already set up in the library but you will notice that some videos are not playing. This is because the video is shared as not embeddable by provider.
@@ -29,10 +23,17 @@
2923
#### iOS
3024

3125
1. Drag drop `assets/YTPlayerView.html` to your iOS project
32-
2. Create a blank Swift file with bridge file in your project (to build swift code easily)
26+
2. Create a blank Swift file with bridge in your project (to build swift code easily)
3327
![ios example](./example/example-ios.png)
3428

35-
\`soon there will be easier implementation`
29+
### With CocoaPods (RN > 0.60)
30+
31+
1. `$ react-native link react-native-youtube-sdk`
32+
2. `$ cd /ios`
33+
3. `$ pod install`
34+
4. Create a blank Swift file with bridge in your project (to build swift code easily)
35+
5. Have fun
36+
3637

3738
### Manual installation
3839

@@ -181,5 +182,10 @@ const styles = StyleSheet.create({
181182
| pause | | void | pause the video |
182183
| loadVideo | videoId, startTime | void | load a video to the player |
183184
| getCurrentTime | | promise | Returns promise that results with the current time of the played video |
184-
| getVideoDuration | | promise | Returns promise that results with the duration of the played video |
185+
| getVideoDuration | | promise | Returns promise that results with the duration of the played video
186+
187+
188+
- [x] iOS (https://github.com/malkouz/youtube-ios-player-helper-swift)
189+
- [x] Android ('com.pierfrancescosoffritti.androidyoutubeplayer')
190+
|
185191

YouTubeSdk.podspec

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
require 'json'
2+
3+
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4+
5+
Pod::Spec.new do |s|
6+
s.name = 'YouTubeSdk'
7+
s.version = package['version']
8+
s.summary = package['description']
9+
s.description = package['description']
10+
s.homepage = package['homepage']
11+
s.license = package['license']
12+
s.author = package['author']
13+
s.source = { :git => 'https://github.com/srfaytkn/react-native-youtube-sdk.git', :tag => "master" }
14+
15+
s.platform = :ios, '9.0'
16+
s.ios.deployment_target = '9.0'
17+
18+
s.preserve_paths = 'LICENSE', 'package.json'
19+
s.source_files = 'ios/*.{h,m,swift}'
20+
s.dependency 'React'
21+
s.resources = ['assets/YTPlayerView.html']
22+
end

0 commit comments

Comments
 (0)