I\'m trying to use Vitamio to run RTSP video stream, I\'m using Vitamio-sample after updating it to run the stream through VideoViewDemo
activity:
p
After scanning a lot of near similar problems, I figured that it's may be because it demands to has ACCESS_NETWORK_STATE
permission, although the log didn't tell me that but as it tells me it's not a qualified user to perform this process which means the user must be given the permission to be qualified for that, So, I added this permission:
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
So, to run an authorized RTSP live stream using Vitamio, you need to register all of the following permissions:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
I had a problem where I was unable to stream RTSP even I removed the Authuntication like Username and Password. So I can Access the link Directly. What Things Work for Me to Stream LIVE were:
1st Make Sure That You Have Registered the Permissions.
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
2nd I gave the Streaming Link as:
rtsp://192.xxx.x.xx/h264 OR rtsp://192.111.1.1/h264 ( example )
Remember I removed the Username and Password for RTSP Links in My IP Camera Settings.
3rd: Important thing that worked for me was:
Open build.gradle of your app
change targedsdkversion to 22
Open build.gradle of your Vitamio:module
change targedsdkversion to 22
It may sound weird but it worked for me like a charm.
Hope This might be helpful.