当前位置: 首页>>代码示例>>Java>>正文


Java EventHandler.MediaPlayerPositionChanged方法代码示例

本文整理汇总了Java中org.videolan.libvlc.EventHandler.MediaPlayerPositionChanged方法的典型用法代码示例。如果您正苦于以下问题:Java EventHandler.MediaPlayerPositionChanged方法的具体用法?Java EventHandler.MediaPlayerPositionChanged怎么用?Java EventHandler.MediaPlayerPositionChanged使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.videolan.libvlc.EventHandler的用法示例。


在下文中一共展示了EventHandler.MediaPlayerPositionChanged方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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();
}
 
开发者ID:Tribler,项目名称:tribler-android,代码行数:60,代码来源:VideoPlayerActivity.java

示例2: 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();
}
 
开发者ID:smyhvae,项目名称:VlcTest,代码行数:64,代码来源:VideoPlayerActivity.java

示例3: 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();
}
 
开发者ID:KlepikovMD,项目名称:popcorntime-android-kitkat,代码行数:55,代码来源:VideoPlayerActivity.java


注:本文中的org.videolan.libvlc.EventHandler.MediaPlayerPositionChanged方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。