Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.lorenzos:ipcam-view:v1.4.0'
}
dependencies {
implementation("com.github.lorenzos:ipcam-view:v1.4.0")
}
<dependency>
<groupId>com.github.lorenzos</groupId>
<artifactId>ipcam-view</artifactId>
<version>v1.4.0</version>
</dependency>
libraryDependencies += "com.github.lorenzos" % "ipcam-view" % "v1.4.0"
:dependencies [[com.github.lorenzos/ipcam-view "v1.4.0"]]
Android MJPEG video streaming made simple!
A wrapper library around the well known SimpleMjpegView and android-camera-axis projects.
If you have problem to identify your IpCam url, please follow this link
<a href='https://play.google.com/store/apps/details?id=com.github.niqdev.ipcam&utm_source=global_co&utm_medium=prtnr&utm_content=Mar2515&utm_campaign=PartBadge&pcampaignid=MKT-Other-global-all-co-prtnr-ap-PartBadge-Mar2515-1'><img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/images/apps/en-play-badge.png' width="200"/></a>
Add to your layout: example
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
// ADD THIS
xmlns:stream="http://schemas.android.com/apk/res-auto"
...>
<com.github.niqdev.mjpeg.MjpegSurfaceView
android:id="@+id/VIEW_NAME"
android:layout_width="match_parent"
android:layout_height="match_parent"
stream:type="stream_default OR stream_native" />
</RelativeLayout>
Read stream in your activity/fragment: example
int TIMEOUT = 5; //seconds
Mjpeg.newInstance()
.credential("USERNAME", "PASSWORD")
.open("IPCAM_URL.mjpg", TIMEOUT)
.subscribe(inputStream -> {
mjpegView.setSource(inputStream);
mjpegView.setDisplayMode(DisplayMode.BEST_FIT);
mjpegView.showFps(true);
});
repositories {
jcenter()
}
dependencies {
compile 'com.github.niqdev:mjpeg-view:0.5.0'
}
You are welcome to add your app to the list!
Download Android NDK:
Compile manually (verify your paths)
$ chmod a+x compileJni.sh
$ ./compileJni.sh
android-camera-axis
SimpleMjpegView