Android MediaPlayer 播放assets 文件夹下面的视频报错 报下面的错: java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed 调用办法是: AssetFileDescriptor afd = getResources().getAssets().openFd("input.avi");mediaPlayer…
/* * Copyright (C) 2006 The Android Open Source Project * Copyright (c) 2014 Chukong Technologies Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You m…
在Android中,我们有三种方式来实现视频的播放: 1.使用其自带的播放器.指定Action为ACTION_VIEW,Data为Uri,Type为其MIME类型. 2.使用VideoView来播放.在布局文件中使用VideoView结合MediaController来实现对其控制. 3.使用MediaPlayer类和SurfaceView来实现,这种方式很灵活. 1.调用其自带的播放器: Uri uri = Uri.parse(Environment.getExternalStorageDir…