基线备份:thirdparty 变体完成 + Android 4.2 兼容改造前
包含内容: - thirdparty flavor 独立 applicationId + Intent 入口(ThirdPartyEntryActivity) - 58 后端接口适配(单 /api 路径、code 0/200、camelCase 字段、UNBOUND 轮询) - MAC 硬件锚定校验(防一凭证多设备共用) - EPG mac 覆盖 SDK init(sMacOverride)+ ChannelManger 初始化对齐 - 提示文案优化(设备未注册/权益未绑定)
This commit is contained in:
229
mediaplayertv/src/main/java/com/pukka/videoplayertv/IMediaPlayer.java
Executable file
229
mediaplayertv/src/main/java/com/pukka/videoplayertv/IMediaPlayer.java
Executable file
@@ -0,0 +1,229 @@
|
||||
|
||||
package com.pukka.videoplayertv;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.view.Surface;
|
||||
import android.view.SurfaceHolder;
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
/**
|
||||
* 播放器相关接口定义和播放器相关常量
|
||||
* */
|
||||
public interface IMediaPlayer {
|
||||
|
||||
int MEDIA_INFO_UNKNOWN = 1;
|
||||
int MEDIA_INFO_STARTED_AS_NEXT = 2;
|
||||
/**第一帧 3*/
|
||||
int MEDIA_INFO_VIDEO_RENDERING_START = 3;
|
||||
int MEDIA_INFO_VIDEO_TRACK_LAGGING = 700;
|
||||
/**开始缓冲 701*/
|
||||
int MEDIA_INFO_BUFFERING_START = 701;
|
||||
/**结束缓冲 702*/
|
||||
int MEDIA_INFO_BUFFERING_END = 702;
|
||||
int MEDIA_INFO_NETWORK_BANDWIDTH = 703;
|
||||
int MEDIA_INFO_BAD_INTERLEAVING = 800;
|
||||
int MEDIA_INFO_NOT_SEEKABLE = 801;
|
||||
int MEDIA_INFO_METADATA_UPDATE = 802;
|
||||
int MEDIA_INFO_TIMED_TEXT_ERROR = 900;
|
||||
int MEDIA_INFO_UNSUPPORTED_SUBTITLE = 901;
|
||||
int MEDIA_INFO_SUBTITLE_TIMED_OUT = 902;
|
||||
|
||||
int MEDIA_INFO_VIDEO_ROTATION_CHANGED = 10001;
|
||||
int MEDIA_INFO_AUDIO_RENDERING_START = 10002;
|
||||
|
||||
int MEDIA_ERROR_UNKNOWN = 1;
|
||||
int MEDIA_ERROR_SERVER_DIED = 100;
|
||||
int MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK = 200;
|
||||
/**IO异常 -1004*/
|
||||
int MEDIA_ERROR_IO = -1004;
|
||||
int MEDIA_ERROR_MALFORMED = -1007;
|
||||
/**IO异常 -1010*/
|
||||
int MEDIA_ERROR_UNSUPPORTED = -1010;
|
||||
/**超时异常 -110*/
|
||||
int MEDIA_ERROR_TIMED_OUT = -110;
|
||||
|
||||
void setDisplay(SurfaceHolder sh);
|
||||
|
||||
void setDataSource(Context context, Uri uri)
|
||||
throws IOException, IllegalArgumentException, SecurityException, IllegalStateException;
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
|
||||
void setDataSource(Context context, Uri uri, Map<String, String> headers)
|
||||
throws IOException, IllegalArgumentException, SecurityException, IllegalStateException;
|
||||
|
||||
void setDataSource(FileDescriptor fd)
|
||||
throws IOException, IllegalArgumentException, IllegalStateException;
|
||||
/**
|
||||
* 设置媒体资源
|
||||
* */
|
||||
void setDataSource(String path)
|
||||
throws IOException, IllegalArgumentException, SecurityException, IllegalStateException;
|
||||
/**
|
||||
* 获取媒体资源
|
||||
* */
|
||||
String getDataSource();
|
||||
/**
|
||||
* 异步准备媒体资源
|
||||
* */
|
||||
void prepareAsync() throws IllegalStateException;
|
||||
/**
|
||||
* 开始播放
|
||||
* */
|
||||
void start() throws IllegalStateException;
|
||||
/**
|
||||
* 停止
|
||||
* */
|
||||
void stop() throws IllegalStateException;
|
||||
/**
|
||||
* 暂停
|
||||
* */
|
||||
void pause() throws IllegalStateException;
|
||||
|
||||
void setScreenOnWhilePlaying(boolean screenOn);
|
||||
|
||||
int getVideoWidth();
|
||||
|
||||
int getVideoHeight();
|
||||
/**
|
||||
* 是否在播放
|
||||
* */
|
||||
boolean isPlaying();
|
||||
/**
|
||||
* 定位播放
|
||||
* */
|
||||
void seekTo(long msec) throws IllegalStateException;
|
||||
/**
|
||||
* 获取当前播放时长
|
||||
* */
|
||||
long getCurrentPosition();
|
||||
/**
|
||||
* 获取播放总时长
|
||||
* */
|
||||
long getDuration();
|
||||
/**
|
||||
* 销毁播放器
|
||||
* */
|
||||
void release();
|
||||
/**
|
||||
* 复位播放器
|
||||
* */
|
||||
void reset();
|
||||
/**
|
||||
* 倍数播
|
||||
* */
|
||||
void setSpeed(float speed);
|
||||
|
||||
float getSpeed();
|
||||
|
||||
void setVolume(float leftVolume, float rightVolume);
|
||||
|
||||
int getAudioSessionId();
|
||||
|
||||
MediaInfo getMediaInfo();
|
||||
|
||||
@Deprecated
|
||||
boolean isPlayable();
|
||||
/**
|
||||
* 播放准备就绪回调
|
||||
* */
|
||||
void setOnPreparedListener(OnPreparedListener listener);
|
||||
/**
|
||||
* 播放结束回调
|
||||
* */
|
||||
void setOnCompletionListener(OnCompletionListener listener);
|
||||
/**
|
||||
* 播放缓冲进度回调
|
||||
* */
|
||||
void setOnBufferingUpdateListener(
|
||||
OnBufferingUpdateListener listener);
|
||||
/**
|
||||
* 定位播放结束回调
|
||||
* */
|
||||
void setOnSeekCompleteListener(
|
||||
OnSeekCompleteListener listener);
|
||||
|
||||
void setOnVideoSizeChangedListener(
|
||||
OnVideoSizeChangedListener listener);
|
||||
/**
|
||||
* 播放错误回调
|
||||
* */
|
||||
void setOnErrorListener(OnErrorListener listener);
|
||||
/**
|
||||
* 播放消息回调
|
||||
* */
|
||||
void setOnInfoListener(OnInfoListener listener);
|
||||
|
||||
/*--------------------
|
||||
* Listeners
|
||||
*/
|
||||
interface OnPreparedListener {
|
||||
void onPrepared(IMediaPlayer mp);
|
||||
}
|
||||
|
||||
interface OnCompletionListener {
|
||||
void onCompletion(IMediaPlayer mp);
|
||||
}
|
||||
|
||||
interface OnBufferingUpdateListener {
|
||||
void onBufferingUpdate(IMediaPlayer mp, int percent);
|
||||
}
|
||||
|
||||
interface OnSeekCompleteListener {
|
||||
void onSeekComplete(IMediaPlayer mp);
|
||||
}
|
||||
|
||||
interface OnVideoSizeChangedListener {
|
||||
void onVideoSizeChanged(IMediaPlayer mp, int width, int height,
|
||||
int sar_num, int sar_den);
|
||||
}
|
||||
|
||||
interface OnErrorListener {
|
||||
boolean onError(IMediaPlayer mp, int what, int extra);
|
||||
}
|
||||
|
||||
interface OnInfoListener {
|
||||
boolean onInfo(IMediaPlayer mp, int what, int extra);
|
||||
}
|
||||
|
||||
/*--------------------
|
||||
* Optional
|
||||
*/
|
||||
void setAudioStreamType(int streamtype);
|
||||
|
||||
@Deprecated
|
||||
void setKeepInBackground(boolean keepInBackground);
|
||||
|
||||
int getVideoSarNum();
|
||||
|
||||
int getVideoSarDen();
|
||||
|
||||
@Deprecated
|
||||
void setWakeMode(Context context, int mode);
|
||||
|
||||
void setLooping(boolean looping);
|
||||
|
||||
boolean isLooping();
|
||||
|
||||
/*--------------------
|
||||
* AndroidMediaPlayer: JELLY_BEAN
|
||||
*/
|
||||
ITrackInfo[] getTrackInfo();
|
||||
|
||||
/*--------------------
|
||||
* AndroidMediaPlayer: ICE_CREAM_SANDWICH:
|
||||
*/
|
||||
void setSurface(Surface surface);
|
||||
|
||||
/*--------------------
|
||||
* AndroidMediaPlayer: M:
|
||||
*/
|
||||
void setDataSource(IMediaDataSource mediaDataSource);
|
||||
/**
|
||||
* exoPlayer getBufferPercentage
|
||||
* */
|
||||
int getBufferPercentage();
|
||||
}
|
||||
Reference in New Issue
Block a user