Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void connect(Context context) {
}
}

public void disconnect(/*Context context*/ ) {
public void disconnect() {
connection.stop();
}

Expand Down
8 changes: 7 additions & 1 deletion android/controller/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ android {
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

defaultConfig {
ndk {
abiFilters 'armeabi-v7a'
}
}
}

buildFeatures {
Expand Down Expand Up @@ -62,7 +68,7 @@ dependencies {
implementation 'com.google.android.material:material:1.3.0'

// vlc for rtsp streaming display
implementation 'org.videolan.android:libvlc-all:3.3.12'
implementation 'org.videolan.android:libvlc-all:3.3.14'

// For a library module, uncomment the following line and comment the one after
// apply plugin: 'com.android.library'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,16 @@

package org.openbot.controller.customComponents

import android.annotation.SuppressLint
import android.content.Context
import android.net.Uri
import android.util.AttributeSet
import android.util.Log
import org.openbot.controller.databinding.ActivityFullscreenBinding
import org.videolan.libvlc.LibVLC
import org.videolan.libvlc.Media
import org.videolan.libvlc.MediaPlayer
import org.videolan.libvlc.interfaces.IVLCVout
import org.videolan.libvlc.util.VLCVideoLayout
import java.util.*

data class VlcPlayer (
data class VlcPlayer(
val context: Context, val layout: VLCVideoLayout
) : IVideoPlayer {
private val TAG: String = "VlcView"
Expand All @@ -37,6 +33,7 @@ data class VlcPlayer (
override fun init() {
val args = ArrayList<String>()
args.add("-vvv")
args.add("--file-caching=2000");

mLibVLC = LibVLC(this.context, args)
mMediaPlayer = MediaPlayer(mLibVLC)
Expand All @@ -50,7 +47,11 @@ data class VlcPlayer (
Log.i(null, "Stated the player..., playState: " + mMediaPlayer!!.playerState)

val media = Media(mLibVLC, Uri.parse(url))
Log.i (TAG, "media.state: " + media.state)
media.setHWDecoderEnabled(true, false)
media.addOption(":network-caching=150")
media.addOption(":clock-jitter=0")
media.addOption(":clock-synchro=0")
Log.i(TAG, "media.state: " + media.state)

mMediaPlayer!!.media = media
media.release()
Expand Down