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


Java Media.setEventListener方法代码示例

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


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

示例1: stop

import org.videolan.libvlc.Media; //导入方法依赖的package包/类
@MainThread
public void stop() {
    if (mMediaPlayer == null)
        return;
    savePosition();
    final Media media = mMediaPlayer.getMedia();
    if (media != null) {
        media.setEventListener(null);
        mMediaPlayer.setEventListener(null);
        mMediaPlayer.stop();
        mMediaPlayer.setMedia(null);
        media.release();
    }
    mMediaList.removeEventListener(mListEventListener);
    setRemoteControlClientPlaybackState(MediaPlayer.Event.Stopped);
    mCurrentIndex = -1;
    mPrevious.clear();
    mHandler.removeMessages(SHOW_PROGRESS);
    hideNotification();
    broadcastMetadata();
    executeUpdate();
    executeUpdateProgress();
    changeAudioFocus(false);
}
 
开发者ID:jiaZengShen,项目名称:vlc_android_win,代码行数:25,代码来源:PlaybackService.java

示例2: playIndex

import org.videolan.libvlc.Media; //导入方法依赖的package包/类
/**
 * Play a media from the media list (playlist)
 *
 * @param index The index of the media
 * @param flags LibVLC.MEDIA_* flags
 */
public void playIndex(int index, int flags) {
    if (mMediaList.size() == 0) {
        Log.w(TAG, "Warning: empty media list, nothing to play !");
        return;
    }
    if (index >= 0 && index < mMediaList.size()) {
        mCurrentIndex = index;
    } else {
        Log.w(TAG, "Warning: index " + index + " out of bounds");
        mCurrentIndex = 0;
    }

    String mrl = mMediaList.getMRL(index);
    if (mrl == null)
        return;
    final MediaWrapper mw = mMediaList.getMedia(index);
    if (mw == null)
        return;

    final Media media = new Media(VLCInstance.get(), mw.getUri());
    VLCOptions.setMediaOptions(media, this, flags | mw.getFlags());
    media.setEventListener(mMediaListener);
    mMediaPlayer.setMedia(media);
    media.release();
    mMediaPlayer.setEqualizer(VLCOptions.getEqualizer(this));
    mMediaPlayer.setVideoTitleDisplay(MediaPlayer.Position.Disable, 0);
    changeAudioFocus(true);
    mMediaPlayer.setEventListener(mMediaPlayerListener);
    mMediaPlayer.play();

    notifyTrackChanged();
    determinePrevAndNextIndices();
}
 
开发者ID:jiaZengShen,项目名称:vlc_android_win,代码行数:40,代码来源:PlaybackService.java

示例3: stop

import org.videolan.libvlc.Media; //导入方法依赖的package包/类
@MainThread
public void stop() {
    if (mMediaSession != null) {
        mMediaSession.setActive(false);
        mMediaSession.release();
        mMediaSession = null;
    }
    if (mMediaPlayer == null)
        return;
    savePosition();
    final Media media = mMediaPlayer.getMedia();
    if (media != null) {
        media.setEventListener(null);
        mMediaPlayer.setEventListener(null);
        mMediaPlayer.stop();
        mMediaPlayer.setMedia(null);
        media.release();
    }
    mMediaList.removeEventListener(mListEventListener);
    setRemoteControlClientPlaybackState(MediaPlayer.Event.Stopped);
    mCurrentIndex = -1;
    mPrevious.clear();
    mHandler.removeMessages(SHOW_PROGRESS);
    hideNotification();
    broadcastMetadata();
    executeUpdate();
    executeUpdateProgress();
    changeAudioFocus(false);
}
 
开发者ID:hanhailong,项目名称:VCL-Android,代码行数:30,代码来源:PlaybackService.java

示例4: playIndex

import org.videolan.libvlc.Media; //导入方法依赖的package包/类
/**
 * Play a media from the media list (playlist)
 *
 * @param index The index of the media
 * @param flags LibVLC.MEDIA_* flags
 */
public void playIndex(int index, int flags) {
    if (mMediaList.size() == 0) {
        Log.w(TAG, "Warning: empty media list, nothing to play !");
        return;
    }
    if (index >= 0 && index < mMediaList.size()) {
        mCurrentIndex = index;
    } else {
        Log.w(TAG, "Warning: index " + index + " out of bounds");
        mCurrentIndex = 0;
    }

    String mrl = mMediaList.getMRL(index);
    if (mrl == null)
        return;
    final MediaWrapper mw = mMediaList.getMedia(index);
    if (mw == null)
        return;

    /* Pausable and seekable are true by default */
    mPausable = mSeekable = true;
    final Media media = new Media(VLCInstance.get(), mw.getUri());
    VLCOptions.setMediaOptions(media, this, flags | mw.getFlags());
    media.setEventListener(mMediaListener);
    mMediaPlayer.setMedia(media);
    media.release();
    mMediaPlayer.setEqualizer(VLCOptions.getEqualizer(this));
    mMediaPlayer.setVideoTitleDisplay(MediaPlayer.Position.Disable, 0);
    changeAudioFocus(true);
    mMediaPlayer.setEventListener(mMediaPlayerListener);
    mMediaPlayer.play();

    notifyTrackChanged();
    determinePrevAndNextIndices();
}
 
开发者ID:hanhailong,项目名称:VCL-Android,代码行数:42,代码来源:PlaybackService.java


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