Code Monkey home page Code Monkey logo

react-native-video-project's Introduction

微信交流群,扫码加入(微信群不能加入的,加我vx:inskimi 我邀请你)

https://raw.githubusercontent.com/ikimiler/react-native-video-project/master/picture/TIM%E6%88%AA%E5%9B%BE20191106090439.png

一个基于react-native的纯跨平台的影视项目,欢迎大家star

此项目经过线上考验,仅供大家学习参考

!!!强烈建议大家分别编译下双端以亲身体会react native的魅力!!!

很多小伙伴会遇到编译不通过,或者直接体验apk,下载地址请看这里https://wwa.lanzoui.com/id07vja

ios端错误统计

https://raw.githubusercontent.com/andmizi/react-native-video-project/master/picture/TIM%E6%88%AA%E5%9B%BE20190218144258.png

ios运营统计

https://raw.githubusercontent.com/andmizi/react-native-video-project/master/picture/TIM%E6%88%AA%E5%9B%BE20190218144313.png

android端错误统计

https://raw.githubusercontent.com/andmizi/react-native-video-project/master/picture/TIM%E6%88%AA%E5%9B%BE20190218144346.png

android运营统计

https://raw.githubusercontent.com/andmizi/react-native-video-project/master/picture/TIM%E6%88%AA%E5%9B%BE20190218144336.png

软件截图

安卓首页

ios首页

安卓频道分类

ios频道分类

安卓播放页

ios播放页

功能要点:

  • m3u8视频播放,支持手势快进后退,倍数播放
  • m3u8视频缓存(单线程模式),暂不支持断点续传
  • 列表页通用封装
  • realm数据库使用
  • codepush热更新使用
  • react-navigation路由导航
  • redux框架

此套代码移除了网络层以及codepush热更新,需要的可以自己配置。

运行android:

  1. 先安装node,然后安装react-native 命令:npm install -g react-native-cli
  2. 在项目根目录执行npm install
  3. 在node-modules/react-native-video/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView 第 710 行把判断语句去除掉
  4. react-native run-android,如果报错,请用android studio先构建一遍,然后执行 react-native run-android

运行ios:

  1. 先安装node,然后安装react-native 命令:npm install -g react-native-cli
  2. 在项目根目录执行npm install
  3. 在node-modules/react-native-video/ios/RCTVideo.m 第394行,加入 if([uri isEqualToString:@""]){ return nil; }
  4. react-native run-ios

tips:

1.有朋友反馈说运行出来后图片加载不出来,是因为远程图片失效的问题,具体修改data.json 里的coverUrl字段

如果编译安卓/ios遇到错误,请提issuess

最后给你们要一个star O(∩_∩)O

react-native-video-project's People

Contributors

ikimiler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-video-project's Issues

无法运行

1-:使用npm i或者npm install 无法安装依赖
根据提示:可能是realm无法下载的
2-:使用yarn无法安装依赖

ld: library not found for -lRealmReact ios编译报错

** BUILD FAILED **

The following build commands failed:

Ld /Users/lee/Desktop/react-native-video-project-master/ios/build/Build/Products/Debug-iphonesimulator/colavideoapp.app/colavideoapp normal x86_64

(1 failure)

Installing build/Build/Products/Debug-iphonesimulator/colavideoapp.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/colavideoapp.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/colavideoapp.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

at checkExecSyncError (child_process.js:616:11)
at Object.execFileSync (child_process.js:634:15)
at /Users/lee/Desktop/react-native-video-project-master/node_modules/react-native/local-cli/runIOS/runIOS.js:208:5

如何解析本地的m3u8

开发过程发现缓存本地的m3u8无法播放,请问是如何播放本地的m3u8文件的,用本地代理可以正常播放,但是用file://无法播放,请问这个是怎样实现本地播放的

编译出错

编译出错
Could not find method register() for arguments [forwardDebugPort, class org.gradle.api.tasks.Exec, build_7oyalcyumyz7bb78lvycvtkae$_run_closure2@147833f8] on task set of type org.gradle.api.internal.tasks.DefaultTaskContainer.

请问这是什么问题?

node版本高安装依赖报错

