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


Java TransportMediator类代码示例

本文整理汇总了Java中android.support.v4.media.TransportMediator的典型用法代码示例。如果您正苦于以下问题:Java TransportMediator类的具体用法?Java TransportMediator怎么用?Java TransportMediator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: b

import android.support.v4.media.TransportMediator; //导入依赖的package包/类
public static String b(Context context, String str) {
    String str2 = VERSION.RELEASE + "," + Integer.toString(VERSION.SDK_INT);
    String str3 = Build.MODEL;
    String a = s.a(context, z[79], z[76]);
    String str4 = Build.DEVICE;
    Object F = cn.jpush.android.a.F();
    if (ai.a(F)) {
        F = " ";
    }
    String c = c(context);
    JSONObject jSONObject = new JSONObject();
    try {
        jSONObject.put(z[TransportMediator.KEYCODE_MEDIA_PLAY], str2);
        jSONObject.put(z[LeMessageIds.MSG_ALBUM_FETCH_PLAY_NEXT_CONTROLLER], str3);
        jSONObject.put(z[76], a);
        jSONObject.put(z[122], str4);
        jSONObject.put(z[125], F);
        jSONObject.put(z[123], c);
        jSONObject.put(z[124], str);
    } catch (JSONException e) {
    }
    return jSONObject.toString();
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:24,代码来源:a.java

示例2: updateButtons

import android.support.v4.media.TransportMediator; //导入依赖的package包/类
/**
 * Disable pause or seek buttons if the stream cannot be paused or seeked.
 * This requires the control interface to be a MediaPlayerControlExt
 */
void updateButtons() {
    int flags = mController.getTransportControlFlags();
    boolean enabled = isEnabled();
    if (mPauseButton != null) {
        mPauseButton.setEnabled(enabled && (flags&TransportMediator.FLAG_KEY_MEDIA_PAUSE) != 0);
    }
    if (mRewButton != null) {
        mRewButton.setEnabled(enabled && (flags&TransportMediator.FLAG_KEY_MEDIA_REWIND) != 0);
    }
    if (mFfwdButton != null) {
        mFfwdButton.setEnabled(enabled &&
                (flags&TransportMediator.FLAG_KEY_MEDIA_FAST_FORWARD) != 0);
    }
    if (mPrevButton != null) {
        mShowPrev = (flags&TransportMediator.FLAG_KEY_MEDIA_PREVIOUS) != 0
                || mPrevListener != null;
        mPrevButton.setEnabled(enabled && mShowPrev);
    }
    if (mNextButton != null) {
        mShowNext = (flags&TransportMediator.FLAG_KEY_MEDIA_NEXT) != 0
                || mNextListener != null;
        mNextButton.setEnabled(enabled && mShowNext);
    }
}
 
开发者ID:reknih,项目名称:informant-droid,代码行数:29,代码来源:MediaController.java

示例3: onCreate

import android.support.v4.media.TransportMediator; //导入依赖的package包/类
@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    setContentView(R.layout.videoview);

    // Find the video player in our UI.
    mContent = (Content) findViewById(R.id.content);

    // Create transport controller to control video, giving the callback
    // interface to receive actions from.
    mTransportMediator = new TransportMediator(this, mTransportPerformer);

    // Create and initialize the media control UI.
    mMediaController = (MediaController) findViewById(R.id.media_controller);
    mMediaController.setMediaPlayer(mTransportMediator);

    // We're just playing a built-in demo video.
    mContent.init(this, mTransportMediator, mMediaController);
    mContent.setVideoURI(Uri.parse("android.resource://" + getPackageName() +
            "/" + R.raw.videoviewdemo));
}
 
开发者ID:reknih,项目名称:informant-droid,代码行数:22,代码来源:TransportControllerActivity.java

示例4: onGetTransportControlFlags

