-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
·react-native upgrade ·react-native-git-upgrade 还可以参考这篇讨论:facebook/react-native#11721 ===================================我是分割线================================= Ijkplayer扔到项目中各种头文件找不到,集成待解决。 下次更新不知道什么时候了……
- Loading branch information
姜振华
committed
Jan 7, 2017
1 parent
7a3a873
commit 4e6517b
Showing
25 changed files
with
457 additions
and
260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* Created by jiangzhenhua on 2017/1/7. | ||
*/ | ||
import React from "react"; | ||
import { | ||
requireNativeComponent | ||
} from "react-native"; | ||
|
||
let Video = requireNativeComponent('VideoRoom',VideoRoom); | ||
|
||
export default class VideoRoom extends React.Component { | ||
render(){ | ||
return <Video {...this.props}/>; | ||
} | ||
} | ||
|
||
VideoRoom.propTypes = { | ||
playURL:React.PropTypes.string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
<resources> | ||
|
||
<string name="app_name">news</string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
rootProject.name = 'news' | ||
|
||
include ':app' | ||
include ':react-native-vector-icons' | ||
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// RCTConvert+UIInterfaceOrientation.h | ||
// news | ||
// | ||
// Created by 姜振华 on 2017/1/7. | ||
// Copyright © 2017年 Facebook. All rights reserved. | ||
// | ||
|
||
#import <React/RCTConvert.h> | ||
|
||
@interface RCTConvert (UIInterfaceOrientation) | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// RCTConvert+UIInterfaceOrientation.m | ||
// news | ||
// | ||
// Created by 姜振华 on 2017/1/7. | ||
// Copyright © 2017年 Facebook. All rights reserved. | ||
// | ||
|
||
#import "RCTConvert+UIInterfaceOrientation.h" | ||
|
||
@implementation RCTConvert (UIInterfaceOrientation) | ||
|
||
RCT_ENUM_CONVERTER(UIInterfaceOrientation, | ||
(@{ | ||
@"interfaceOrientationUnknown":@(UIInterfaceOrientationPortrait), | ||
@"interfaceOrientationPortrait":@(UIInterfaceOrientationPortrait), | ||
@"interfaceOrientationPortraitUpsideDown":@(UIInterfaceOrientationPortraitUpsideDown), | ||
@"interfaceOrientationLandscapeLeft":@(UIInterfaceOrientationLandscapeLeft), | ||
@"interfaceOrientationLandscapeRight":@(UIInterfaceOrientationLandscapeRight) | ||
}), | ||
UIInterfaceOrientationPortrait, | ||
integerValue) | ||
|
||
|
||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// ScreenRotateManager.h | ||
// news | ||
// | ||
// Created by 姜振华 on 2017/1/7. | ||
// Copyright © 2017年 Facebook. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import <UIKit/UIKit.h> | ||
#import <React/RCTBridgeModule.h> | ||
|
||
@interface ScreenRotateManager : NSObject | ||
|
||
+ (void)forceOrientation: (UIInterfaceOrientation)orientation; | ||
|
||
+ (BOOL)isOrientationLandscape; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// | ||
// ScreenRotateManager.m | ||
// news | ||
// | ||
// Created by 姜振华 on 2017/1/7. | ||
// Copyright © 2017年 Facebook. All rights reserved. | ||
// | ||
|
||
#import "ScreenRotateManager.h" | ||
|
||
@implementation ScreenRotateManager | ||
|
||
RCT_EXPORT_MODULE(); | ||
|
||
|
||
|
||
RCT_EXPORT_METHOD(forceforceOrientation:(UIInterfaceOrientation)orientation) | ||
{ | ||
[ScreenRotateManager forceOrientation:orientation]; | ||
} | ||
|
||
|
||
+ (void)forceOrientation:(UIInterfaceOrientation)orientation { | ||
if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) { | ||
SEL selector = NSSelectorFromString(@"setOrientation:"); | ||
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[UIDevice instanceMethodSignatureForSelector:selector]]; | ||
[invocation setSelector:selector]; | ||
[invocation setTarget:[UIDevice currentDevice]]; | ||
int val = orientation; | ||
[invocation setArgument:&val atIndex:2]; | ||
[invocation invoke]; | ||
} | ||
} | ||
|
||
|
||
+ (BOOL)isOrientationLandscape { | ||
if (UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) { | ||
return YES; | ||
}else { | ||
return NO; | ||
} | ||
} | ||
|
||
- (NSDictionary *)constantsToExport | ||
{ | ||
return @{ | ||
@"interfaceOrientationUnknown":@(UIInterfaceOrientationPortrait), | ||
@"interfaceOrientationPortrait":@(UIInterfaceOrientationPortrait), | ||
@"interfaceOrientationPortraitUpsideDown":@(UIInterfaceOrientationPortraitUpsideDown), | ||
@"interfaceOrientationLandscapeLeft":@(UIInterfaceOrientationLandscapeLeft), | ||
@"interfaceOrientationLandscapeRight":@(UIInterfaceOrientationLandscapeRight) | ||
}; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// VideoRoom.h | ||
// news | ||
// | ||
// Created by 姜振华 on 2017/1/7. | ||
// Copyright © 2017年 Facebook. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@interface VideoRoom : UIView | ||
|
||
@property(nonatomic,copy)NSString* playURL; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// VideoRoom.m | ||
// news | ||
// | ||
// Created by 姜振华 on 2017/1/7. | ||
// Copyright © 2017年 Facebook. All rights reserved. | ||
// | ||
|
||
#import "VideoRoom.h" | ||
|
||
@implementation VideoRoom | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// VideoRoomManager.h | ||
// news | ||
// | ||
// Created by 姜振华 on 2017/1/7. | ||
// Copyright © 2017年 Facebook. All rights reserved. | ||
// | ||
|
||
#import <React/RCTViewManager.h> | ||
|
||
@interface VideoRoomManager : RCTViewManager | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// VideoRoomManager.m | ||
// news | ||
// | ||
// Created by 姜振华 on 2017/1/7. | ||
// Copyright © 2017年 Facebook. All rights reserved. | ||
// | ||
|
||
#import "VideoRoomManager.h" | ||
#import "VideoRoom.h" | ||
|
||
@implementation VideoRoomManager | ||
|
||
RCT_EXPORT_MODULE() | ||
RCT_EXPORT_VIEW_PROPERTY(playURL, NSString); | ||
|
||
-(UIView*)view { | ||
VideoRoom* videoroom = [[VideoRoom alloc]init]; | ||
return videoroom; | ||
} | ||
|
||
@end |
Oops, something went wrong.