node版本v12.16.3
报错信息:
error E:\www\react-navite\react-native-video-project\node_modules\realm: Command failed.
Exit code: 1
Command: node-pre-gyp install --fallback-to-build
Arguments:
Directory: E:\www\react-navite\react-native-video-project\node_modules\realm
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using [email protected]
node-pre-gyp info using [email protected] | win32 | x64
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp info check checked for "E:\www\react-navite\react-native-video-project\node_modules\realm\compiled\node-v72_win32_x64\realm.node" (not found)
node-pre-gyp http GET https://static.realm.io/node-pre-gyp/2.29.2/realm-v2.29.2-node-v72-win32-x64.tar.gz
node-pre-gyp http 404 https://static.realm.io/node-pre-gyp/2.29.2/realm-v2.29.2-node-v72-win32-x64.tar.gz
node-pre-gyp WARN Tried to download(404): https://static.realm.io/node-pre-gyp/2.29.2/realm-v2.29.2-node-v72-win32-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v72 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp http 404 status code downloading tarball https://static.realm.io/node-pre-gyp/2.29.2/realm-v2.29.2-node-v72-win32-x64.tar.gz

E:\www\react-navite\react-native-video-project\node_modules\realm>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gy
p.js" clean ) else (node "" clean )
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp info ok

E:\www\react-navite\react-native-video-project\node_modules\realm>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gy
p.js" configure --fallback-to-build --module=E:\www\react-navite\react-native-video-project\node_modules\realm\compiled\node-v72_win32_x64\realm.node --module_name=realm --module_path=E:\www\react-navite\re
act-native-video-project\node_modules\realm\compiled\node-v72_win32_x64 --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72 ) else (node "" configure --fallback-to-build
--module=E:\www\react-navite\react-native-video-project\node_modules\realm\compiled\node-v72_win32_x64\realm.node --module_name=realm --module_path=E:\www\react-navite\react-native-video-project\node_modul
es\realm\compiled\node-v72_win32_x64 --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72 )
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp info find Python using Python version 3.8.2 found at "D:\Program Files\Python\Python38-32\python.exe"
gyp ERR! find VS
gyp ERR! find VS msvs_version not set from command line or npm config
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer
gyp ERR! find VS looking for Visual Studio 2015
gyp ERR! find VS - not found
gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
gyp ERR! find VS
gyp ERR! find VS **************************************************************
gyp ERR! find VS You need to install the latest version of Visual Studio
gyp ERR! find VS including the "Desktop development with C++" workload.
gyp ERR! find VS For more information consult the documentation at:
gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
gyp ERR! find VS **************************************************************
gyp ERR! find VS
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Visual Studio installation to use
gyp ERR! stack at VisualStudioFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
gyp ERR! stack at ChildProcess.exithandler (child_process.js:310:5)
gyp ERR! stack at ChildProcess.emit (events.js:310:20)
gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to-build" "--module=E:\www\react-nav
ite\react-native-video-project\node_modules\realm\compiled\node-v72_win32_x64\realm.node" "--module_name=realm" "--module_path=E:\www\react-navite\react-native-video-project\node_modules\realm\c
ompiled\node-v72_win32_x64" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
gyp ERR! cwd E:\www\react-navite\react-native-video-project\node_modules\realm
gyp ERR! node -v v12.16.3
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd configure --fallback-to-build --module=E:\www\react-navite\react-native-video-project\node_modules\realm\compiled\node-v72_win32_x64\realm.node
--module_name=realm --module_path=E:\www\react-navite\react-native-video-project\node_modules\realm\compiled\node-v72_win32_x64 --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_labe
l=node-v72' (1)
node-pre-gyp ERR! stack at ChildProcess. (E:\www\react-navite\react-native-video-project\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:310:20)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
node-pre-gyp ERR! System Windows_NT 10.0.18362
node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "E:\www\react-navite\react-native-video-project\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd E:\www\react-navite\react-native-video-project\node_modules\realm
node-pre-gyp ERR! node -v v12.16.3
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp.cmd configure --fallback-to-build --module=E:\www\react-navite\react-native-video-project\node_modules\realm\compiled\node-v72_win32_x64\realm.node --module_name=realm --module_p

不能看

视频也不能下载。。下载100% 就提示资源错误 重试

而且只能下载一集,不能再加入。。。
确定是线上用的么~~~

设备安卓~

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.