本文整理汇总了Java中com.google.android.exoplayer.audio.AudioCapabilitiesReceiver类的典型用法代码示例。如果您正苦于以下问题:Java AudioCapabilitiesReceiver类的具体用法?Java AudioCapabilitiesReceiver怎么用?Java AudioCapabilitiesReceiver使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AudioCapabilitiesReceiver类属于com.google.android.exoplayer.audio包,在下文中一共展示了AudioCapabilitiesReceiver类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.google.android.exoplayer.audio.AudioCapabilitiesReceiver; //导入依赖的package包/类
@Override
public void onCreate() {
TvApplication.setCurrentRunningProcess(this, false);
super.onCreate();
if (DEBUG) Log.d(TAG, "onCreate");
mChannelDataManager = new ChannelDataManager(getApplicationContext());
mAudioCapabilitiesReceiver = new AudioCapabilitiesReceiver(getApplicationContext(), this);
mAudioCapabilitiesReceiver.register();
mBufferManager = createBufferManager();
if (CommonFeatures.DVR.isEnabled(this)) {
JobScheduler jobScheduler =
(JobScheduler) getSystemService(Context.JOB_SCHEDULER_SERVICE);
JobInfo pendingJob = jobScheduler.getPendingJob(DVR_STORAGE_CLEANUP_JOB_ID);
if (pendingJob != null) {
// storage cleaning job is already scheduled.
} else {
JobInfo job = new JobInfo.Builder(DVR_STORAGE_CLEANUP_JOB_ID,
new ComponentName(this, TunerStorageCleanUpService.class))
.setPersisted(true).setPeriodic(TimeUnit.DAYS.toMillis(1)).build();
jobScheduler.schedule(job);
}
}
if (mBufferManager == null) {
Log.i(TAG, "Trickplay is disabled");
} else {
Log.i(TAG, "Trickplay is enabled");
}
}
示例2: onCreate
import com.google.android.exoplayer.audio.AudioCapabilitiesReceiver; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EpisodeBaseModel episode = (EpisodeBaseModel) getIntent().getSerializableExtra(ContentManagerBase.CONTENT_ID);
mOtherEpisodeUrls = Arrays.asList(getIntent().getStringArrayExtra(ContentManagerBase.OTHER_EPISODES));
resumePosition = getIntent().getLongExtra(RESUME_POSITION, 0);
if (resumePosition <= 0 && episode.getResumePosition() > 0) {
resumePosition = episode.getResumePosition();
Log.d(TAG, "Resume from recently played");
}
setContentView(R.layout.video_player_activity);
View root = findViewById(R.id.root);
mediaController = new PlaybackControls(this);
mediaController.setAnchorView(root);
videoPlayerView = new VideoPlayerView(this, mediaController, root);
audioCapabilitiesReceiver = new AudioCapabilitiesReceiver(getApplicationContext(), this);
CookieHandler currentHandler = CookieHandler.getDefault();
if (currentHandler != defaultCookieManager) {
CookieHandler.setDefault(defaultCookieManager);
}
playEpisode(episode);
}
示例3: onCreate
import com.google.android.exoplayer.audio.AudioCapabilitiesReceiver; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_video_player);
View root = findViewById(R.id.root);
root.setOnTouchListener((view, motionEvent) -> {
if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
toggleControlsVisibility();
} else if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
view.performClick();
}
return true;
});
root.setOnKeyListener((v, keyCode, event) -> !(keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_ESCAPE
|| keyCode == KeyEvent.KEYCODE_MENU) && mediaController.dispatchKeyEvent(event));
shutterView = findViewById(R.id.shutter);
videoFrame = (AspectRatioFrameLayout) findViewById(R.id.video_frame);
surfaceView = (SurfaceView) findViewById(R.id.surface_view);
surfaceView.getHolder().addCallback(this);
subtitleLayout = (SubtitleLayout) findViewById(R.id.subtitles);
mediaController = new KeyCompatibleMediaController(this);
mediaController.setAnchorView(root);
CookieHandler currentHandler = CookieHandler.getDefault();
if (currentHandler != defaultCookieManager) {
CookieHandler.setDefault(defaultCookieManager);
}
audioCapabilitiesReceiver = new AudioCapabilitiesReceiver(this, this);
audioCapabilitiesReceiver.register();
}
示例4: replaceRenderBuilder
import com.google.android.exoplayer.audio.AudioCapabilitiesReceiver; //导入依赖的package包/类
public void replaceRenderBuilder(@Nullable RenderBuilder renderBuilder) {
this.rendererBuilder = renderBuilder;
if (rendererBuilder != null && audioCapabilities == null) {
audioCapabilitiesReceiver = new AudioCapabilitiesReceiver(rendererBuilder.getContext(), this);
audioCapabilitiesReceiver.register();
}
prepared = false;
prepare();
}
示例5: setup
import com.google.android.exoplayer.audio.AudioCapabilitiesReceiver; //导入依赖的package包/类
protected void setup() {
audioCapabilitiesReceiver = new AudioCapabilitiesReceiver(getContext().getApplicationContext(), this);
audioCapabilitiesReceiver.register();
emExoPlayer = new EMExoPlayer(null);
//Sets the internal listener
emExoPlayer.setMetadataListener(null);
setSurfaceTextureListener(new EMExoVideoSurfaceTextureListener());
updateVideoSize(0, 0);
}
示例6: initExoPlayer
import com.google.android.exoplayer.audio.AudioCapabilitiesReceiver; //导入依赖的package包/类
/**
* 初始化播放器
*/
private void initExoPlayer() {
audioCapabilitiesReceiver = new AudioCapabilitiesReceiver(getContext().getApplicationContext(), this);
audioCapabilitiesReceiver.register();
okPlayer = new OkPlayer(null);
okPlayer.addListener(this);
okPlayer.setId3MetadataListener(null);
okPlayer.setSurface(surfaceView.getHolder().getSurface());
surfaceView.getHolder().addCallback(this);
}
示例7: onCreate
import com.google.android.exoplayer.audio.AudioCapabilitiesReceiver; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// TODO:
// setContentView(R.layout.player_activity);
setContentView(R.layout.player_activity_two);
root = findViewById(R.id.root);
root.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
toggleControlsVisibility();
} else if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
view.performClick();
}
return true;
}
});
root.setOnKeyListener(new OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_ESCAPE
|| keyCode == KeyEvent.KEYCODE_MENU) {
return false;
}
// TODO: return mediaController.dispatchKeyEvent(event);
return goatMediaController.dispatchKeyEvent(event);
}
});
shutterView = findViewById(R.id.shutter);
debugRootView = findViewById(R.id.controls_root);
videoFrame = (AspectRatioFrameLayout) findViewById(R.id.video_frame);
surfaceView = (SurfaceView) findViewById(R.id.surface_view);
surfaceView.getHolder().addCallback(this);
debugTextView = (TextView) findViewById(R.id.debug_text_view);
playerStateTextView = (TextView) findViewById(R.id.player_state_view);
subtitleLayout = (SubtitleLayout) findViewById(R.id.subtitles);
// TODO:
// mediaController = new MediaController(this);
// mediaController.setAnchorView(root);
goatMediaController = (GoatMediaController) findViewById(R.id.media_controller);
retryButton = (Button) findViewById(R.id.retry_button);
retryButton.setOnClickListener(this);
videoButton = (Button) findViewById(R.id.video_controls);
audioButton = (Button) findViewById(R.id.audio_controls);
textButton = (Button) findViewById(R.id.text_controls);
CookieHandler currentHandler = CookieHandler.getDefault();
if (currentHandler != defaultCookieManager) {
CookieHandler.setDefault(defaultCookieManager);
}
audioCapabilitiesReceiver = new AudioCapabilitiesReceiver(this, this);
audioCapabilitiesReceiver.register();
getWindow().getDecorView().setOnSystemUiVisibilityChangeListener(this);
}
示例8: onCreate
import com.google.android.exoplayer.audio.AudioCapabilitiesReceiver; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.player_activity);
View root = findViewById(R.id.root);
root.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
toggleControlsVisibility();
} else if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
view.performClick();
}
return true;
}
});
root.setOnKeyListener(new OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_ESCAPE
|| keyCode == KeyEvent.KEYCODE_MENU) {
return false;
}
return mediaController.dispatchKeyEvent(event);
}
});
shutterView = findViewById(R.id.shutter);
debugRootView = findViewById(R.id.controls_root);
videoFrame = (AspectRatioFrameLayout) findViewById(R.id.video_frame);
surfaceView = (SurfaceView) findViewById(R.id.surface_view);
surfaceView.getHolder().addCallback(this);
debugTextView = (TextView) findViewById(R.id.debug_text_view);
playerStateTextView = (TextView) findViewById(R.id.player_state_view);
subtitleLayout = (SubtitleLayout) findViewById(R.id.subtitles);
mediaController = new KeyCompatibleMediaController(this);
mediaController.setAnchorView(root);
retryButton = (Button) findViewById(R.id.retry_button);
retryButton.setOnClickListener(this);
videoButton = (Button) findViewById(R.id.video_controls);
audioButton = (Button) findViewById(R.id.audio_controls);
textButton = (Button) findViewById(R.id.text_controls);
CookieHandler currentHandler = CookieHandler.getDefault();
if (currentHandler != defaultCookieManager) {
CookieHandler.setDefault(defaultCookieManager);
}
audioCapabilitiesReceiver = new AudioCapabilitiesReceiver(this, this);
audioCapabilitiesReceiver.register();
}
示例9: bindView
import com.google.android.exoplayer.audio.AudioCapabilitiesReceiver; //导入依赖的package包/类
private void bindView(FrameLayout oldRoot) {
@SuppressLint("InflateParams")
ViewGroup root = (ViewGroup) activity.getLayoutInflater().inflate(R.layout.player_view_layout, null);
ViewGroupUtils.replaceView(oldRoot, root);
root.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
toggleControlsVisibility();
} else if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
view.performClick();
}
return true;
}
});
root.setOnKeyListener(new View.OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_MENU) {
return false;
}
return mediaController.dispatchKeyEvent(event);
}
});
audioCapabilitiesReceiver = new AudioCapabilitiesReceiver(activity.getApplicationContext(),
this);
shutterView = root.findViewById(R.id.shutter);
videoFrame = (AspectRatioFrameLayout) root.findViewById(R.id.video_frame);
surfaceView = (SurfaceView) root.findViewById(R.id.surface_view);
surfaceView.getHolder().addCallback(this);
subtitleLayout = (SubtitleLayout) root.findViewById(R.id.subtitles);
mediaController = new VideoControllerView(activity, false);
mediaController.setAnchorView(root);
CookieHandler currentHandler = CookieHandler.getDefault();
if (currentHandler != defaultCookieManager) {
CookieHandler.setDefault(defaultCookieManager);
}
}
示例10: onCreate
import com.google.android.exoplayer.audio.AudioCapabilitiesReceiver; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mAudioCapabilitiesReceiver = new AudioCapabilitiesReceiver(getActivity(), mAudioCapabilitiesListener);
}