本文整理汇总了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);
}
示例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();
}
示例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);
}
示例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();
}