├── .gitignore
├── .npmignore
├── 1.png
├── Examples
└── rtspplayer
│ ├── .buckconfig
│ ├── .flowconfig
│ ├── .gitignore
│ ├── .watchmanconfig
│ ├── README.md
│ ├── SimpleVideo.js
│ ├── android
│ ├── app
│ │ ├── BUCK
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── assets
│ │ │ └── fonts
│ │ │ │ ├── Entypo.ttf
│ │ │ │ ├── EvilIcons.ttf
│ │ │ │ ├── FontAwesome.ttf
│ │ │ │ ├── Foundation.ttf
│ │ │ │ ├── Ionicons.ttf
│ │ │ │ ├── MaterialIcons.ttf
│ │ │ │ ├── Octicons.ttf
│ │ │ │ └── Zocial.ttf
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── vlcplayer
│ │ │ │ └── MainActivity.java
│ │ │ └── res
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ │ └── values
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── keystores
│ │ ├── BUCK
│ │ └── debug.keystore.properties
│ └── settings.gradle
│ ├── frameworks
│ ├── index.android.js
│ ├── index.ios.js
│ ├── ios
│ ├── rtspplayer.xcodeproj
│ │ ├── project.pbxproj
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── rtspplayer.xcscheme
│ └── rtspplayer
│ │ ├── AppDelegate.h
│ │ ├── AppDelegate.m
│ │ ├── Base.lproj
│ │ └── LaunchScreen.xib
│ │ ├── Images.xcassets
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ │ ├── Info.plist
│ │ └── main.m
│ └── package.json
├── LICENSE
├── PxPlayer.js
├── README.md
├── ReactNative_qq_group.png
├── ios
└── PxPlayer
│ ├── Build
│ └── Intermediates
│ │ └── PxPlayer.build
│ │ └── Debug-iphonesimulator
│ │ └── PxPlayer.build
│ │ ├── Objects-normal
│ │ └── x86_64
│ │ │ └── PxPlayer.LinkFileList
│ │ ├── PxPlayer-all-non-framework-target-headers.hmap
│ │ ├── PxPlayer-all-target-headers.hmap
│ │ ├── PxPlayer-generated-files.hmap
│ │ ├── PxPlayer-own-target-headers.hmap
│ │ ├── PxPlayer-project-headers.hmap
│ │ ├── PxPlayer.hmap
│ │ ├── dgph
│ │ └── dgph~
│ ├── FFMpegDecoder
│ ├── AudioStreamer.h
│ ├── AudioStreamer.m
│ ├── RTSPPlayer.h
│ ├── RTSPPlayer.m
│ ├── Utilities.h
│ └── Utilities.m
│ ├── PxPlayer.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcuserdata
│ │ │ └── xiongchuan.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── xcuserdata
│ │ └── xiongchuan.xcuserdatad
│ │ └── xcschemes
│ │ ├── PxPlayer.xcscheme
│ │ └── xcschememanagement.plist
│ └── PxPlayer
│ ├── PxPlayer.h
│ ├── PxPlayer.m
│ ├── PxPlayerManager.h
│ └── PxPlayerManager.m
└── package.json
/.gitignore:
--------------------------------------------------------------------------------
1 | ios/PxPlayer/Build
2 | Examples/rtspplayer/ios/build
3 | Examples/rtspplayer/node_modules
4 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | ios/PxPlayer/Build
2 | Examples/rtspplayer/ios/build
3 | Examples/rtspplayer/node_modules
4 |
--------------------------------------------------------------------------------
/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiongchuan86/react-native-pxplayer/db5924b50724c0f81b491e84e626e4fc6bca8fb7/1.png
--------------------------------------------------------------------------------
/Examples/rtspplayer/.buckconfig:
--------------------------------------------------------------------------------
1 |
2 | [android]
3 | target = Google Inc.:Google APIs:23
4 |
5 | [maven_repositories]
6 | central = https://repo1.maven.org/maven2
7 |
--------------------------------------------------------------------------------
/Examples/rtspplayer/.flowconfig:
--------------------------------------------------------------------------------
1 | [ignore]
2 |
3 | # We fork some components by platform.
4 | .*/*.web.js
5 | .*/*.android.js
6 |
7 | # Some modules have their own node_modules with overlap
8 | .*/node_modules/node-haste/.*
9 |
10 | # Ugh
11 | .*/node_modules/babel.*
12 | .*/node_modules/babylon.*
13 | .*/node_modules/invariant.*
14 |
15 | # Ignore react and fbjs where there are overlaps, but don't ignore
16 | # anything that react-native relies on
17 | .*/node_modules/fbjs/lib/Map.js
18 | .*/node_modules/fbjs/lib/ErrorUtils.js
19 |
20 | # Flow has a built-in definition for the 'react' module which we prefer to use
21 | # over the currently-untyped source
22 | .*/node_modules/react/react.js
23 | .*/node_modules/react/lib/React.js
24 | .*/node_modules/react/lib/ReactDOM.js
25 |
26 | .*/__mocks__/.*
27 | .*/__tests__/.*
28 |
29 | .*/commoner/test/source/widget/share.js
30 |
31 | # Ignore commoner tests
32 | .*/node_modules/commoner/test/.*
33 |
34 | # See https://github.com/facebook/flow/issues/442
35 | .*/react-tools/node_modules/commoner/lib/reader.js
36 |
37 | # Ignore jest
38 | .*/node_modules/jest-cli/.*
39 |
40 | # Ignore Website
41 | .*/website/.*
42 |
43 | # Ignore generators
44 | .*/local-cli/generator.*
45 |
46 | # Ignore BUCK generated folders
47 | .*\.buckd/
48 |
49 | # Ignore RNPM
50 | .*/local-cli/rnpm/.*
51 |
52 | .*/node_modules/is-my-json-valid/test/.*\.json
53 | .*/node_modules/iconv-lite/encodings/tables/.*\.json
54 | .*/node_modules/y18n/test/.*\.json
55 | .*/node_modules/spdx-license-ids/spdx-license-ids.json
56 | .*/node_modules/spdx-exceptions/index.json
57 | .*/node_modules/resolve/test/subdirs/node_modules/a/b/c/x.json
58 | .*/node_modules/resolve/lib/core.json
59 | .*/node_modules/jsonparse/samplejson/.*\.json
60 | .*/node_modules/json5/test/.*\.json
61 | .*/node_modules/ua-parser-js/test/.*\.json
62 | .*/node_modules/builtin-modules/builtin-modules.json
63 | .*/node_modules/binary-extensions/binary-extensions.json
64 | .*/node_modules/url-regex/tlds.json
65 | .*/node_modules/joi/.*\.json
66 | .*/node_modules/isemail/.*\.json
67 | .*/node_modules/tr46/.*\.json
68 |
69 |
70 | [include]
71 |
72 | [libs]
73 | node_modules/react-native/Libraries/react-native/react-native-interface.js
74 | node_modules/react-native/flow
75 | flow/
76 |
77 | [options]
78 | module.system=haste
79 |
80 | esproposal.class_static_fields=enable
81 | esproposal.class_instance_fields=enable
82 |
83 | munge_underscores=true
84 |
85 | module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
86 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
87 |
88 | suppress_type=$FlowIssue
89 | suppress_type=$FlowFixMe
90 | suppress_type=$FixMe
91 |
92 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-5]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
93 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-5]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
94 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
95 |
96 | [version]
97 | ^0.25.0
98 |
--------------------------------------------------------------------------------
/Examples/rtspplayer/.gitignore:
--------------------------------------------------------------------------------
1 | # OSX
2 | #
3 | .DS_Store
4 |
5 | # Xcode
6 | #
7 | build/
8 | *.pbxuser
9 | !default.pbxuser
10 | *.mode1v3
11 | !default.mode1v3
12 | *.mode2v3
13 | !default.mode2v3
14 | *.perspectivev3
15 | !default.perspectivev3
16 | xcuserdata
17 | *.xccheckout
18 | *.moved-aside
19 | DerivedData
20 | *.hmap
21 | *.ipa
22 | *.xcuserstate
23 | project.xcworkspace
24 |
25 | # Android/IJ
26 | #
27 | .idea
28 | .gradle
29 | local.properties
30 |
31 | # node.js
32 | #
33 | node_modules/
34 | npm-debug.log
35 |
36 | # BUCK
37 | buck-out/
38 | \.buckd/
39 | android/app/libs
40 | android/keystores/debug.keystore
41 |
--------------------------------------------------------------------------------
/Examples/rtspplayer/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/Examples/rtspplayer/README.md:
--------------------------------------------------------------------------------
1 | ## 参考代码
2 |
3 | Video.js 封装的一个 适用于 mobile 的播放器
4 |
5 | 在自己的代码里面可以直接使用
6 |
7 | ```
8 | import React, { Component } from 'react';
9 | import {
10 | AppRegistry
11 | } from 'react-native';
12 | import Video from './Video.js';
13 |
14 |
15 |
16 | class vlcplayer extends Component {
17 |
18 | render() {
19 | const uri = 'http://cdn.goluk.cn/video/t1_2.mp4';
20 | return (
21 |
22 | );
23 | }
24 | }
25 |
26 | AppRegistry.registerComponent('vlcplayer', () => vlcplayer);
27 | ```
28 |
--------------------------------------------------------------------------------
/Examples/rtspplayer/SimpleVideo.js:
--------------------------------------------------------------------------------
1 |
2 | import React, { Component ,PropTypes} from 'react';
3 | import {
4 | StyleSheet,
5 | Text,
6 | View,
7 | Dimensions,
8 | TouchableOpacity
9 | } from 'react-native';
10 | import PxPlayer from 'react-native-pxplayer';
11 | import * as Progress from 'react-native-progress';
12 | import Icon from 'react-native-vector-icons/FontAwesome';
13 | import { Bars } from 'react-native-loader';
14 | import Slider from 'react-native-slider';
15 | var RNFS = require('react-native-fs');
16 |
17 | const playerDefaultHeight = 250;
18 | const playerDefaultWidth = Dimensions.get('window').width;
19 |
20 | export default class SimpleVideo extends Component {
21 |
22 | static propTypes = {
23 | uri:PropTypes.string
24 | }
25 |
26 | constructor(props) {
27 | super(props);
28 | this.state = {
29 | progress: 0,
30 | indeterminate: true,
31 | paused:false,
32 | playButtonColor:'rgba(255,255,255,0)',
33 | loadingColor:'rgba(255,255,255,0)',
34 | playend:false,
35 | position:0,
36 | customStyle:{},
37 | customButtonStyle:{},
38 | buttonSize:70,
39 | progressWidth:playerDefaultWidth
40 | };
41 | this.state.customStyle = Object.assign({},this.props.style);
42 |
43 | if(this.state.customStyle.width){
44 | this.state.progressWidth = this.state.customStyle.width;
45 | this.state.customButtonStyle.width = this.state.customStyle.width;
46 | }
47 |
48 | if(this.state.customStyle.height){
49 | this.state.customButtonStyle.height = this.state.customStyle.height;
50 | this.state.customButtonStyle.top = - (this.state.customStyle.height);
51 | }
52 |
53 | if(this.props.buttonSize){
54 | this.state.buttonSize = this.props.buttonSize;
55 | }
56 |
57 | this.state.customButtonStyle = Object.assign(this.state.customButtonStyle,this.props.buttonStyle);
58 | }
59 |
60 | render() {
61 | let defaultControlsView = this.defaultControlsView();
62 | let actionButton = this.actionButton();
63 | return (
64 |
65 |
76 | {defaultControlsView}
77 | {actionButton}
78 |
79 | );
80 | }
81 |
82 | actionButton()
83 | {
84 | return (
85 |
86 | 截图
87 |
88 |
89 | );
90 | }
91 |
92 | saveVideoSnapshot()
93 | {
94 | let path = RNFS.DocumentDirectoryPath + '/1.png';
95 | console.warn("saveVideoSnapshot path="+path);
96 | this.refs['player'].snapshot(path);
97 | }
98 |
99 |
100 | pause()
101 | {
102 | this.setState({paused:!this.state.paused});
103 | }
104 |
105 | onPlaying(event){
106 | this.setState({loadingColor:'rgba(255,255,255,0)'});
107 | this.setState({playButtonColor:'rgba(255,255,255,0)'});
108 | }
109 |
110 | onPaused(event){
111 | this.setState({loadingColor:'rgba(255,255,255,0)'});
112 | this.setState({playButtonColor:'rgba(255,255,255,1)'});
113 | }
114 |
115 |
116 | defaultControlsView(){
117 | return (
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 | );
126 | }
127 |
128 | onProgress(event)
129 | {
130 | //console.warn("position="+event.position+",currentTime="+event.currentTime+",remainingTime="+event.remainingTime);
131 | this.setState({progress:event.position});
132 | this.setState({loadingColor:'rgba(255,255,255,0)'});
133 | }
134 |
135 | onEnded(event)
136 | {
137 | this.setState({progress:1,playend:true});
138 | this.setState({playButtonColor:'rgba(255,255,255,1)'});
139 | }
140 | }
141 |
142 | const styles = StyleSheet.create({
143 | container: {
144 | flex: 1,
145 |
146 | alignItems: 'center',
147 | backgroundColor: '#F5FCFF',
148 | },
149 | vlcplayer:{
150 | width:playerDefaultWidth,
151 | height:playerDefaultHeight,
152 | backgroundColor:'black',
153 | // transform:[{rotate:'90deg'}]
154 | },
155 | buttonBox:{
156 | position:'absolute',
157 | top:-(playerDefaultHeight),
158 | alignItems: 'center',
159 | justifyContent: 'center',
160 | width:playerDefaultWidth,
161 | height:playerDefaultHeight
162 | }
163 | });
164 |
--------------------------------------------------------------------------------
/Examples/rtspplayer/android/app/BUCK:
--------------------------------------------------------------------------------
1 | import re
2 |
3 | # To learn about Buck see [Docs](https://buckbuild.com/).
4 | # To run your application with Buck:
5 | # - install Buck
6 | # - `npm start` - to start the packager
7 | # - `cd android`
8 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US`
9 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
10 | # - `buck install -r android/app` - compile, install and run application
11 | #
12 |
13 | lib_deps = []
14 | for jarfile in glob(['libs/*.jar']):
15 | name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile)
16 | lib_deps.append(':' + name)
17 | prebuilt_jar(
18 | name = name,
19 | binary_jar = jarfile,
20 | )
21 |
22 | for aarfile in glob(['libs/*.aar']):
23 | name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile)
24 | lib_deps.append(':' + name)
25 | android_prebuilt_aar(
26 | name = name,
27 | aar = aarfile,
28 | )
29 |
30 | android_library(
31 | name = 'all-libs',
32 | exported_deps = lib_deps
33 | )
34 |
35 | android_library(
36 | name = 'app-code',
37 | srcs = glob([
38 | 'src/main/java/**/*.java',
39 | ]),
40 | deps = [
41 | ':all-libs',
42 | ':build_config',
43 | ':res',
44 | ],
45 | )
46 |
47 | android_build_config(
48 | name = 'build_config',
49 | package = 'com.vlcplayer',
50 | )
51 |
52 | android_resource(
53 | name = 'res',
54 | res = 'src/main/res',
55 | package = 'com.vlcplayer',
56 | )
57 |
58 | android_binary(
59 | name = 'app',
60 | package_type = 'debug',
61 | manifest = 'src/main/AndroidManifest.xml',
62 | keystore = '//android/keystores:debug',
63 | deps = [
64 | ':app-code',
65 | ],
66 | )
67 |
--------------------------------------------------------------------------------
/Examples/rtspplayer/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "com.android.application"
2 |
3 | import com.android.build.OutputFile
4 |
5 | /**
6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
7 | * and bundleReleaseJsAndAssets).
8 | * These basically call `react-native bundle` with the correct arguments during the Android build
9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
10 | * bundle directly from the development server. Below you can see all the possible configurations
11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the
12 | * `apply from: "../../node_modules/react-native/react.gradle"` line.
13 | *
14 | * project.ext.react = [
15 | * // the name of the generated asset file containing your JS bundle
16 | * bundleAssetName: "index.android.bundle",
17 | *
18 | * // the entry file for bundle generation
19 | * entryFile: "index.android.js",
20 | *
21 | * // whether to bundle JS and assets in debug mode
22 | * bundleInDebug: false,
23 | *
24 | * // whether to bundle JS and assets in release mode
25 | * bundleInRelease: true,
26 | *
27 | * // whether to bundle JS and assets in another build variant (if configured).
28 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
29 | * // The configuration property can be in the following formats
30 | * // 'bundleIn${productFlavor}${buildType}'
31 | * // 'bundleIn${buildType}'
32 | * // bundleInFreeDebug: true,
33 | * // bundleInPaidRelease: true,
34 | * // bundleInBeta: true,
35 | *
36 | * // the root of your project, i.e. where "package.json" lives
37 | * root: "../../",
38 | *
39 | * // where to put the JS bundle asset in debug mode
40 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
41 | *
42 | * // where to put the JS bundle asset in release mode
43 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
44 | *
45 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
46 | * // require('./image.png')), in debug mode
47 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
48 | *
49 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
50 | * // require('./image.png')), in release mode
51 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
52 | *
53 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
54 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
55 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle
56 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
57 | * // for example, you might want to remove it from here.
58 | * inputExcludes: ["android/**", "ios/**"]
59 | * ]
60 | */
61 |
62 | apply from: "../../node_modules/react-native/react.gradle"
63 |
64 | /**
65 | * Set this to true to create two separate APKs instead of one:
66 | * - An APK that only works on ARM devices
67 | * - An APK that only works on x86 devices
68 | * The advantage is the size of the APK is reduced by about 4MB.
69 | * Upload all the APKs to the Play Store and people will download
70 | * the correct one based on the CPU architecture of their device.
71 | */
72 | def enableSeparateBuildPerCPUArchitecture = false
73 |
74 | /**
75 | * Run Proguard to shrink the Java bytecode in release builds.
76 | */
77 | def enableProguardInReleaseBuilds = false
78 |
79 | android {
80 | compileSdkVersion 23
81 | buildToolsVersion "23.0.1"
82 |
83 | defaultConfig {
84 | applicationId "com.vlcplayer"
85 | minSdkVersion 16
86 | targetSdkVersion 22
87 | versionCode 1
88 | versionName "1.0"
89 | ndk {
90 | abiFilters "armeabi-v7a", "x86"
91 | }
92 | }
93 | splits {
94 | abi {
95 | reset()
96 | enable enableSeparateBuildPerCPUArchitecture
97 | universalApk false // If true, also generate a universal APK
98 | include "armeabi-v7a", "x86"
99 | }
100 | }
101 | buildTypes {
102 | release {
103 | minifyEnabled enableProguardInReleaseBuilds
104 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
105 | }
106 | }
107 | // applicationVariants are e.g. debug, release
108 | applicationVariants.all { variant ->
109 | variant.outputs.each { output ->
110 | // For each separate APK per architecture, set a unique version code as described here:
111 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
112 | def versionCodes = ["armeabi-v7a":1, "x86":2]
113 | def abi = output.getFilter(OutputFile.ABI)
114 | if (abi != null) { // null for the universal-debug, universal-release variants
115 | output.versionCodeOverride =
116 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
117 | }
118 | }
119 | }
120 | }
121 |
122 | dependencies {
123 | compile project(':react-native-vector-icons')
124 | compile fileTree(dir: "libs", include: ["*.jar"])
125 | compile "com.android.support:appcompat-v7:23.0.1"
126 | compile "com.facebook.react:react-native:+" // From node_modules
127 | }
128 |
129 | // Run this once to be able to run the application with BUCK
130 | // puts all compile dependencies into folder libs for BUCK to use
131 | task copyDownloadableDepsToLibs(type: Copy) {
132 | from configurations.compile
133 | into 'libs'
134 | }
135 |
--------------------------------------------------------------------------------
/Examples/rtspplayer/android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Disabling obfuscation is useful if you collect stack traces from production crashes
20 | # (unless you are using a system that supports de-obfuscate the stack traces).
21 | -dontobfuscate
22 |
23 | # React Native
24 |
25 | # Keep our interfaces so they can be used by other ProGuard rules.
26 | # See http://sourceforge.net/p/proguard/bugs/466/
27 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
28 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
29 |
30 | # Do not strip any method/class that is annotated with @DoNotStrip
31 | -keep @com.facebook.proguard.annotations.DoNotStrip class *
32 | -keepclassmembers class * {
33 | @com.facebook.proguard.annotations.DoNotStrip *;
34 | }
35 |
36 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
37 | void set*(***);
38 | *** get*();
39 | }
40 |
41 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; }
42 | -keep class * extends com.facebook.react.bridge.NativeModule { *; }
43 | -keepclassmembers,includedescriptorclasses class * { native ; }
44 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; }
45 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; }
46 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; }
47 |
48 | -dontwarn com.facebook.react.**
49 |
50 | # okhttp
51 |
52 | -keepattributes Signature
53 | -keepattributes *Annotation*
54 | -keep class okhttp3.** { *; }
55 | -keep interface okhttp3.** { *; }
56 | -dontwarn okhttp3.**
57 |
58 | # okio
59 |
60 | -keep class sun.misc.Unsafe { *; }
61 | -dontwarn java.nio.file.*
62 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
63 | -dontwarn okio.**
64 |
--------------------------------------------------------------------------------
/Examples/rtspplayer/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
12 |
13 |
18 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/Examples/rtspplayer/android/app/src/main/assets/fonts/Entypo.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiongchuan86/react-native-pxplayer/db5924b50724c0f81b491e84e626e4fc6bca8fb7/Examples/rtspplayer/android/app/src/main/assets/fonts/Entypo.ttf
--------------------------------------------------------------------------------
/Examples/rtspplayer/android/app/src/main/assets/fonts/EvilIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiongchuan86/react-native-pxplayer/db5924b50724c0f81b491e84e626e4fc6bca8fb7/Examples/rtspplayer/android/app/src/main/assets/fonts/EvilIcons.ttf
--------------------------------------------------------------------------------
/Examples/rtspplayer/android/app/src/main/assets/fonts/FontAwesome.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiongchuan86/react-native-pxplayer/db5924b50724c0f81b491e84e626e4fc6bca8fb7/Examples/rtspplayer/android/app/src/main/assets/fonts/FontAwesome.ttf
--------------------------------------------------------------------------------
/Examples/rtspplayer/android/app/src/main/assets/fonts/Foundation.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiongchuan86/react-native-pxplayer/db5924b50724c0f81b491e84e626e4fc6bca8fb7/Examples/rtspplayer/android/app/src/main/assets/fonts/Foundation.ttf
--------------------------------------------------------------------------------
/Examples/rtspplayer/android/app/src/main/assets/fonts/Ionicons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiongchuan86/react-native-pxplayer/db5924b50724c0f81b491e84e626e4fc6bca8fb7/Examples/rtspplayer/android/app/src/main/assets/fonts/Ionicons.ttf
--------------------------------------------------------------------------------
/Examples/rtspplayer/android/app/src/main/assets/fonts/MaterialIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiongchuan86/react-native-pxplayer/db5924b50724c0f81b491e84e626e4fc6bca8fb7/Examples/rtspplayer/android/app/src/main/assets/fonts/MaterialIcons.ttf
--------------------------------------------------------------------------------
/Examples/rtspplayer/android/app/src/main/assets/fonts/Octicons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiongchuan86/react-native-pxplayer/db5924b50724c0f81b491e84e626e4fc6bca8fb7/Examples/rtspplayer/android/app/src/main/assets/fonts/Octicons.ttf
--------------------------------------------------------------------------------
/Examples/rtspplayer/android/app/src/main/assets/fonts/Zocial.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiongchuan86/react-native-pxplayer/db5924b50724c0f81b491e84e626e4fc6bca8fb7/Examples/rtspplayer/android/app/src/main/assets/fonts/Zocial.ttf
--------------------------------------------------------------------------------
/Examples/rtspplayer/android/app/src/main/java/com/vlcplayer/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.vlcplayer;
2 |
3 | import com.facebook.react.ReactActivity;
4 | import com.oblador.vectoricons.VectorIconsPackage;
5 | import com.facebook.react.ReactPackage;
6 | import com.facebook.react.shell.MainReactPackage;
7 |
8 | import java.util.Arrays;
9 | import java.util.List;
10 |
11 | public class MainActivity extends ReactActivity {
12 |
13 | /**
14 | * Returns the name of the main component registered from JavaScript.
15 | * This is used to schedule rendering of the component.
16 | */
17 | @Override
18 | protected String getMainComponentName() {
19 | return "vlcplayer";
20 | }
21 |
22 | /**
23 | * Returns whether dev mode should be enabled.
24 | * This enables e.g. the dev menu.
25 | */
26 | @Override
27 | protected boolean getUseDeveloperSupport() {
28 | return BuildConfig.DEBUG;
29 | }
30 |
31 | /**
32 | * A list of packages used by the app. If the app uses additional views
33 | * or modules besides the default ones, add more packages here.
34 | */
35 | @Override
36 | protected List getPackages() {
37 | return Arrays.asList(
38 | new MainReactPackage(),
39 | new VectorIconsPackage()
40 | );
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/Examples/rtspplayer/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiongchuan86/react-native-pxplayer/db5924b50724c0f81b491e84e626e4fc6bca8fb7/Examples/rtspplayer/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Examples/rtspplayer/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiongchuan86/react-native-pxplayer/db5924b50724c0f81b491e84e626e4fc6bca8fb7/Examples/rtspplayer/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Examples/rtspplayer/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiongchuan86/react-native-pxplayer/db5924b50724c0f81b491e84e626e4fc6bca8fb7/Examples/rtspplayer/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Examples/rtspplayer/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiongchuan86/react-native-pxplayer/db5924b50724c0f81b491e84e626e4fc6bca8fb7/Examples/rtspplayer/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Examples/rtspplayer/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | vlcplayer
4 |
5 |
--------------------------------------------------------------------------------
/Examples/rtspplayer/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Examples/rtspplayer/android/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:1.3.1'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | mavenLocal()
18 | jcenter()
19 | maven {
20 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
21 | url "$projectDir/../../node_modules/react-native/android"
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Examples/rtspplayer/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
19 |
20 | android.useDeprecatedNdk=true
21 |
--------------------------------------------------------------------------------
/Examples/rtspplayer/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiongchuan86/react-native-pxplayer/db5924b50724c0f81b491e84e626e4fc6bca8fb7/Examples/rtspplayer/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/Examples/rtspplayer/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
6 |
--------------------------------------------------------------------------------
/Examples/rtspplayer/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/Examples/rtspplayer/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/Examples/rtspplayer/android/keystores/BUCK:
--------------------------------------------------------------------------------
1 | keystore(
2 | name = 'debug',
3 | store = 'debug.keystore',
4 | properties = 'debug.keystore.properties',
5 | visibility = [
6 | 'PUBLIC',
7 | ],
8 | )
9 |
--------------------------------------------------------------------------------
/Examples/rtspplayer/android/keystores/debug.keystore.properties:
--------------------------------------------------------------------------------
1 | key.store=debug.keystore
2 | key.alias=androiddebugkey
3 | key.store.password=android
4 | key.alias.password=android
5 |
--------------------------------------------------------------------------------
/Examples/rtspplayer/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'vlcplayer'
2 |
3 | include ':app'
4 | include ':react-native-vector-icons'
5 | project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
6 |
--------------------------------------------------------------------------------
/Examples/rtspplayer/frameworks:
--------------------------------------------------------------------------------
1 | /Users/xiongchuan/git/chelook_RN/frameworks
--------------------------------------------------------------------------------
/Examples/rtspplayer/index.android.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Sample React Native App
3 | * https://github.com/facebook/react-native
4 | * @flow
5 | */
6 |
7 | import React, { Component } from 'react';
8 | import {
9 | AppRegistry,
10 | StyleSheet,
11 | Text,
12 | View
13 | } from 'react-native';
14 |
15 | class vlcplayer extends Component {
16 | render() {
17 | return (
18 |
19 |
20 | Welcome to React Native!
21 |
22 |
23 | To get started, edit index.android.js
24 |
25 |
26 | Shake or press menu button for dev menu
27 |
28 |
29 | );
30 | }
31 | }
32 |
33 | const styles = StyleSheet.create({
34 | container: {
35 | flex: 1,
36 | justifyContent: 'center',
37 | alignItems: 'center',
38 | backgroundColor: '#F5FCFF',
39 | },
40 | welcome: {
41 | fontSize: 20,
42 | textAlign: 'center',
43 | margin: 10,
44 | },
45 | instructions: {
46 | textAlign: 'center',
47 | color: '#333333',
48 | marginBottom: 5,
49 | },
50 | });
51 |
52 | AppRegistry.registerComponent('vlcplayer', () => vlcplayer);
53 |
--------------------------------------------------------------------------------
/Examples/rtspplayer/index.ios.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import {
3 | AppRegistry,
4 | View,
5 | Text
6 | } from 'react-native';
7 | import SimpleVideo from './SimpleVideo.js';
8 | //import Video from './Video.js';
9 |
10 |
11 |
12 | class rtspplayer extends Component {
13 |
14 | render() {
15 | //const uri = 'http://cdn.goluk.cn/video/t1_2.mp4';
16 | const uri = 'rtsp://192.168.1.254/xxx.mp4';
17 | let simplevideo = this.renderSimpleVideo(uri);
18 | //let simplevideo = null;
19 | let video = null;//this.renderVideo(uri);
20 | return (
21 |
22 | {simplevideo}
23 | {video}
24 |
25 | );
26 | }
27 |
28 | renderSimpleVideo(uri){
29 | return (
30 |
31 |
32 | A Simple Player
33 |
34 | );
35 | }
36 |
37 | // renderVideo(uri){
38 | // return (
39 | //
40 | //
41 | // A full-featured player
42 | //
43 | // );
44 | // }
45 | }
46 |
47 | AppRegistry.registerComponent('rtspplayer', () => rtspplayer);
48 |
--------------------------------------------------------------------------------
/Examples/rtspplayer/ios/rtspplayer.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; };
11 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; };
12 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; };
13 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; };
14 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; };
15 | 0C2B977D1D07FDC1007E68B1 /* VideoToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C2B977C1D07FDC1007E68B1 /* VideoToolbox.framework */; };
16 | 0C2B977F1D07FDD7007E68B1 /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C2B977E1D07FDD7007E68B1 /* libiconv.tbd */; };
17 | 0C2B97A11D094B54007E68B1 /* libART.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C2B97A01D094B47007E68B1 /* libART.a */; };
18 | 0C3753131D2BAC81005D73FE /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 0C37530D1D2BAC81005D73FE /* Info.plist */; };
19 | 0C3753141D2BAC81005D73FE /* Base.lproj in Resources */ = {isa = PBXBuildFile; fileRef = 0C37530E1D2BAC81005D73FE /* Base.lproj */; };
20 | 0C3753151D2BAC81005D73FE /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 0C3753101D2BAC81005D73FE /* AppDelegate.m */; };
21 | 0C3753161D2BAC81005D73FE /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0C3753111D2BAC81005D73FE /* Images.xcassets */; };
22 | 0C3753171D2BAC81005D73FE /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 0C3753121D2BAC81005D73FE /* main.m */; };
23 | 0C3753431D2BB3CC005D73FE /* libavcodec.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C37533B1D2BB3CC005D73FE /* libavcodec.a */; };
24 | 0C3753441D2BB3CC005D73FE /* libavdevice.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C37533C1D2BB3CC005D73FE /* libavdevice.a */; };
25 | 0C3753451D2BB3CC005D73FE /* libavfilter.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C37533D1D2BB3CC005D73FE /* libavfilter.a */; };
26 | 0C3753461D2BB3CC005D73FE /* libavformat.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C37533E1D2BB3CC005D73FE /* libavformat.a */; };
27 | 0C3753471D2BB3CC005D73FE /* libavutil.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C37533F1D2BB3CC005D73FE /* libavutil.a */; };
28 | 0C3753481D2BB3CD005D73FE /* libpostproc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C3753401D2BB3CC005D73FE /* libpostproc.a */; };
29 | 0C3753491D2BB3CD005D73FE /* libswresample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C3753411D2BB3CC005D73FE /* libswresample.a */; };
30 | 0C37534A1D2BB3CD005D73FE /* libswscale.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C3753421D2BB3CC005D73FE /* libswscale.a */; };
31 | 0C37534C1D2BB3F6005D73FE /* libplayerxx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C37534B1D2BB3F6005D73FE /* libplayerxx.a */; };
32 | 0C37534E1D2BB416005D73FE /* libtbox.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C37534D1D2BB416005D73FE /* libtbox.a */; };
33 | 0C3753501D2BB428005D73FE /* libx264.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C37534F1D2BB428005D73FE /* libx264.a */; };
34 | 0C3753521D2BB45B005D73FE /* libbz2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C3753511D2BB45B005D73FE /* libbz2.tbd */; };
35 | 0C3753541D2BB464005D73FE /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C3753531D2BB464005D73FE /* libz.tbd */; };
36 | 0C965E081D0D7EB90057679D /* libRNFS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C965E071D0D7EA80057679D /* libRNFS.a */; };
37 | 0CD99FF31D3774A600A56D7A /* libPxPlayer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0CD99FF21D37749A00A56D7A /* libPxPlayer.a */; };
38 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; };
39 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; };
40 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; };
41 | 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
42 | 14C1C18DB65145AF8362826C /* EvilIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = EF8F7648D1924463990B8A91 /* EvilIcons.ttf */; };
43 | 1C866C7487394FCAB425504B /* libRNVectorIcons.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CF5347D5C0664C4F8AF1453E /* libRNVectorIcons.a */; };
44 | 29C92F7DACFB48B4AADE1220 /* Octicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = CCACA4B135994666A1ACFE52 /* Octicons.ttf */; };
45 | 403E1FEC1B7346559B3FA70E /* MaterialIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 60274862D2AB48B78454DB34 /* MaterialIcons.ttf */; };
46 | 6349CDC11E474E808505F519 /* Entypo.ttf in Resources */ = {isa = PBXBuildFile; fileRef = C13C2068AF5541C3B55CBC93 /* Entypo.ttf */; };
47 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
48 | 93B638B69D834147A91BDD93 /* FontAwesome.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 9BC522021841448D960E6EF9 /* FontAwesome.ttf */; };
49 | C33D3C9B571C453680088BAB /* Zocial.ttf in Resources */ = {isa = PBXBuildFile; fileRef = E75D9B3500A4492AB91BCBB8 /* Zocial.ttf */; };
50 | CD49F309841C4B9ABEDFDD6C /* Foundation.ttf in Resources */ = {isa = PBXBuildFile; fileRef = B93CA16C3FC2463F87E97159 /* Foundation.ttf */; };
51 | D9B018E21F514FAAB310A9DB /* Ionicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 203B47B8936945FAA543CC74 /* Ionicons.ttf */; };
52 | /* End PBXBuildFile section */
53 |
54 | /* Begin PBXContainerItemProxy section */
55 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = {
56 | isa = PBXContainerItemProxy;
57 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */;
58 | proxyType = 2;
59 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
60 | remoteInfo = RCTActionSheet;
61 | };
62 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = {
63 | isa = PBXContainerItemProxy;
64 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */;
65 | proxyType = 2;
66 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
67 | remoteInfo = RCTGeolocation;
68 | };
69 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = {
70 | isa = PBXContainerItemProxy;
71 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;
72 | proxyType = 2;
73 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676;
74 | remoteInfo = RCTImage;
75 | };
76 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = {
77 | isa = PBXContainerItemProxy;
78 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;
79 | proxyType = 2;
80 | remoteGlobalIDString = 58B511DB1A9E6C8500147676;
81 | remoteInfo = RCTNetwork;
82 | };
83 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = {
84 | isa = PBXContainerItemProxy;
85 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */;
86 | proxyType = 2;
87 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7;
88 | remoteInfo = RCTVibration;
89 | };
90 | 0C2B97991D092CB7007E68B1 /* PBXContainerItemProxy */ = {
91 | isa = PBXContainerItemProxy;
92 | containerPortal = 46BFE0274CFB46E0A8644627 /* RNVectorIcons.xcodeproj */;
93 | proxyType = 2;
94 | remoteGlobalIDString = 5DBEB1501B18CEA900B34395;
95 | remoteInfo = RNVectorIcons;
96 | };
97 | 0C2B979F1D094B47007E68B1 /* PBXContainerItemProxy */ = {
98 | isa = PBXContainerItemProxy;
99 | containerPortal = 0C2B979B1D094B47007E68B1 /* ART.xcodeproj */;
100 | proxyType = 2;
101 | remoteGlobalIDString = 0CF68AC11AF0540F00FF9E5C;
102 | remoteInfo = ART;
103 | };
104 | 0C965E061D0D7EA80057679D /* PBXContainerItemProxy */ = {
105 | isa = PBXContainerItemProxy;
106 | containerPortal = 0C965E021D0D7EA70057679D /* RNFS.xcodeproj */;
107 | proxyType = 2;
108 | remoteGlobalIDString = F12AFB9B1ADAF8F800E0535D;
109 | remoteInfo = RNFS;
110 | };
111 | 0CD99FF11D37749A00A56D7A /* PBXContainerItemProxy */ = {
112 | isa = PBXContainerItemProxy;
113 | containerPortal = 0CD99FED1D37749A00A56D7A /* PxPlayer.xcodeproj */;
114 | proxyType = 2;
115 | remoteGlobalIDString = 0C3752B81D2BA73D005D73FE;
116 | remoteInfo = PxPlayer;
117 | };
118 | 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = {
119 | isa = PBXContainerItemProxy;
120 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;
121 | proxyType = 2;
122 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
123 | remoteInfo = RCTSettings;
124 | };
125 | 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = {
126 | isa = PBXContainerItemProxy;
127 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
128 | proxyType = 2;
129 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A;
130 | remoteInfo = RCTWebSocket;
131 | };
132 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = {
133 | isa = PBXContainerItemProxy;
134 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
135 | proxyType = 2;
136 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192;
137 | remoteInfo = React;
138 | };
139 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = {
140 | isa = PBXContainerItemProxy;
141 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;
142 | proxyType = 2;
143 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
144 | remoteInfo = RCTLinking;
145 | };
146 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = {
147 | isa = PBXContainerItemProxy;
148 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;
149 | proxyType = 2;
150 | remoteGlobalIDString = 58B5119B1A9E6C1200147676;
151 | remoteInfo = RCTText;
152 | };
153 | /* End PBXContainerItemProxy section */
154 |
155 | /* Begin PBXFileReference section */
156 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; };
157 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; };
158 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; };
159 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; };
160 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; };
161 | 0C2B977C1D07FDC1007E68B1 /* VideoToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = VideoToolbox.framework; path = System/Library/Frameworks/VideoToolbox.framework; sourceTree = SDKROOT; };
162 | 0C2B977E1D07FDD7007E68B1 /* libiconv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.tbd; path = usr/lib/libiconv.tbd; sourceTree = SDKROOT; };
163 | 0C2B979B1D094B47007E68B1 /* ART.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ART.xcodeproj; path = "../node_modules/react-native/Libraries/ART/ART.xcodeproj"; sourceTree = ""; };
164 | 0C37530D1D2BAC81005D73FE /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
165 | 0C37530E1D2BAC81005D73FE /* Base.lproj */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Base.lproj; sourceTree = ""; };
166 | 0C37530F1D2BAC81005D73FE /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
167 | 0C3753101D2BAC81005D73FE /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
168 | 0C3753111D2BAC81005D73FE /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
169 | 0C3753121D2BAC81005D73FE /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
170 | 0C37533B1D2BB3CC005D73FE /* libavcodec.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libavcodec.a; path = ../frameworks/ffmpeg.pkg/lib/iphoneos/universal/libavcodec.a; sourceTree = ""; };
171 | 0C37533C1D2BB3CC005D73FE /* libavdevice.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libavdevice.a; path = ../frameworks/ffmpeg.pkg/lib/iphoneos/universal/libavdevice.a; sourceTree = ""; };
172 | 0C37533D1D2BB3CC005D73FE /* libavfilter.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libavfilter.a; path = ../frameworks/ffmpeg.pkg/lib/iphoneos/universal/libavfilter.a; sourceTree = ""; };
173 | 0C37533E1D2BB3CC005D73FE /* libavformat.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libavformat.a; path = ../frameworks/ffmpeg.pkg/lib/iphoneos/universal/libavformat.a; sourceTree = ""; };
174 | 0C37533F1D2BB3CC005D73FE /* libavutil.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libavutil.a; path = ../frameworks/ffmpeg.pkg/lib/iphoneos/universal/libavutil.a; sourceTree = ""; };
175 | 0C3753401D2BB3CC005D73FE /* libpostproc.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpostproc.a; path = ../frameworks/ffmpeg.pkg/lib/iphoneos/universal/libpostproc.a; sourceTree = ""; };
176 | 0C3753411D2BB3CC005D73FE /* libswresample.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libswresample.a; path = ../frameworks/ffmpeg.pkg/lib/iphoneos/universal/libswresample.a; sourceTree = ""; };
177 | 0C3753421D2BB3CC005D73FE /* libswscale.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libswscale.a; path = ../frameworks/ffmpeg.pkg/lib/iphoneos/universal/libswscale.a; sourceTree = ""; };
178 | 0C37534B1D2BB3F6005D73FE /* libplayerxx.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libplayerxx.a; path = ../frameworks/playerxx.pkg/lib/release/iphoneos/universal/libplayerxx.a; sourceTree = ""; };
179 | 0C37534D1D2BB416005D73FE /* libtbox.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libtbox.a; path = ../frameworks/tbox.pkg/lib/release/iphoneos/universal/libtbox.a; sourceTree = ""; };
180 | 0C37534F1D2BB428005D73FE /* libx264.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libx264.a; path = ../frameworks/x264.pkg/lib/iphoneos/universal/libx264.a; sourceTree = ""; };
181 | 0C3753511D2BB45B005D73FE /* libbz2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libbz2.tbd; path = usr/lib/libbz2.tbd; sourceTree = SDKROOT; };
182 | 0C3753531D2BB464005D73FE /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
183 | 0C965E021D0D7EA70057679D /* RNFS.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNFS.xcodeproj; path = "../node_modules/react-native-fs/RNFS.xcodeproj"; sourceTree = ""; };
184 | 0CD99FED1D37749A00A56D7A /* PxPlayer.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PxPlayer.xcodeproj; path = "../node_modules/react-native-pxplayer/ios/PxPlayer/PxPlayer.xcodeproj"; sourceTree = ""; };
185 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; };
186 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; };
187 | 13B07F961A680F5B00A75B9A /* rtspplayer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = rtspplayer.app; sourceTree = BUILT_PRODUCTS_DIR; };
188 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; };
189 | 203B47B8936945FAA543CC74 /* Ionicons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Ionicons.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Ionicons.ttf"; sourceTree = ""; };
190 | 46BFE0274CFB46E0A8644627 /* 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 = ""; };
191 | 60274862D2AB48B78454DB34 /* MaterialIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = MaterialIcons.ttf; path = "../node_modules/react-native-vector-icons/Fonts/MaterialIcons.ttf"; sourceTree = ""; };
192 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; };
193 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; };
194 | 9BC522021841448D960E6EF9 /* FontAwesome.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = FontAwesome.ttf; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf"; sourceTree = ""; };
195 | B93CA16C3FC2463F87E97159 /* Foundation.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Foundation.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Foundation.ttf"; sourceTree = ""; };
196 | C13C2068AF5541C3B55CBC93 /* Entypo.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Entypo.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Entypo.ttf"; sourceTree = ""; };
197 | CCACA4B135994666A1ACFE52 /* Octicons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Octicons.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Octicons.ttf"; sourceTree = ""; };
198 | CF5347D5C0664C4F8AF1453E /* libRNVectorIcons.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNVectorIcons.a; sourceTree = ""; };
199 | E75D9B3500A4492AB91BCBB8 /* Zocial.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Zocial.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Zocial.ttf"; sourceTree = ""; };
200 | EF8F7648D1924463990B8A91 /* EvilIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = EvilIcons.ttf; path = "../node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf"; sourceTree = ""; };
201 | /* End PBXFileReference section */
202 |
203 | /* Begin PBXFrameworksBuildPhase section */
204 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
205 | isa = PBXFrameworksBuildPhase;
206 | buildActionMask = 2147483647;
207 | files = (
208 | 0C3753541D2BB464005D73FE /* libz.tbd in Frameworks */,
209 | 0C3753521D2BB45B005D73FE /* libbz2.tbd in Frameworks */,
210 | 0C2B977F1D07FDD7007E68B1 /* libiconv.tbd in Frameworks */,
211 | 0C2B977D1D07FDC1007E68B1 /* VideoToolbox.framework in Frameworks */,
212 | 146834051AC3E58100842450 /* libReact.a in Frameworks */,
213 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */,
214 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */,
215 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */,
216 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */,
217 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */,
218 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */,
219 | 0C2B97A11D094B54007E68B1 /* libART.a in Frameworks */,
220 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,
221 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,
222 | 0C3753431D2BB3CC005D73FE /* libavcodec.a in Frameworks */,
223 | 0C3753441D2BB3CC005D73FE /* libavdevice.a in Frameworks */,
224 | 0C3753501D2BB428005D73FE /* libx264.a in Frameworks */,
225 | 0C3753451D2BB3CC005D73FE /* libavfilter.a in Frameworks */,
226 | 0C3753461D2BB3CC005D73FE /* libavformat.a in Frameworks */,
227 | 0C37534E1D2BB416005D73FE /* libtbox.a in Frameworks */,
228 | 0C3753471D2BB3CC005D73FE /* libavutil.a in Frameworks */,
229 | 0C3753481D2BB3CD005D73FE /* libpostproc.a in Frameworks */,
230 | 0C37534C1D2BB3F6005D73FE /* libplayerxx.a in Frameworks */,
231 | 0C3753491D2BB3CD005D73FE /* libswresample.a in Frameworks */,
232 | 0C37534A1D2BB3CD005D73FE /* libswscale.a in Frameworks */,
233 | 0CD99FF31D3774A600A56D7A /* libPxPlayer.a in Frameworks */,
234 | 0C965E081D0D7EB90057679D /* libRNFS.a in Frameworks */,
235 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,
236 | 1C866C7487394FCAB425504B /* libRNVectorIcons.a in Frameworks */,
237 | );
238 | runOnlyForDeploymentPostprocessing = 0;
239 | };
240 | /* End PBXFrameworksBuildPhase section */
241 |
242 | /* Begin PBXGroup section */
243 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = {
244 | isa = PBXGroup;
245 | children = (
246 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */,
247 | );
248 | name = Products;
249 | sourceTree = "";
250 | };
251 | 00C302B61ABCB90400DB3ED1 /* Products */ = {
252 | isa = PBXGroup;
253 | children = (
254 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */,
255 | );
256 | name = Products;
257 | sourceTree = "";
258 | };
259 | 00C302BC1ABCB91800DB3ED1 /* Products */ = {
260 | isa = PBXGroup;
261 | children = (
262 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */,
263 | );
264 | name = Products;
265 | sourceTree = "";
266 | };
267 | 00C302D41ABCB9D200DB3ED1 /* Products */ = {
268 | isa = PBXGroup;
269 | children = (
270 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */,
271 | );
272 | name = Products;
273 | sourceTree = "";
274 | };
275 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = {
276 | isa = PBXGroup;
277 | children = (
278 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */,
279 | );
280 | name = Products;
281 | sourceTree = "";
282 | };
283 | 0C2B978B1D092CB7007E68B1 /* Products */ = {
284 | isa = PBXGroup;
285 | children = (
286 | 0C2B979A1D092CB7007E68B1 /* libRNVectorIcons.a */,
287 | );
288 | name = Products;
289 | sourceTree = "";
290 | };
291 | 0C2B979C1D094B47007E68B1 /* Products */ = {
292 | isa = PBXGroup;
293 | children = (
294 | 0C2B97A01D094B47007E68B1 /* libART.a */,
295 | );
296 | name = Products;
297 | sourceTree = "";
298 | };
299 | 0C965E031D0D7EA70057679D /* Products */ = {
300 | isa = PBXGroup;
301 | children = (
302 | 0C965E071D0D7EA80057679D /* libRNFS.a */,
303 | );
304 | name = Products;
305 | sourceTree = "";
306 | };
307 | 0CD99FEE1D37749A00A56D7A /* Products */ = {
308 | isa = PBXGroup;
309 | children = (
310 | 0CD99FF21D37749A00A56D7A /* libPxPlayer.a */,
311 | );
312 | name = Products;
313 | sourceTree = "";
314 | };
315 | 139105B71AF99BAD00B5F7CC /* Products */ = {
316 | isa = PBXGroup;
317 | children = (
318 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */,
319 | );
320 | name = Products;
321 | sourceTree = "";
322 | };
323 | 139FDEE71B06529A00C62182 /* Products */ = {
324 | isa = PBXGroup;
325 | children = (
326 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */,
327 | );
328 | name = Products;
329 | sourceTree = "";
330 | };
331 | 13B07FAE1A68108700A75B9A /* rtspplayer */ = {
332 | isa = PBXGroup;
333 | children = (
334 | 0C37530D1D2BAC81005D73FE /* Info.plist */,
335 | 0C37530E1D2BAC81005D73FE /* Base.lproj */,
336 | 0C37530F1D2BAC81005D73FE /* AppDelegate.h */,
337 | 0C3753101D2BAC81005D73FE /* AppDelegate.m */,
338 | 0C3753111D2BAC81005D73FE /* Images.xcassets */,
339 | 0C3753121D2BAC81005D73FE /* main.m */,
340 | );
341 | path = rtspplayer;
342 | sourceTree = "";
343 | };
344 | 146834001AC3E56700842450 /* Products */ = {
345 | isa = PBXGroup;
346 | children = (
347 | 146834041AC3E56700842450 /* libReact.a */,
348 | );
349 | name = Products;
350 | sourceTree = "";
351 | };
352 | 78C398B11ACF4ADC00677621 /* Products */ = {
353 | isa = PBXGroup;
354 | children = (
355 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */,
356 | );
357 | name = Products;
358 | sourceTree = "";
359 | };
360 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = {
361 | isa = PBXGroup;
362 | children = (
363 | 0CD99FED1D37749A00A56D7A /* PxPlayer.xcodeproj */,
364 | 0C965E021D0D7EA70057679D /* RNFS.xcodeproj */,
365 | 0C2B979B1D094B47007E68B1 /* ART.xcodeproj */,
366 | 146833FF1AC3E56700842450 /* React.xcodeproj */,
367 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */,
368 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */,
369 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */,
370 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */,
371 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */,
372 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */,
373 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,
374 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
375 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
376 | 46BFE0274CFB46E0A8644627 /* RNVectorIcons.xcodeproj */,
377 | );
378 | name = Libraries;
379 | sourceTree = "";
380 | };
381 | 832341B11AAA6A8300B99B32 /* Products */ = {
382 | isa = PBXGroup;
383 | children = (
384 | 832341B51AAA6A8300B99B32 /* libRCTText.a */,
385 | );
386 | name = Products;
387 | sourceTree = "";
388 | };
389 | 83CBB9F61A601CBA00E9B192 = {
390 | isa = PBXGroup;
391 | children = (
392 | 0C3753531D2BB464005D73FE /* libz.tbd */,
393 | 0C3753511D2BB45B005D73FE /* libbz2.tbd */,
394 | 0C37534F1D2BB428005D73FE /* libx264.a */,
395 | 0C37534D1D2BB416005D73FE /* libtbox.a */,
396 | 0C37534B1D2BB3F6005D73FE /* libplayerxx.a */,
397 | 0C37533B1D2BB3CC005D73FE /* libavcodec.a */,
398 | 0C37533C1D2BB3CC005D73FE /* libavdevice.a */,
399 | 0C37533D1D2BB3CC005D73FE /* libavfilter.a */,
400 | 0C37533E1D2BB3CC005D73FE /* libavformat.a */,
401 | 0C37533F1D2BB3CC005D73FE /* libavutil.a */,
402 | 0C3753401D2BB3CC005D73FE /* libpostproc.a */,
403 | 0C3753411D2BB3CC005D73FE /* libswresample.a */,
404 | 0C3753421D2BB3CC005D73FE /* libswscale.a */,
405 | 0C2B977E1D07FDD7007E68B1 /* libiconv.tbd */,
406 | 0C2B977C1D07FDC1007E68B1 /* VideoToolbox.framework */,
407 | 13B07FAE1A68108700A75B9A /* rtspplayer */,
408 | 832341AE1AAA6A7D00B99B32 /* Libraries */,
409 | 83CBBA001A601CBA00E9B192 /* Products */,
410 | EA93E47994C74D7EAA4B9B4E /* Resources */,
411 | );
412 | indentWidth = 2;
413 | sourceTree = "";
414 | tabWidth = 2;
415 | };
416 | 83CBBA001A601CBA00E9B192 /* Products */ = {
417 | isa = PBXGroup;
418 | children = (
419 | 13B07F961A680F5B00A75B9A /* rtspplayer.app */,
420 | );
421 | name = Products;
422 | sourceTree = "";
423 | };
424 | EA93E47994C74D7EAA4B9B4E /* Resources */ = {
425 | isa = PBXGroup;
426 | children = (
427 | C13C2068AF5541C3B55CBC93 /* Entypo.ttf */,
428 | EF8F7648D1924463990B8A91 /* EvilIcons.ttf */,
429 | 9BC522021841448D960E6EF9 /* FontAwesome.ttf */,
430 | B93CA16C3FC2463F87E97159 /* Foundation.ttf */,
431 | 203B47B8936945FAA543CC74 /* Ionicons.ttf */,
432 | 60274862D2AB48B78454DB34 /* MaterialIcons.ttf */,
433 | CCACA4B135994666A1ACFE52 /* Octicons.ttf */,
434 | E75D9B3500A4492AB91BCBB8 /* Zocial.ttf */,
435 | );
436 | name = Resources;
437 | sourceTree = "";
438 | };
439 | /* End PBXGroup section */
440 |
441 | /* Begin PBXNativeTarget section */
442 | 13B07F861A680F5B00A75B9A /* rtspplayer */ = {
443 | isa = PBXNativeTarget;
444 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "rtspplayer" */;
445 | buildPhases = (
446 | 13B07F871A680F5B00A75B9A /* Sources */,
447 | 13B07F8C1A680F5B00A75B9A /* Frameworks */,
448 | 13B07F8E1A680F5B00A75B9A /* Resources */,
449 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
450 | );
451 | buildRules = (
452 | );
453 | dependencies = (
454 | );
455 | name = rtspplayer;
456 | productName = "Hello World";
457 | productReference = 13B07F961A680F5B00A75B9A /* rtspplayer.app */;
458 | productType = "com.apple.product-type.application";
459 | };
460 | /* End PBXNativeTarget section */
461 |
462 | /* Begin PBXProject section */
463 | 83CBB9F71A601CBA00E9B192 /* Project object */ = {
464 | isa = PBXProject;
465 | attributes = {
466 | LastUpgradeCheck = 610;
467 | ORGANIZATIONNAME = Facebook;
468 | };
469 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "rtspplayer" */;
470 | compatibilityVersion = "Xcode 3.2";
471 | developmentRegion = English;
472 | hasScannedForEncodings = 0;
473 | knownRegions = (
474 | en,
475 | Base,
476 | );
477 | mainGroup = 83CBB9F61A601CBA00E9B192;
478 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
479 | projectDirPath = "";
480 | projectReferences = (
481 | {
482 | ProductGroup = 0C2B979C1D094B47007E68B1 /* Products */;
483 | ProjectRef = 0C2B979B1D094B47007E68B1 /* ART.xcodeproj */;
484 | },
485 | {
486 | ProductGroup = 0CD99FEE1D37749A00A56D7A /* Products */;
487 | ProjectRef = 0CD99FED1D37749A00A56D7A /* PxPlayer.xcodeproj */;
488 | },
489 | {
490 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */;
491 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */;
492 | },
493 | {
494 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */;
495 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */;
496 | },
497 | {
498 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */;
499 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;
500 | },
501 | {
502 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */;
503 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;
504 | },
505 | {
506 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */;
507 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;
508 | },
509 | {
510 | ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */;
511 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;
512 | },
513 | {
514 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */;
515 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;
516 | },
517 | {
518 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */;
519 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */;
520 | },
521 | {
522 | ProductGroup = 139FDEE71B06529A00C62182 /* Products */;
523 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
524 | },
525 | {
526 | ProductGroup = 146834001AC3E56700842450 /* Products */;
527 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */;
528 | },
529 | {
530 | ProductGroup = 0C965E031D0D7EA70057679D /* Products */;
531 | ProjectRef = 0C965E021D0D7EA70057679D /* RNFS.xcodeproj */;
532 | },
533 | {
534 | ProductGroup = 0C2B978B1D092CB7007E68B1 /* Products */;
535 | ProjectRef = 46BFE0274CFB46E0A8644627 /* RNVectorIcons.xcodeproj */;
536 | },
537 | );
538 | projectRoot = "";
539 | targets = (
540 | 13B07F861A680F5B00A75B9A /* rtspplayer */,
541 | );
542 | };
543 | /* End PBXProject section */
544 |
545 | /* Begin PBXReferenceProxy section */
546 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = {
547 | isa = PBXReferenceProxy;
548 | fileType = archive.ar;
549 | path = libRCTActionSheet.a;
550 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */;
551 | sourceTree = BUILT_PRODUCTS_DIR;
552 | };
553 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = {
554 | isa = PBXReferenceProxy;
555 | fileType = archive.ar;
556 | path = libRCTGeolocation.a;
557 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */;
558 | sourceTree = BUILT_PRODUCTS_DIR;
559 | };
560 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = {
561 | isa = PBXReferenceProxy;
562 | fileType = archive.ar;
563 | path = libRCTImage.a;
564 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */;
565 | sourceTree = BUILT_PRODUCTS_DIR;
566 | };
567 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = {
568 | isa = PBXReferenceProxy;
569 | fileType = archive.ar;
570 | path = libRCTNetwork.a;
571 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */;
572 | sourceTree = BUILT_PRODUCTS_DIR;
573 | };
574 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = {
575 | isa = PBXReferenceProxy;
576 | fileType = archive.ar;
577 | path = libRCTVibration.a;
578 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */;
579 | sourceTree = BUILT_PRODUCTS_DIR;
580 | };
581 | 0C2B979A1D092CB7007E68B1 /* libRNVectorIcons.a */ = {
582 | isa = PBXReferenceProxy;
583 | fileType = archive.ar;
584 | path = libRNVectorIcons.a;
585 | remoteRef = 0C2B97991D092CB7007E68B1 /* PBXContainerItemProxy */;
586 | sourceTree = BUILT_PRODUCTS_DIR;
587 | };
588 | 0C2B97A01D094B47007E68B1 /* libART.a */ = {
589 | isa = PBXReferenceProxy;
590 | fileType = archive.ar;
591 | path = libART.a;
592 | remoteRef = 0C2B979F1D094B47007E68B1 /* PBXContainerItemProxy */;
593 | sourceTree = BUILT_PRODUCTS_DIR;
594 | };
595 | 0C965E071D0D7EA80057679D /* libRNFS.a */ = {
596 | isa = PBXReferenceProxy;
597 | fileType = archive.ar;
598 | path = libRNFS.a;
599 | remoteRef = 0C965E061D0D7EA80057679D /* PBXContainerItemProxy */;
600 | sourceTree = BUILT_PRODUCTS_DIR;
601 | };
602 | 0CD99FF21D37749A00A56D7A /* libPxPlayer.a */ = {
603 | isa = PBXReferenceProxy;
604 | fileType = archive.ar;
605 | path = libPxPlayer.a;
606 | remoteRef = 0CD99FF11D37749A00A56D7A /* PBXContainerItemProxy */;
607 | sourceTree = BUILT_PRODUCTS_DIR;
608 | };
609 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = {
610 | isa = PBXReferenceProxy;
611 | fileType = archive.ar;
612 | path = libRCTSettings.a;
613 | remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */;
614 | sourceTree = BUILT_PRODUCTS_DIR;
615 | };
616 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = {
617 | isa = PBXReferenceProxy;
618 | fileType = archive.ar;
619 | path = libRCTWebSocket.a;
620 | remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */;
621 | sourceTree = BUILT_PRODUCTS_DIR;
622 | };
623 | 146834041AC3E56700842450 /* libReact.a */ = {
624 | isa = PBXReferenceProxy;
625 | fileType = archive.ar;
626 | path = libReact.a;
627 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */;
628 | sourceTree = BUILT_PRODUCTS_DIR;
629 | };
630 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = {
631 | isa = PBXReferenceProxy;
632 | fileType = archive.ar;
633 | path = libRCTLinking.a;
634 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */;
635 | sourceTree = BUILT_PRODUCTS_DIR;
636 | };
637 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = {
638 | isa = PBXReferenceProxy;
639 | fileType = archive.ar;
640 | path = libRCTText.a;
641 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */;
642 | sourceTree = BUILT_PRODUCTS_DIR;
643 | };
644 | /* End PBXReferenceProxy section */
645 |
646 | /* Begin PBXResourcesBuildPhase section */
647 | 13B07F8E1A680F5B00A75B9A /* Resources */ = {
648 | isa = PBXResourcesBuildPhase;
649 | buildActionMask = 2147483647;
650 | files = (
651 | 6349CDC11E474E808505F519 /* Entypo.ttf in Resources */,
652 | 14C1C18DB65145AF8362826C /* EvilIcons.ttf in Resources */,
653 | 93B638B69D834147A91BDD93 /* FontAwesome.ttf in Resources */,
654 | CD49F309841C4B9ABEDFDD6C /* Foundation.ttf in Resources */,
655 | D9B018E21F514FAAB310A9DB /* Ionicons.ttf in Resources */,
656 | 0C3753131D2BAC81005D73FE /* Info.plist in Resources */,
657 | 0C3753161D2BAC81005D73FE /* Images.xcassets in Resources */,
658 | 403E1FEC1B7346559B3FA70E /* MaterialIcons.ttf in Resources */,
659 | 0C3753141D2BAC81005D73FE /* Base.lproj in Resources */,
660 | 29C92F7DACFB48B4AADE1220 /* Octicons.ttf in Resources */,
661 | C33D3C9B571C453680088BAB /* Zocial.ttf in Resources */,
662 | );
663 | runOnlyForDeploymentPostprocessing = 0;
664 | };
665 | /* End PBXResourcesBuildPhase section */
666 |
667 | /* Begin PBXShellScriptBuildPhase section */
668 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
669 | isa = PBXShellScriptBuildPhase;
670 | buildActionMask = 2147483647;
671 | files = (
672 | );
673 | inputPaths = (
674 | );
675 | name = "Bundle React Native code and images";
676 | outputPaths = (
677 | );
678 | runOnlyForDeploymentPostprocessing = 0;
679 | shellPath = /bin/sh;
680 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh";
681 | };
682 | /* End PBXShellScriptBuildPhase section */
683 |
684 | /* Begin PBXSourcesBuildPhase section */
685 | 13B07F871A680F5B00A75B9A /* Sources */ = {
686 | isa = PBXSourcesBuildPhase;
687 | buildActionMask = 2147483647;
688 | files = (
689 | 0C3753171D2BAC81005D73FE /* main.m in Sources */,
690 | 0C3753151D2BAC81005D73FE /* AppDelegate.m in Sources */,
691 | );
692 | runOnlyForDeploymentPostprocessing = 0;
693 | };
694 | /* End PBXSourcesBuildPhase section */
695 |
696 | /* Begin XCBuildConfiguration section */
697 | 13B07F941A680F5B00A75B9A /* Debug */ = {
698 | isa = XCBuildConfiguration;
699 | buildSettings = {
700 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
701 | DEAD_CODE_STRIPPING = NO;
702 | ENABLE_BITCODE = NO;
703 | FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/../frameworks/**";
704 | HEADER_SEARCH_PATHS = (
705 | "$(inherited)",
706 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
707 | "$(SRCROOT)/../node_modules/react-native/React/**",
708 | "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
709 | );
710 | INFOPLIST_FILE = rtspplayer/Info.plist;
711 | IPHONEOS_DEPLOYMENT_TARGET = 9.3;
712 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
713 | LIBRARY_SEARCH_PATHS = (
714 | "$(SRCROOT)/../frameworks/ffmpeg.pkg/lib/iphoneos/universal",
715 | "$(SRCROOT)/../frameworks/playerxx.pkg/lib/release/iphoneos/universal",
716 | "$(SRCROOT)/../frameworks/tbox.pkg/lib/release/iphoneos/universal",
717 | "$(SRCROOT)/../frameworks/x264.pkg/lib/iphoneos/universal",
718 | );
719 | ONLY_ACTIVE_ARCH = YES;
720 | OTHER_LDFLAGS = (
721 | "-ObjC",
722 | "-lc++",
723 | );
724 | PRODUCT_BUNDLE_IDENTIFIER = org.xiongchuan.examples.rtspplayer;
725 | PRODUCT_NAME = rtspplayer;
726 | VALID_ARCHS = "arm64 armv7 armv7s x86_64";
727 | };
728 | name = Debug;
729 | };
730 | 13B07F951A680F5B00A75B9A /* Release */ = {
731 | isa = XCBuildConfiguration;
732 | buildSettings = {
733 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
734 | ENABLE_BITCODE = NO;
735 | FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/../frameworks/**";
736 | HEADER_SEARCH_PATHS = (
737 | "$(inherited)",
738 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
739 | "$(SRCROOT)/../node_modules/react-native/React/**",
740 | "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
741 | );
742 | INFOPLIST_FILE = rtspplayer/Info.plist;
743 | IPHONEOS_DEPLOYMENT_TARGET = 9.3;
744 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
745 | LIBRARY_SEARCH_PATHS = (
746 | "$(SRCROOT)/../frameworks/ffmpeg.pkg/lib/iphoneos/universal",
747 | "$(SRCROOT)/../frameworks/playerxx.pkg/lib/release/iphoneos/universal",
748 | "$(SRCROOT)/../frameworks/tbox.pkg/lib/release/iphoneos/universal",
749 | "$(SRCROOT)/../frameworks/x264.pkg/lib/iphoneos/universal",
750 | );
751 | ONLY_ACTIVE_ARCH = YES;
752 | OTHER_LDFLAGS = (
753 | "-ObjC",
754 | "-lc++",
755 | );
756 | PRODUCT_BUNDLE_IDENTIFIER = org.xiongchuan.examples.rtspplayer;
757 | PRODUCT_NAME = rtspplayer;
758 | VALID_ARCHS = "arm64 armv7 armv7s x86_64";
759 | };
760 | name = Release;
761 | };
762 | 83CBBA201A601CBA00E9B192 /* Debug */ = {
763 | isa = XCBuildConfiguration;
764 | buildSettings = {
765 | ALWAYS_SEARCH_USER_PATHS = NO;
766 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
767 | CLANG_CXX_LIBRARY = "libc++";
768 | CLANG_ENABLE_MODULES = YES;
769 | CLANG_ENABLE_OBJC_ARC = YES;
770 | CLANG_WARN_BOOL_CONVERSION = YES;
771 | CLANG_WARN_CONSTANT_CONVERSION = YES;
772 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
773 | CLANG_WARN_EMPTY_BODY = YES;
774 | CLANG_WARN_ENUM_CONVERSION = YES;
775 | CLANG_WARN_INT_CONVERSION = YES;
776 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
777 | CLANG_WARN_UNREACHABLE_CODE = YES;
778 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
779 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
780 | COPY_PHASE_STRIP = NO;
781 | ENABLE_STRICT_OBJC_MSGSEND = YES;
782 | GCC_C_LANGUAGE_STANDARD = gnu99;
783 | GCC_DYNAMIC_NO_PIC = NO;
784 | GCC_OPTIMIZATION_LEVEL = 0;
785 | GCC_PREPROCESSOR_DEFINITIONS = (
786 | "DEBUG=1",
787 | "$(inherited)",
788 | );
789 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
790 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
791 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
792 | GCC_WARN_UNDECLARED_SELECTOR = YES;
793 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
794 | GCC_WARN_UNUSED_FUNCTION = YES;
795 | GCC_WARN_UNUSED_VARIABLE = YES;
796 | HEADER_SEARCH_PATHS = (
797 | "$(inherited)",
798 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
799 | "$(SRCROOT)/../node_modules/react-native/React/**",
800 | "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
801 | );
802 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
803 | MTL_ENABLE_DEBUG_INFO = YES;
804 | ONLY_ACTIVE_ARCH = YES;
805 | SDKROOT = iphoneos;
806 | };
807 | name = Debug;
808 | };
809 | 83CBBA211A601CBA00E9B192 /* Release */ = {
810 | isa = XCBuildConfiguration;
811 | buildSettings = {
812 | ALWAYS_SEARCH_USER_PATHS = NO;
813 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
814 | CLANG_CXX_LIBRARY = "libc++";
815 | CLANG_ENABLE_MODULES = YES;
816 | CLANG_ENABLE_OBJC_ARC = YES;
817 | CLANG_WARN_BOOL_CONVERSION = YES;
818 | CLANG_WARN_CONSTANT_CONVERSION = YES;
819 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
820 | CLANG_WARN_EMPTY_BODY = YES;
821 | CLANG_WARN_ENUM_CONVERSION = YES;
822 | CLANG_WARN_INT_CONVERSION = YES;
823 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
824 | CLANG_WARN_UNREACHABLE_CODE = YES;
825 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
826 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
827 | COPY_PHASE_STRIP = YES;
828 | ENABLE_NS_ASSERTIONS = NO;
829 | ENABLE_STRICT_OBJC_MSGSEND = YES;
830 | GCC_C_LANGUAGE_STANDARD = gnu99;
831 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
832 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
833 | GCC_WARN_UNDECLARED_SELECTOR = YES;
834 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
835 | GCC_WARN_UNUSED_FUNCTION = YES;
836 | GCC_WARN_UNUSED_VARIABLE = YES;
837 | HEADER_SEARCH_PATHS = (
838 | "$(inherited)",
839 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
840 | "$(SRCROOT)/../node_modules/react-native/React/**",
841 | "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager",
842 | );
843 | IPHONEOS_DEPLOYMENT_TARGET = 7.0;
844 | MTL_ENABLE_DEBUG_INFO = NO;
845 | ONLY_ACTIVE_ARCH = YES;
846 | SDKROOT = iphoneos;
847 | VALIDATE_PRODUCT = YES;
848 | };
849 | name = Release;
850 | };
851 | /* End XCBuildConfiguration section */
852 |
853 | /* Begin XCConfigurationList section */
854 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "rtspplayer" */ = {
855 | isa = XCConfigurationList;
856 | buildConfigurations = (
857 | 13B07F941A680F5B00A75B9A /* Debug */,
858 | 13B07F951A680F5B00A75B9A /* Release */,
859 | );
860 | defaultConfigurationIsVisible = 0;
861 | defaultConfigurationName = Release;
862 | };
863 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "rtspplayer" */ = {
864 | isa = XCConfigurationList;
865 | buildConfigurations = (
866 | 83CBBA201A601CBA00E9B192 /* Debug */,
867 | 83CBBA211A601CBA00E9B192 /* Release */,
868 | );
869 | defaultConfigurationIsVisible = 0;
870 | defaultConfigurationName = Release;
871 | };
872 | /* End XCConfigurationList section */
873 | };
874 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
875 | }
876 |
--------------------------------------------------------------------------------
/Examples/rtspplayer/ios/rtspplayer.xcodeproj/xcshareddata/xcschemes/rtspplayer.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
47 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
65 |
66 |
67 |
68 |
78 |
80 |
86 |
87 |
88 |
89 |
90 |
91 |
97 |
99 |
105 |
106 |
107 |
108 |
110 |
111 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/Examples/rtspplayer/ios/rtspplayer/AppDelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @interface AppDelegate : UIResponder
13 |
14 | @property (nonatomic, strong) UIWindow *window;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/Examples/rtspplayer/ios/rtspplayer/AppDelegate.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "AppDelegate.h"
11 |
12 | #import "RCTRootView.h"
13 |
14 | @implementation AppDelegate
15 |
16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
17 | {
18 | NSURL *jsCodeLocation;
19 |
20 | /**
21 | * Loading JavaScript code - uncomment the one you want.
22 | *
23 | * OPTION 1
24 | * Load from development server. Start the server from the repository root:
25 | *
26 | * $ npm start
27 | *
28 | * To run on device, change `localhost` to the IP address of your computer
29 | * (you can get this by typing `ifconfig` into the terminal and selecting the
30 | * `inet` value under `en0:`) and make sure your computer and iOS device are
31 | * on the same Wi-Fi network.
32 | */
33 |
34 | jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
35 |
36 | /**
37 | * OPTION 2
38 | * Load from pre-bundled file on disk. The static bundle is automatically
39 | * generated by the "Bundle React Native code and images" build step when
40 | * running the project on an actual device or running the project on the
41 | * simulator in the "Release" build configuration.
42 | */
43 |
44 | //jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
45 |
46 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
47 | moduleName:@"rtspplayer"
48 | initialProperties:nil
49 | launchOptions:launchOptions];
50 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
51 |
52 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
53 | UIViewController *rootViewController = [UIViewController new];
54 | rootViewController.view = rootView;
55 | self.window.rootViewController = rootViewController;
56 | [self.window makeKeyAndVisible];
57 | return YES;
58 | }
59 |
60 | @end
61 |
--------------------------------------------------------------------------------
/Examples/rtspplayer/ios/rtspplayer/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
20 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/Examples/rtspplayer/ios/rtspplayer/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/Examples/rtspplayer/ios/rtspplayer/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | NSAppTransportSecurity
26 |
27 | NSAllowsArbitraryLoads
28 |
29 |
30 | NSLocationWhenInUseUsageDescription
31 |
32 | UIAppFonts
33 |
34 | Entypo.ttf
35 | EvilIcons.ttf
36 | FontAwesome.ttf
37 | Foundation.ttf
38 | Ionicons.ttf
39 | MaterialIcons.ttf
40 | Octicons.ttf
41 | Zocial.ttf
42 |
43 | UIRequiredDeviceCapabilities
44 |
45 | armv7
46 |
47 | UISupportedInterfaceOrientations
48 |
49 | UIInterfaceOrientationPortrait
50 | UIInterfaceOrientationLandscapeLeft
51 | UIInterfaceOrientationLandscapeRight
52 |
53 | UIViewControllerBasedStatusBarAppearance
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/Examples/rtspplayer/ios/rtspplayer/main.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import "AppDelegate.h"
13 |
14 | int main(int argc, char * argv[]) {
15 | @autoreleasepool {
16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Examples/rtspplayer/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vlcplayer",
3 | "version": "0.0.1",
4 | "private": true,
5 | "scripts": {
6 | "start": "node node_modules/react-native/local-cli/cli.js start"
7 | },
8 | "dependencies": {
9 | "react": "~15.2.0",
10 | "react-native": "^0.28.0",
11 | "react-native-fs": "^1.5.1",
12 | "react-native-loader": "^1.1.0",
13 | "react-native-progress": "^3.0.0",
14 | "react-native-slider": "^0.8.0",
15 | "react-native-vector-icons": "^2.0.3",
16 | "react-native-pxplayer": "../../"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2016 Brent Vatne, Baris Sencan
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/PxPlayer.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactNative from 'react-native';
3 |
4 | const {
5 | Component,
6 | PropTypes,
7 | } = React;
8 |
9 | const {
10 | StyleSheet,
11 | requireNativeComponent,
12 | NativeModules,
13 | View,
14 | } = ReactNative;
15 |
16 | export default class RtspPlayer extends Component {
17 |
18 | constructor(props, context) {
19 | super(props, context);
20 | this.snapshot = this.snapshot.bind(this);
21 | this.fullscreen = this.fullscreen.bind(this);
22 | this._assignRoot = this._assignRoot.bind(this);
23 | this._onError = this._onError.bind(this);
24 | this._onStartPlay = this._onStartPlay.bind(this);
25 | this._onBuffering = this._onBuffering.bind(this);
26 | this._onPlaying = this._onPlaying.bind(this);
27 | this._onStopped = this._onStopped.bind(this);
28 | this._onPaused = this._onPaused.bind(this);
29 | }
30 |
31 | setNativeProps(nativeProps) {
32 | this._root.setNativeProps(nativeProps);
33 | }
34 |
35 | snapshot(path) {
36 | this.setNativeProps({ snapshotPath: path});
37 | }
38 |
39 | fullscreen(isFull) {
40 | this.setNativeProps({fullscreen:isFull});
41 | }
42 |
43 | _assignRoot(component) {
44 | this._root = component;
45 | }
46 |
47 | _onError(event) {
48 | if (this.props.onError) {
49 | this.props.onError(event.nativeEvent);
50 | }
51 | }
52 |
53 | _onStopped(event) {
54 | if (this.props.onStopped) {
55 | this.props.onStopped(event.nativeEvent);
56 | }
57 | }
58 |
59 | _onPaused(event) {
60 | if (this.props.onPaused) {
61 | this.props.onPaused(event.nativeEvent);
62 | }
63 | }
64 |
65 | _onStartPlay(event) {
66 | if (this.props.onStartPlay) {
67 | this.props.onStartPlay(event.nativeEvent);
68 | }
69 | }
70 |
71 | _onBuffering(event) {
72 | if (this.props.onBuffering) {
73 | this.props.onBuffering(event.nativeEvent);
74 | }
75 | }
76 |
77 | _onPlaying(event) {
78 | if (this.props.onPlaying) {
79 | this.props.onPlaying(event.nativeEvent);
80 | }
81 | }
82 |
83 | render() {
84 | const {
85 | source
86 | } = this.props;
87 | source.initOptions = source.initOptions || [];
88 | const nativeProps = Object.assign({}, this.props);
89 | Object.assign(nativeProps, {
90 | style: [styles.base, nativeProps.style],
91 | source: source,
92 | onVideoError: this._onError,
93 | onVideoStartPlay:this._onStartPlay,
94 | onVideoBuffering:this._onBuffering,
95 | onVideoPlaying:this._onPlaying,
96 | onVideoPaused:this._onPaused,
97 | onVideoStopped:this._onStopped,
98 | });
99 |
100 | return (
101 |
102 | );
103 | }
104 |
105 |
106 | }
107 |
108 | RtspPlayer.propTypes = {
109 | /* Native only */
110 | snapshotPath: PropTypes.string,
111 | paused: PropTypes.bool,
112 | fullscreen: PropTypes.bool,
113 |
114 |
115 | /* Wrapper component */
116 | source: PropTypes.object,
117 |
118 | onError: PropTypes.func,
119 | onStopped: PropTypes.func,
120 | onStartPlay: PropTypes.func,
121 | onPlaying: PropTypes.func,
122 | onBuffering: PropTypes.func,
123 | onPaused: PropTypes.func,
124 |
125 | /* Required by react-native */
126 | scaleX: React.PropTypes.number,
127 | scaleY: React.PropTypes.number,
128 | translateX: React.PropTypes.number,
129 | translateY: React.PropTypes.number,
130 | rotation: React.PropTypes.number,
131 | ...View.propTypes,
132 | };
133 |
134 | const styles = StyleSheet.create({
135 | base: {
136 | overflow: 'hidden',
137 | }
138 | });
139 | const PxPlayer = requireNativeComponent('PxPlayer', RtspPlayer);
140 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # react-native-rtspplayer
2 |
3 | A `` component for react-native
4 | using ffmpeg,convert yuv to rgb for uiimage
5 |
6 |
7 | 
8 |
9 | ### Add it to your project
10 |
11 | Run `npm install react-native-rtspplayer --save`
12 |
13 | #### iOS
14 |
15 | - Install [rnpm](https://github.com/rnpm/rnpm) and run `rnpm link react-native-rtspplayer`
16 |
17 |
18 | ## Usage
19 |
20 |
21 | ```
22 |
28 |
29 | ```
30 |
31 |
32 | ## Static Methods
33 |
34 |
35 | `snapshot(path)`
36 |
37 | ```
38 | this.refs['rtspplayer'].snapshot(path); //保存截图
39 | ```
40 |
41 | ## Examples
42 |
43 | - `npm install`
44 | - `rnpm link`
45 | - 同时需要安装`ART`
46 | 参考https://github.com/oblador/react-native-vector-icons
47 |
48 | 可以根据自己的情况使用下面的例子,自己DIY播放器
49 | - `` 一个简单的播放器
50 |
51 |
52 | ## TODOS
53 |
54 | - [ ] Add support for Android
55 | - [x] Add support for snapshot
56 |
57 |
58 |
59 | ## 加入ReactNative讨论组
60 |
61 | ###`QQ群:316434159` ###
62 | ![扫描加入][1]
63 |
64 | [1]:ReactNative_qq_group.png
65 |
66 | ---
67 |
68 | **MIT Licensed**
69 |
--------------------------------------------------------------------------------
/ReactNative_qq_group.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiongchuan86/react-native-pxplayer/db5924b50724c0f81b491e84e626e4fc6bca8fb7/ReactNative_qq_group.png
--------------------------------------------------------------------------------
/ios/PxPlayer/Build/Intermediates/PxPlayer.build/Debug-iphonesimulator/PxPlayer.build/Objects-normal/x86_64/PxPlayer.LinkFileList:
--------------------------------------------------------------------------------
1 | /Users/xiongchuan/git/github/react-native-pxplayer/ios/PxPlayer/Build/Intermediates/PxPlayer.build/Debug-iphonesimulator/PxPlayer.build/Objects-normal/x86_64/PxPlayerManager.o
2 | /Users/xiongchuan/git/github/react-native-pxplayer/ios/PxPlayer/Build/Intermediates/PxPlayer.build/Debug-iphonesimulator/PxPlayer.build/Objects-normal/x86_64/KNGLView.o
3 | /Users/xiongchuan/git/github/react-native-pxplayer/ios/PxPlayer/Build/Intermediates/PxPlayer.build/Debug-iphonesimulator/PxPlayer.build/Objects-normal/x86_64/PxPlayer.o
4 |
--------------------------------------------------------------------------------
/ios/PxPlayer/Build/Intermediates/PxPlayer.build/Debug-iphonesimulator/PxPlayer.build/PxPlayer-all-non-framework-target-headers.hmap:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiongchuan86/react-native-pxplayer/db5924b50724c0f81b491e84e626e4fc6bca8fb7/ios/PxPlayer/Build/Intermediates/PxPlayer.build/Debug-iphonesimulator/PxPlayer.build/PxPlayer-all-non-framework-target-headers.hmap
--------------------------------------------------------------------------------
/ios/PxPlayer/Build/Intermediates/PxPlayer.build/Debug-iphonesimulator/PxPlayer.build/PxPlayer-all-target-headers.hmap:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiongchuan86/react-native-pxplayer/db5924b50724c0f81b491e84e626e4fc6bca8fb7/ios/PxPlayer/Build/Intermediates/PxPlayer.build/Debug-iphonesimulator/PxPlayer.build/PxPlayer-all-target-headers.hmap
--------------------------------------------------------------------------------
/ios/PxPlayer/Build/Intermediates/PxPlayer.build/Debug-iphonesimulator/PxPlayer.build/PxPlayer-generated-files.hmap:
--------------------------------------------------------------------------------
1 | pamh x
--------------------------------------------------------------------------------
/ios/PxPlayer/Build/Intermediates/PxPlayer.build/Debug-iphonesimulator/PxPlayer.build/PxPlayer-own-target-headers.hmap:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiongchuan86/react-native-pxplayer/db5924b50724c0f81b491e84e626e4fc6bca8fb7/ios/PxPlayer/Build/Intermediates/PxPlayer.build/Debug-iphonesimulator/PxPlayer.build/PxPlayer-own-target-headers.hmap
--------------------------------------------------------------------------------
/ios/PxPlayer/Build/Intermediates/PxPlayer.build/Debug-iphonesimulator/PxPlayer.build/PxPlayer-project-headers.hmap:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiongchuan86/react-native-pxplayer/db5924b50724c0f81b491e84e626e4fc6bca8fb7/ios/PxPlayer/Build/Intermediates/PxPlayer.build/Debug-iphonesimulator/PxPlayer.build/PxPlayer-project-headers.hmap
--------------------------------------------------------------------------------
/ios/PxPlayer/Build/Intermediates/PxPlayer.build/Debug-iphonesimulator/PxPlayer.build/PxPlayer.hmap:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiongchuan86/react-native-pxplayer/db5924b50724c0f81b491e84e626e4fc6bca8fb7/ios/PxPlayer/Build/Intermediates/PxPlayer.build/Debug-iphonesimulator/PxPlayer.build/PxPlayer.hmap
--------------------------------------------------------------------------------
/ios/PxPlayer/Build/Intermediates/PxPlayer.build/Debug-iphonesimulator/PxPlayer.build/dgph:
--------------------------------------------------------------------------------
1 | DGPH1.04Apr 11 201618:39:16D / Users
2 | xiongchuan git github react-native-pxplayer ios PxPlayer Build Products
Intermediates tmp PxPlayer.dst var folders q9 mwr37_sj5bs7dsqf6fylhz100000gn C com.apple.DeveloperTools 7.3.1-7D1014 Xcode
3 | Debug-iphonesimulator PxPlayer.build Debug-iphonesimulator PrecompiledHeaders Applications Xcode.app Contents Developer Platforms iPhoneSimulator.platform Developer SDKs !iPhoneSimulator9.3.sdk PxPlayer.build #DerivedSources
libPxPlayer.a OnDemandResources PxPlayer '
4 | PxPlayer.m #Objects-normal )x86_64 *
5 | PxPlayer.o "SDKSettings.plist "System -Library .CoreServices /SystemVersion.plist
6 | Toolchains 1XcodeDefault.xctoolchain 2usr 3lib 4clang 57.3.0 6include 7module.modulemap *PxPlayer.ast *PxPlayer.LinkFileList include ;PxPlayer <
7 | PxPlayer.h '
8 | PxPlayer.h 'PxPlayerManager.m *PxPlayerManager.o *PxPlayerManager.ast
9 | KNGLView.m *
10 | KNGLView.o *KNGLView.ast
--------------------------------------------------------------------------------
/ios/PxPlayer/Build/Intermediates/PxPlayer.build/Debug-iphonesimulator/PxPlayer.build/dgph~:
--------------------------------------------------------------------------------
1 | DGPH1.04Apr 11 201618:39:16A / Users
2 | xiongchuan git github react-native-pxplayer ios PxPlayer Build Products
Intermediates tmp PxPlayer.dst var folders q9 mwr37_sj5bs7dsqf6fylhz100000gn C com.apple.DeveloperTools 7.3.1-7D1014 Xcode
3 | Debug-iphonesimulator PxPlayer.build Debug-iphonesimulator PrecompiledHeaders Applications Xcode.app Contents Developer Platforms iPhoneSimulator.platform Developer SDKs !iPhoneSimulator9.3.sdk PxPlayer.build #DerivedSources
libPxPlayer.a OnDemandResources PxPlayer '
4 | PxPlayer.m #Objects-normal )x86_64 *
5 | PxPlayer.o "SDKSettings.plist "System -Library .CoreServices /SystemVersion.plist
6 | Toolchains 1XcodeDefault.xctoolchain 2usr 3lib 4clang 57.3.0 6include 7module.modulemap *PxPlayer.ast *PxPlayer.LinkFileList include ;PxPlayer <
7 | PxPlayer.h '
8 | PxPlayer.h 'PxPlayerManager.m *PxPlayerManager.o *PxPlayerManager.ast
--------------------------------------------------------------------------------
/ios/PxPlayer/FFMpegDecoder/AudioStreamer.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 | #import
4 | #import "RTSPPlayer.h"
5 |
6 | #define kNumAQBufs 3
7 | #define kAudioBufferSeconds 3
8 |
9 | typedef enum _AUDIO_STATE {
10 | AUDIO_STATE_READY = 0,
11 | AUDIO_STATE_STOP = 1,
12 | AUDIO_STATE_PLAYING = 2,
13 | AUDIO_STATE_PAUSE = 3,
14 | AUDIO_STATE_SEEKING = 4
15 | } AUDIO_STATE;
16 |
17 | @interface AudioStreamer : NSObject
18 | {
19 | NSString *playingFilePath_;
20 | AudioStreamBasicDescription audioStreamBasicDesc_;
21 | AudioQueueRef audioQueue_;
22 | AudioQueueBufferRef audioQueueBuffer_[kNumAQBufs];
23 | BOOL started_, finished_;
24 | NSTimeInterval durationTime_, startedTime_;
25 | NSInteger state_;
26 | NSTimer *seekTimer_;
27 | NSLock *decodeLock_;
28 | AVCodecContext *_audioCodecContext;
29 | }
30 |
31 | - (void)_startAudio;
32 | - (void)_stopAudio;
33 | - (BOOL)createAudioQueue;
34 | - (void)removeAudioQueue;
35 | - (void)audioQueueOutputCallback:(AudioQueueRef)inAQ inBuffer:(AudioQueueBufferRef)inBuffer;
36 | - (void)audioQueueIsRunningCallback;
37 | - (OSStatus)enqueueBuffer:(AudioQueueBufferRef)buffer;
38 | - (id)initWithStreamer:(RTSPPlayer*)streamer;
39 |
40 | - (OSStatus)startQueue;
41 |
42 | @end
43 |
--------------------------------------------------------------------------------
/ios/PxPlayer/FFMpegDecoder/AudioStreamer.m:
--------------------------------------------------------------------------------
1 | #import "AudioStreamer.h"
2 | #import "RTSPPlayer.h"
3 |
4 | void audioQueueOutputCallback(void *inClientData, AudioQueueRef inAQ,
5 | AudioQueueBufferRef inBuffer);
6 | void audioQueueIsRunningCallback(void *inClientData, AudioQueueRef inAQ,
7 | AudioQueuePropertyID inID);
8 |
9 | void audioQueueOutputCallback(void *inClientData, AudioQueueRef inAQ,
10 | AudioQueueBufferRef inBuffer) {
11 |
12 | AudioStreamer *audioController = (__bridge AudioStreamer*)inClientData;
13 | [audioController audioQueueOutputCallback:inAQ inBuffer:inBuffer];
14 | }
15 |
16 | void audioQueueIsRunningCallback(void *inClientData, AudioQueueRef inAQ,
17 | AudioQueuePropertyID inID) {
18 |
19 | AudioStreamer *audioController = (__bridge AudioStreamer*)inClientData;
20 | [audioController audioQueueIsRunningCallback];
21 | }
22 |
23 | @interface AudioStreamer ()
24 | @property (nonatomic, assign) RTSPPlayer *streamer;
25 | @property (nonatomic, assign) AVCodecContext *audioCodecContext;
26 | @end
27 |
28 | @implementation AudioStreamer
29 |
30 | @synthesize streamer = _streamer;
31 | @synthesize audioCodecContext = _audioCodecContext;
32 |
33 | - (id)initWithStreamer:(RTSPPlayer*)streamer {
34 | if (self = [super init]) {
35 | AVAudioSession *audioSession = [AVAudioSession sharedInstance];
36 | [audioSession setCategory:AVAudioSessionCategoryPlayback error:nil];
37 | _streamer = streamer;
38 | _audioCodecContext = _streamer._audioCodecContext;
39 | }
40 |
41 | return self;
42 | }
43 |
44 |
45 | - (IBAction)playAudio:(UIButton*)sender
46 | {
47 | [self _startAudio];
48 | }
49 |
50 | - (IBAction)pauseAudio:(UIButton*)sender
51 | {
52 | if (started_) {
53 | state_ = AUDIO_STATE_PAUSE;
54 |
55 | AudioQueuePause(audioQueue_);
56 | AudioQueueReset(audioQueue_);
57 | }
58 | }
59 |
60 | - (void)_startAudio
61 | {
62 | NSLog(@"ready to start audio");
63 | if (started_) {
64 | AudioQueueStart(audioQueue_, NULL);
65 | } else {
66 | [self createAudioQueue] ;
67 | [self startQueue];
68 | }
69 |
70 | for (NSInteger i = 0; i < kNumAQBufs; ++i) {
71 | [self enqueueBuffer:audioQueueBuffer_[i]];
72 | }
73 |
74 | state_ = AUDIO_STATE_PLAYING;
75 | }
76 |
77 | - (void)_stopAudio
78 | {
79 | if (started_) {
80 | AudioQueueStop(audioQueue_, YES);
81 | startedTime_ = 0.0;
82 | state_ = AUDIO_STATE_STOP;
83 | finished_ = NO;
84 | }
85 | }
86 |
87 | - (BOOL)createAudioQueue
88 | {
89 | state_ = AUDIO_STATE_READY;
90 | finished_ = NO;
91 |
92 | if (decodeLock_) {
93 | [decodeLock_ unlock];
94 | decodeLock_ = nil;
95 | }
96 |
97 | decodeLock_ = [[NSLock alloc] init];
98 |
99 | audioStreamBasicDesc_.mFormatID = -1;
100 | audioStreamBasicDesc_.mSampleRate = _audioCodecContext->sample_rate;
101 |
102 | if (audioStreamBasicDesc_.mSampleRate < 1) {
103 | audioStreamBasicDesc_.mSampleRate = 32000;
104 | }
105 |
106 | audioStreamBasicDesc_.mFormatFlags = 0;
107 |
108 | switch (_audioCodecContext->codec_id) {
109 | case AV_CODEC_ID_MP3:
110 | {
111 | audioStreamBasicDesc_.mFormatID = kAudioFormatMPEGLayer3;
112 | break;
113 | }
114 | case AV_CODEC_ID_AAC:
115 | {
116 | audioStreamBasicDesc_.mFormatID = kAudioFormatMPEG4AAC;
117 | audioStreamBasicDesc_.mFormatFlags = kMPEG4Object_AAC_LC;
118 | audioStreamBasicDesc_.mSampleRate = _audioCodecContext->sample_rate;
119 | audioStreamBasicDesc_.mChannelsPerFrame = _audioCodecContext->channels;
120 | audioStreamBasicDesc_.mBitsPerChannel = 0;
121 | audioStreamBasicDesc_.mFramesPerPacket =_audioCodecContext->frame_size;
122 | audioStreamBasicDesc_.mBytesPerPacket = 0;
123 | audioStreamBasicDesc_.mBytesPerFrame = _audioCodecContext->frame_bits;
124 | audioStreamBasicDesc_.mReserved = 0;
125 | NSLog(@"audio format %s (%d) is supported", _audioCodecContext->codec_descriptor->name, _audioCodecContext->codec_id);
126 |
127 | break;
128 | }
129 | case AV_CODEC_ID_AC3:
130 | {
131 | audioStreamBasicDesc_.mFormatID = kAudioFormatAC3;
132 | break;
133 | }
134 | case AV_CODEC_ID_PCM_MULAW:
135 | {
136 | audioStreamBasicDesc_.mFormatID = kAudioFormatULaw;
137 | audioStreamBasicDesc_.mSampleRate = 8000.0;
138 | audioStreamBasicDesc_.mFormatFlags = 0;
139 | audioStreamBasicDesc_.mFramesPerPacket = 1;
140 | audioStreamBasicDesc_.mChannelsPerFrame = 1;
141 | audioStreamBasicDesc_.mBitsPerChannel = 8;
142 | audioStreamBasicDesc_.mBytesPerPacket = 1;
143 | audioStreamBasicDesc_.mBytesPerFrame = 1;
144 | NSLog(@"found audio codec mulaw");
145 | break;
146 | }
147 | default:
148 | {
149 | NSLog(@"Error: audio format '%s' (%d) is not supported", _audioCodecContext->codec_descriptor->name, _audioCodecContext->codec_id);
150 | audioStreamBasicDesc_.mFormatID = kAudioFormatAC3;
151 | break;
152 | }
153 | }
154 |
155 | // if (audioStreamBasicDesc_.mFormatID != kAudioFormatULaw) {
156 | // audioStreamBasicDesc_.mBytesPerPacket = 0;
157 | // audioStreamBasicDesc_.mFramesPerPacket = _audioCodecContext->frame_size;
158 | // audioStreamBasicDesc_.mBytesPerFrame = 0;
159 | // audioStreamBasicDesc_.mChannelsPerFrame = _audioCodecContext->channels;
160 | // audioStreamBasicDesc_.mBitsPerChannel = 0;
161 | // }
162 |
163 | OSStatus status = AudioQueueNewOutput(&audioStreamBasicDesc_, audioQueueOutputCallback, (__bridge void*)self, NULL, NULL, 0, &audioQueue_);
164 | if (status != noErr) {
165 | NSLog(@"Could not create new output.");
166 | return NO;
167 | }
168 |
169 | status = AudioQueueAddPropertyListener(audioQueue_, kAudioQueueProperty_IsRunning, audioQueueIsRunningCallback, (__bridge void*)self);
170 | if (status != noErr) {
171 | NSLog(@"Could not add propery listener. (kAudioQueueProperty_IsRunning)");
172 | return NO;
173 | }
174 |
175 | for (NSInteger i = 0; i < kNumAQBufs; ++i) {
176 | status = AudioQueueAllocateBufferWithPacketDescriptions(audioQueue_,
177 | audioStreamBasicDesc_.mSampleRate * kAudioBufferSeconds / 8,
178 | _audioCodecContext->sample_rate * kAudioBufferSeconds / (_audioCodecContext->frame_size + 1),
179 | &audioQueueBuffer_[i]);
180 | if (status != noErr) {
181 | NSLog(@"Could not allocate buffer.");
182 | return NO;
183 | }
184 | }
185 |
186 | return YES;
187 | }
188 |
189 | - (void)removeAudioQueue
190 | {
191 | [self _stopAudio];
192 | started_ = NO;
193 |
194 | for (NSInteger i = 0; i < kNumAQBufs; ++i) {
195 | AudioQueueFreeBuffer(audioQueue_, audioQueueBuffer_[i]);
196 | }
197 |
198 | AudioQueueDispose(audioQueue_, YES);
199 |
200 | if (decodeLock_) {
201 | [decodeLock_ unlock];
202 | decodeLock_ = nil;
203 | }
204 | }
205 |
206 |
207 | - (void)audioQueueOutputCallback:(AudioQueueRef)inAQ inBuffer:(AudioQueueBufferRef)inBuffer
208 | {
209 | if (state_ == AUDIO_STATE_PLAYING) {
210 | [self enqueueBuffer:inBuffer];
211 | }
212 | }
213 |
214 | - (void)audioQueueIsRunningCallback
215 | {
216 | UInt32 isRunning;
217 | UInt32 size = sizeof(isRunning);
218 | OSStatus status = AudioQueueGetProperty(audioQueue_, kAudioQueueProperty_IsRunning, &isRunning, &size);
219 |
220 | if (status == noErr && !isRunning && state_ == AUDIO_STATE_PLAYING) {
221 | state_ = AUDIO_STATE_STOP;
222 |
223 | if (finished_) {
224 | }
225 | }
226 | }
227 |
228 | - (OSStatus)enqueueBuffer:(AudioQueueBufferRef)buffer
229 | {
230 | OSStatus status = noErr;
231 |
232 | if (buffer) {
233 | AudioTimeStamp bufferStartTime;
234 | buffer->mAudioDataByteSize = 0;
235 | buffer->mPacketDescriptionCount = 0;
236 |
237 | if (_streamer.audioPacketQueue.count <= 0) {
238 | _streamer.emptyAudioBuffer = buffer;
239 | return status;
240 | }
241 |
242 | _streamer.emptyAudioBuffer = nil;
243 |
244 | while (_streamer.audioPacketQueue.count && buffer->mPacketDescriptionCount < buffer->mPacketDescriptionCapacity) {
245 | AVPacket *packet = [_streamer readPacket];
246 |
247 | if (buffer->mAudioDataBytesCapacity - buffer->mAudioDataByteSize >= packet->size) {
248 | if (buffer->mPacketDescriptionCount == 0) {
249 | bufferStartTime.mSampleTime = packet->dts * _audioCodecContext->frame_size;
250 | bufferStartTime.mFlags = kAudioTimeStampSampleTimeValid;
251 | }
252 |
253 | memcpy((uint8_t *)buffer->mAudioData + buffer->mAudioDataByteSize, packet->data, packet->size);
254 | buffer->mPacketDescriptions[buffer->mPacketDescriptionCount].mStartOffset = buffer->mAudioDataByteSize;
255 | buffer->mPacketDescriptions[buffer->mPacketDescriptionCount].mDataByteSize = packet->size;
256 | buffer->mPacketDescriptions[buffer->mPacketDescriptionCount].mVariableFramesInPacket = _audioCodecContext->frame_size;
257 |
258 | buffer->mAudioDataByteSize += packet->size;
259 | buffer->mPacketDescriptionCount++;
260 |
261 |
262 | _streamer.audioPacketQueueSize -= packet->size;
263 |
264 | av_free_packet(packet);
265 | }
266 | else {
267 | break;
268 | }
269 | }
270 |
271 | [decodeLock_ lock];
272 | if (buffer->mPacketDescriptionCount > 0) {
273 | status = AudioQueueEnqueueBuffer(audioQueue_, buffer, 0, NULL);
274 | if (status != noErr) {
275 | NSLog(@"Could not enqueue buffer.");
276 | }
277 | } else {
278 | AudioQueueStop(audioQueue_, NO);
279 | finished_ = YES;
280 | }
281 |
282 | [decodeLock_ unlock];
283 | }
284 |
285 | return status;
286 | }
287 |
288 | - (OSStatus)startQueue
289 | {
290 | OSStatus status = noErr;
291 |
292 | if (!started_) {
293 | status = AudioQueueStart(audioQueue_, NULL);
294 | if (status == noErr) {
295 | started_ = YES;
296 | }
297 | else {
298 | NSLog(@"Could not start audio queue.");
299 | }
300 | }
301 |
302 | return status;
303 | }
304 |
305 | @end
306 |
--------------------------------------------------------------------------------
/ios/PxPlayer/FFMpegDecoder/RTSPPlayer.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import "libavformat/avformat.h"
3 | #import "libavcodec/avcodec.h"
4 | #import "libavformat/avio.h"
5 | #import "libswscale/swscale.h"
6 | #import
7 | #import
8 |
9 | @interface RTSPPlayer : NSObject {
10 | AVFormatContext *pFormatCtx;
11 | AVCodecContext *pCodecCtx;
12 | AVFrame *pFrame;
13 | AVPacket packet;
14 | AVPicture picture;
15 | int videoStream;
16 | int audioStream;
17 | struct SwsContext *img_convert_ctx;
18 | int sourceWidth, sourceHeight;
19 | int outputWidth, outputHeight;
20 | UIImage *currentImage;
21 | double duration;
22 | double currentTime;
23 | NSLock *audioPacketQueueLock;
24 | AVCodecContext *_audioCodecContext;
25 | int16_t *_audioBuffer;
26 | int audioPacketQueueSize;
27 | NSMutableArray *audioPacketQueue;
28 | AVStream *_audioStream;
29 | NSUInteger _audioBufferSize;
30 | BOOL _inBuffer;
31 | AVPacket *_packet, _currentPacket;
32 | BOOL primed;
33 |
34 |
35 | }
36 |
37 | /* Last decoded picture as UIImage */
38 | @property (nonatomic, readonly) UIImage *currentImage;
39 |
40 | /* Size of video frame */
41 | @property (nonatomic, readonly) int sourceWidth, sourceHeight;
42 |
43 | /* Output image size. Set to the source size by default. */
44 | @property (nonatomic) int outputWidth, outputHeight;
45 |
46 | /* Length of video in seconds */
47 | @property (nonatomic, readonly) double duration;
48 |
49 | /* Current time of video in seconds */
50 | @property (nonatomic, readonly) double currentTime;
51 |
52 | @property (nonatomic, retain) NSMutableArray *audioPacketQueue;
53 | @property (nonatomic, assign) AVCodecContext *_audioCodecContext;
54 | @property (nonatomic, assign) AudioQueueBufferRef emptyAudioBuffer;
55 | @property (nonatomic, assign) int audioPacketQueueSize;
56 | @property (nonatomic, assign) AVStream *_audioStream;
57 |
58 | /* Initialize with movie at moviePath. Output dimensions are set to source dimensions. */
59 | -(id)initWithVideo:(NSString *)moviePath usesTcp:(BOOL)usesTcp;
60 |
61 | /* Read the next frame from the video stream. Returns false if no frame read (video over). */
62 | -(BOOL)stepFrame;
63 |
64 | /* Seek to closest keyframe near specified time */
65 | -(void)seekTime:(double)seconds;
66 |
67 | -(void)closeAudio;
68 |
69 | - (AVPacket*)readPacket;
70 |
71 | @end
72 |
--------------------------------------------------------------------------------
/ios/PxPlayer/FFMpegDecoder/RTSPPlayer.m:
--------------------------------------------------------------------------------
1 | #import "RTSPPlayer.h"
2 | #import "Utilities.h"
3 | #import "AudioStreamer.h"
4 |
5 | #ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE
6 | # define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
7 | #endif
8 |
9 | @interface RTSPPlayer ()
10 | @property (nonatomic, retain) AudioStreamer *audioController;
11 | @end
12 |
13 | @interface RTSPPlayer (private)
14 | -(void)convertFrameToRGB;
15 | -(UIImage *)imageFromAVPicture:(AVPicture)pict width:(int)width height:(int)height;
16 | -(void)savePicture:(AVPicture)pFrame width:(int)width height:(int)height index:(int)iFrame;
17 | -(void)setupScaler;
18 | @end
19 |
20 | @implementation RTSPPlayer
21 |
22 | @synthesize audioController = _audioController;
23 | @synthesize audioPacketQueue,audioPacketQueueSize;
24 | @synthesize _audioStream,_audioCodecContext;
25 | @synthesize emptyAudioBuffer;
26 |
27 | @synthesize outputWidth, outputHeight;
28 |
29 | - (void)setOutputWidth:(int)newValue
30 | {
31 | if (outputWidth != newValue) {
32 | outputWidth = newValue;
33 | [self setupScaler];
34 | }
35 | }
36 |
37 | - (void)setOutputHeight:(int)newValue
38 | {
39 | if (outputHeight != newValue) {
40 | outputHeight = newValue;
41 | [self setupScaler];
42 | }
43 | }
44 |
45 | - (UIImage *)currentImage
46 | {
47 | if (!pFrame->data[0]) return nil;
48 | [self convertFrameToRGB];
49 | return [self imageFromAVPicture:picture width:outputWidth height:outputHeight];
50 | }
51 |
52 | - (double)duration
53 | {
54 | return (double)pFormatCtx->duration / AV_TIME_BASE;
55 | }
56 |
57 | - (double)currentTime
58 | {
59 | AVRational timeBase = pFormatCtx->streams[videoStream]->time_base;
60 | return packet.pts * (double)timeBase.num / timeBase.den;
61 | }
62 |
63 | - (int)sourceWidth
64 | {
65 | return pCodecCtx->width;
66 | }
67 |
68 | - (int)sourceHeight
69 | {
70 | return pCodecCtx->height;
71 | }
72 |
73 | - (id)initWithVideo:(NSString *)moviePath usesTcp:(BOOL)usesTcp
74 | {
75 | if (!(self=[super init])) return nil;
76 |
77 | AVCodec *pCodec;
78 |
79 | // Register all formats and codecs
80 | avcodec_register_all();
81 | av_register_all();
82 | avformat_network_init();
83 |
84 | // Set the RTSP Options
85 | AVDictionary *opts = 0;
86 | if (usesTcp)
87 | av_dict_set(&opts, "rtsp_transport", "tcp", 0);
88 |
89 |
90 | if (avformat_open_input(&pFormatCtx, [moviePath UTF8String], NULL, &opts) !=0 ) {
91 | av_log(NULL, AV_LOG_ERROR, "Couldn't open file\n");
92 | goto initError;
93 | }
94 |
95 | // Retrieve stream information
96 | if (avformat_find_stream_info(pFormatCtx,NULL) < 0) {
97 | av_log(NULL, AV_LOG_ERROR, "Couldn't find stream information\n");
98 | goto initError;
99 | }
100 |
101 | // Find the first video stream
102 | videoStream=-1;
103 | audioStream=-1;
104 |
105 | for (int i=0; inb_streams; i++) {
106 | if (pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO) {
107 | NSLog(@"found video stream");
108 | videoStream=i;
109 | }
110 |
111 | if (pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_AUDIO) {
112 | audioStream=i;
113 | NSLog(@"found audio stream");
114 | }
115 | }
116 |
117 | if (videoStream==-1 && audioStream==-1) {
118 | goto initError;
119 | }
120 |
121 | // Get a pointer to the codec context for the video stream
122 | pCodecCtx = pFormatCtx->streams[videoStream]->codec;
123 |
124 | // Find the decoder for the video stream
125 | pCodec = avcodec_find_decoder(pCodecCtx->codec_id);
126 | if (pCodec == NULL) {
127 | av_log(NULL, AV_LOG_ERROR, "Unsupported codec!\n");
128 | goto initError;
129 | }
130 |
131 | // Open codec
132 | if (avcodec_open2(pCodecCtx, pCodec, NULL) < 0) {
133 | av_log(NULL, AV_LOG_ERROR, "Cannot open video decoder\n");
134 | goto initError;
135 | }
136 |
137 | if (audioStream > -1 ) {
138 | NSLog(@"set up audiodecoder");
139 | [self setupAudioDecoder];
140 | }
141 |
142 | // Allocate video frame
143 | pFrame = av_frame_alloc();
144 |
145 | outputWidth = pCodecCtx->width;
146 | self.outputHeight = pCodecCtx->height;
147 |
148 | return self;
149 |
150 | initError:
151 | return nil;
152 | }
153 |
154 |
155 | - (void)setupScaler
156 | {
157 | // Release old picture and scaler
158 | avpicture_free(&picture);
159 | sws_freeContext(img_convert_ctx);
160 |
161 | // Allocate RGB picture
162 | avpicture_alloc(&picture, AV_PIX_FMT_RGB24, outputWidth, outputHeight);
163 |
164 | // Setup scaler
165 | static int sws_flags = SWS_FAST_BILINEAR;
166 | img_convert_ctx = sws_getContext(pCodecCtx->width,
167 | pCodecCtx->height,
168 | pCodecCtx->pix_fmt,
169 | outputWidth,
170 | outputHeight,
171 | AV_PIX_FMT_RGB24,
172 | sws_flags, NULL, NULL, NULL);
173 |
174 | }
175 |
176 | - (void)seekTime:(double)seconds
177 | {
178 | AVRational timeBase = pFormatCtx->streams[videoStream]->time_base;
179 | int64_t targetFrame = (int64_t)((double)timeBase.den / timeBase.num * seconds);
180 | avformat_seek_file(pFormatCtx, videoStream, targetFrame, targetFrame, targetFrame, AVSEEK_FLAG_FRAME);
181 | avcodec_flush_buffers(pCodecCtx);
182 | }
183 |
184 | - (void)dealloc
185 | {
186 | // Free scaler
187 | sws_freeContext(img_convert_ctx);
188 |
189 | // Free RGB picture
190 | avpicture_free(&picture);
191 |
192 | // Free the packet that was allocated by av_read_frame
193 | av_free_packet(&packet);
194 |
195 | // Free the YUV frame
196 | av_free(pFrame);
197 |
198 | // Close the codec
199 | if (pCodecCtx) avcodec_close(pCodecCtx);
200 |
201 | // Close the video file
202 | if (pFormatCtx) avformat_close_input(&pFormatCtx);
203 |
204 | [_audioController _stopAudio];
205 | _audioController = nil;
206 |
207 | audioPacketQueue = nil;
208 |
209 | audioPacketQueueLock = nil;
210 |
211 | }
212 |
213 | - (BOOL)stepFrame
214 | {
215 | // AVPacket packet;
216 | int frameFinished=0;
217 |
218 | while (!frameFinished && av_read_frame(pFormatCtx, &packet) >=0 ) {
219 | // Is this a packet from the video stream?
220 | if(packet.stream_index==videoStream) {
221 | // Decode video frame
222 | avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packet);
223 | }
224 |
225 | if (packet.stream_index==audioStream) {
226 | // NSLog(@"audio stream");
227 | [audioPacketQueueLock lock];
228 |
229 | audioPacketQueueSize += packet.size;
230 | [audioPacketQueue addObject:[NSMutableData dataWithBytes:&packet length:sizeof(packet)]];
231 |
232 | [audioPacketQueueLock unlock];
233 |
234 | if (!primed) {
235 | primed=YES;
236 | [_audioController _startAudio];
237 | }
238 |
239 | if (emptyAudioBuffer) {
240 | [_audioController enqueueBuffer:emptyAudioBuffer];
241 | }
242 | }
243 | }
244 |
245 | return frameFinished!=0;
246 | }
247 |
248 | - (void)convertFrameToRGB
249 | {
250 | sws_scale(img_convert_ctx,
251 | pFrame->data,
252 | pFrame->linesize,
253 | 0,
254 | pCodecCtx->height,
255 | picture.data,
256 | picture.linesize);
257 | }
258 |
259 | - (UIImage *)imageFromAVPicture:(AVPicture)pict width:(int)width height:(int)height
260 | {
261 | CGBitmapInfo bitmapInfo = kCGBitmapByteOrderDefault;
262 | CFDataRef data = CFDataCreateWithBytesNoCopy(kCFAllocatorDefault, pict.data[0], pict.linesize[0]*height,kCFAllocatorNull);
263 | CGDataProviderRef provider = CGDataProviderCreateWithCFData(data);
264 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
265 | CGImageRef cgImage = CGImageCreate(width,
266 | height,
267 | 8,
268 | 24,
269 | pict.linesize[0],
270 | colorSpace,
271 | bitmapInfo,
272 | provider,
273 | NULL,
274 | NO,
275 | kCGRenderingIntentDefault);
276 | CGColorSpaceRelease(colorSpace);
277 | UIImage *image = [UIImage imageWithCGImage:cgImage];
278 |
279 | CGImageRelease(cgImage);
280 | CGDataProviderRelease(provider);
281 | CFRelease(data);
282 |
283 | return image;
284 | }
285 |
286 | - (void)setupAudioDecoder
287 | {
288 | if (audioStream >= 0) {
289 | _audioBufferSize = AVCODEC_MAX_AUDIO_FRAME_SIZE;
290 | _audioBuffer = av_malloc(_audioBufferSize);
291 | _inBuffer = NO;
292 |
293 | _audioCodecContext = pFormatCtx->streams[audioStream]->codec;
294 | _audioStream = pFormatCtx->streams[audioStream];
295 |
296 | AVCodec *codec = avcodec_find_decoder(_audioCodecContext->codec_id);
297 | if (codec == NULL) {
298 | NSLog(@"Not found audio codec.");
299 | return;
300 | }
301 |
302 | if (avcodec_open2(_audioCodecContext, codec, NULL) < 0) {
303 | NSLog(@"Could not open audio codec.");
304 | return;
305 | }
306 |
307 | if (audioPacketQueue) {
308 | audioPacketQueue = nil;
309 | }
310 | audioPacketQueue = [[NSMutableArray alloc] init];
311 |
312 | if (audioPacketQueueLock) {
313 | audioPacketQueueLock = nil;
314 | }
315 | audioPacketQueueLock = [[NSLock alloc] init];
316 |
317 | if (_audioController) {
318 | [_audioController _stopAudio];
319 | _audioController = nil;
320 | }
321 | _audioController = [[AudioStreamer alloc] initWithStreamer:self];
322 | } else {
323 | pFormatCtx->streams[audioStream]->discard = AVDISCARD_ALL;
324 | audioStream = -1;
325 | }
326 | }
327 |
328 | - (void)nextPacket
329 | {
330 | _inBuffer = NO;
331 | }
332 |
333 | - (AVPacket*)readPacket
334 | {
335 | if (_currentPacket.size > 0 || _inBuffer) return &_currentPacket;
336 |
337 | NSMutableData *packetData = [audioPacketQueue objectAtIndex:0];
338 | _packet = [packetData mutableBytes];
339 |
340 | if (_packet) {
341 | if (_packet->dts != AV_NOPTS_VALUE) {
342 | _packet->dts += av_rescale_q(0, AV_TIME_BASE_Q, _audioStream->time_base);
343 | }
344 |
345 | if (_packet->pts != AV_NOPTS_VALUE) {
346 | _packet->pts += av_rescale_q(0, AV_TIME_BASE_Q, _audioStream->time_base);
347 | }
348 |
349 | [audioPacketQueueLock lock];
350 | audioPacketQueueSize -= _packet->size;
351 | if ([audioPacketQueue count] > 0) {
352 | [audioPacketQueue removeObjectAtIndex:0];
353 | }
354 | [audioPacketQueueLock unlock];
355 |
356 | _currentPacket = *(_packet);
357 | }
358 |
359 | return &_currentPacket;
360 | }
361 |
362 | - (void)closeAudio
363 | {
364 | [_audioController _stopAudio];
365 | primed=NO;
366 | }
367 |
368 | - (void)savePPMPicture:(AVPicture)pict width:(int)width height:(int)height index:(int)iFrame
369 | {
370 | FILE *pFile;
371 | NSString *fileName;
372 | int y;
373 |
374 | fileName = [Utilities documentsPath:[NSString stringWithFormat:@"image%04d.ppm",iFrame]];
375 | // Open file
376 | NSLog(@"write image file: %@",fileName);
377 | pFile=fopen([fileName cStringUsingEncoding:NSASCIIStringEncoding], "wb");
378 | if (pFile == NULL) {
379 | return;
380 | }
381 |
382 | // Write header
383 | fprintf(pFile, "P6\n%d %d\n255\n", width, height);
384 |
385 | // Write pixel data
386 | for (y=0; y
23 |
24 | @interface Utilities : NSObject {
25 |
26 | }
27 |
28 | +(NSString *)bundlePath:(NSString *)fileName;
29 | +(NSString *)documentsPath:(NSString *)fileName;
30 |
31 | @end
32 |
--------------------------------------------------------------------------------
/ios/PxPlayer/FFMpegDecoder/Utilities.m:
--------------------------------------------------------------------------------
1 | //
2 | // Utilities.m
3 | // iFrameExtractor
4 | //
5 | // Created by lajos on 1/10/10.
6 | //
7 | // Copyright 2010 Lajos Kamocsay
8 | //
9 | // lajos at codza dot com
10 | //
11 | // iFrameExtractor is free software; you can redistribute it and/or
12 | // modify it under the terms of the GNU Lesser General Public
13 | // License as published by the Free Software Foundation; either
14 | // version 2.1 of the License, or (at your option) any later version.
15 | //
16 | // iFrameExtractor is distributed in the hope that it will be useful,
17 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 | // Lesser General Public License for more details.
20 | //
21 |
22 | #import "Utilities.h"
23 |
24 |
25 | @implementation Utilities
26 |
27 | +(NSString *)bundlePath:(NSString *)fileName {
28 | return [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:fileName];
29 | }
30 |
31 | +(NSString *)documentsPath:(NSString *)fileName {
32 | NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
33 | NSString *documentsDirectory = [paths objectAtIndex:0];
34 | return [documentsDirectory stringByAppendingPathComponent:fileName];
35 | }
36 |
37 | @end
38 |
--------------------------------------------------------------------------------
/ios/PxPlayer/PxPlayer.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 0C3752BC1D2BA73D005D73FE /* PxPlayer.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 0C3752BB1D2BA73D005D73FE /* PxPlayer.h */; };
11 | 0C3752BE1D2BA73D005D73FE /* PxPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 0C3752BD1D2BA73D005D73FE /* PxPlayer.m */; };
12 | 0C3752C61D2BA7C5005D73FE /* PxPlayerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0C3752C41D2BA7C5005D73FE /* PxPlayerManager.m */; };
13 | 0CD99FB31D37527900A56D7A /* AudioStreamer.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CD99FAE1D37527900A56D7A /* AudioStreamer.m */; };
14 | 0CD99FB41D37527900A56D7A /* RTSPPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CD99FB01D37527900A56D7A /* RTSPPlayer.m */; };
15 | 0CD99FB51D37527900A56D7A /* Utilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 0CD99FB21D37527900A56D7A /* Utilities.m */; };
16 | /* End PBXBuildFile section */
17 |
18 | /* Begin PBXCopyFilesBuildPhase section */
19 | 0C3752B61D2BA73D005D73FE /* CopyFiles */ = {
20 | isa = PBXCopyFilesBuildPhase;
21 | buildActionMask = 2147483647;
22 | dstPath = "include/$(PRODUCT_NAME)";
23 | dstSubfolderSpec = 16;
24 | files = (
25 | 0C3752BC1D2BA73D005D73FE /* PxPlayer.h in CopyFiles */,
26 | );
27 | runOnlyForDeploymentPostprocessing = 0;
28 | };
29 | /* End PBXCopyFilesBuildPhase section */
30 |
31 | /* Begin PBXFileReference section */
32 | 0C3752B81D2BA73D005D73FE /* libPxPlayer.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPxPlayer.a; sourceTree = BUILT_PRODUCTS_DIR; };
33 | 0C3752BB1D2BA73D005D73FE /* PxPlayer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PxPlayer.h; sourceTree = ""; };
34 | 0C3752BD1D2BA73D005D73FE /* PxPlayer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PxPlayer.m; sourceTree = ""; };
35 | 0C3752C41D2BA7C5005D73FE /* PxPlayerManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PxPlayerManager.m; sourceTree = ""; };
36 | 0C3752C51D2BA7C5005D73FE /* PxPlayerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PxPlayerManager.h; sourceTree = ""; };
37 | 0CD99FAD1D37527900A56D7A /* AudioStreamer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AudioStreamer.h; path = FFMpegDecoder/AudioStreamer.h; sourceTree = ""; };
38 | 0CD99FAE1D37527900A56D7A /* AudioStreamer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AudioStreamer.m; path = FFMpegDecoder/AudioStreamer.m; sourceTree = ""; };
39 | 0CD99FAF1D37527900A56D7A /* RTSPPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RTSPPlayer.h; path = FFMpegDecoder/RTSPPlayer.h; sourceTree = ""; };
40 | 0CD99FB01D37527900A56D7A /* RTSPPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RTSPPlayer.m; path = FFMpegDecoder/RTSPPlayer.m; sourceTree = ""; };
41 | 0CD99FB11D37527900A56D7A /* Utilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Utilities.h; path = FFMpegDecoder/Utilities.h; sourceTree = ""; };
42 | 0CD99FB21D37527900A56D7A /* Utilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Utilities.m; path = FFMpegDecoder/Utilities.m; sourceTree = ""; };
43 | /* End PBXFileReference section */
44 |
45 | /* Begin PBXFrameworksBuildPhase section */
46 | 0C3752B51D2BA73D005D73FE /* Frameworks */ = {
47 | isa = PBXFrameworksBuildPhase;
48 | buildActionMask = 2147483647;
49 | files = (
50 | );
51 | runOnlyForDeploymentPostprocessing = 0;
52 | };
53 | /* End PBXFrameworksBuildPhase section */
54 |
55 | /* Begin PBXGroup section */
56 | 0C3752AF1D2BA73D005D73FE = {
57 | isa = PBXGroup;
58 | children = (
59 | 0CD99FAC1D37525800A56D7A /* FFMpegDecoder */,
60 | 0C3752BA1D2BA73D005D73FE /* PxPlayer */,
61 | 0C3752B91D2BA73D005D73FE /* Products */,
62 | );
63 | sourceTree = "";
64 | };
65 | 0C3752B91D2BA73D005D73FE /* Products */ = {
66 | isa = PBXGroup;
67 | children = (
68 | 0C3752B81D2BA73D005D73FE /* libPxPlayer.a */,
69 | );
70 | name = Products;
71 | sourceTree = "";
72 | };
73 | 0C3752BA1D2BA73D005D73FE /* PxPlayer */ = {
74 | isa = PBXGroup;
75 | children = (
76 | 0C3752C41D2BA7C5005D73FE /* PxPlayerManager.m */,
77 | 0C3752C51D2BA7C5005D73FE /* PxPlayerManager.h */,
78 | 0C3752BB1D2BA73D005D73FE /* PxPlayer.h */,
79 | 0C3752BD1D2BA73D005D73FE /* PxPlayer.m */,
80 | );
81 | path = PxPlayer;
82 | sourceTree = "";
83 | };
84 | 0CD99FAC1D37525800A56D7A /* FFMpegDecoder */ = {
85 | isa = PBXGroup;
86 | children = (
87 | 0CD99FAD1D37527900A56D7A /* AudioStreamer.h */,
88 | 0CD99FAE1D37527900A56D7A /* AudioStreamer.m */,
89 | 0CD99FAF1D37527900A56D7A /* RTSPPlayer.h */,
90 | 0CD99FB01D37527900A56D7A /* RTSPPlayer.m */,
91 | 0CD99FB11D37527900A56D7A /* Utilities.h */,
92 | 0CD99FB21D37527900A56D7A /* Utilities.m */,
93 | );
94 | name = FFMpegDecoder;
95 | sourceTree = "";
96 | };
97 | /* End PBXGroup section */
98 |
99 | /* Begin PBXNativeTarget section */
100 | 0C3752B71D2BA73D005D73FE /* PxPlayer */ = {
101 | isa = PBXNativeTarget;
102 | buildConfigurationList = 0C3752C11D2BA73D005D73FE /* Build configuration list for PBXNativeTarget "PxPlayer" */;
103 | buildPhases = (
104 | 0C3752B41D2BA73D005D73FE /* Sources */,
105 | 0C3752B51D2BA73D005D73FE /* Frameworks */,
106 | 0C3752B61D2BA73D005D73FE /* CopyFiles */,
107 | );
108 | buildRules = (
109 | );
110 | dependencies = (
111 | );
112 | name = PxPlayer;
113 | productName = PxPlayer;
114 | productReference = 0C3752B81D2BA73D005D73FE /* libPxPlayer.a */;
115 | productType = "com.apple.product-type.library.static";
116 | };
117 | /* End PBXNativeTarget section */
118 |
119 | /* Begin PBXProject section */
120 | 0C3752B01D2BA73D005D73FE /* Project object */ = {
121 | isa = PBXProject;
122 | attributes = {
123 | LastUpgradeCheck = 0730;
124 | ORGANIZATIONNAME = "熊川";
125 | TargetAttributes = {
126 | 0C3752B71D2BA73D005D73FE = {
127 | CreatedOnToolsVersion = 7.3.1;
128 | };
129 | };
130 | };
131 | buildConfigurationList = 0C3752B31D2BA73D005D73FE /* Build configuration list for PBXProject "PxPlayer" */;
132 | compatibilityVersion = "Xcode 3.2";
133 | developmentRegion = English;
134 | hasScannedForEncodings = 0;
135 | knownRegions = (
136 | en,
137 | );
138 | mainGroup = 0C3752AF1D2BA73D005D73FE;
139 | productRefGroup = 0C3752B91D2BA73D005D73FE /* Products */;
140 | projectDirPath = "";
141 | projectRoot = "";
142 | targets = (
143 | 0C3752B71D2BA73D005D73FE /* PxPlayer */,
144 | );
145 | };
146 | /* End PBXProject section */
147 |
148 | /* Begin PBXSourcesBuildPhase section */
149 | 0C3752B41D2BA73D005D73FE /* Sources */ = {
150 | isa = PBXSourcesBuildPhase;
151 | buildActionMask = 2147483647;
152 | files = (
153 | 0C3752C61D2BA7C5005D73FE /* PxPlayerManager.m in Sources */,
154 | 0CD99FB51D37527900A56D7A /* Utilities.m in Sources */,
155 | 0C3752BE1D2BA73D005D73FE /* PxPlayer.m in Sources */,
156 | 0CD99FB41D37527900A56D7A /* RTSPPlayer.m in Sources */,
157 | 0CD99FB31D37527900A56D7A /* AudioStreamer.m in Sources */,
158 | );
159 | runOnlyForDeploymentPostprocessing = 0;
160 | };
161 | /* End PBXSourcesBuildPhase section */
162 |
163 | /* Begin XCBuildConfiguration section */
164 | 0C3752BF1D2BA73D005D73FE /* Debug */ = {
165 | isa = XCBuildConfiguration;
166 | buildSettings = {
167 | ALWAYS_SEARCH_USER_PATHS = NO;
168 | CLANG_ANALYZER_NONNULL = YES;
169 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
170 | CLANG_CXX_LIBRARY = "libc++";
171 | CLANG_ENABLE_MODULES = YES;
172 | CLANG_ENABLE_OBJC_ARC = YES;
173 | CLANG_WARN_BOOL_CONVERSION = YES;
174 | CLANG_WARN_CONSTANT_CONVERSION = YES;
175 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
176 | CLANG_WARN_EMPTY_BODY = YES;
177 | CLANG_WARN_ENUM_CONVERSION = YES;
178 | CLANG_WARN_INT_CONVERSION = YES;
179 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
180 | CLANG_WARN_UNREACHABLE_CODE = YES;
181 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
182 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
183 | COPY_PHASE_STRIP = NO;
184 | DEBUG_INFORMATION_FORMAT = dwarf;
185 | ENABLE_STRICT_OBJC_MSGSEND = YES;
186 | ENABLE_TESTABILITY = YES;
187 | GCC_C_LANGUAGE_STANDARD = gnu99;
188 | GCC_DYNAMIC_NO_PIC = NO;
189 | GCC_NO_COMMON_BLOCKS = YES;
190 | GCC_OPTIMIZATION_LEVEL = 0;
191 | GCC_PREPROCESSOR_DEFINITIONS = (
192 | "DEBUG=1",
193 | "$(inherited)",
194 | );
195 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
196 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
197 | GCC_WARN_UNDECLARED_SELECTOR = YES;
198 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
199 | GCC_WARN_UNUSED_FUNCTION = YES;
200 | GCC_WARN_UNUSED_VARIABLE = YES;
201 | IPHONEOS_DEPLOYMENT_TARGET = 9.3;
202 | MTL_ENABLE_DEBUG_INFO = YES;
203 | ONLY_ACTIVE_ARCH = YES;
204 | SDKROOT = iphoneos;
205 | };
206 | name = Debug;
207 | };
208 | 0C3752C01D2BA73D005D73FE /* Release */ = {
209 | isa = XCBuildConfiguration;
210 | buildSettings = {
211 | ALWAYS_SEARCH_USER_PATHS = NO;
212 | CLANG_ANALYZER_NONNULL = YES;
213 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
214 | CLANG_CXX_LIBRARY = "libc++";
215 | CLANG_ENABLE_MODULES = YES;
216 | CLANG_ENABLE_OBJC_ARC = YES;
217 | CLANG_WARN_BOOL_CONVERSION = YES;
218 | CLANG_WARN_CONSTANT_CONVERSION = YES;
219 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
220 | CLANG_WARN_EMPTY_BODY = YES;
221 | CLANG_WARN_ENUM_CONVERSION = YES;
222 | CLANG_WARN_INT_CONVERSION = YES;
223 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
224 | CLANG_WARN_UNREACHABLE_CODE = YES;
225 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
226 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
227 | COPY_PHASE_STRIP = NO;
228 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
229 | ENABLE_NS_ASSERTIONS = NO;
230 | ENABLE_STRICT_OBJC_MSGSEND = YES;
231 | GCC_C_LANGUAGE_STANDARD = gnu99;
232 | GCC_NO_COMMON_BLOCKS = YES;
233 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
234 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
235 | GCC_WARN_UNDECLARED_SELECTOR = YES;
236 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
237 | GCC_WARN_UNUSED_FUNCTION = YES;
238 | GCC_WARN_UNUSED_VARIABLE = YES;
239 | IPHONEOS_DEPLOYMENT_TARGET = 9.3;
240 | MTL_ENABLE_DEBUG_INFO = NO;
241 | SDKROOT = iphoneos;
242 | VALIDATE_PRODUCT = YES;
243 | };
244 | name = Release;
245 | };
246 | 0C3752C21D2BA73D005D73FE /* Debug */ = {
247 | isa = XCBuildConfiguration;
248 | buildSettings = {
249 | HEADER_SEARCH_PATHS = (
250 | "$(inherited)",
251 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
252 | "$(SRCROOT)/../../../react-native/React/**",
253 | "$(SRCROOT)/node_modules/react-native/React/**",
254 | "$(SRCROOT)/../../../../frameworks/ffmpeg.pkg/inc",
255 | "$(SRCROOT)/../../../../frameworks/tbox.pkg/inc/",
256 | "$(SRCROOT)/../../../../frameworks/tbox.pkg/inc/iphoneos",
257 | );
258 | LIBRARY_SEARCH_PATHS = "";
259 | OTHER_LDFLAGS = "-ObjC";
260 | PRODUCT_NAME = "$(TARGET_NAME)";
261 | SKIP_INSTALL = YES;
262 | };
263 | name = Debug;
264 | };
265 | 0C3752C31D2BA73D005D73FE /* Release */ = {
266 | isa = XCBuildConfiguration;
267 | buildSettings = {
268 | HEADER_SEARCH_PATHS = (
269 | "$(inherited)",
270 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
271 | "$(SRCROOT)/../../../react-native/React/**",
272 | "$(SRCROOT)/node_modules/react-native/React/**",
273 | "$(SRCROOT)/../../../../frameworks/ffmpeg.pkg/inc",
274 | "$(SRCROOT)/../../../../frameworks/tbox.pkg/inc/",
275 | "$(SRCROOT)/../../../../frameworks/tbox.pkg/inc/iphoneos",
276 | );
277 | LIBRARY_SEARCH_PATHS = "";
278 | OTHER_LDFLAGS = "-ObjC";
279 | PRODUCT_NAME = "$(TARGET_NAME)";
280 | SKIP_INSTALL = YES;
281 | };
282 | name = Release;
283 | };
284 | /* End XCBuildConfiguration section */
285 |
286 | /* Begin XCConfigurationList section */
287 | 0C3752B31D2BA73D005D73FE /* Build configuration list for PBXProject "PxPlayer" */ = {
288 | isa = XCConfigurationList;
289 | buildConfigurations = (
290 | 0C3752BF1D2BA73D005D73FE /* Debug */,
291 | 0C3752C01D2BA73D005D73FE /* Release */,
292 | );
293 | defaultConfigurationIsVisible = 0;
294 | defaultConfigurationName = Release;
295 | };
296 | 0C3752C11D2BA73D005D73FE /* Build configuration list for PBXNativeTarget "PxPlayer" */ = {
297 | isa = XCConfigurationList;
298 | buildConfigurations = (
299 | 0C3752C21D2BA73D005D73FE /* Debug */,
300 | 0C3752C31D2BA73D005D73FE /* Release */,
301 | );
302 | defaultConfigurationIsVisible = 0;
303 | defaultConfigurationName = Release;
304 | };
305 | /* End XCConfigurationList section */
306 | };
307 | rootObject = 0C3752B01D2BA73D005D73FE /* Project object */;
308 | }
309 |
--------------------------------------------------------------------------------
/ios/PxPlayer/PxPlayer.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/PxPlayer/PxPlayer.xcodeproj/project.xcworkspace/xcuserdata/xiongchuan.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiongchuan86/react-native-pxplayer/db5924b50724c0f81b491e84e626e4fc6bca8fb7/ios/PxPlayer/PxPlayer.xcodeproj/project.xcworkspace/xcuserdata/xiongchuan.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/ios/PxPlayer/PxPlayer.xcodeproj/xcuserdata/xiongchuan.xcuserdatad/xcschemes/PxPlayer.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
70 |
71 |
72 |
73 |
75 |
76 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/ios/PxPlayer/PxPlayer.xcodeproj/xcuserdata/xiongchuan.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | PxPlayer.xcscheme
8 |
9 | orderHint
10 | 1
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 0C3752B71D2BA73D005D73FE
16 |
17 | primary
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/ios/PxPlayer/PxPlayer/PxPlayer.h:
--------------------------------------------------------------------------------
1 | #import "RCTView.h"
2 | #import
3 | #import
4 | #include "tbox/tbox.h"
5 | #import "RTSPPlayer.h"
6 | #import "Utilities.h"
7 |
8 | @class RCTEventDispatcher;
9 |
10 | @interface PxPlayer : UIView
11 |
12 |
13 | typedef enum {
14 | PLAYER_STATE_START,
15 | PLAYER_STATE_BUFFERING,
16 | PLAYER_STATE_PLAYING,
17 | PLAYER_STATE_PAUSED,
18 | PLAYER_STATE_STOPPED,
19 | PLAYER_STATE_ERROR
20 | }playerState;
21 |
22 | @property (nonatomic, readonly) int sourceWidth, sourceHeight;
23 | @property (nonatomic) int outputWidth, outputHeight;
24 | @property (nonatomic, readonly) double duration;
25 | @property (nonatomic, readonly) double currentTime;
26 | @property (nonatomic) BOOL paused;
27 | @property (nonatomic) BOOL canPlay;
28 | @property (nonatomic) BOOL playing;
29 | @property (nonatomic) BOOL fullscreen;
30 |
31 | @property (nonatomic) BOOL useGLView;
32 | @property (nonatomic) BOOL releaseInstance;
33 |
34 | @property (nonatomic, retain) NSString *errorMsg;
35 | @property (nonatomic, retain) RCTEventDispatcher *_eventDispatcher;
36 | @property (nonatomic, retain) NSTimer *nextFrameTimer;
37 |
38 | @property (nonatomic, retain) UIView *videoView;
39 | @property (nonatomic, retain) UIImageView *imageView;
40 |
41 | @property (nonatomic, retain) RTSPPlayer *video;
42 |
43 |
44 |
45 | -(void)start;
46 | -(void)stop;
47 | -(void)pause;
48 | -(void)setDisplay:(UIView*)videoView width:(int)width height:(int)height;
49 | -(void)savePicture:(NSString*)path;
50 | - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER;
51 |
52 | @end
53 |
--------------------------------------------------------------------------------
/ios/PxPlayer/PxPlayer/PxPlayer.m:
--------------------------------------------------------------------------------
1 | //
2 | // Playerxx.m
3 | // playerxx
4 | //
5 | // Created by 熊川 on 16/7/5.
6 | // Copyright © 2016年 熊川. All rights reserved.
7 | //
8 | #import "RCTConvert.h"
9 | #import "RCTBridgeModule.h"
10 | #import "RCTEventDispatcher.h"
11 | #import "UIView+React.h"
12 | #import "PxPlayer.h"
13 |
14 | @implementation PxPlayer
15 |
16 | @synthesize outputWidth, outputHeight , video;
17 |
18 | @synthesize nextFrameTimer = _nextFrameTimer;
19 |
20 | ///////////////////
21 |
22 | - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher
23 | {
24 | if ((self = [super init])) {
25 | self._eventDispatcher = eventDispatcher;
26 |
27 | [[NSNotificationCenter defaultCenter] addObserver:self
28 | selector:@selector(applicationWillResignActive:)
29 | name:UIApplicationWillResignActiveNotification
30 | object:nil];
31 |
32 | [[NSNotificationCenter defaultCenter] addObserver:self
33 | selector:@selector(applicationWillEnterForeground:)
34 | name:UIApplicationWillEnterForegroundNotification
35 | object:nil];
36 |
37 | }
38 | _canPlay = NO;
39 | _paused = NO;
40 | _errorMsg = @"";
41 | _useGLView = NO;
42 | _releaseInstance = NO;
43 | outputHeight = 0;
44 | outputWidth = 0;
45 |
46 |
47 | return self;
48 | }
49 |
50 | - (void)applicationWillResignActive:(NSNotification *)notification
51 | {
52 | if (!_paused) {
53 | [self setPaused:_paused];
54 | }
55 | }
56 |
57 | - (void)applicationWillEnterForeground:(NSNotification *)notification
58 | {
59 |
60 | }
61 |
62 | - (BOOL) isBlankString:(NSString *)string {
63 | if (string == nil || string == NULL) {
64 | return YES;
65 | }
66 | if ([string isKindOfClass:[NSNull class]]) {
67 | return YES;
68 | }
69 | if ([[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] length]==0) {
70 | return YES;
71 | }
72 | return NO;
73 | }
74 |
75 | -(void)setSource:(NSDictionary *)source
76 | {
77 |
78 | if(video){
79 | video = nil;
80 | [self stop];
81 | }
82 |
83 | NSString* uri = [source objectForKey:@"uri"];
84 | BOOL useTcp = [RCTConvert BOOL:[source objectForKey:@"useTcp"]];
85 | int width = [RCTConvert int:[source objectForKey:@"width"]];
86 | int height = [RCTConvert int:[source objectForKey:@"height"]];
87 | NSLog(@"width=%i,height=%i",width,height);
88 | if( ![self isBlankString:uri] ){
89 | [self setDataSource:uri useTcp:useTcp width:width height:height];
90 | }
91 |
92 | }
93 |
94 | -(void)setSnapshotPath:(NSString*)path
95 | {
96 | if(video)
97 | [self savePicture:path];
98 | }
99 |
100 | - (void)setPaused:(BOOL)paused
101 | {
102 | if(video){
103 | if(paused && _playing){
104 | [self pause];
105 | }
106 | if(_paused){
107 | [self playerStateChanged:PLAYER_STATE_PAUSED];
108 | }else{
109 | [self playerStateChanged:PLAYER_STATE_PLAYING];
110 | }
111 | }
112 | }
113 |
114 | /////////////////
115 |
116 | -(void)setDataSource:(NSString*)uri useTcp:(BOOL)useTcp width:(int)width height:(int)height
117 | {
118 | [self setDisplay:self width:width height:height];
119 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
120 | video = [[RTSPPlayer alloc] initWithVideo:uri usesTcp:useTcp];
121 | if(video == nil){
122 | _errorMsg = @"无法播放";
123 | [self playerStateChanged:PLAYER_STATE_ERROR];
124 | }else{
125 | NSLog(@"width=%i,height=%i",width,height);
126 | video.outputWidth = width;
127 | video.outputHeight = height;
128 | dispatch_async(dispatch_get_main_queue(),^{
129 | [self start];
130 | });
131 | }
132 | });
133 | }
134 |
135 | -(void)start
136 | {
137 | if(video){
138 | [_nextFrameTimer invalidate];
139 | _nextFrameTimer = [NSTimer scheduledTimerWithTimeInterval:1.0/30
140 | target:self
141 | selector:@selector(displayNextFrame)
142 | userInfo:nil
143 | repeats:YES];
144 | [self playerStateChanged:PLAYER_STATE_START];
145 | }
146 | }
147 |
148 | -(void)stop
149 | {
150 | if(video){
151 | _playing = NO;
152 | [_nextFrameTimer invalidate];
153 | _nextFrameTimer = nil;
154 | [self playerStateChanged:PLAYER_STATE_STOPPED];
155 | }
156 | }
157 |
158 | -(void)pause
159 | {
160 | if(video){
161 | _paused = !_paused;
162 | }
163 | }
164 |
165 | -(void)setDisplay:(UIView*)videoView width:(int)width height:(int)height
166 | {
167 | outputWidth = width;
168 | outputHeight = height;
169 |
170 | _videoView = videoView;
171 | NSArray *viewsToRemove = [_videoView subviews];
172 | for (UIView *v in viewsToRemove) {
173 | [v removeFromSuperview];
174 | }
175 |
176 | CGRect frame = CGRectMake(0, 0, width, height);
177 |
178 | if(_useGLView){
179 | [self initGLViewWith:frame];
180 | }else{
181 | [self initImageViewWith:frame];
182 | }
183 |
184 | }
185 |
186 | -(void)initGLViewWith:(CGRect)frame
187 | {
188 |
189 | }
190 |
191 | -(void)initImageViewWith:(CGRect)frame
192 | {
193 | _imageView=[[UIImageView alloc] initWithFrame:frame];
194 | [_imageView setContentMode:UIViewContentModeScaleAspectFill];
195 | [_videoView addSubview:_imageView];
196 | }
197 |
198 | -(void)setFullscreen:(BOOL)isFull
199 | {
200 | CGRect screenBounds = [[UIScreen mainScreen] bounds];
201 | int width = (int)screenBounds.size.width;
202 | int height = (int)screenBounds.size.height;
203 | if(isFull && _fullscreen==NO){
204 | _fullscreen = YES;
205 | CGAffineTransform transform = CGAffineTransformMakeRotation(90 * M_PI/180.0);
206 | if(_useGLView){
207 |
208 | }else{
209 | [_imageView setTransform:transform];
210 | [_imageView setFrame:CGRectMake(0, 0, width,height)];
211 | }
212 | }else if(isFull == NO && _fullscreen == YES){
213 | _fullscreen = NO;
214 | CGAffineTransform transform = CGAffineTransformMakeRotation(0);
215 | if(_useGLView){
216 |
217 | }else{
218 | [_imageView setTransform:transform];
219 | [_imageView setFrame:CGRectMake(0, 0, outputWidth, outputHeight)];
220 | }
221 | }
222 | }
223 |
224 | -(void)setOutputWidth:(int)value
225 | {
226 | outputWidth = value;
227 | }
228 |
229 | -(void)setOutputHeight:(int)value
230 | {
231 | outputHeight = value;
232 | }
233 |
234 |
235 | - (UIImage *)imageFromAVPicture:(AVPicture)pict width:(int)width height:(int)height
236 | {
237 | CGBitmapInfo bitmapInfo = kCGBitmapByteOrderDefault;
238 | CFDataRef data = CFDataCreateWithBytesNoCopy(kCFAllocatorDefault, pict.data[0], pict.linesize[0]*height,kCFAllocatorNull);
239 | CGDataProviderRef provider = CGDataProviderCreateWithCFData(data);
240 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
241 | CGImageRef cgImage = CGImageCreate(width,
242 | height,
243 | 8,
244 | 24,
245 | pict.linesize[0],
246 | colorSpace,
247 | bitmapInfo,
248 | provider,
249 | NULL,
250 | NO,
251 | kCGRenderingIntentDefault);
252 | CGColorSpaceRelease(colorSpace);
253 | UIImage *image = [UIImage imageWithCGImage:cgImage];
254 |
255 | CGImageRelease(cgImage);
256 | CGDataProviderRelease(provider);
257 | CFRelease(data);
258 |
259 | return image;
260 | }
261 |
262 |
263 | - (void)playerStateChanged:(playerState)state
264 | {
265 | switch (state) {
266 | case PLAYER_STATE_PAUSED:
267 | _paused = YES;
268 | //NSLog(@"VLCMediaPlayerStatePaused %i",VLCMediaPlayerStatePaused);
269 | [self._eventDispatcher sendInputEventWithName:@"onVideoPaused"
270 | body:@{
271 | @"target": self.reactTag
272 | }];
273 | break;
274 | case PLAYER_STATE_STOPPED:
275 | //NSLog(@"VLCMediaPlayerStateStopped %i",VLCMediaPlayerStateStopped);
276 | [self._eventDispatcher sendInputEventWithName:@"onVideoStopped"
277 | body:@{
278 | @"target": self.reactTag
279 | }];
280 | break;
281 | case PLAYER_STATE_START:
282 | _paused = NO;
283 | [self._eventDispatcher sendInputEventWithName:@"onVideoStartPlay"
284 | body:@{
285 | @"target": self.reactTag
286 | }];
287 | break;
288 | case PLAYER_STATE_BUFFERING:
289 | _paused = NO;
290 | [self._eventDispatcher sendInputEventWithName:@"onVideoBuffering"
291 | body:@{
292 | @"target": self.reactTag
293 | }];
294 | break;
295 | case PLAYER_STATE_PLAYING:
296 | _paused = NO;
297 | [self._eventDispatcher sendInputEventWithName:@"onVideoPlaying"
298 | body:@{
299 | @"target": self.reactTag
300 | }];
301 | break;
302 | case PLAYER_STATE_ERROR:
303 | [self._eventDispatcher sendInputEventWithName:@"onVideoError"
304 | body:@{
305 | @"target": self.reactTag,
306 | @"error": self.errorMsg
307 | }];
308 | [self _release];
309 | break;
310 | default:
311 | //NSLog(@"state %i",state);
312 | break;
313 | }
314 | }
315 |
316 | #define LERP(A,B,C) ((A)*(1.0-C)+(B)*C)
317 |
318 | -(void)displayNextFrame
319 | {
320 | if(video && _paused)return;//pause
321 | @autoreleasepool {
322 | if (![video stepFrame]) {
323 | [video closeAudio];
324 | return;
325 | }
326 | if(!_playing){
327 | _playing = YES;
328 | [self playerStateChanged:PLAYER_STATE_PLAYING];
329 | }
330 | [self playerStateChanged:PLAYER_STATE_PLAYING];
331 | _imageView.image = video.currentImage;
332 | }
333 | }
334 |
335 | - (NSData *)copYUVData:(UInt8 *)src linesize:(int)linesize width:(int)width height:(int)height {
336 |
337 | width = MIN(linesize, width);
338 | NSMutableData *md = [NSMutableData dataWithLength: width * height];
339 | Byte *dst = md.mutableBytes;
340 | for (NSUInteger i = 0; i < height; ++i) {
341 | memcpy(dst, src, width);
342 | dst += width;
343 | src += linesize;
344 | }
345 | return md;
346 | }
347 |
348 |
349 | - (void)_release
350 | {
351 | if(video){
352 | [self pause];
353 | [self stop];
354 | }
355 | }
356 |
357 | -(void)savePicture:(NSString*)path
358 | {
359 | //构建路径
360 | // NSString *strPath = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:path];
361 | NSLog(@"path=%@",path);
362 | //保存png的图片到app下的Document/saveimg.png
363 | [UIImagePNGRepresentation(_imageView.image) writeToFile:path atomically:YES];
364 | }
365 |
366 | #pragma mark - Lifecycle
367 | - (void)removeFromSuperview
368 | {
369 | [self _release];
370 | [super removeFromSuperview];
371 | }
372 |
373 |
374 | @end
375 |
--------------------------------------------------------------------------------
/ios/PxPlayer/PxPlayer/PxPlayerManager.h:
--------------------------------------------------------------------------------
1 | #import "RCTViewManager.h"
2 |
3 | @interface PxPlayerManager : RCTViewManager
4 |
5 | @end
6 |
--------------------------------------------------------------------------------
/ios/PxPlayer/PxPlayer/PxPlayerManager.m:
--------------------------------------------------------------------------------
1 | #import "PxPlayerManager.h"
2 | #import "PxPlayer.h"
3 | #import "RCTBridge.h"
4 |
5 | @implementation PxPlayerManager
6 |
7 | RCT_EXPORT_MODULE();
8 |
9 | @synthesize bridge = _bridge;
10 |
11 | - (UIView *)view
12 | {
13 | return [[PxPlayer alloc] initWithEventDispatcher:self.bridge.eventDispatcher];
14 | }
15 |
16 | /* Should support: onLoadStart, onLoad, and onError to stay consistent with Image */
17 |
18 | - (NSArray *)customDirectEventTypes
19 | {
20 | return @[
21 | @"onVideoStartPlay",
22 | @"onVideoBuffering",
23 | @"onVideoPlaying",
24 | @"onVideoPaused",
25 | @"onVideoStopped",
26 | @"onVideoError"
27 | ];
28 | }
29 |
30 | - (dispatch_queue_t)methodQueue
31 | {
32 | return dispatch_get_main_queue();
33 | }
34 |
35 | RCT_EXPORT_VIEW_PROPERTY(source, NSDictionary);
36 | RCT_EXPORT_VIEW_PROPERTY(paused, BOOL);
37 | RCT_EXPORT_VIEW_PROPERTY(fullscreen, BOOL);
38 | RCT_EXPORT_VIEW_PROPERTY(snapshotPath, NSString);
39 |
40 |
41 | @end
42 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-native-pxplayer",
3 | "version": "0.1.8",
4 | "description": "A element for react-native,a rtsp player",
5 | "main": "PxPlayer.js",
6 | "license": "MIT",
7 | "keywords": [
8 | "pxplayer",
9 | "video",
10 | "player",
11 | "rtsp"
12 | ],
13 | "author": {
14 | "name": "xiongchuan",
15 | "email": "xiongchuan86@vip.qq.com"
16 | },
17 | "homepage": "https://github.com/xiongchuan86/react-native-pxplayer",
18 | "repository": {
19 | "type": "git",
20 | "url": "https://github.com/xiongchuan86/react-native-pxplayer.git"
21 | },
22 | "devDependencies": {
23 |
24 | },
25 | "dependencies": {
26 | }
27 | }
28 |
--------------------------------------------------------------------------------