Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 9 has issues with video streaming #2

Closed
jnroesch opened this issue Jan 17, 2019 · 8 comments
Closed

Android 9 has issues with video streaming #2

jnroesch opened this issue Jan 17, 2019 · 8 comments
Labels
Android Android platform

Comments

@jnroesch
Copy link

we are facing a problem with the AVPro Player that has come up in the forums as well: Mpeg dash video streaming doesn't work for Android 9.

• This happens with all Android 9 devices (Huawai p20, Google Pixel 2, OnePlus 5T)
• with an older version of AvPro the problem occured
• with the AvPro Version 1.9.10 from January we are still experiencing the problem
• we are using Unity 2018.2.17f1
• no other Android devices besides the Android 9 ones show the error.
• no iOS devices with HLS streaming show the error

The videos we are using are MPEG-DASH files encoded on the azure media services.

Can you help us out with this issue?

@AndrewRH
Copy link
Member

Thanks for reporting this.

Could you collect the ADB LOG CAT while it is trying to load one of these MPEG-DASH streams so we can see what errors/warnings are logged?

Also, does it make any difference if you set the Video API to MediaPlayer/ExoPlayer? (in MediaPlayer > Platform Specific > Android > Preferred Video API setting)

@jnroesch
Copy link
Author

jnroesch commented Jan 18, 2019

Here you can find the logcat from the OnePlus 5T. Switching between MediaPlayer/ExoPlayer does not seem to make a difference. You can use the https link to the video from the log for testing. While most browsers try to download the manifest file, MS Edge will display the correct video in the browser so you can see that the file itself should be correct. All older versions of Android and all iOS devices (with the dedicated HLS videolink) work just fine.

(Filename: ./Runtime/Export/Debug.bindings.h Line: 43) 2019-01-18 10:01:51.908 20282-20322/? I/Unity: [AVProVideo] Opening https://sympatientmedia-gect.streaming.media.cloudapi.de/6ed54c18-03ed-4e9a-ad88-a26b2e987df2/01_FreemiumLesson1Tim[1].ism/manifest(format=mpd-time-csf) (offset 0) UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[]) UnityEngine.Logger:Log(LogType, Object, Object) UnityEngine.Debug:Log(Object, Object) RenderHeads.Media.AVProVideo.MediaPlayer:OpenVideoFromFile() Sympatient.General.Tools.VideoPlayerScript:PlayVideo(String, String, Action) Sympatient.General.UI_Scripts.Screens.PilotScreenManager:<get_MobileConnectionOnContinue>m__1() UnityEngine.Events.UnityEvent:Invoke() UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction1)
UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData, Boolean, Boolean)
UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents()
UnityEngine.EventSystems.StandaloneInputModule:Process()

(Filename: ./Runtime/Export/Debug.bindings.h Line: 43)

2019-01-18 10:01:51.922 1356-4125/? D/ActivityManager: setRequestedOrientation() to 0 for ActivityRecord{831f97d u0 com.sympatient.sicherfliegen/com.unity3d.player.UnityPlayerActivity t27962} from pid=20282, uid=10260
2019-01-18 10:01:52.047 1356-3789/? D/ActivityManager: setRequestedOrientation() to 0 for ActivityRecord{831f97d u0 com.sympatient.sicherfliegen/com.unity3d.player.UnityPlayerActivity t27962} from pid=20282, uid=10260
2019-01-18 10:01:55.569 20282-20322/? E/Unity: [AVProVideo] Error: Loading failed. File not found, codec not supported, video resolution too high or insufficient system resources.
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
RenderHeads.Media.AVProVideo.MediaPlayer:UpdateErrors()
RenderHeads.Media.AVProVideo.MediaPlayer:Update()

(Filename: ./Runtime/Export/Debug.bindings.h Line: 43)

2019-01-18 10:01:55.575 20282-20322/? I/Unity: VIDEOPLAYER ERROR: LoadFailed
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
Sympatient.General.Tools.VideoPlayerScript:OnVideoEvent(MediaPlayer, EventType, ErrorCode)
UnityEngine.Events.UnityAction3:Invoke(T0, T1, T2) UnityEngine.Events.InvokableCall3:Invoke(T1, T2, T3)
UnityEngine.Events.UnityEvent3:Invoke(T0, T1, T2) RenderHeads.Media.AVProVideo.MediaPlayer:UpdateErrors() RenderHeads.Media.AVProVideo.MediaPlayer:Update()

@AndrewRH
Copy link
Member

Thanks for that!

Android 9.0 is still very new, so it could be that either it or ExoPlayer has bugs related to it. It could also be some new security option that Android 9.0 has introduced... I wonder if it would work if the URL was HTTP instead of HTTPS...Any way you could test this?

Could you email us the whole log, as we need to see all the messages that happen around that time from the various OS components (www.renderheads.com/contact/)

Thanks,

@jnroesch
Copy link
Author

Yes we had it set to HTTP previously with the same result and tried to use HTTPS with no luck. I will send you the log in a few minutes to the unitysupport email address

@AndrewRH
Copy link
Member

Thanks for sending the log.

I see a few interesting things in the stack....


01-18 14:07:22.082  3296  3430 E ExoPlayerImplInternal: Source error.
01-18 14:07:22.082  3296  3430 E ExoPlayerImplInternal: com.google.android.exoplayer2.upstream.HttpDataSource$HttpDataSourceException: Unable to connect to https://sympatientmedia-gect.streaming.media.cloudapi.de/6ed54c18-03ed-4e9a-ad88-a26b2e987df2/01_FreemiumLesson1Tim[1].ism/manifest(format=mpd-time-csf)
Caused by: javax.net.ssl.SSLHandshakeException: Chain validation failed
01-18 14:07:22.082  3296  3430 E ExoPlayerImplInternal: Caused by: java.security.cert.CertificateException: Chain validation failed
01-18 14:07:22.084  3296  3430 E ExoPlayerImplInternal: Caused by: java.security.cert.CertPathValidatorException: Response is unreliable: its validity interval is out-of-date
01-18 14:07:22.084  3296  3430 E ExoPlayerImplInternal:         Suppressed: java.security.cert.CertPathValidatorException: Could not determine revocation status

Check that the device has the correct date and time...
Try rebooting the device to see if that helps....

It looks like this has already been reported to the ExoPlayer guys:
google/ExoPlayer#5103

They have concluded that it is an issue with how the OS is handling certificates.

Otherwise it might be related to changes in the certificate handling in Android 9.0:
https://android-developers.googleblog.com/2018/04/protecting-users-with-tls-by-default-in.html

In which case it might be solved by creating/modifying your android manifest file to add appropriate security rules:
https://developer.android.com/training/articles/security-config

Let me know if any of these work.

Thanks,

@jnroesch
Copy link
Author

Yes that worked for us! We added a custom security config that allowed http connections to the azure media services. We also found out that this is in fact not only an android 9 issue as we realized that some older devices showed the same issue (we've seen the issue on API levels 23 to 28).

According to our logs avpro was able to connect to the server but the exoplayer ssl handshake failed sometimes (seemed to be random) which caused the issue.

@AndrewRH
Copy link
Member

Glad to hear that it is solved :) We'll add something to the FAQ about this. I'll close this ticket now.

@AndrewRH AndrewRH added the Android Android platform label Jan 30, 2019
@devsarfo
Copy link

Hi guys,

So i was facing same issue and a little research I did arrived at HTTP/HTTPS issues so to fix it, use this attribute to your AndroidManifest.xml where you allow all http for all requests:

android:usesCleartextTraffic="true"

Eg.




Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Android platform
Projects
None yet
Development

No branches or pull requests

3 participants