File tree Expand file tree Collapse file tree 6 files changed +255
-22
lines changed
android/src/main/java/com/ghondar/vlc Expand file tree Collapse file tree 6 files changed +255
-22
lines changed Original file line number Diff line number Diff line change @@ -49,8 +49,9 @@ public Map getExportedCustomDirectEventTypeConstants() {
4949 @ ReactProp (name = PROP_SOURCE )
5050 public void setPath (final VlcPlayerView playerView , ReadableMap map ) {
5151 String path = map .getString ("uri" );
52+ int currentSize = map .getInt ("currentSize" );
5253 boolean autoPlay = map .getBoolean ("autoplay" );
53- Log . d ( "data:" , path );
54+ playerView . setCurrentSize ( currentSize );
5455 playerView .setAutoPlay (autoPlay );
5556 playerView .setFilePath (path );
5657 }
Original file line number Diff line number Diff line change @@ -297,6 +297,10 @@ public void setAutoPlay(boolean autoPlay) {
297297 this .autoPlay = autoPlay ;
298298 }
299299
300+ public void setCurrentSize (int currentSize ) {
301+ mCurrentSize = currentSize ;
302+ }
303+
300304 /**
301305 * Play or pause the media.
302306 */
Original file line number Diff line number Diff line change 99 */
1010
1111import React , { Component } from 'react' ;
12- import {
13- StyleSheet ,
14- View
15- } from 'react-native' ;
12+ import { StyleSheet , View } from 'react-native' ;
1613
17- import VlcPlayer from 'react-native-vlc-player' ;
14+ import VlcPlayer , { SURFACE_16_9 } from 'react-native-vlc-player' ;
1815
1916export default class App extends Component {
2017 vlcplayer = React . createRef ( ) ;
2118
2219 componentDidMount ( ) {
23- console . log ( this . vlcplayer )
20+ console . log ( this . vlcplayer ) ;
2421 }
2522
2623 render ( ) {
2724 return (
28- < View
29- style = { [
30- styles . container
31- ] } >
25+ < View style = { [ styles . container ] } >
3226 < VlcPlayer
3327 ref = { this . vlcplayer }
3428 style = { {
3529 width : 300 ,
3630 height : 200 ,
3731 } }
32+ currentSize = { SURFACE_16_9 }
3833 paused = { false }
3934 autoplay = { true }
4035 source = { {
4136 uri : 'file:///storage/emulated/0/Download/example.mp4' ,
4237 autoplay : true ,
4338 initOptions : [ '--codec=avcodec' ] ,
44- } } />
39+ } }
40+ />
4541 </ View >
4642 ) ;
4743 }
You can’t perform that action at this time.
0 commit comments