Android 在线视频不播放
我正在学习一个用Android播放视频的教程, 但是当我在Emulator上运行应用程序时,它给出了以下错误 MediaPlayer错误(1,-2147483648) 请帮忙 这是我申请的代码 爪哇 XMLAndroid 在线视频不播放,android,video-streaming,android-videoview,android-video-player,Android,Video Streaming,Android Videoview,Android Video Player,我正在学习一个用Android播放视频的教程, 但是当我在Emulator上运行应用程序时,它给出了以下错误 MediaPlayer错误(1,-2147483648) 请帮忙 这是我申请的代码 爪哇 XML 并表明 <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.examp
并表明
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.videoplayer"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.videoplayer.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
将此作为一个答案添加到此处,以帮助其他人解决此问题-我看到此错误主要发生在模拟器上,并且似乎在设备上运行良好。可能是模拟器安装问题,如果发现任何官方报告的问题,我将更新此线程。我只在尝试播放不受支持的格式(如wmv)的设备上见过这种情况。如果有人在模拟器上有此问题的链接,请添加您在设备上试用过吗?是的,现在试用。效果很好!!非常感谢。真棒的男人。。。。你的代码在我的Nexus 7上起作用了你能帮我吗?我已经使用videoview进行直播,但我得到的问题与上述问题相同
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<VideoView
android:id="@+id/video"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"/>
<ProgressBar
android:id="@+id/prog"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_gravity="center"/>
</FrameLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.videoplayer"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.videoplayer.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>