import android.support.v4.media.TransportMediator; //导入依赖的package包/类
@Override
public int onGetTransportControlFlags() {
    int flags = TransportMediator.FLAG_KEY_MEDIA_REWIND
            | TransportMediator.FLAG_KEY_MEDIA_FAST_FORWARD;
    if (mMediaRouteController != null && mMediaRouteController.isPlaying()) {
        flags |= TransportMediator.FLAG_KEY_MEDIA_PAUSE;
    } else {
        flags |= TransportMediator.FLAG_KEY_MEDIA_PLAY;
    }
    return flags;
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:12,代码来源:ExpandedControllerActivity.java

示例5: b

import android.support.v4.media.TransportMediator; //导入依赖的package包/类
private void b(int i) throws cf {
    int i2 = 0;
    while ((i & -128) != 0) {
        int i3 = i2 + 1;
        this.a[i2] = (byte) ((i & TransportMediator.KEYCODE_MEDIA_PAUSE) | 128);
        i >>>= 7;
        i2 = i3;
    }
    int i4 = i2 + 1;
    this.a[i2] = (byte) i;
    this.g.b(this.a, 0, i4);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:13,代码来源:cs.java

示例6: read32

import android.support.v4.media.TransportMediator; //导入依赖的package包/类
private long read32(byte[] buffer, int offset) {
    int i0;
    int i1;
    int i2;
    int i3;
    byte b0 = buffer[offset];
    byte b1 = buffer[offset + 1];
    byte b2 = buffer[offset + 2];
    byte b3 = buffer[offset + 3];
    if ((b0 & 128) == 128) {
        i0 = (b0 & TransportMediator.KEYCODE_MEDIA_PAUSE) + 128;
    } else {
        byte i02 = b0;
    }
    if ((b1 & 128) == 128) {
        i1 = (b1 & TransportMediator.KEYCODE_MEDIA_PAUSE) + 128;
    } else {
        byte i12 = b1;
    }
    if ((b2 & 128) == 128) {
        i2 = (b2 & TransportMediator.KEYCODE_MEDIA_PAUSE) + 128;
    } else {
        byte i22 = b2;
    }
    if ((b3 & 128) == 128) {
        i3 = (b3 & TransportMediator.KEYCODE_MEDIA_PAUSE) + 128;
    } else {
        byte i32 = b3;
    }
    return (((((long) i0) << 24) + (((long) i1) << 16)) + (((long) i2) << 8)) + ((long) i3);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:32,代码来源:SntpClient.java

示例7: onKeyDown

import android.support.v4.media.TransportMediator; //导入依赖的package包/类
public boolean onKeyDown(int keyCode, KeyEvent event) {
    boolean isKeyCodeSupported;
    if (keyCode == 4 || keyCode == 24 || keyCode == 25 || keyCode == 164 || keyCode == 82 || keyCode == 5 || keyCode == 6) {
        isKeyCodeSupported = false;
    } else {
        isKeyCodeSupported = true;
    }
    if (isInPlaybackState() && isKeyCodeSupported && this.mediaController != null) {
        if (keyCode == 79 || keyCode == 85) {
            if (this.mMediaPlayer.isPlaying()) {
                pause();
                this.mediaController.show();
                return true;
            }
            start();
            this.mediaController.hide();
            return true;
        } else if (keyCode == TransportMediator.KEYCODE_MEDIA_PLAY) {
            if (this.mMediaPlayer.isPlaying()) {
                return true;
            }
            start();
            this.mediaController.hide();
            return true;
        } else if (keyCode != 86 && keyCode != TransportMediator.KEYCODE_MEDIA_PAUSE) {
            toggleMediaControlsVisiblity();
        } else if (!this.mMediaPlayer.isPlaying()) {
            return true;
        } else {
            pause();
            this.mediaController.show();
            return true;
        }
    }
    return super.onKeyDown(keyCode, event);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:37,代码来源:VideoViewTV.java

示例8: b

import android.support.v4.media.TransportMediator; //导入依赖的package包/类
public final long b() {
    long j = 0;
    for (int i = 0; i < 64; i += 7) {
        byte i2 = i();
        j |= ((long) (i2 & TransportMediator.KEYCODE_MEDIA_PAUSE)) << i;
        if ((i2 & 128) == 0) {
            return j;
        }
    }
    throw j.c();
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:12,代码来源:d.java

示例9: f

import android.support.v4.media.TransportMediator; //导入依赖的package包/类
public final int f() {
    byte i = i();
    if (i >= (byte) 0) {
        return i;
    }
    int i2 = i & TransportMediator.KEYCODE_MEDIA_PAUSE;
    byte i3 = i();
    if (i3 >= (byte) 0) {
        return i2 | (i3 << 7);
    }
    i2 |= (i3 & TransportMediator.KEYCODE_MEDIA_PAUSE) << 7;
    i3 = i();
    if (i3 >= (byte) 0) {
        return i2 | (i3 << 14);
    }
    i2 |= (i3 & TransportMediator.KEYCODE_MEDIA_PAUSE) << 14;
    i3 = i();
    if (i3 >= (byte) 0) {
        return i2 | (i3 << 21);
    }
    i2 |= (i3 & TransportMediator.KEYCODE_MEDIA_PAUSE) << 21;
    i3 = i();
    i2 |= i3 << 28;
    if (i3 >= (byte) 0) {
        return i2;
    }
    for (int i4 = 0; i4 < 5; i4++) {
        if (i() >= (byte) 0) {
            return i2;
        }
    }
    throw j.c();
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:34,代码来源:d.java

示例10: b

import android.support.v4.media.TransportMediator; //导入依赖的package包/类
private void b(long j) {
    while ((-128 & j) != 0) {
        b((((int) j) & TransportMediator.KEYCODE_MEDIA_PAUSE) | 128);
        j >>>= 7;
    }
    b((int) j);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:8,代码来源:e.java

示例11: d

import android.support.v4.media.TransportMediator; //导入依赖的package包/类
private void d(int i) {
    while ((i & -128) != 0) {
        b((i & TransportMediator.KEYCODE_MEDIA_PAUSE) | 128);
        i >>>= 7;
    }
    b(i);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:8,代码来源:e.java

示例12: type

import android.support.v4.media.TransportMediator; //导入依赖的package包/类
public static SubjectFactory<TransportMediatorSubject, TransportMediator> type() {
  return new SubjectFactory<TransportMediatorSubject, TransportMediator>() {
    @Override
    public TransportMediatorSubject getSubject(FailureStrategy fs, TransportMediator that) {
      return new TransportMediatorSubject(fs, that);
    }
  };
}
 
开发者ID:pkware,项目名称:truth-android,代码行数:9,代码来源:TransportMediatorSubject.java

示例13: controlFlagsToString

import android.support.v4.media.TransportMediator; //导入依赖的package包/类
public static String controlFlagsToString(@TransportMediatorControlFlags int flags) {
  return buildBitMaskString(flags)
      .flag(TransportMediator.FLAG_KEY_MEDIA_FAST_FORWARD, "fast_forward")
      .flag(TransportMediator.FLAG_KEY_MEDIA_NEXT, "next")
      .flag(TransportMediator.FLAG_KEY_MEDIA_PAUSE, "pause")
      .flag(TransportMediator.FLAG_KEY_MEDIA_PLAY, "play")
      .flag(TransportMediator.FLAG_KEY_MEDIA_PLAY_PAUSE, "play_pause")
      .flag(TransportMediator.FLAG_KEY_MEDIA_PREVIOUS, "previous")
      .flag(TransportMediator.FLAG_KEY_MEDIA_REWIND, "rewind")
      .flag(TransportMediator.FLAG_KEY_MEDIA_STOP, "stop")
      .get();
}
 
开发者ID:pkware,项目名称:truth-android,代码行数:13,代码来源:TransportMediatorSubject.java

示例14: onGetTransportControlFlags

import android.support.v4.media.TransportMediator; //导入依赖的package包/类
@Override public int onGetTransportControlFlags() {
    int flags = TransportMediator.FLAG_KEY_MEDIA_PLAY
            | TransportMediator.FLAG_KEY_MEDIA_PLAY_PAUSE
            | TransportMediator.FLAG_KEY_MEDIA_STOP;
    if (mContent.canPause()) {
        flags |= TransportMediator.FLAG_KEY_MEDIA_PAUSE;
    }
    if (mContent.canSeekBackward()) {
        flags |= TransportMediator.FLAG_KEY_MEDIA_REWIND;
    }
    if (mContent.canSeekForward()) {
        flags |= TransportMediator.FLAG_KEY_MEDIA_FAST_FORWARD;
    }
    return flags;
}
 
开发者ID:reknih,项目名称:informant-droid,代码行数:16,代码来源:TransportControllerActivity.java

示例15: init

import android.support.v4.media.TransportMediator; //导入依赖的package包/类
public void init(Activity activity, TransportMediator transportMediator,
        MediaController mediaController) {
    // This called by the containing activity to supply the surrounding
    // state of the video player that it will interact with.
    mActivity = activity;
    mTransportMediator = transportMediator;
    mMediaController = mediaController;
    pause();
}
 
开发者ID:reknih,项目名称:informant-droid,代码行数:10,代码来源:TransportControllerActivity.java


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