本文整理汇总了Java中org.videolan.vlc.PlaybackService类的典型用法代码示例。如果您正苦于以下问题:Java PlaybackService类的具体用法?Java PlaybackService怎么用?Java PlaybackService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PlaybackService类属于org.videolan.vlc包,在下文中一共展示了PlaybackService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onRepeatClick
import org.videolan.vlc.PlaybackService; //导入依赖的package包/类
public void onRepeatClick(View view) {
if (mService == null)
return;
switch (mService.getRepeatType()) {
case None:
mService.setRepeatType(PlaybackService.RepeatType.All);
break;
case All:
mService.setRepeatType(PlaybackService.RepeatType.Once);
break;
default:
case Once:
mService.setRepeatType(PlaybackService.RepeatType.None);
break;
}
update();
}
示例2: endReached
import org.videolan.vlc.PlaybackService; //导入依赖的package包/类
private void endReached() {
if (mService == null)
return;
if (mService.getRepeatType() == PlaybackService.RepeatType.Once){
seek(0);
return;
}
if(mService.expand() == 0) {
startLoading();
Log.d(TAG, "Found a video playlist, expanding it");
mHandler.post(new Runnable() {
@Override
public void run() {
loadMedia();
}
});
} else {
/* Exit player when reaching the end */
mEndReached = true;
exitOK();
}
}
示例3: onRepeatClick
import org.videolan.vlc.PlaybackService; //导入依赖的package包/类
public void onRepeatClick(View view) {
if (mService == null)
return;
switch (mService.getRepeatType()) {
case PlaybackService.REPEAT_NONE:
mService.setRepeatType(PlaybackService.REPEAT_ALL);
break;
case PlaybackService.REPEAT_ALL:
mService.setRepeatType(PlaybackService.REPEAT_ONE);
break;
default:
case PlaybackService.REPEAT_ONE:
mService.setRepeatType(PlaybackService.REPEAT_NONE);
break;
}
update();
}
示例4: endReached
import org.videolan.vlc.PlaybackService; //导入依赖的package包/类
private void endReached() {
if (mService == null)
return;
if (mService.getRepeatType() == PlaybackService.REPEAT_ONE){
seek(0);
return;
}
if(mService.expand() == 0) {
startLoading();
Log.d(TAG, "Found a video playlist, expanding it");
mHandler.post(new Runnable() {
@Override
public void run() {
loadMedia();
}
});
} else {
/* Exit player when reaching the end */
mEndReached = true;
exitOK();
}
}
示例5: openMedia
import org.videolan.vlc.PlaybackService; //导入依赖的package包/类
public static void openMedia(final Context context, final MediaWrapper media){
if (media == null)
return;
if (media.getType() == MediaWrapper.TYPE_VIDEO)
VideoPlayerActivity.start(context, media.getUri(), media.getTitle());
else if (media.getType() == MediaWrapper.TYPE_AUDIO) {
new DialogCallback(context, new DialogCallback.Runnable() {
@Override
public void run(PlaybackService service) {
service.load(media);
}
});
}
}
示例6: openList
import org.videolan.vlc.PlaybackService; //导入依赖的package包/类
public static void openList(final Context context, final List<MediaWrapper> list, final int position){
new DialogCallback(context, new DialogCallback.Runnable() {
@Override
public void run(PlaybackService service) {
service.load(list, position);
}
});
}
示例7: openStream
import org.videolan.vlc.PlaybackService; //导入依赖的package包/类
public static void openStream(final Context context, final String uri){
new DialogCallback(context, new DialogCallback.Runnable() {
@Override
public void run(PlaybackService service) {
service.loadLocation(uri);
}
});
}
示例8: registerFragment
import org.videolan.vlc.PlaybackService; //导入依赖的package包/类
@MainThread
public void registerFragment(PlaybackService.Client.Callback connectCb) {
if (connectCb == null)
throw new IllegalArgumentException("connectCb can't be null");
mFragmentCallbacks.add(connectCb);
if (mService != null)
connectCb.onConnected(mService);
}
示例9: onConnected
import org.videolan.vlc.PlaybackService; //导入依赖的package包/类
@Override
public void onConnected(PlaybackService service) {
mService = service;
mActivityCallback.onConnected(service);
for (PlaybackService.Client.Callback connectCb : mFragmentCallbacks)
connectCb.onConnected(mService);
}
示例10: onDisconnected
import org.videolan.vlc.PlaybackService; //导入依赖的package包/类
@Override
public void onDisconnected() {
mService = null;
mActivityCallback.onDisconnected();
for (PlaybackService.Client.Callback connectCb : mFragmentCallbacks)
connectCb.onDisconnected();
}
示例11: onResume
import org.videolan.vlc.PlaybackService; //导入依赖的package包/类
@Override
protected void onResume() {
super.onResume();
/* FIXME: this is used to avoid having MainActivity twice in the backstack */
if (getIntent() != null && getIntent().hasExtra(PlaybackService.START_FROM_NOTIFICATION))
getIntent().removeExtra(PlaybackService.START_FROM_NOTIFICATION);
if (mSlidingPane.getState() == mSlidingPane.STATE_CLOSED)
mActionBar.hide();
}
示例12: onLongClick
import org.videolan.vlc.PlaybackService; //导入依赖的package包/类
@Override
public boolean onLongClick(View v) {
if (mService == null)
return false;
if (mService.getRepeatType() == PlaybackService.RepeatType.Once) {
showInfo(getString(R.string.repeat));
mService.setRepeatType(PlaybackService.RepeatType.None);
} else {
mService.setRepeatType(PlaybackService.RepeatType.Once);
showInfo(getString(R.string.repeat_single));
}
return true;
}
示例13: updateMedia
import org.videolan.vlc.PlaybackService; //导入依赖的package包/类
public void updateMedia(PlaybackService service) {
removeAllViews();
hasPrevious = false;
previousPosition = 0;
LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
if (service.hasPrevious()) {
addMediaView(inflater,
service.getTitlePrev(),
service.getArtistPrev(),
service.getCoverPrev());
hasPrevious = true;
}
if (service.hasMedia())
addMediaView(inflater,
service.getTitle(),
service.getArtist(),
service.getCover());
if (service.hasNext())
addMediaView(inflater,
service.getTitleNext(),
service.getArtistNext(),
service.getCoverNext());
if (service.hasPrevious() && service.hasMedia()) {
previousPosition = 1;
scrollTo(1);
}
else
scrollTo(0);
}
示例14: onConnected
import org.videolan.vlc.PlaybackService; //导入依赖的package包/类
@Override
public void onConnected(PlaybackService service) {
super.onConnected(service);
mService.addCallback(this);
ArrayList<MediaWrapper> medias = (ArrayList<MediaWrapper>) mService.getMedias();
if (!mMediaList.isEmpty() && !mMediaList.equals(medias)) {
mService.load(mMediaList, mCurrentlyPlaying);
} else {
mMediaList = medias;
update();
mAdapter = new PlaylistAdapter(this, mMediaList);
mRecyclerView.setAdapter(mAdapter);
}
}
示例15: updateRepeatMode
import org.videolan.vlc.PlaybackService; //导入依赖的package包/类
private void updateRepeatMode() {
if (mService == null)
return;
int type = mService.getRepeatType();
if (type == PlaybackService.REPEAT_NONE){
mService.setRepeatType(PlaybackService.REPEAT_ALL);
mRepeat.setImageResource(R.drawable.ic_repeat_on);
} else if (type == PlaybackService.REPEAT_ALL) {
mService.setRepeatType(PlaybackService.REPEAT_ONE);
mRepeat.setImageResource(R.drawable.ic_repeat_one);
} else if (type == PlaybackService.REPEAT_ONE) {
mService.setRepeatType(PlaybackService.REPEAT_NONE);
mRepeat.setImageResource(R.drawable.ic_repeat);
}
}