MobileMobile | Continue
       
Nibiru VR Development Nibiru Studio 360/180 Video playback on Android

360/180 Video playback on Android

LesVikings Post time 2019-1-30 18:47 | Show all posts [Copy URL]
6 384
Hi!

I'm integrating Nibiru into an app that reads training videos on a BOBO VR X6 headset on Android. I managed to read a video using the Intent com.nibiru.videostart but I want to play the video in fullscreen, without any controls available to the user (the video playback is controlled via the network).

I saw in the Nibiru Studio docs that the IMediaPlayer is deprecated and that we have to use XSurfaceArea but the documentation is not very clear as to how a video can be played and controlled this way.

Do you have an example of this?

Thanks!
Reply

Use magic Report

Post time 2019-1-29 10:03 | Show all posts
Hi
If you use the Intent com.nibiru.videosstart, you can not make any changes by using the LocalPlayer Application.  You need to develop the mediaPlayer yourself. We have demo and source code about mediaPlayer developing in NVR Stduio. The demo class name is com.nibiru.studio.vrdemo.launcher.SubSceneVideo. You can reference  the code and documentation.
Post time 2019-1-29 16:52 | Show all posts
Hi there,

If you are using Nibiru OS and VR All-in-one for 2B solution, there are some professional service we could provide. Welcome to let us know if you are in demand of such service by dropping email to eliza.zhao@inibiru.com

Thank you for choosing us, 
Nibiru Support Team
Post time 2019-1-30 02:30 | Show all posts
Edited by LesVikings at 2019-1-30 02:33 \n\nThank you.

I'm trying to launch the media player scene that I created from a Cordova Plugin to be used in Ionic applications.

I have the code for the player, but I can't figure out how to launch it from my plugin class (it's a CordovaPlugin class). I tried launching my class (derived from XBaseScene) directly but the system can't cast it as an Activity.

I tried creating a XBaseXRActivity class and setting a LauncherScene in the manifest, but that did not work either.

