我正在构建一个包含Unity 3d交互式体验的Android应用程序.
我已将Unity项目导入Android Studio,但在启动时,活动是全屏的,并未显示Android操作栏.
我怎样才能做到这一点?
整合步骤
试图解决方案
AndroidManifest.xml中
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.company.unity.test"
android:installLocation="preferExternal"
android:versionCode="1"
android:versionName="1.0">
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="true" />
<application
android:banner="@drawable/app_banner"
android:debuggable="false"
android:icon="@drawable/app_icon"
android:isGame="true"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity
android:name="com.company.unity.test.UnityPlayerActivity"
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale"
android:label="@string/app_name"
android:launchMode="singleTask"
android:screenOrientation="fullSensor">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
<meta-data
android:name="unityplayer.UnityActivity"
android:value="true" />
</activity>
</application>
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="23" />
<uses-feature …Run Code Online (Sandbox Code Playgroud) 我正在尝试开发一个应用程序,它通过RTSP(实时流协议)从安全摄像头下载实时视频流.
我已经成功连接到相机,可以查看视频VideoView.但是,我希望对数据流进行低级访问,因此一直在寻找MediaExtractorAPI.
当我将数据源设置为RTSP URI时,我收到IOException- 无法打开文件.这是令人困惑的,因为这个相同的URI在VideoViewVLC和其他媒体播放器中正常工作.我假设VideoView必须MediaExtractor在引擎盖下使用相同的选项.是否MediaExtractor支持RTSP?我期待MediaExtractor打开我的RTSP URI.我在文档中看不到任何不受支持的地方.如果我遗失了什么,请指出我正确的方向.我看到有其他库,如FFmpeg,VLC和Live555可用,但我试图尽可能使用Android SDK.
代码(Kotlin):
val extractor = MediaExtractor()
extractor.setDataSource("rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov")
Run Code Online (Sandbox Code Playgroud)
错误:
2018-12-11 15:43:23.259 21127-21127/com.crichq.myactionreplayhub E/FileSource: Failed to open file 'rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov'. (No such file or directory)
2018-12-11 15:43:23.260 21127-21127/com.crichq.myactionreplayhub D/AndroidRuntime: Shutting down VM
2018-12-11 15:43:23.262 21127-21127/com.crichq.myactionreplayhub E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.crichq.myactionreplayhub, PID: 21127
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.crichq.myactionreplayhub/com.crichq.myactionreplayhub.MediaExtractorActivity}: java.io.IOException: Failed to instantiate extractor.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2957)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696) …Run Code Online (Sandbox Code Playgroud)