IPCamView ![]()
An extended ImageView that can stream MJPEG videos.
Now add the dependency to your app build.gradle file:
implementation 'com.github.marcoscgdev:IPCamView:1.0.0'
<com.marcoscg.ipcamview.IPCamView
android:id="@+id/ip_cam_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitCenter"
app:url="YOUR_STREAM_URL"
app:interval="1500"/>
IPCamView ipCamView = findViewById(R.id.ip_cam_view);
ipCamView.setUrl("http://webcam.abaco-digital.es/zuda/image2.jpg");
ipCamView.setInterval(1000); // In milliseconds, default 1000
ipCamView.start();
The start() method is required in order to start the MJPEG stream. You can also stop the stream by calling the stop() method.
See the
sample project to clarify any queries you may have.