Skip to content

Commit

Permalink
Merge pull request #10 from srfaytkn/ios-dev
Browse files Browse the repository at this point in the history
podspec for rn 60
  • Loading branch information
ozgursoy authored Jul 15, 2019
2 parents c838f84 + 7ab7764 commit 1e3c74f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 10 deletions.
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,8 @@

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

## Progress

- [x] ios (implemented %99 using https://github.com/malkouz/youtube-ios-player-helper-swift)
- [x] android (implemented https://github.com/PierfrancescoSoffritti/android-youtube-player)

## Note
- your android app needs to be using the androidx libraries instead of the old support libraries.
- iOS under development but you can use
- Your android app needs to be using the androidx libraries instead of the old support libraries.

## Video is unavailable problem
- 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.
Expand All @@ -29,10 +23,17 @@
#### iOS

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

\`soon there will be easier implementation`
### With CocoaPods (RN > 0.60)

1. `$ react-native link react-native-youtube-sdk`
2. `$ cd /ios`
3. `$ pod install`
4. Create a blank Swift file with bridge in your project (to build swift code easily)
5. Have fun


### Manual installation

Expand Down Expand Up @@ -181,5 +182,10 @@ const styles = StyleSheet.create({
| pause | | void | pause the video |
| loadVideo | videoId, startTime | void | load a video to the player |
| getCurrentTime | | promise | Returns promise that results with the current time of the played video |
| getVideoDuration | | promise | Returns promise that results with the duration of the played video |
| getVideoDuration | | promise | Returns promise that results with the duration of the played video


- [x] iOS (https://github.com/malkouz/youtube-ios-player-helper-swift)
- [x] Android ('com.pierfrancescosoffritti.androidyoutubeplayer')
|

22 changes: 22 additions & 0 deletions YouTubeSdk.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
require 'json'

package = JSON.parse(File.read(File.join(__dir__, 'package.json')))

Pod::Spec.new do |s|
s.name = 'YouTubeSdk'
s.version = package['version']
s.summary = package['description']
s.description = package['description']
s.homepage = package['homepage']
s.license = package['license']
s.author = package['author']
s.source = { :git => 'https://github.com/srfaytkn/react-native-youtube-sdk.git', :tag => "master" }

s.platform = :ios, '9.0'
s.ios.deployment_target = '9.0'

s.preserve_paths = 'LICENSE', 'package.json'
s.source_files = 'ios/*.{h,m,swift}'
s.dependency 'React'
s.resources = ['assets/YTPlayerView.html']
end

0 comments on commit 1e3c74f

Please sign in to comment.