Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
optimize doc
  • Loading branch information
LichKing-2234 committed Jul 24, 2020
commit 7a8205d4c46c1df15aa686df99cb429f50083686
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"types": "lib/index.d.ts",
"scripts": {
"build": "rm -rf lib && tsc",
"doc": "typedoc --out docs/api ./src",
"doc": "typedoc ./src",
"test": "jest",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"prepublish": "npm run build"
Expand Down
716 changes: 0 additions & 716 deletions src/RtcChannel.native.ts

This file was deleted.

2,132 changes: 0 additions & 2,132 deletions src/RtcEngine.native.ts

This file was deleted.

38 changes: 38 additions & 0 deletions src/RtcLocalView.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import React, {Component} from "react";
import {Platform} from "react-native";

import {RtcSurfaceView, RtcSurfaceViewProps, RtcTextureView, RtcTextureViewProps} from "./src/RtcRenderView.native";

namespace RtcLocalView {
/**
* Use SurfaceView in Android.
* Use UIView in iOS.
*/
export class SurfaceView extends Component<RtcSurfaceViewProps, {}> {
render() {
return (
<RtcSurfaceView
{...this.props}
uid={0}/>
);
}
}

/**
* Use TextureView in Android.
* Not support for iOS.
*/
export class TextureView extends Component<RtcTextureViewProps, {}> {
render() {
if (Platform.OS === 'ios')
throw new Error('TextureView not support for iOS')
return (
<RtcTextureView
{...this.props}
uid={0}/>
);
}
}
}

export default RtcLocalView
40 changes: 40 additions & 0 deletions src/RtcRemoteView.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import React, {Component} from "react";
import {Platform} from "react-native";

import {
RtcSurfaceView,
RtcSurfaceViewProps,
RtcTextureView,
RtcTextureViewProps,
RtcUidProps
} from "./src/RtcRenderView.native";

namespace RtcRemoteView {
/**
* Use SurfaceView in Android.
* Use UIView in iOS.
*/
export class SurfaceView extends Component<RtcSurfaceViewProps & RtcUidProps, {}> {
render() {
return (
<RtcSurfaceView {...this.props}/>
);
}
}

/**
* Use TextureView in Android.
* Not support for iOS.
*/
export class TextureView extends Component<RtcTextureViewProps & RtcUidProps, {}> {
render() {
if (Platform.OS === 'ios')
throw new Error('TextureView not support for iOS')
return (
<RtcTextureView {...this.props}/>
);
}
}
}

export default RtcRemoteView
Loading