Git Product home page Git Product logo

react-native-yz-vlcplayer's Introduction

react-native-yz-vlcplayer

A <VLCPlayer> component for react-native 此项目 参考react-native-videoreact-native-vlcplayer, react-native-vlc-player

VLCPlayer 支持各种格式(mp4,m3u8,flv,mov,rtsp,rtmp,etc.),具体参看vlc wiki

https://code.videolan.org/videolan/VLCKit

Example project

https://github.com/xuyuanzhou/vlcplayerExample

Xcode10+ 的一些问题

(1)libstdc++.6.0.9.tbd 找不到 在Xcode10中,libstdc++.6.0.9.tbd被移除掉了,我们也移除掉它就OK了

(2)编译卡死的情况(目前只能等官方修正这个问题)

https://forums.developer.apple.com/thread/107570

(1)去除DSYM

项目 Build Settings --> Build Options --> Debug Information Format 设置为 DWARF.

(2)改为Xcode10以下版本编译

install

 `npm install react-native-yz-vlcplayer --save`

android setup

android vlc-sdk from:https://github.com/mengzhidaren/Vlc-sdk-lib

step 1:

Run react-native link react-native-yz-vlcplayer

ios setup

combined from react-native-vlcplayer

reference: https://code.videolan.org/videolan/VLCKit

step 1:

Run react-native link react-native-yz-vlcplayer

step 2:

download MobileVLCKit.framework from nightlies.videolan.org/build/iOS/

step 3:

create a folder named vlcKit, and copy MobileVLCKit.framework in this folder.

step 4:

