FileDocCategorySizeDatePackage
MediaPlayerDataSource.javaAPI DocAndroid 5.1 API2086Thu Mar 12 22:22:48 GMT 2015com.android.ex.variablespeed

MediaPlayerDataSource

public class MediaPlayerDataSource extends Object
Encapsulates the data source for a media player.

Is used to make the setting of the data source for a {@link android.media.MediaPlayer} easier, or the calling of the correct {@link VariableSpeedNative} method done correctly. You should not use this class directly, it is for the benefit of the {@link VariableSpeed} implementation.

Fields Summary
private final android.content.Context
mContext
private final android.net.Uri
mUri
private final String
mPath
Constructors Summary
public MediaPlayerDataSource(android.content.Context context, android.net.Uri intentUri)

        mContext = context;
        mUri = intentUri;
        mPath = null;
    
public MediaPlayerDataSource(String path)

        mContext = null;
        mUri = null;
        mPath = path;
    
Methods Summary
public voidplayNative()

        if (mContext != null) {
            VariableSpeedNative.playFromContext(mContext, mUri);
        } else {
            VariableSpeedNative.playUri(mPath);
        }
    
public voidsetAsSourceFor(android.media.MediaPlayer mediaPlayer)

        if (mContext != null) {
            mediaPlayer.setDataSource(mContext, mUri);
        } else {
            mediaPlayer.setDataSource(mPath);
        }