我开发了一个小型Android应用程序,其中提供了一个链接,它只需要播放该视频。 但播放说"无法播放此视频"。 谁能帮助我呢?
主要活动代码:
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final VideoView ramVV= (VideoView)findViewById(R.id.ramVV);
ramVV.setVideoPath("https://www.thenewboston.com/forum/project_files/006_testVideo.mp4");
ramVV.start();
}
}
logcat显示以下内容:
07-18 22:24:19.925 17364-17364/com.example.ram.videoplayer D/﹕ HostConnection::get() New Host Connection established 0xb3eb3e80, tid 17364
07-18 22:24:20.015 17364-17364/com.example.ram.videoplayer D/Atlas﹕ Validating map...
07-18 22:24:20.059 17364-17379/com.example.ram.videoplayer D/﹕ HostConnection::get() New Host Connection established 0xb3eb3fd0, tid 17379
07-18 22:24:20.076 17364-17379/com.example.ram.videoplayer I/OpenGLRenderer﹕ Initialized EGL, version 1.4
07-18 22:24:20.110 17364-17379/com.example.ram.videoplayer D/OpenGLRenderer﹕ Enabling debug mode 0
07-18 22:24:20.117 17364-17379/com.example.ram.videoplayer W/EGL_emulation﹕ eglSurfaceAttrib not implemented
07-18 22:24:20.117 17364-17379/com.example.ram.videoplayer W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xb3f1ec20, error=EGL_SUCCESS
07-18 22:24:20.167 17364-17364/com.example.ram.videoplayer D/MediaPlayer﹕ Couldn't open file on client side, trying server side
07-18 22:24:50.612 17364-17378/com.example.ram.videoplayer E/MediaPlayer﹕ error (1, -2147483648)
07-18 22:24:50.612 17364-17364/com.example.ram.videoplayer E/MediaPlayer﹕ Error (1,-2147483648)
07-18 22:24:50.612 17364-17364/com.example.ram.videoplayer D/VideoView﹕ Error: 1,-2147483648
07-18 22:24:50.703 17364-17379/com.example.ram.videoplayer W/EGL_emulation﹕ eglSurfaceAttrib not implemented
07-18 22:24:50.703 17364-17379/com.example.ram.videoplayer W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xb3feb960, error=EGL_SUCCESS
07-18 22:24:53.600 17364-17379/com.example.ram.videoplayer D/OpenGLRenderer﹕ endAllStagingAnimators on 0xa512fd80 (RippleDrawable) with handle 0xa51358f0
我还在Manifest文件中添加了权限。