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


Java EventHandler.MediaPlayerPlaying方法代码示例

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


在下文中一共展示了EventHandler.MediaPlayerPlaying方法的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;
    }
}
 
开发者ID:wass08,项目名称:VLC-Simple-Player-Android,代码行数:24,代码来源:FullscreenVlcPlayer.java

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

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

示例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;
    }
}
 
开发者ID:jiangerji,项目名称:danmaku-project,代码行数:25,代码来源:VideoActivity.java

示例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;
        }
    }
 
开发者ID:tyazid,项目名称:Exoplayer_VLC,代码行数:29,代码来源:VideoActivity.java

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

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

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


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