Do you have any idea how I could launch my scene from the Cordova plugin?
Here is an error I get in logcat (it's repeating over and over until the app dies):
  1. 01-29 13:31:00.507 32202 32483 D NibiruSDKPlugin: Args: ["file:\/\/\/storage\/emulated\/0\/Download\/Onsim\/video_formation2.mp4",{"videoType":1,"videoFormat":0}]
  2. 01-29 13:31:00.507 32202 32483 D NibiruSDKPlugin: Play video
  3. 01-29 13:31:00.510 32202 32483 D NibiruSDKPlugin: Starting MediaPlayerView activity
  4. 01-29 13:31:00.512  2301  3498 I ActivityManager: START u0 {cmp=fr.of2s.onsim_student/cordovapluginnibirusdk.MediaPlayerActivity (has extras)} from uid 10065 on display 0
  5. 01-29 13:31:00.512  2301  3498 I ActivityManager: activitye: cordovapluginnibirusdk.MediaPlayerActivity, pkg: fr.of2s.onsim_student, vr mode: null
  6. 01-29 13:31:00.512  2301  3498 W ActivityManager: startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { cmp=fr.of2s.onsim_student/cordovapluginnibirusdk.MediaPlayerActivity (has extras) }
  7. 01-29 13:31:00.523 32202 32202 D CordovaActivity: Paused the activity.
  8. 01-29 13:31:00.542 32202 32202 D NibiruStudio: cordovapluginnibirusdk.MediaPlayerActivity ======================== Activity on Create: cordovapluginnibirusdk.MediaPlayerActivity@b89da77
  9. 01-29 13:31:00.551 32202 32202 D ccc     : NibiruVR.clearBeforeInit.false
  10. 01-29 13:31:00.552 32202 32202 D NibiruStudio: [M] ========== is M Env: false
  11. 01-29 13:31:00.555 32202 32202 D ccc     : NPM.edt.0
  12. 01-29 13:31:00.556 32202 32202 D ccc     : checkClass Failed, not find class com.nibiru.service.NibiruPayService
  13. 01-29 13:31:00.559 32202 32202 D ccc     : use dtr sdk mode
  14. 01-29 13:31:00.559 32202 32202 D ccc     : allow nvr tracker working
  15. 01-29 13:31:00.564 32202 32202 D ccc     : create NibiruVRServiceGL engineType is 0
  16. 01-29 13:31:00.565 32202 32202 V ccc     : [] === init Context=== Thread[main,5,main]
  17. 01-29 13:31:00.567 32202 32202 D ccc     : engine type is 0,0
  18. 01-29 13:31:00.573 32202 32202 W ccc     : cannot load core lib version: no set
  19. 01-29 13:31:00.573 32202 32202 V ccc     : NVR Loader Ver: 2
  20. 01-29 13:31:00.591  1648  1648 E HWComposer: Invalid layer type change: Client --> Client
  21. 01-29 13:31:00.597 32202 32202 I nvr-sdk-info: >>> Disable Interaction SDK <<<
  22. 01-29 13:31:00.597 32202 32202 I nvr-sdk-info: [NibiruSDK] SVer[246], JVer[252], Dual[0], Date[20181017], Sv[14239], DFBR[0],
  23. 01-29 13:31:00.597 32202 32202 I nvr-sdk-info: Sst[2], Ft[14285714], Tw[0], Xr[1], P[neptune], CS[0],
  24. 01-29 13:31:00.597 32202 32202 I nvr-sdk-info: Ant[0], 9Trk[1], Spy[0.500000], Oax[0], OaxRot[-2.000000],
  25. 01-29 13:31:00.597 32202 32202 I nvr-sdk-info: Reticle[0], ET[0], Mtid[32202],Mr[], Channel[],
  26. 01-29 13:31:00.597 32202 32202 I nvr-sdk-info: TwFifo[0], SyncFrame[0], Tps[1.000000], Inact[0]
  27. 01-29 13:31:00.599 32202 32202 I nvr-platform: client version: 246
  28. 01-29 13:31:00.600 32202 32202 I nvr-sdk-info: NVR PLATFORM Ver.23 SUPPORT DTR: 0 ,PLATFORM ID: 11 ,UNREAL DTR: 0 ,OS API: 25_7.1.2 ,CHANNEL VR1030, DualTB 1, LRRefresh 1, UnityDTR 0
  29. 01-29 13:31:00.602 32202 32202 I nvr-sdk-info: Nibiru OS: 1, ABI: armeabi-v7a, Support DTR: 0, Engine Type: 0, OS Env Ver 1, FrameTime 14285714ms, REL V2.4.6, Oct 17 2018 - 17:13:35
  30. 01-29 13:31:00.605  1648  1648 E HWComposer: Invalid layer type change: Client --> Client
  31. 01-29 13:31:00.611 32202 32202 I nvr-sdk-info: Load NoloClient success: connected 0, version is 100 !
  32. 01-29 13:31:00.611 32202 32202 I nvr-sdk-info: TrackerVR9 Init Succ
  33. 01-29 13:31:00.611 32202 32202 I nvr-sdk-info: >>>>>> Tracker.init TrackerVR9
  34. 01-29 13:31:00.599 32202 32202 I s.onsim_student: type=1400 audit(0.0:70): avc: denied { call } for scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:noloservice:s0 tclass=binder permissive=1
  35. 01-29 13:31:00.599 14153 14153 I Binder:1641_3: type=1400 audit(0.0:71): avc: denied { transfer } for scontext=u:r:noloservice:s0 tcontext=u:r:untrusted_app:s0:c512,c768 tclass=binder permissive=1
  36. 01-29 13:31:00.599  1659  1659 I Binder:1641_1: type=1400 audit(0.0:72): avc: denied { use } for path="/dev/ashmem" dev="tmpfs" ino=5938 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:noloservice:s0 tclass=fd permissive=1
  37. 01-29 13:31:00.611 32202 32202 E nvr-sdk-info: Open liblive555_client.so failed ! dlopen failed: library "liblive555_client.so" not found . Change to load libnvr_live555.so
  38. 01-29 13:31:00.612 32202 32202 E nvr-sdk-info: Open libnvr_live555.so failed ! dlopen failed: library "libnvr_live555.so" not found
  39. 01-29 13:31:00.613 32202 32202 E nvr-sdk-info: open os service lib failed: dlopen failed: library "libinvrservice.so" not found
  40. 01-29 13:31:00.613 32202 32202 D PortalApi: call int awInitPortalSdk(int)
  41. 01-29 13:31:00.613 32202 32202 D libEGL  : call EGLBoolean android::eglCustomEnablePortal(int). time=13940.615961
  42. 01-29 13:31:00.613 32202 32202 E libEGL  : call int android::PortalDevice::SetPortalEnabled(int) mode 1:dynamic reprojection
  43. 01-29 13:31:00.613 32202 32202 D libEGL  : PortalDevice: load portal driver
  44. 01-29 13:31:00.621 32202 32202 D libEGL  : Get PortalInit=0xcd8a9ce5 from /libatw.so
  45. 01-29 13:31:00.621 32202 32202 D libEGL  : Get PortalDestroy=0xcd8a9da1 from /libatw.so
  46. 01-29 13:31:00.621 32202 32202 D libEGL  : Get PortalSwap=0xcd8a9dd5 from /libatw.so
  47. 01-29 13:31:00.621 32202 32202 D libEGL  : Get PortalSetFrameNumber=0xcd8a9e1d from /libatw.so
  48. 01-29 13:31:00.621 32202 32202 D libEGL  : Get PortalReproj=0xcd8a9e55 from /libatw.so
  49. 01-29 13:31:00.621 32202 32202 D libEGL  : Get PortalSetTracker=0xcd8a9d61 from /libatw.so
  50. 01-29 13:31:00.621 32202 32202 D libEGL  : Get PortalEnableDevice=0xcd8a9e91 from /libatw.so
  51. 01-29 13:31:00.621 32202 32202 D libEGL  : Get PortalDisableDevice=0xcd8a9ec9 from /libatw.so
  52. 01-29 13:31:00.621 32202 32202 D libEGL  : Get PortalGetOrientation=0xcd8a9f05 from /libatw.so
  53. 01-29 13:31:00.621 32202 32202 D libEGL  : Get PortalResetHeadTracker=0xcd8a9f4d from /libatw.so
  54. 01-29 13:31:00.621 32202 32202 D libEGL  : Get PortalSetWarpStatus=0xcd8a9f89 from /libatw.so
  55. 01-29 13:31:00.621 32202 32202 D libEGL  : Portal MSAA:0 IsUnityApp:0
  56. 01-29 13:31:00.621 32202 32202 D libEGL  : set PortalStatus 1
  57. 01-29 13:31:00.621 32202 32202 D PortalApi: init portal sdk success
  58. 01-29 13:31:00.623 32202 32202 I nvr-sdk-info: Service->initialize[0], Service.init nvr for VR9CoreService, isDTRSupport false
  59. 01-29 13:31:00.623 32202 32202 D ccc     : nvr.tw.mode: 0, qualcomm sdk.false
  60. 01-29 13:31:00.626 32202 32202 D ccc     : checkClass Failed, not find class com.nibiru.service.Nibiru6DOFProService
  61. 01-29 13:31:00.630 32202 32202 D ccc     : checkClass Failed, not find class com.nibiru.service.NibiruPayService
  62. 01-29 13:31:00.630 32202 32202 D ccc     : free version do not need preInit !
  63. 01-29 13:31:00.633  1648  1648 E HWComposer: Invalid layer type change: Client --> Client
  64. 01-29 13:31:00.638 32202 32202 D ccc     : ExtAndroid Sensor Init
  65. 01-29 13:31:00.650 32202 32202 D ccc     : checkClass Failed, not find class com.nibiru.service.NibiruPayService
  66. 01-29 13:31:00.650 32202 32202 I nvr-platform: client version: 246
  67. 01-29 13:31:00.650 32202 32202 V test    : platform length: 25
  68. 01-29 13:31:00.656 32202 32202 W ccc     : cannot load core lib version: no set
  69. 01-29 13:31:00.656 32202 32202 I NVR     : >>>>>>>>>>>>>>>>>>> Welcome to Nibiru VR World
  70. 01-29 13:31:00.656 32202 32202 I NVR     : >>>>>>>>>>>>>>>>>>> Release Date: 2018-12-06 07:35:04
  71. 01-29 13:31:00.656 32202 32202 I NVR     : >>>>>>>>>>>>>>>>>>> Hardware Platform: VR9
  72. 01-29 13:31:00.656 32202 32202 I NVR     : >>>>>>>>>>>>>>>>>>> Nibiru Platform Version: 23
  73. 01-29 13:31:00.656 32202 32202 I NVR     : >>>>>>>>>>>>>>>>>>> Frame Time: 16666666
  74. 01-29 13:31:00.656 32202 32202 I NVR     : >>>>>>>>>>>>>>>>>>> VSYNC Support: false
  75. 01-29 13:31:00.656 32202 32202 I NVR     : >>>>>>>>>>>>>>>>>>> VSync Drift: 0
  76. 01-29 13:31:00.656 32202 32202 I NVR     : >>>>>>>>>>>>>>>>>>> Screen Mode: SINGLE
  77. 01-29 13:31:00.656 32202 32202 I NVR     : >>>>>>>>>>>>>>>>>>> DTR Opt Mode: false
  78. 01-29 13:31:00.656 32202 32202 I NVR     : >>>>>>>>>>>>>>>>>>> DTR Support: S->false U->false UE->false
  79. 01-29 13:31:00.656 32202 32202 I NVR     : >>>>>>>>>>>>>>>>>>> DTR Impl: FEN
  80. 01-29 13:31:00.656 32202 32202 I NVR     : >>>>>>>>>>>>>>>>>>> DTR Support Render: SYNC MODE
  81. 01-29 13:31:00.656 32202 32202 I NVR     : >>>>>>>>>>>>>>>>>>> MultiView Support: NO SUPPORT
  82. 01-29 13:31:00.656 32202 32202 I NVR     : >>>>>>>>>>>>>>>>>>> Refresh Order: R -> L
  83. 01-29 13:31:00.656 32202 32202 I NVR     : >>>>>>>>>>>>>>>>>>> Distortion: true
  84. 01-29 13:31:00.656 32202 32202 I NVR     : >>>>>>>>>>>>>>>>>>> Tracking Mode: Raw Data Fusion [N]
  85. 01-29 13:31:00.656 32202 32202 I NVR     : >>>>>>>>>>>>>>>>>>> Tracking Source: APP
  86. 01-29 13:31:00.656 32202 32202 I NVR     : >>>>>>>>>>>>>>>>>>> Performance Level: 2
  87. 01-29 13:31:00.656 32202 32202 I NVR     : >>>>>>>>>>>>>>>>>>> Version: SDK->246 JAR->252 DATE->20181206 JID->101 Lib->-1 Ser->5 SVNVER->15027
  88. 01-29 13:31:00.656 32202 32202 I NVR     : >>>>>>>>>>>>>>>>>>> APP Package: fr.of2s.onsim_student
  89. 01-29 13:31:00.656 32202 32202 I NVR     : >>>>>>>>>>>>>>>>>>> Build.VERSION_CODES: 25
  90. 01-29 13:31:00.661 32202 32202 V ccc     : [cordovapluginnibirusdk.MediaPlayerActivity] === init vr service ===0 Thread[main,5,main]
  91. 01-29 13:31:00.662 32202 32202 D ccc     : NO SUPPORT DIRECT RENDER
  92. 01-29 13:31:00.666 32202 32202 I nvr-sdk-info: on create
  93. 01-29 13:31:00.675 32202 32202 D ccc     : NibiruVRActivity.onCreate.248
  94. 01-29 13:31:00.777 32202 32202 D ccc     : >>>>>> has initCardboardInfo , just pass it !
  95. 01-29 13:31:00.778 32202 32202 D ccc     : App Ver [0.0.2 Base 2]fr.of2s.onsim_student
  96. 01-29 13:31:00.779 32202 32202 V ccc     : [cordovapluginnibirusdk.MediaPlayerActivity] ========set_view_false,false,0 Thread[main,5,main]
  97. 01-29 13:31:00.826 32202 32202 D NibiruStudio: register cmd receiver
  98. 01-29 13:31:00.830 32202 32202 D AndroidRuntime: Shutting down VM
  99. 01-29 13:31:00.831 32202 32202 I System.out: >>>>>>>>>> 程序出错,请查看 sdcard/NibiruSDK.Log目录下log文件...
Copy the Code


Thanks!
Post time 2019-1-30 10:48 | Show all posts
LesVikings replied at 2019-1-30 02:30
Edited by LesVikings at 2019-1-30 02:33 \n\nThank you.

I'm trying to launch the media player scene ...

Hi,

1, please verify the Demo apk can play video correctly.
2, import demo source code as module into an empty project to check the code can play video correctly.
3, read the SubSceneVideoAll2.java code and understand how to use MediaPlayer and XSurfaceArea to play the video.
4, modify the code to use your player code and XSurfaceArea to play video.
5, If above all is OK, try to merge the modified code into your project to do test.

If you meet crash, you can find the log file at /sdcard/NibiruSDK.Log and send us. The code you pasted has not included exception code.

Thanks.
Steven
Post time 2019-1-30 17:29 | Show all posts
Hi,

The code works, the problem is launching it from a CordovaPlugin which is not a typical Android application.

The exception pulled from the log file is as follows:
  1. Time : 2019_01_30_04_25_11
  2. ApiVerInfo : ReleaseDate 20181206, JarVersion 252, SDKVersion 246
  3. AppVerInfo : VersionName 0.0.2, VersionCode 2
  4. BOARD=exdroid
  5. BOOTLOADER=unknown
  6. BRAND=Nibiru
  7. CPU_ABI=armeabi-v7a
  8. CPU_ABI2=armeabi
  9. DEVICE=neptune-ys
  10. DISPLAY=neptune_ys-eng 7.1.2 N2G48B 20181018 test-keys
  11. FINGERPRINT=Allwinner/neptune_ys/neptune-ys:7.1.2/N2G48B/20181018:eng/test-keys
  12. HARDWARE=sun50iw3p1
  13. HOST=nibiru2
  14. ID=N2G48B
  15. IS_DEBUGGABLE=true
  16. IS_EMULATOR=false
  17. IS_VR_BUILD=true
  18. MANUFACTURER=Allwinner
  19. MODEL=Neptune VR9 Triton
  20. PERMISSIONS_REVIEW_REQUIRED=false
  21. PRODUCT=neptune_ys
  22. RADIO=unknown
  23. SERIAL=060014141303815010b
  24. SUPPORTED_32_BIT_ABIS=[Ljava.lang.String;@65e5c24
  25. SUPPORTED_64_BIT_ABIS=[Ljava.lang.String;@e18638d
  26. SUPPORTED_ABIS=[Ljava.lang.String;@ac58942
  27. TAG=Build
  28. TAGS=test-keys
  29. TIME=1539842387000
  30. TYPE=eng
  31. UNKNOWN=unknown
  32. USER=nibiru
  33. java.lang.RuntimeException: Unable to start activity ComponentInfo{fr.of2s.onsim_student/cordovapluginnibirusdk.MediaPlayerActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean x.core.GlobalApplication.isReady()' on a null object reference
  34.         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2666)
  35.         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2727)
  36.         at android.app.ActivityThread.-wrap12(ActivityThread.java)
  37.         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1478)
  38.         at android.os.Handler.dispatchMessage(Handler.java:102)
  39.         at android.os.Looper.loop(Looper.java:154)
  40.         at android.app.ActivityThread.main(ActivityThread.java:6121)
  41.         at java.lang.reflect.Method.invoke(Native Method)
  42.         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
  43.         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
  44. Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean x.core.GlobalApplication.isReady()' on a null object reference
  45.         at x.core.XBaseStereoRenderer.initGlobalApplication(XBaseStereoRenderer.java:712)
  46.         at x.core.XBaseStereoRenderer.initGlobalApplicationAndHandler(XBaseStereoRenderer.java:672)
  47.         at x.core.XBaseStereoRenderer.init(XBaseStereoRenderer.java:461)
  48.         at x.core.XBaseStereoRenderer.<init>(XBaseStereoRenderer.java:411)
  49.         at x.core.XBaseXRActivity.init(XBaseXRActivity.java:80)
  50.         at x.core.XBaseXRActivity.onCreate(XBaseXRActivity.java:60)
  51.         at cordovapluginnibirusdk.MediaPlayerActivity.onCreate(MediaPlayerActivity.java:14)
  52.         at android.app.Activity.performCreate(Activity.java:6686)
  53.         at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
  54.         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2619)
  55.         ... 9 more
Copy the Code
Post time 2019-1-30 18:47 | Show all posts
LesVikings 发表于 2019-1-30 17:29
Hi,

The code works, the problem is launching it from a CordovaPlugin which is not a typical Android ...

Hi,

If you have custom Android Application Class, you need to extends from Nibiru Studio Base Application either. You can refer to "Customize Application or activate Activity: " part into development guide documentation.

That means you need first make your application class extends x.core.util.XBaseXRApplication and then config it in AndroidManifest.xml.  

There is an example:

    <application
        android:name="com.nibiru.studio.vrdemo.SampleReplaceAndroidApplication"
        tools:replace="android:name"
        android:allowBackup="true"
        android:icon="@mipmap/icon"
        android:label="@string/app_name">
You have to log in before you can reply Login | Register

Points Rules

!fastreply! Top !return_list!