本文整理汇总了Java中org.chromium.chrome.browser.media.remote.MediaRouteController.MediaStateListener类的典型用法代码示例。如果您正苦于以下问题:Java MediaStateListener类的具体用法?Java MediaStateListener怎么用?Java MediaStateListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MediaStateListener类属于org.chromium.chrome.browser.media.remote.MediaRouteController包,在下文中一共展示了MediaStateListener类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showMediaRouteDialog
import org.chromium.chrome.browser.media.remote.MediaRouteController.MediaStateListener; //导入依赖的package包/类
private void showMediaRouteDialog(MediaStateListener player, MediaRouteController controller,
Activity activity) {
FragmentManager fm = ((FragmentActivity) activity).getSupportFragmentManager();
if (fm == null) {
throw new IllegalStateException("The activity must be a subclass of FragmentActivity");
}
MediaRouteDialogFactory factory = new MediaRouteChooserDialogFactory(player, controller,
activity);
if (fm.findFragmentByTag(
"android.support.v7.mediarouter:MediaRouteChooserDialogFragment") != null) {
Log.w(TAG, "showDialog(): Route chooser dialog already showing!");
return;
}
MediaRouteChooserDialogFragment f = factory.onCreateChooserDialogFragment();
f.setRouteSelector(controller.buildMediaRouteSelector());
f.show(fm, "android.support.v7.mediarouter:MediaRouteChooserDialogFragment");
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:22,代码来源:RemoteMediaPlayerController.java
示例2: showMediaRouteControlDialog
import org.chromium.chrome.browser.media.remote.MediaRouteController.MediaStateListener; //导入依赖的package包/类
private void showMediaRouteControlDialog(MediaStateListener player, Activity activity) {
FragmentManager fm = ((FragmentActivity) activity).getSupportFragmentManager();
if (fm == null) {
throw new IllegalStateException("The activity must be a subclass of FragmentActivity");
}
MediaRouteDialogFactory factory = new MediaRouteControllerDialogFactory(player);
if (fm.findFragmentByTag(
"android.support.v7.mediarouter:MediaRouteControllerDialogFragment") != null) {
Log.w(TAG, "showDialog(): Route controller dialog already showing!");
return;
}
MediaRouteControllerDialogFragment f = factory.onCreateControllerDialogFragment();
f.show(fm, "android.support.v7.mediarouter:MediaRouteControllerDialogFragment");
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:17,代码来源:RemoteMediaPlayerController.java
示例3: requestRemotePlayback
import org.chromium.chrome.browser.media.remote.MediaRouteController.MediaStateListener; //导入依赖的package包/类
/**
* Called when a lower layer requests that a video be cast. This will typically be a request
* from Blink when the cast button is pressed on the default video controls.
* @param player the player for which cast is being requested
* @param frameUrl the URL of the frame containing the video, needed for YouTube videos
*/
public void requestRemotePlayback(
MediaRouteController.MediaStateListener player, MediaRouteController controller) {
Activity currentActivity = ApplicationStatus.getLastTrackedFocusedActivity();
mChromeVideoActivity = new WeakReference<Activity>(currentActivity);
if (mCurrentRouteController != null && controller != mCurrentRouteController) {
mCurrentRouteController.release();
}
onStateReset(controller);
showMediaRouteDialog(player, controller, currentActivity);
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:20,代码来源:RemoteMediaPlayerController.java
示例4: requestRemotePlaybackControl
import org.chromium.chrome.browser.media.remote.MediaRouteController.MediaStateListener; //导入依赖的package包/类
/**
* Called when a lower layer requests control of a video that is being cast.
* @param player The player for which remote playback control is being requested.
*/
public void requestRemotePlaybackControl(MediaRouteController.MediaStateListener player) {
// Player should match currently remotely played item, but there
// can be a race between various
// ways that the a video can stop playing remotely. Check that the
// player is current, and ignore if not.
if (mCurrentRouteController == null) return;
if (mCurrentRouteController.getMediaStateListener() != player) return;
showMediaRouteControlDialog(player, ApplicationStatus.getLastTrackedFocusedActivity());
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:16,代码来源:RemoteMediaPlayerController.java
示例5: requestRemotePlaybackStop
import org.chromium.chrome.browser.media.remote.MediaRouteController.MediaStateListener; //导入依赖的package包/类
/**
* Called when a lower layer requests to stop casting the video.
* @param player The player to stop remote playback for.
*/
public void requestRemotePlaybackStop(MediaRouteController.MediaStateListener player) {
if (mCurrentRouteController == null) return;
if (mCurrentRouteController.getMediaStateListener() != player) return;
mCurrentRouteController.release();
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:11,代码来源:RemoteMediaPlayerController.java
示例6: MediaRouteChooserDialogFactory
import org.chromium.chrome.browser.media.remote.MediaRouteController.MediaStateListener; //导入依赖的package包/类
MediaRouteChooserDialogFactory(MediaStateListener player, MediaRouteController controller,
Context context) {
mPlayer = player;
mController = controller;
mContext = context;
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:7,代码来源:MediaRouteChooserDialogFactory.java
示例7: Fragment
import org.chromium.chrome.browser.media.remote.MediaRouteController.MediaStateListener; //导入依赖的package包/类
@SuppressLint("ValidFragment")
Fragment(MediaRouteController controller, MediaStateListener player) {
mController = controller;
mPlayer = player;
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:6,代码来源:MediaRouteChooserDialogFactory.java
示例8: MediaRouteControllerDialogFactory
import org.chromium.chrome.browser.media.remote.MediaRouteController.MediaStateListener; //导入依赖的package包/类
MediaRouteControllerDialogFactory(MediaStateListener player) {
mPlayer = player;
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:4,代码来源:MediaRouteControllerDialogFactory.java
示例9: Fragment
import org.chromium.chrome.browser.media.remote.MediaRouteController.MediaStateListener; //导入依赖的package包/类
@SuppressLint("ValidFragment")
Fragment(MediaStateListener player) {
mPlayer = player;
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:5,代码来源:MediaRouteControllerDialogFactory.java