本文整理汇总了Java中tv.danmaku.ijk.media.player.misc.IMediaDataSource类的典型用法代码示例。如果您正苦于以下问题:Java IMediaDataSource类的具体用法?Java IMediaDataSource怎么用?Java IMediaDataSource使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IMediaDataSource类属于tv.danmaku.ijk.media.player.misc包,在下文中一共展示了IMediaDataSource类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: openAssetFile
import tv.danmaku.ijk.media.player.misc.IMediaDataSource; //导入依赖的package包/类
public void openAssetFile(Context context, String assetPath) {
try {
AssetManager am = context.getResources().getAssets();
final InputStream is = am.open(assetPath);
mPlayer.setDataSource(new IMediaDataSource() {
@Override
public int readAt(long position, byte[] buffer, int offset, int size) throws IOException {
return is.read(buffer, offset, size);
}
@Override
public long getSize() throws IOException {
return is.available();
}
@Override
public void close() throws IOException {
is.close();
}
});
} catch (IOException e) {
e.printStackTrace();
}
}
示例2: setDataSource
import tv.danmaku.ijk.media.player.misc.IMediaDataSource; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.M)
@Override
public void setDataSource(IMediaDataSource mediaDataSource) {
releaseMediaDataSource();
mMediaDataSource = new MediaDataSourceProxy(mediaDataSource);
mInternalMediaPlayer.setDataSource(mMediaDataSource);
}
示例3: setDataSource
import tv.danmaku.ijk.media.player.misc.IMediaDataSource; //导入依赖的package包/类
public void setDataSource(IMediaDataSource mediaDataSource) {
throw new UnsupportedOperationException();
}
示例4: setDataSource
import tv.danmaku.ijk.media.player.misc.IMediaDataSource; //导入依赖的package包/类
public void setDataSource(IMediaDataSource mediaDataSource)
throws IllegalArgumentException, SecurityException, IllegalStateException {
_setDataSource(mediaDataSource);
}
示例5: _setDataSource
import tv.danmaku.ijk.media.player.misc.IMediaDataSource; //导入依赖的package包/类
private native void _setDataSource(IMediaDataSource mediaDataSource)
throws IllegalArgumentException, SecurityException, IllegalStateException;
示例6: MediaDataSourceProxy
import tv.danmaku.ijk.media.player.misc.IMediaDataSource; //导入依赖的package包/类
public MediaDataSourceProxy(IMediaDataSource mediaDataSource) {
mMediaDataSource = mediaDataSource;
}
示例7: setDataSource
import tv.danmaku.ijk.media.player.misc.IMediaDataSource; //导入依赖的package包/类
@Override
public void setDataSource(IMediaDataSource mediaDataSource) {
mBackEndMediaPlayer.setDataSource(mediaDataSource);
}
示例8: setDataSource
import tv.danmaku.ijk.media.player.misc.IMediaDataSource; //导入依赖的package包/类
@Override
public void setDataSource(IMediaDataSource iMediaDataSource) {
mMediaPlayer.setDataSource(iMediaDataSource);
}