本文整理汇总了Java中org.videolan.libvlc.EventHandler.MediaPlayerStopped方法的典型用法代码示例。如果您正苦于以下问题:Java EventHandler.MediaPlayerStopped方法的具体用法?Java EventHandler.MediaPlayerStopped怎么用?Java EventHandler.MediaPlayerStopped使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.videolan.libvlc.EventHandler
的用法示例。
在下文中一共展示了EventHandler.MediaPlayerStopped方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleMessage
import org.videolan.libvlc.EventHandler; //导入方法依赖的package包/类
@Override
public void handleMessage(Message msg) {
FullscreenVlcPlayer player = mOwner.get();
// Player events
if (msg.what == VideoSizeChanged) {
player.setSize(msg.arg1, msg.arg2);
return;
}
// Libvlc events
Bundle b = msg.getData();
switch (b.getInt("event")) {
case EventHandler.MediaPlayerEndReached:
player.releasePlayer();
break;
case EventHandler.MediaPlayerPlaying:
case EventHandler.MediaPlayerPaused:
case EventHandler.MediaPlayerStopped:
default:
break;
}
}
示例2: setRemoteControlClientPlaybackState
import org.videolan.libvlc.EventHandler; //导入方法依赖的package包/类
/**
* A function to control the Remote Control Client. It is needed for
* compatibility with devices below Ice Cream Sandwich (4.0).
*
* @param p Playback state
*/
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
private void setRemoteControlClientPlaybackState(int state) {
if (!LibVlcUtil.isICSOrLater() || mRemoteControlClient == null)
return;
switch (state) {
case EventHandler.MediaPlayerPlaying:
mRemoteControlClient.setPlaybackState(RemoteControlClient.PLAYSTATE_PLAYING);
break;
case EventHandler.MediaPlayerPaused:
mRemoteControlClient.setPlaybackState(RemoteControlClient.PLAYSTATE_PAUSED);
break;
case EventHandler.MediaPlayerStopped:
mRemoteControlClient.setPlaybackState(RemoteControlClient.PLAYSTATE_STOPPED);
break;
}
}
示例3: setRemoteControlClientPlaybackState
import org.videolan.libvlc.EventHandler; //导入方法依赖的package包/类
/**
* A function to control the Remote Control Client. It is needed for
* compatibility with devices below Ice Cream Sandwich (4.0).
*
* @param p Playback state
*/
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
private void setRemoteControlClientPlaybackState(int state) {
if(!Util.isICSOrLater() || mRemoteControlClient == null)
return;
switch (state) {
case EventHandler.MediaPlayerPlaying:
mRemoteControlClient.setPlaybackState(RemoteControlClient.PLAYSTATE_PLAYING);
break;
case EventHandler.MediaPlayerPaused:
mRemoteControlClient.setPlaybackState(RemoteControlClient.PLAYSTATE_PAUSED);
break;
case EventHandler.MediaPlayerStopped:
mRemoteControlClient.setPlaybackState(RemoteControlClient.PLAYSTATE_STOPPED);
break;
}
}
示例4: handleMessage
import org.videolan.libvlc.EventHandler; //导入方法依赖的package包/类
@Override
public void handleMessage(Message msg) {
VideoActivity player = mOwner.get();
// SamplePlayer events
if (msg.what == VideoSizeChanged) {
Log.d(TAG, "Video Size Changed:" + msg.arg1 + " " + msg.arg2);
player.setSize(msg.arg1, msg.arg2);
return;
}
// Libvlc events
Bundle b = msg.getData();
switch (b.getInt("event")) {
case EventHandler.MediaPlayerEndReached:
player.releasePlayer();
break;
case EventHandler.MediaPlayerPlaying:
case EventHandler.MediaPlayerPaused:
case EventHandler.MediaPlayerStopped:
default:
break;
}
}
示例5: handleMessage
import org.videolan.libvlc.EventHandler; //导入方法依赖的package包/类
@Override
public void handleMessage(Message msg) {
VideoActivity player = mOwner.get();
// SamplePlayer events
if (msg.what == VideoSizeChanged) {
// player.setSize(msg.arg1, msg.arg2);
player.changeSurfaceLayout();
return;
}
// Libvlc events
Bundle b = msg.getData();
switch (b.getInt("event")) {
case EventHandler.MediaPlayerEndReached:
System.out.println(">>> VideoActivity.MyHandler.handleMessage():::MediaPlayerEndReached");
Log.d(TAG, "MediaPlayerEndReached");
player.releasePlayer();
break;
case EventHandler.MediaPlayerPlaying:
case EventHandler.MediaPlayerPaused:
case EventHandler.MediaPlayerStopped:
default:
break;
}
}
示例6: handleMessage
import org.videolan.libvlc.EventHandler; //导入方法依赖的package包/类
@Override
public void handleMessage(Message msg) {
VideoPlayerActivity activity = getOwner();
if(activity == null) return;
// Do not handle events if we are leaving the VideoPlayerActivity
if (activity.mSwitchingView) return;
switch (msg.getData().getInt("event")) {
case EventHandler.MediaParsedChanged:
Log.i(TAG, "MediaParsedChanged");
if (activity.mLibVLC.getVideoTracksCount() < 1) {
Log.i(TAG, "No video track, open in audio mode");
activity.switchToAudioMode();
}
break;
case EventHandler.MediaPlayerPlaying:
Log.i(TAG, "MediaPlayerPlaying");
activity.stopLoadingAnimation();
activity.showOverlay();
/** FIXME: update the track list when it changes during the
* playback. (#7540) */
activity.setESTrackLists(true);
activity.setESTracks();
activity.changeAudioFocus(true);
break;
case EventHandler.MediaPlayerPaused:
Log.i(TAG, "MediaPlayerPaused");
break;
case EventHandler.MediaPlayerStopped:
Log.i(TAG, "MediaPlayerStopped");
activity.changeAudioFocus(false);
break;
case EventHandler.MediaPlayerEndReached:
Log.i(TAG, "MediaPlayerEndReached");
activity.changeAudioFocus(false);
activity.endReached();
break;
case EventHandler.MediaPlayerVout:
activity.handleVout(msg);
break;
case EventHandler.MediaPlayerPositionChanged:
if (!activity.mCanSeek)
activity.mCanSeek = true;
//don't spam the logs
break;
case EventHandler.MediaPlayerEncounteredError:
Log.i(TAG, "MediaPlayerEncounteredError");
activity.encounteredError();
break;
case EventHandler.HardwareAccelerationError:
Log.i(TAG, "HardwareAccelerationError");
activity.handleHardwareAccelerationError();
break;
default:
Log.e(TAG, String.format("Event not handled (0x%x)", msg.getData().getInt("event")));
break;
}
activity.updateOverlayPausePlay();
}
示例7: handleMessage
import org.videolan.libvlc.EventHandler; //导入方法依赖的package包/类
@Override
public void handleMessage(Message msg) {
VideoPlayerActivity activity = getOwner();
if(activity == null) return;
// Do not handle events if we are leaving the VideoPlayerActivity
if (activity.mSwitchingView) return;
switch (msg.getData().getInt("event")) {
case EventHandler.MediaParsedChanged:
Log.i(TAG, "MediaParsedChanged");
activity.updateNavStatus();
if (!activity.mHasMenu && activity.mLibVLC.getVideoTracksCount() < 1) {
Log.i(TAG, "No video track, open in audio mode");
activity.switchToAudioMode();
}
break;
case EventHandler.MediaPlayerPlaying:
Log.i(TAG, "MediaPlayerPlaying");
activity.stopLoadingAnimation();
activity.showOverlay();
/** FIXME: update the track list when it changes during the
* playback. (#7540) */
activity.setESTrackLists(true);
activity.setESTracks();
activity.changeAudioFocus(true);
activity.updateNavStatus();
break;
case EventHandler.MediaPlayerPaused:
Log.i(TAG, "MediaPlayerPaused");
break;
case EventHandler.MediaPlayerStopped:
Log.i(TAG, "MediaPlayerStopped");
activity.changeAudioFocus(false);
break;
case EventHandler.MediaPlayerEndReached:
Log.i(TAG, "MediaPlayerEndReached");
activity.changeAudioFocus(false);
activity.endReached();
break;
case EventHandler.MediaPlayerVout:
activity.updateNavStatus();
if (!activity.mHasMenu)
activity.handleVout(msg);
break;
case EventHandler.MediaPlayerPositionChanged:
if (!activity.mCanSeek)
activity.mCanSeek = true;
//don't spam the logs
break;
case EventHandler.MediaPlayerEncounteredError:
Log.i(TAG, "MediaPlayerEncounteredError");
activity.encounteredError();
break;
case EventHandler.HardwareAccelerationError:
Log.i(TAG, "HardwareAccelerationError");
activity.handleHardwareAccelerationError();
break;
default:
Log.e(TAG, String.format("Event not handled (0x%x)", msg.getData().getInt("event")));
break;
}
activity.updateOverlayPausePlay();
}
示例8: handleMessage
import org.videolan.libvlc.EventHandler; //导入方法依赖的package包/类
@Override
public void handleMessage(Message msg) {
VideoPlayerActivity activity = getOwner();
if (activity == null)
return;
switch (msg.getData().getInt("event")) {
case EventHandler.MediaPlayerPlaying:
Log.i(TAG, "MediaPlayerPlaying");
activity.showOverlay();
/**
* FIXME: update the track list when it changes during the
* playback. (#7540)
*/
// TRIBLER
if (VideoPlayerActivity.initCompleted
&& VideoPlayerActivity.seekBufferCompleted) {
activity.setESTrackLists(true);
activity.setESTracks();
activity.changeAudioFocus(true);
}
break;
case EventHandler.MediaPlayerPaused:
Log.i(TAG, "MediaPlayerPaused");
break;
case EventHandler.MediaPlayerStopped:
Log.i(TAG, "MediaPlayerStopped");
activity.changeAudioFocus(false);
break;
case EventHandler.MediaPlayerEndReached:
Log.i(TAG, "MediaPlayerEndReached");
// activity.changeAudioFocus(false);
activity.endReached();
break;
case EventHandler.MediaPlayerVout:
activity.handleVout(msg);
break;
case EventHandler.MediaPlayerPositionChanged:
if (!activity.mCanSeek)
activity.mCanSeek = true;
// don't spam the logs
break;
case EventHandler.MediaPlayerEncounteredError:
Log.i(TAG, "MediaPlayerEncounteredError");
activity.encounteredError();
break;
default:
Log.e(TAG, String.format("Event not handled (0x%x)", msg
.getData().getInt("event")));
break;
}
activity.updateOverlayPausePlay();
}