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


Java PlaybackService.REPEAT_ONE属性代码示例

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


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

示例1: onRepeatClick

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,代码行数:18,代码来源:AudioPlayer.java

示例2: endReached

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,代码行数:22,代码来源:VideoPlayerActivity.java

示例3: updateRepeatMode

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,代码行数:15,代码来源:AudioPlayerActivity.java

示例4: onLongClick

@Override
public boolean onLongClick(View v) {
    if (mService == null)
        return false;
    if (mService.getRepeatType() == PlaybackService.REPEAT_ONE) {
        showInfo(getString(R.string.repeat));
        mService.setRepeatType(PlaybackService.REPEAT_NONE);
    } else {
        mService.setRepeatType(PlaybackService.REPEAT_ONE);
        showInfo(getString(R.string.repeat_single));
    }
    return true;
}
 
开发者ID:hanhailong,项目名称:VCL-Android,代码行数:13,代码来源:VideoPlayerActivity.java

示例5: update

@Override
public void update() {
    if (mService == null || getActivity() == null)
        return;

    if (mService.hasMedia() && !mService.isVideoPlaying()) {
        SharedPreferences mSettings= PreferenceManager.getDefaultSharedPreferences(getActivity());
        if (mSettings.getBoolean(PreferencesActivity.VIDEO_RESTORE, false)){
            Util.commitPreferences(mSettings.edit().putBoolean(PreferencesActivity.VIDEO_RESTORE, false));
            mService.switchToVideo();
            mSwitchedToVideo = true;
            return;
        } else
            show();
    } else {
        hide();
        return;
    }

    mHeaderMediaSwitcher.updateMedia(mService);
    mCoverMediaSwitcher.updateMedia(mService);

    FragmentActivity act = getActivity();
    mResumeToVideo.setVisibility(mService.getVideoTracksCount() > 0 ? View.VISIBLE : View.GONE);

    if (mService.isPlaying()) {
        mPlayPause.setImageResource(Util.getResourceFromAttribute(act, R.attr.ic_pause));
        mPlayPause.setContentDescription(getString(R.string.pause));
        mHeaderPlayPause.setImageResource(Util.getResourceFromAttribute(act, R.attr.ic_pause));
        mHeaderPlayPause.setContentDescription(getString(R.string.pause));
    } else {
        mPlayPause.setImageResource(Util.getResourceFromAttribute(act, R.attr.ic_play));
        mPlayPause.setContentDescription(getString(R.string.play));
        mHeaderPlayPause.setImageResource(Util.getResourceFromAttribute(act, R.attr.ic_play));
        mHeaderPlayPause.setContentDescription(getString(R.string.play));
    }
    if (mService.isShuffling()) {
        mShuffle.setImageResource(Util.getResourceFromAttribute(act, R.attr.ic_shuffle_on));
        mShuffle.setContentDescription(getResources().getString(R.string.shuffle_on));
    } else {
        mShuffle.setImageResource(Util.getResourceFromAttribute(act, R.attr.ic_shuffle));
        mShuffle.setContentDescription(getResources().getString(R.string.shuffle));
    }
    switch(mService.getRepeatType()) {
    case PlaybackService.REPEAT_NONE:
        mRepeat.setImageResource(Util.getResourceFromAttribute(act, R.attr.ic_repeat));
        mRepeat.setContentDescription(getResources().getString(R.string.repeat));
        break;
    case PlaybackService.REPEAT_ONE:
        mRepeat.setImageResource(Util.getResourceFromAttribute(act, R.attr.ic_repeat_one));
        mRepeat.setContentDescription(getResources().getString(R.string.repeat_single));
        break;
    default:
    case PlaybackService.REPEAT_ALL:
        mRepeat.setImageResource(Util.getResourceFromAttribute(act, R.attr.ic_repeat_on));
        mRepeat.setContentDescription(getResources().getString(R.string.repeat_all));
        break;
    }

    final List<String> mediaLocations = mService.getMediaLocations();
    mShuffle.setVisibility(mediaLocations != null && mediaLocations.size() > 2 ? View.VISIBLE : View.INVISIBLE);
    mTimeline.setOnSeekBarChangeListener(mTimelineListner);

    updateList();
}
 
开发者ID:hanhailong,项目名称:VCL-Android,代码行数:65,代码来源:AudioPlayer.java


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