google / play-instant-unity-plugin

Google Play Instant Plugin for Unity Beta (Archived)
https://developer.android.com/topic/google-play-instant/getting-started/game-unity-plugin
Apache License 2.0
148 stars 31 forks source link

Video Player doesn't work on Android 8.0 device #141

Closed Zeratu closed 5 years ago

Zeratu commented 5 years ago

I built version follow steps, and it works fine in Android 9.0 device in Play Store. but the same built on Android 8.0 device, it doesn't work. Video Player plays nothing.

thanwah commented 5 years ago

Thanks for letting us know about this issue. There is a difference in the Android instant apps runtime between Android 9+ (the runtime is built into the Android framework) and Android 8.0 and earlier (it's provided by "Google Play services for instant apps").

Can you confirm that this is a Unity project? If so, what version? What library are you using to play video - a Unity API, ExoPlayer, or something else?

Also, are there any associated errors in logcat that could tell us more information about what is happening?

Zeratu commented 5 years ago

Details are as following:

  1. We created Play Instant game with Unity 2019.1.4.
  2. We used Native Video Player Component to play video clip in the game.
  3. With same built version which we submit to Google Store, it works on Android 9.0 device, video could play. But on Android 8.0 device, the video did not play at all, but there is no error has been thrown.
  4. However, If I install the Play Instant as APK on Android 8.0 device, the video played fine.

I suspect this is a Bug for Unity deloying App with Google Instant framework.

Thank you!

thanwah commented 5 years ago

Thank you for the additional details! We will try to reproduce the issue internally and get back to you when we know more.

Zeratu commented 5 years ago

Thank you very much! Look forward for your feedback. :)

thanwah commented 5 years ago

Hi @Zeratu,

I just wanted to share an update that we were able to locally reproduce this issue on a Pixel running Android 8.1.

Just to confirm that it's the same issue, if you look at logcat do you see an error like this? eoplayer I/ServiceManager: Waiting for service drm.drmManager... 2019-09-25 16:02:57.851 477-477/? E/SELinux: avc: denied { find } for service=drm.drmManager pid=20190 uid=10572 scontext=u:r:ephemeral_app:s0:c512,c768 tcontext=u:object_r:drmserver_service:s0 tclass=service_manager permissive=0

Thanks again.

Zeratu commented 5 years ago

Yes, there it is!

09-27 17:45:57.773 31601 31601 D ViewRootImpl@70c5c59[UnityPlayerActivity]: ViewPostIme key 0 09-27 17:45:57.782 720 720 D SEC LightsHAL: button : 1 - 09-27 17:45:57.794 605 605 E audit : avc: denied { find } for service=drm.drmManager pid=31601 uid=10381 scontext=u:r:ephemeral_app:s0:c512,c768 tcontext=u:object_r:drmserver_service:s0 tclass=service_manager 09-27 17:45:57.795 31601 31645 I ServiceManager: Waiting for service drm.drmManager... 09-27 17:45:57.813 1333 2859 D InputReader: Input event(8): value=0 when=228473451019000 09-27 17:45:57.816 1333 2859 D WindowManager: interceptKeyTq s_result=1 09-27 17:45:57.818 1333 2858 I InputDispatcher: Delivering key to (31601): action: 0x1 (0) 09-27 17:45:57.819 14075 14075 D InputMethodService: onKeyUp B key 09-27 17:45:57.819 14075 14075 D InputMethodService: onKeyUp not B key 09-27 17:45:57.819 31601 31601 D ViewRootImpl@70c5c59[UnityPlayerActivity]: ViewPostIme key 1

jamcohen commented 5 years ago

Hi Zeratu,

Thank you for the detailed information! We were able to track down the issue.

Unity's video player uses MediaExtractor under the hood. Unfortunately, there is a bug in Android Oreo that breaks MediaExtractor in instant apps.

The bug was fixed for Oreo after it was already released: https://android-review.googlesource.com/c/platform/system/sepolicy/+/700511

It's up to the individual OEMs to patch that fix in and push an updated Android version to their devices, so it's possible that the video player works on some devices but not others.

If you're planning on releasing an instant app that uses Unity's video player, please contact us at play-instant-unity-plugin-support@googlegroups.com to discuss possible options.

Zeratu commented 5 years ago

Thanks for your relay! I will discuss with team and see what we can do in next!

Thanks again! :)

Zeratu commented 5 years ago

@jamcohen , I have wrote a e-mail, and look forward for option discussion. Thank you!

thanwah commented 5 years ago

Thank you! I responded to your email. Closing this issue now.