11# IPCamView [ ![ API] ( https://img.shields.io/badge/API-9%2B-blue.svg?style=flat )] ( https://android-arsenal.com/api?level=9 )
22An extended ImageView that can stream MJPEG videos.
33
4+ <img src =" https://raw.githubusercontent.com/marcoscgdev/IPCamView/master/device-2018-12-14-230350.png " width =" 350 " >
5+
46---
57
68## Releases:
@@ -11,19 +13,13 @@ You can see all the library releases [here](https://github.com/marcoscgdev/IPCam
1113
1214---
1315
14- ## Screenshots
15-
16- <img src =" https://raw.githubusercontent.com/marcoscgdev/IPCamView/master/device-2018-12-14-230350.png " width =" 350 " >
17-
18- ---
19-
2016## Usage:
2117
2218### Adding the depencency
2319
2420Add this to your root * build.gradle* file:
2521
26- ```
22+ ``` groovy
2723allprojects {
2824 repositories {
2925 ...
@@ -34,6 +30,55 @@ allprojects {
3430
3531Now add the dependency to your app build.gradle file:
3632
37- ```
33+ ``` groovy
3834implementation 'com.github.marcoscgdev:IPCamView:1.0.0'
3935```
36+
37+ ### Loading a MJPEG stream
38+
39+ - XML
40+
41+ ``` xml
42+ <com .marcoscg.ipcamview.IPCamView
43+ android : id =" @+id/ip_cam_view"
44+ android : layout_width =" match_parent"
45+ android : layout_height =" match_parent"
46+ android : scaleType =" fitCenter"
47+ app : url =" YOUR_STREAM_URL"
48+ app : interval =" 1500" />
49+ ```
50+
51+ - Java
52+
53+ ``` java
54+ IPCamView ipCamView = findViewById(R . id. ip_cam_view);
55+ ipCamView. setUrl(" http://webcam.abaco-digital.es/zuda/image2.jpg" );
56+ ipCamView. setInterval(1000 ); // In milliseconds, default 1000
57+ ipCamView. start();
58+ ```
59+
60+ #### NOTE:
61+ The _ start()_ method is required in order to start the MJPEG stream. You can also stop the stream by calling the _ stop()_ method.
62+
63+ ---
64+ > See the * sample project* to clarify any queries you may have.
65+
66+ ---
67+
68+ ## License
69+
70+ ```
71+ Copyright 2018 Marcos Calvo García
72+
73+ Licensed under the Apache License, Version 2.0 (the "License");
74+ you may not use this file except in compliance with the License.
75+ You may obtain a copy of the License at
76+
77+ http://www.apache.org/licenses/LICENSE-2.0
78+
79+ Unless required by applicable law or agreed to in writing, software
80+ distributed under the License is distributed on an "AS IS" BASIS,
81+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
82+ See the License for the specific language governing permissions and
83+ limitations under the License.
84+ ```
0 commit comments