In XCode, in the project navigator, right click Frameworks -> Add Files to [your project's name], go to /vlckit and add MobileVLCKit.framework

step 5:

add framework search path: $(PROJECT_DIR)/../vlcKit

step 6:

Select your project. Add the following libraries to your project's Build Phases -> Link Binary With Libraries:

  • AudioToolbox.framework
  • VideoToolbox.framework
  • CoreMedia.framework
  • CoreVideo.framework
  • CoreAudio.framework
  • AVFoundation.framework
  • MediaPlayer.framework
  • libstdc++.6.0.9.tbd
  • libiconv.2.tbd
  • libc++.1.tbd
  • libz.1.tbd
  • libbz2.1.0.tbd

step 7:

set Enable Bitcode to no

Build Settings ---> search Bitcode

step 8:

set project deployment target 9.3

other react-native plugins

  1. npm install react-native-orientation --save

    react-native link react-native-orientation

  2. npm install react-native-slider --save

  3. npm install react-native-vector-icons --save

    react-native link react-native-vector-icons

Static Methods

seek(seconds)

android:
    this.vlcplayer.seek(100); //  unit(单位)  ms
ios:
    this.vlcplayer.seek(0.1); //  0 --- 1 视频位置进度


this.vlcPlayer.resume(autoplay) //重新加载视频进行播放,autopaly: true 表示播放 false表示暂停

this.vlcPlayer.play(bool)       // true: play the video   false: paused the video


this.vlcPlayer.snapshot(path)  // path: string  存储的文件的路径。


VLCPlayer props

import { VLCPlayer } from 'react-native-yz-vlcplayer';
props type value describe
paused bool
muted bool
volume bool 0---200
hwDecoderEnabled number 0 or 1 (Only android) need use with hwDecoderForced
hwDecoderForced number 0 or 1 (Only android) need use with hwDecoderEnabled
initType number
initOptions array
mediaOptions object
source object { uri: 'http:...' }
autoplay bool 是否自动播放(默认false)
onLoadStart func vlc视频容器初始化完毕
onOpen func 视频被打开
onBuffering func 正在缓冲中
onProgress func { currentTime:1000,duration:1000 } unit:ms 视频进度发生改变
onEnd func 视频播放结束
onPlaying func 视频正在播放
onPaused func 视频暂停
onError func 播放视频出错
onStopped func 视频停止播放(直播视频请根据这个判断)
onIsPlaying func {isPlaying:true} 视频是否正在播放
   initType:   1,2     default value: 1
     example:
          ios:
                1: [[VLCMediaPlayer alloc] init]
                2: [[VLCMediaPlayer alloc] initWithOptions:options];

initOptions:

https://wiki.videolan.org/VLC_command-line_help

https://www.cnblogs.com/waimai/p/3342739.html

   onBuffer:

     android: {
                 isPlaying: true,
                 bufferRate: 70,
                 duration: 0,
              }

         ios: {
                duration: 0,
                isPlaying: true,
              }

   onProgress:

             {
                 currentTime: 1000        ms
                 duration: 5000           ms
             }

   onIsPlaying:

             {
                 isPlaying: true
             }



回调函数简单说明(目前碰到的)

                                                            支持平台
          onEnd            视频播放结束                  ios       android
          onBuffering      正在缓冲中                    ios       android
          onError          播放视频出错
          onPlaying        视频播放                      ios       android
          onPaused         视频暂停                      ios       android
          onOpen           视频被打开                              android
          onLoadStart      vlc视频容器初始化完毕          ios       android
          onProgress       视频进度发生改变               ios       android          swf格式不支持

          回调函数出现顺序:  onLoadStart  ---> onOpen

use plugin

   import { VLCPlayer, VlCPlayerView } from 'react-native-yz-vlcplayer';
   import Orientation from 'react-native-orientation';

   (1)
       android:
           this.vlcplayer.seek(100); // 单位是 ms
       ios:
           this.vlcplayer.seek(0.1); // 0 --- 1 视频位置进度
  (2)
       <VLCPlayer
           ref={ref => (this.vlcPlayer = ref)}
           style={[styles.video]}
           /**
            *  增加视频宽高比,视频将按照这个比率拉伸
            *  不设置按照默认比例
            */
           videoAspectRatio="16:9"
           /**
            *  是否暂停播放
            */
           paused={this.state.paused}
           /**
            *  资源路径
            *  暂不支持本地资源
            */
           source={{ uri: this.props.uri}}
           /**
            *  进度
            *  返回 {currentTime:1000,duration:1000}
            *  单位是 ms
            *  currentTime: 当前时间
            *  duration:    总时间
            */
           onProgress={this.onProgress.bind(this)}
           /**
            *  视频播放结束
            */
           onEnd={this.onEnded.bind(this)}
           /**
            * 正在缓存中
            */
           onBuffering={this.onBuffering.bind(this)}
           /**
            * 播放视频出错
            */
           onError={this._onError}
           /**
            * 视频停止
            */
           onStopped={this.onStopped.bind(this)}
           /**
            * 视频播放
            */
           onPlaying={this.onPlaying.bind(this)}
           /**
            * 视频暂停
            */
           onPaused={this.onPaused.bind(this)}
           /**
            * 视频被打开
            /
           onOpen={this._onOpen}
           /**
            * vlc视频容器初始化完毕
            * 在这里进行设置播放的进度,是否开始播放
            */
           onLoadStart={()=>{
                   if(Platform.OS === 'ios'){
                       this.vlcPlayer.seek(0); //设置播放进度
                   }else{
                       this.vlcPlayer.seek(0); //设置播放的时间
                   }
                   this.setState({
                     paused: true,
                   },()=>{
                     this.setState({
                       paused: false,
                     });
                   })
           }}
       />

可用的源

香港财经,rtmp://202.69.69.180:443/webcast/bshdlive-pc

湖南卫视,rtmp://58.200.131.2:1935/livetv/hunantv

rtsp://184.72.239.149/vod/mp4://BigBuckBunny_175k.mov

版本简单说明

    1.1.1-beta7:
        (1) 增加  autoAspectRatio  bool  (only  on  Android)
            占满Android满屏

Simple Example

   (1)
      1. npm install react-native-orientation --save

         react-native link react-native-orientation

      2. npm install react-native-slider --save

      3. npm install react-native-vector-icons --save

         react-native link react-native-vector-icons

   (2)

       import { VLCPlayer, VlcSimplePlayer } from 'react-native-yz-vlcplayer';
       import Orientation from 'react-native-orientation';





       <VlcSimplePlayer
           ref={ ref => this.vlCPlayerView = ref}
           url={"rtmp://live.hkstv.hk.lxdns.com/live/hks"}
           Orientation={Orientation}
       />

       注意:
        《1》插件默认用了如下所示的宽高比(1.1.1-beta1及以下)
            fullVideoAspectRatio: deviceHeight + ':' + deviceWidth,
            videoAspectRatio: deviceWidth + ':' + 211.5,
            (1)在竖屏情况下画面比例会出现问题,请自行设置宽高比或去除内置宽高比
            (2)非全屏下修改了默认高度的话,请自行设置宽高比或去除内置宽高比
                去除内置宽高比:
                            fullVideoAspectRatio={""}
                            videoAspectRatio={""}
        《2》默认不会自动播放,需要自动播放请添加如下参数
             autoplay={true}

        《3》 你可以自定义文字用以下参数:
                endingViewText: {
                    endingText: '视频播放结束',
                    reloadBtnText: '重新播放',
                    nextBtnText: '下一个'
                },
                errorViewText: {
                    errorText: '视频播放出错',
                    reloadBtnText: '重新播放',
                },
                vipEndViewText: {
                    vipEndText: '试看结束',
                    boughtBtnText: '请购买后观看立即购买',
                },

      下面是可用的一些参数:

       static propTypes = {

        /**
            * vlc 播放类型相关
            */
               //广告初始化类型
               initAdType: PropTypes.oneOf([1,2]),
               //广告初始化参数
               initAdOptions: PropTypes.array,

               //视频初始化类型
               initType: PropTypes.oneOf([1,2]),
               //视频初始化参数
               initOptions: PropTypes.array,

           /**
            * 直播相关
            */
                //是否直播
                isLive: PropTypes.bool,
                //是否自动reload  live
                autoReloadLive: PropTypes.bool,

           /**
            * 广告相关
            */
               //是否显示广告
               showAd:  PropTypes.bool,
               //广告url
               adUrl: PropTypes.oneOfType([PropTypes.string,PropTypes.number]).isRequired,
               //重新加载包括广告
               reloadWithAd: PropTypes.bool,
               //广告头播放结束
               onAdEnd: PropTypes.func,
               //广告是否在播放
               onIsAdPlaying: PropTypes.func,


           /**
            * 屏幕相关
            */
           // 以全屏初始化
           initWithFull: PropTypes.bool,
           //开启全屏回调函数
           onStartFullScreen: PropTypes.func,
           //关闭全屏回调函数
           onCloseFullScreen: PropTypes.func,

           /**
            * 视频相关
            */

               //视频路径:
                    //string:  本地或者网络资源路径
                    //number:  require('./resource/1.mp4')
               url: PropTypes.oneOfType([PropTypes.string,PropTypes.number]).isRequired,
               //视频播放结束
               onEnd: PropTypes.func,
               //是否在播放
               onIsPlaying: PropTypes.func,
               //已经观看时间
               lookTime: PropTypes.number,
               //总时间
               totalTime: PropTypes.number,
               //是否有下一视频源
               hadNext: PropTypes.bool,
               //自动播放下一个视频
               autoPlayNext: PropTypes.bool,
               //自动重复播放
               autoRePlay: PropTypes.bool,


           /**
            * 样式相关
            */
               //视频样式
               style: PropTypes.object,
               //全屏视频样式
               fullStyle: PropTypes.object,
               //是否需要考虑statusBar   only for ios
               considerStatusBar: PropTypes.bool,
               //是否显示顶部
               showTop: PropTypes.bool,
               //标题
               title: PropTypes.string,
               //是否显示标题
               showTitle: PropTypes.bool,
               //是否显示返回按钮
               showBack: PropTypes.bool,
               //返回按钮点击事件
               onLeftPress: PropTypes.func,

           /**
            * vip相关
            */
               //是否使用vip
               useVip: PropTypes.bool,
               //非vip观看长度
               vipPlayLength: PropTypes.number,

         };

    /**
     * Sample React Native App
     * https://github.com/facebook/react-native
     *
     * @format
     * @flow
     */

    import React, {Component} from 'react';
    import {StyleSheet, View} from 'react-native';
    import {VlcSimplePlayer, VLCPlayer}  from 'react-native-yz-vlcplayer';


    export default class App extends Component<Props> {
        render() {
            return (
                <View style={styles.container}>
                <VlcSimplePlayer
                    autoplay={false}
                    url='rtsp://184.72.239.149/vod/mp4://BigBuckBunny_175k.mov'
                    initType={2}
                    hwDecoderEnabled={1}
                    hwDecoderForced={1}
                    initOptions={[
                        "--no-audio",
                        "--rtsp-tcp",
                        "--network-caching=" + 150,
                        "--rtsp-caching=" + 150,
                        "--no-stats",
                        "--tcp-caching=" + 150,
                        "--realrtsp-caching=" + 150,
                    ]}
                />
                <VLCPlayer
                    style={{width:"100%",height:200,marginTop:30}}
                    source={{uri:'rtsp://184.72.239.149/vod/mp4://BigBuckBunny_175k.mov'}}
                    initType={2}
                    initOptions={[
                        "--network-caching=" + 150,
                        "--rtsp-caching=" + 150,
                        "--no-stats",
                        "--tcp-caching=" + 150,
                        "--realrtsp-caching=" + 150,
                    ]}
            />
            </View>
        );
        }
    }

    const styles = StyleSheet.create({
        container: {
            flex: 1,
            justifyContent: 'center',
            alignItems: 'center',
            backgroundColor: '#F5FCFF',
        },
    });

MIT Licensed

react-native-yz-vlcplayer's People

Contributors

maximilize avatar xuyuanzhou 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

react-native-yz-vlcplayer's Issues

run-android 报错

嗨,我有问题想请教,按照你的步骤进行操作,讲道理android应该没问题,但是run-android的时候报错Could not resolve all files for configuration ':react-native-yz-vlcplayer:debugCompileClasspath'.
请问如何解决?

如何在页面关闭时销毁播放实例?

现在安卓和 ios 多次进入播放页面后好像都有问题,会有卡死或闪退的情况。
初步判断是页面关闭后没有销毁播放实例,有具体的方法吗

Build IOS

Hi,
if I try download the packages on site:
nightlies.videolan.org/build/iOS/
after try extract the component in archive, I have a problem, the Mac no extract directory, but make an other archive, I try too with other software for archive, but the results are equal.
I have try open in windows and after send to Mac , but when I try open in Mac open alert archive damaged
can we help me?
and the libstdc++.6.0.9.tbd is deprecated, how resolve this ?

iOS 编译报错: duplicate symbol

项目中导入了amap3d和yz-vlcplayer,编译时出现
duplicate symbol _png_check_chunk_length in: Pods/AMap3DMap/MAMapKit.framework/MAMapKit(MAMapKit-x86_64-master.o) VLCKit/MobileVLCKit.framework/MobileVLCKit(pngrutil.o)
请问要怎么处理这个问题呢

Installation problem

I have the problem with installation. I follow all steps from readme, but I got this error:

'MobileVLCKit/MobileVLCKit.h' file not found in RCTVLCPlayer.m

I downloaded this MobileVLCKit framework:
MobileVLCKit-3.0-pre-20180822-0635.tar.xz 22-Aug-2018 06:05 269M

Anyone has the same problem?

QUESTION

It is possible modify getErrorView in playerViewByMethod/index.js without modify your code ?

Because i need to show some error in english.

Thanks in advance.

react-native error

This is not working for me, I copied this from github readme:

<VlCPlayerViewByMethod
           ref={ ref => this.vlCPlayerView = ref}
           //onVipPress={this._onVipPress.bind(this)}
           autoPlay={true}
           url={"rtmp://live.hkstv.hk.lxdns.com/live/hks"}
           onLeftPress={() => {
           }}
           onProgressChange={this._onProgressChange}
           //title={title}
           //showTitle={true}
           //showBack={true}
           //lookTime={timeStudied}
           //totalTime={timeTotal}
           //useVip={!hadOwn}
           onEnd={this._onEnd}
           Orientation={Orientation}
           //BackHandle={BackHandle}
           //autoPlayNext={false}
           //autoRePlay={false}
           //hadNext={false}
           showAd={true}
           adUrl="http://bxyzweb.doctorz.cn/ofafilm/03.swf"
           //chapterElements={this._renderList()}
           onStartFullScreen={() => {
             this.setState({
               isFull: true,
             });
           }}
           onCloseFullScreen={() => {
             this.setState({
               isFull: false,
             });
           }}
        />

This is error that is showing in simulator:

screen shot 2018-08-24 at 12 21 07

How to solve this problem?

Only play audio ?

Is it possible to play only audio in 2.6 without showing any video?

Archive Error iOS

if try archive project iOS , I have this error:

Strip /Users/user/Library/Developer/Xcode/DerivedData/player-gmmcnsshbqbynlcwphkqyfqtkkwa/Build/Intermediates.noindex/ArchiveIntermediates/player/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libyoga.a (in target: yoga)
cd /Users/user/Desktop/player/node_modules/react-native/React
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip -S -T /Users/user/Library/Developer/Xcode/DerivedData/player-gmmcnsshbqbynlcwphkqyfqtkkwa/Build/Intermediates.noindex/ArchiveIntermediates/player/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/libyoga.a

fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip: can't open temporary file: /tmp/strip.T1DJzz (No such file or directory)
Command Strip failed with a nonzero exit code

can you help me?

Android Crashes

Hi, I just installed this module and tested on ios and android.
My iphone works well on iOS 12.1.2 with webm / mp4
But my android 8.1.0 crashes app with same video as soon as open video. (with both webm / mp4)

App crashes ONLY RELEASE VERSION and works well with DEBUG MODE

I attached my code

<VlcSimplePlayer
          ref={(ref) => { this.player = ref; }}
          url={this.props.source}
          muted={this.state.isMuted}
          paused={!this.state.isPlaying}
          initWithFull
          autoplay
          showTop
          showBack
          onLeftPress={Actions.pop}
          onBuffering={this.onBuffer}
          onLoadStart={this.onLoadStart}
          onPlaying={this.onPlaying}
          onEnd={this.onEnd}
          onError={this.onError}
          endingViewText={{reloadBtnText: 'Reload'}}
          errorViewText={{
            errorText: 'Player Error',
            reloadBtnText: 'Reload',
          }}
          />

logcat logs

01-30 14:57:28.784   634   634 E SELinux : avc:  denied  { find } for interface=vendor.lge.hardware.configstore::IConfigStore pid=18339 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:hal_lge_configstore_hwservice:s0 tclass=hwservice_manager permissive=0
01-30 14:57:28.828 18339 18339 E VLC/JNI/VLCObject: FindClass(org/videolan/libvlc/Dialog) failed
01-30 14:57:28.828 18339 18339 E VLC     : VLCJNI_OnLoad failed
01-30 14:57:28.828 18339 18339 E VLC/LibVLC: Can't load vlcjni library: java.lang.UnsatisfiedLinkError: JNI_ERR returned from JNI_OnLoad in "/data/app/com.zyteapp.zyteapp-8OGAdTSQbRDyvO_X1Uqj6A==/lib/arm/libjniloader.so"
01-30 14:57:28.942  2151  2386 E InputDispatcher: channel 'f39613e com.zyteapp.zyteapp/com.zyteapp.zyteapp.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
01-30 14:57:28.996  2151  2167 E zygote64: Error encountered killing process cgroup uid 99261 pid 18408: No such file or directory
01-30 14:57:29.045 19014 19055 E PBSessionCacheImpl: sessionId[83626005086860281] not persisted.
01-30 14:57:29.454  1791  1791 E MSM-irqbalance: IRQ 81 not found in internal structure or should be ignored
01-30 14:57:29.601   858   926 E ANDR-PERF-OPTSHANDLER: perf_lock_rel: updated /sys/class/scsi_host/host0/../../../clkscale_enable with 1
01-30 14:57:29.601   858   926 E ANDR-PERF-OPTSHANDLER:  return value 2

Player flickers to a blank screen when bandwidth is low

The player in iOS devices flickers to a blank screen when the network bandwidth is low. However, this issue is not seen when on Android devices, or even iOS emulator.
We have tried increasing all cache levels ( up to 1500 ) but the problem still persists.
It seems to be a iOS player issue. With Android, when bandwidth is low, the screen just freezes which is acceptable.
Does anyone have a solution to this problem?
Thanks.

IMG_0141
IMG_0142

XCode 10: Build never completes

I downloaded the sample projects and did same all steps on install tutorials. Android works fine for me, but iOS project cannot built. It was running very slow, frozen OS and restarted for a while. Could you please try to reproduce and resolve this issue? My XCode versionL 10.0

Thank you so much!

QUESTION

With which version of android is this version of the pluin compatible?

支持react-native 0.44.3吗?引入link后报support v4错误

file:/Users/sierra/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v4/26.1.0/support-v4-26.1.0.pom
file:/Users/sierra/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v4/26.1.0/support-v4-26.1.0.jar
file:/Users/sierra/Desktop/new/cwpapp_native/android/sdk-manager/com/android/support/support-v4/26.1.0/support-v4-26.1.0.jar
Required by:
cwp_app_native:react-native-yz-vlcplayer:unspecified > com.facebook.react:react-native:0.44.3 > com.android.support:appcompat-v7:23.0.1
请问该如何解决???

VLCPlayerView not working, white screen only showing

Dear xuyuanzhou,

I used VlCPlayer and it run ok. But i try use VlCPlayerView is not working. Phone display white screen. Below is my code:

<VlCPlayerView
autoplay={true}
url="http://cdn.goluk.cn/video/t1_2.mp4"
Orientation={Orientation}
//BackHandle={BackHandle}
ggUrl=""
showGG={false}
showTitle={true}
title="Test video"
showBack={true}
onLeftPress={()=>{}}
startFullScreen={() => {
this.setState({
isFull: true,
});
}}
closeFullScreen={() => {
this.setState({
isFull: false,
});
}}
/>

建议在增加一个硬件加速开关属性

大神,你好,经过一段时间的使用,我发vlc在android上开启硬件加速的话,会有一些兼容性问题,建议将硬件加速的属性设置暴露给js,比如叫haEnabled。这样方便在各种机型上进行调试。

如何播放file://目录下的视频

react-native-camera录制的视频,存放于file://路径下,使用VlcSimplePlayer传入url={"file://****"}无法播放,目前只能上传服务器后再播放。
请作者添加播放file://视频功能,感谢。

Android black screen

Can you provide solution for this problem?
Code is same for both platforms.

`

Welcome to React Native!
To get started, edit App.js
{instructions}

    <VlcSimplePlayer
       ref={ ref => this.vlCPlayerView = ref}
       url={"rtmp://live.hkstv.hk.lxdns.com/live/hks"}
       Orientation={Orientation}                          
   />
  </View>

`

I am using this dependencies:

"react": "16.6.0-alpha.8af6728",
    "react-native": "0.57.3",
    "react-native-firebase": "^5.0.0",
    "react-native-orientation": "^3.1.3",
    "react-native-slider": "^0.11.0",
    "react-native-vector-icons": "^6.0.2",
    "react-native-yz-vlcplayer": "^1.1.0"

screen shot 2018-10-15 at 16 44 59

How to use VlcPlayerViewByMerhod functions

How can I use functions like onPlaying, onOpen...?
How can I pause video on loading, or not autoplay?

I use this code, and rtsp live stream:


<VlCPlayerViewByMethod
               ref={ ref => this.vlCPlayerView = ref}
               onVipPress={this._onVipPress.bind(this)}
               autoPlay={true}
               url={"rtmp://live.hkstv.hk.lxdns.com/live/hks"}
               onLeftPress={() => {
               }}
               onProgressChange={this._onProgressChange}
               //title={title}              
               //showTitle={true}
               //showBack={true}
               //lookTime={timeStudied}
               //totalTime={timeTotal}
               //useVip={!hadOwn}
               onEnd={this._onEnd}
               Orientation={Orientation}
               BackHandle={BackHandle}
               //autoPlayNext={false}
               //autoRePlay={false}
               //hadNext={false}
               showAd={true}
               adUrl="http://bxyzweb.doctorz.cn/ofafilm/03.swf"             
               //chapterElements={this._renderList()}
               onStartFullScreen={() => {
                 this.setState({
                   isFull: true,
                 });
               }}
               onCloseFullScreen={() => {
                 this.setState({
                   isFull: false,
                 });
               }}
            />

Could you provide some examples?

RTSP Caching

Hello I'm working on a video application with an RTSP stream. Is it possible to reduce latency in another way than :

initOptions={[ "--rtsp-tcp", "--network-caching=" + 0, "--rtsp-caching=" + 0, "--tcp-caching=" + 0, "--realrtsp-caching=" + 0, ]}
Thanks.

[Q] Audio analysis

Hi xuyanzhou, I was wondering if you had any plan to integrate audio analysis callbacks to create, for example, a volume meter so it would be possible to provide an audio volume feedback.

Thank you for your work.
It was plug and play for my Android application, good job !

Alann

Can't play video via http

Hello there, thanks for awesome library.But currently what am I facing is , I can't play video via http.
Is there any ways to play video via http ?
Thanks.

Issue with RTP over RTSP

I'm using VLC player to play real-time stream from a RTSP camera , so I did enable --rtsp-tcp as an init option. Camera is opening as a new screen when user press on a button.

Player working correctly when I press the camera button , but if I go back open it or another camera it returns following error.

Screen Shot 2562-05-09 at 10 57 09 AM

my player is like

<VlcSimplePlayer
    url={"rtsp://......"}
    autoplay={true}
    isLive={true}
    autoReloadLive={true}
    style={{width: "100%", height: 200, marginTop: 30}}
    onStartFullScreen={this.onStartFullScreen}
    onCloseFullScreen={this.onCloseFullScreen}
    initOptions={[
        "--rtsp-tcp"
    ]}
    hwDecoderEnabled={1}
   hwDecoderForced={1}
/>

xCode 10: build never completes

I downloaded the sample projects and did same all steps on install tutorials. Android works fine for me, but iOS project cannot built. It was running very slow, frozen OS and restarted for a while. Could you please try to reproduce and resolve this issue? My XCode versionL 10.0

Thank you so much!

改进建议

  • api改进建议

1 举例,startFullScreen是一个事件,建议改名为onStartFullScreen
2 广告,建议用英文缩写Ad,其他相关的,比如ggUrl改成adUrl,showGG改成showAd
3 根据最新的vlc,暴露snapshot(截图)和record(录像)的相关方法,android我已经尝试过了,但是没有ios环境,没有尝试

  • bug

1 播放rtsp实时视频时,因为取不到视频总长度,所以play/pause按钮的初始状态是不对的

onProgress事件的改进

在直播的时候,onProgress的当前时间还有时长都是0,但是vlc播放的过程中确实会不断的发出这个事件。这个事件发生的时候hasVideoOut是YES,但是大神你的代码中不抛出这个事件。这样在直播的时候就没有办法可以让我通过事件判断hasVideoOut的状态了。建议把此处判断当前时间和时长的代码去掉,这样从逻辑上是没问题的,虽然数据上有点奇怪。

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.