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


Java PlaybackService类代码示例

本文整理汇总了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();
}
 
开发者ID:xuie0000,项目名称:vlc-android,代码行数:19,代码来源:AudioPlayer.java

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

示例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();
}
 
开发者ID:hanhailong,项目名称:VCL-Android,代码行数:19,代码来源:AudioPlayer.java

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

示例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);
            }
        });
    }
}
 
开发者ID:jiaZengShen,项目名称:vlc_android_win,代码行数:15,代码来源:Util.java

示例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);
        }
    });
}
 
开发者ID:jiaZengShen,项目名称:vlc_android_win,代码行数:9,代码来源:Util.java

示例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);
        }
    });
}
 
开发者ID:jiaZengShen,项目名称:vlc_android_win,代码行数:9,代码来源:Util.java

示例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);

}
 
开发者ID:jiaZengShen,项目名称:vlc_android_win,代码行数:10,代码来源:PlaybackServiceActivity.java

示例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);
}
 
开发者ID:jiaZengShen,项目名称:vlc_android_win,代码行数:8,代码来源:PlaybackServiceActivity.java

示例10: onDisconnected

import org.videolan.vlc.PlaybackService; //导入依赖的package包/类
@Override
public void onDisconnected() {
    mService = null;
    mActivityCallback.onDisconnected();
    for (PlaybackService.Client.Callback connectCb : mFragmentCallbacks)
        connectCb.onDisconnected();
}
 
开发者ID:jiaZengShen,项目名称:vlc_android_win,代码行数:8,代码来源:PlaybackServiceActivity.java

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

示例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;
}
 
开发者ID:jiaZengShen,项目名称:vlc_android_win,代码行数:14,代码来源:VideoPlayerActivity.java

示例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);
}
 
开发者ID:jiaZengShen,项目名称:vlc_android_win,代码行数:33,代码来源:AudioMediaSwitcher.java

示例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);
    }
}
 
开发者ID:hanhailong,项目名称:VCL-Android,代码行数:16,代码来源:AudioPlayerActivity.java

示例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);
    }
}
 
开发者ID:hanhailong,项目名称:VCL-Android,代码行数:16,代码来源:AudioPlayerActivity.java


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