本文整理汇总了Java中org.videolan.libvlc.EventHandler.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java EventHandler.getInstance方法的具体用法?Java EventHandler.getInstance怎么用?Java EventHandler.getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.videolan.libvlc.EventHandler
的用法示例。
在下文中一共展示了EventHandler.getInstance方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onDestroy
import org.videolan.libvlc.EventHandler; //导入方法依赖的package包/类
@Override
protected void onDestroy() {
super.onDestroy();
unregisterReceiver(mReceiver);
EventHandler em = EventHandler.getInstance();
em.removeHandler(eventHandler);
// MediaCodec opaque direct rendering should not be used anymore since there is no surface to attach.
mLibVLC.eventVideoPlayerActivityCreated(false);
// HW acceleration was temporarily disabled because of an error, restore the previous value.
if (mDisabledHardwareAcceleration)
mLibVLC.setHardwareAcceleration(mPreviousHardwareAccelerationMode);
mAudioManager = null;
}
示例2: onDestroy
import org.videolan.libvlc.EventHandler; //导入方法依赖的package包/类
@Override
protected void onDestroy() {
Log.d("lifeCycleVPA", "onDestroy");
super.onDestroy();
unregisterReceiver(mReceiver);
EventHandler em = EventHandler.getInstance();
em.removeHandler(eventHandler);
mAudioManager = null;
// TRIBLER
initCompleted = false;
metaDataDone = false;
seekBufferCompleted = false;
inMetaDataWait = false;
magnet = false;
torrentFile = false;
if (!contentName.isEmpty()) {
libTorrent().RemoveTorrent(contentName);
}
libTorrent().AbortSession();
asyncTaskRunning.remove("main");
// delete libTorrent instance
deleteLibTorrent();
}
示例3: eventHardwareAccelerationError
import org.videolan.libvlc.EventHandler; //导入方法依赖的package包/类
public void eventHardwareAccelerationError() {
EventHandler em = EventHandler.getInstance();
em.callback(EventHandler.HardwareAccelerationError, new Bundle());
}
示例4: onCreate
import org.videolan.libvlc.EventHandler; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
// Get libVLC instance
try {
mLibVLC = VLCInstance.getLibVlcInstance();
} catch (LibVlcException e) {
e.printStackTrace();
}
mCallback = new HashMap<IAudioServiceCallback, Integer>();
mCurrentIndex = -1;
mPrevIndex = -1;
mNextIndex = -1;
mPrevious = new Stack<Integer>();
mEventHandler = EventHandler.getInstance();
mRemoteControlClientReceiverComponent = new ComponentName(getPackageName(),
RemoteControlClientReceiver.class.getName());
// Make sure the audio player will acquire a wake-lock while playing. If we don't do
// that, the CPU might go to sleep while the song is playing, causing playback to stop.
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG);
IntentFilter filter = new IntentFilter();
filter.setPriority(Integer.MAX_VALUE);
filter.addAction(ACTION_REMOTE_BACKWARD);
filter.addAction(ACTION_REMOTE_PLAYPAUSE);
filter.addAction(ACTION_REMOTE_PLAY);
filter.addAction(ACTION_REMOTE_PAUSE);
filter.addAction(ACTION_REMOTE_STOP);
filter.addAction(ACTION_REMOTE_FORWARD);
filter.addAction(ACTION_REMOTE_LAST_PLAYLIST);
filter.addAction(ACTION_WIDGET_INIT);
filter.addAction(Intent.ACTION_HEADSET_PLUG);
filter.addAction(AudioManager.ACTION_AUDIO_BECOMING_NOISY);
filter.addAction(VLCApplication.SLEEP_INTENT);
registerReceiver(serviceReceiver, filter);
final SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(this);
boolean stealRemoteControl = pref.getBoolean("enable_steal_remote_control", false);
if (!LibVlcUtil.isFroyoOrLater() || stealRemoteControl) {
/* Backward compatibility for API 7 */
filter = new IntentFilter();
if (stealRemoteControl)
filter.setPriority(Integer.MAX_VALUE);
filter.addAction(Intent.ACTION_MEDIA_BUTTON);
mRemoteControlClientReceiver = new RemoteControlClientReceiver();
registerReceiver(mRemoteControlClientReceiver, filter);
}
}
示例5: onCreate
import org.videolan.libvlc.EventHandler; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
// Get libVLC instance
try {
mLibVLC = Util.getLibVlcInstance();
} catch (LibVlcException e) {
e.printStackTrace();
}
mCallback = new HashMap<IAudioServiceCallback, Integer>();
mCurrentIndex = -1;
mPrevIndex = -1;
mNextIndex = -1;
mPrevious = new Stack<Integer>();
mEventHandler = EventHandler.getInstance();
mRemoteControlClientReceiverComponent = new ComponentName(getPackageName(),
RemoteControlClientReceiver.class.getName());
// Make sure the audio player will acquire a wake-lock while playing. If we don't do
// that, the CPU might go to sleep while the song is playing, causing playback to stop.
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG);
IntentFilter filter = new IntentFilter();
filter.setPriority(Integer.MAX_VALUE);
filter.addAction(ACTION_REMOTE_BACKWARD);
filter.addAction(ACTION_REMOTE_PLAYPAUSE);
filter.addAction(ACTION_REMOTE_PLAY);
filter.addAction(ACTION_REMOTE_PAUSE);
filter.addAction(ACTION_REMOTE_STOP);
filter.addAction(ACTION_REMOTE_FORWARD);
filter.addAction(ACTION_REMOTE_LAST_PLAYLIST);
filter.addAction(ACTION_WIDGET_INIT);
filter.addAction(Intent.ACTION_HEADSET_PLUG);
filter.addAction(AudioManager.ACTION_AUDIO_BECOMING_NOISY);
filter.addAction(VLCApplication.SLEEP_INTENT);
registerReceiver(serviceReceiver, filter);
final SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(this);
boolean stealRemoteControl = pref.getBoolean("enable_steal_remote_control", false);
if(!Util.isFroyoOrLater() || stealRemoteControl) {
/* Backward compatibility for API 7 */
filter = new IntentFilter();
if (stealRemoteControl)
filter.setPriority(Integer.MAX_VALUE);
filter.addAction(Intent.ACTION_MEDIA_BUTTON);
mRemoteControlClientReceiver = new RemoteControlClientReceiver();
registerReceiver(mRemoteControlClientReceiver, filter);
}
}