From 47c70650a05f43be565037dd3beaa3599a244fbd Mon Sep 17 00:00:00 2001 From: Rob2k9 <46205006+Rob2k9@users.noreply.github.com> Date: Sat, 31 Aug 2019 15:47:06 +0100 Subject: [PATCH 1/4] Update README.md --- README.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index e200959..337db4d 100644 --- a/README.md +++ b/README.md @@ -15,17 +15,15 @@ Copy Ionicons.ttf from `node_modules/react-native-vector-icons/Fonts` to `androi #### Android -1. Insert the following lines inside the dependencies block in `android/app/build.gradle`: +1. Insert the following lines inside the repositories block in `android/build.gradle`: ```Diff ... allprojects { - ... - dependencies { - ... -+ maven { -+ url("https://jitpack.io") -+ } - } + repositories { + + maven { url("https://jitpack.io") } + + } } ``` From 5accafc4879dc3f156d5248e33d4c06bf599ca2e Mon Sep 17 00:00:00 2001 From: Rob2k9 <46205006+Rob2k9@users.noreply.github.com> Date: Sat, 31 Aug 2019 15:47:37 +0100 Subject: [PATCH 2/4] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 337db4d..f82d7dd 100644 --- a/README.md +++ b/README.md @@ -20,9 +20,9 @@ Copy Ionicons.ttf from `node_modules/react-native-vector-icons/Fonts` to `androi ... allprojects { repositories { - +... maven { url("https://jitpack.io") } - +... } } ``` From 932a2478176074476244389abdb1da0d69e7f764 Mon Sep 17 00:00:00 2001 From: Rob2k9 <46205006+Rob2k9@users.noreply.github.com> Date: Sun, 1 Sep 2019 20:04:37 +0100 Subject: [PATCH 3/4] Update VlcPlayerView.java --- .../java/com/ghondar/vlc/VlcPlayerView.java | 33 +++++-------------- 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/android/src/main/java/com/ghondar/vlc/VlcPlayerView.java b/android/src/main/java/com/ghondar/vlc/VlcPlayerView.java index 44bf0a0..6d48246 100644 --- a/android/src/main/java/com/ghondar/vlc/VlcPlayerView.java +++ b/android/src/main/java/com/ghondar/vlc/VlcPlayerView.java @@ -89,7 +89,7 @@ public String toString() { private static final int SURFACE_4_3 = 5; private static final int SURFACE_ORIGINAL = 6; - private int mCurrentSize = SURFACE_BEST_FIT; + private int mCurrentSize = SURFACE_FILL; private Media media; private boolean autoPlay; @@ -114,28 +114,8 @@ private void initializePlayerIfNeeded() { final SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(getContext().getApplicationContext()); // Create LibVLC ArrayList options = new ArrayList<>(50); - int deblocking = getDeblocking(-1); - - int networkCaching = pref.getInt("network_caching_value", 0); - if (networkCaching > 60000) networkCaching = 60000; - else if (networkCaching < 0) networkCaching = 0; - options.add("--audio-time-stretch"); - options.add("--avcodec-skiploopfilter"); - options.add("" + deblocking); - options.add("--avcodec-skip-frame"); - options.add("0"); - options.add("--avcodec-skip-idct"); - options.add("0"); - options.add("--subsdec-encoding"); - options.add("--stats"); - if (networkCaching > 0) options.add("--network-caching=" + networkCaching); - options.add("--androidwindow-chroma"); - options.add("RV32"); - - options.add("-vv"); - - libvlc = new LibVLC(options); + libvlc = new LibVLC(getContext().getApplicationContext(), options); holder.setKeepScreenOn(true); // Create media player @@ -156,6 +136,12 @@ private void setMedia(String filePath) { } Uri uri = Uri.parse(filePath); media = new Media(libvlc, uri); + int cache = 150; + media.addOption(":network-caching=" + cache); + media.addOption(":file-caching=" + cache); + media.addOption(":live-cacheing=" + cache); + media.addOption(":sout-mux-caching=" + cache); + media.addOption(":codec=mediacodec,iomx,all"); mMediaPlayer.setMedia(media); if (autoPlay) { mMediaPlayer.play(); @@ -270,6 +256,7 @@ private void changeSurfaceSize(int width, int height) { break; } + // set display size int finalWidth = (int) Math.ceil(displayWidth * mVideoWidth / mVideoVisibleWidth); int finalHeight = (int) Math.ceil(displayHeight * mVideoHeight / mVideoVisibleHeight); @@ -329,7 +316,6 @@ public void setVolume(int volume) { mMediaPlayer.setVolume(volume); } - @Override public void onNewLayout(IVLCVout vout, int width, int height, int visibleWidth, int visibleHeight, int sarNum, int sarDen) { if (width * height == 0) return; @@ -349,7 +335,6 @@ public void onSurfacesDestroyed(IVLCVout vout) { } - @Override public void onHardwareAccelerationError(IVLCVout vout) { // Handle errors with hardware acceleration this.releasePlayer(); From 2ea1cfd8f44cc53e0b8035061077f6bbbbaf3160 Mon Sep 17 00:00:00 2001 From: Rob2k9 <46205006+Rob2k9@users.noreply.github.com> Date: Sun, 1 Sep 2019 20:06:31 +0100 Subject: [PATCH 4/4] Update build.gradle --- android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/build.gradle b/android/build.gradle index 2147be9..cd46b92 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -53,7 +53,7 @@ repositories { dependencies { implementation "com.facebook.react:react-native:${safeExtGet('reactnativeVersion', '+')}" - implementation 'de.mrmaffen:vlc-android-sdk:1.9.8' + implementation 'de.mrmaffen:libvlc-android:2.1.12' } def configureReactNativePom(def pom) {