本文整理汇总了Java中com.google.android.exoplayer2.C.StreamType方法的典型用法代码示例。如果您正苦于以下问题:Java C.StreamType方法的具体用法?Java C.StreamType怎么用?Java C.StreamType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.android.exoplayer2.C
的用法示例。
在下文中一共展示了C.StreamType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleMessage
import com.google.android.exoplayer2.C; //导入方法依赖的package包/类
@Override
public void handleMessage(int messageType, Object message) throws ExoPlaybackException {
switch (messageType) {
case C.MSG_SET_VOLUME:
audioTrack.setVolume((Float) message);
break;
case C.MSG_SET_STREAM_TYPE:
@C.StreamType int streamType = (Integer) message;
audioTrack.setStreamType(streamType);
break;
default:
super.handleMessage(messageType, message);
break;
}
}
示例2: setStreamType
import com.google.android.exoplayer2.C; //导入方法依赖的package包/类
/**
* Sets the stream type for audio track. If the stream type has changed and if the audio track
* is not configured for use with tunneling, then the audio track is reset and the audio session
* id is cleared.
* <p>
* If the audio track is configured for use with tunneling then the stream type is ignored, the
* audio track is not reset and the audio session id is not cleared. The passed stream type will
* be used if the audio track is later re-configured into non-tunneled mode.
*
* @param streamType The {@link C.StreamType} to use for audio output.
*/
public void setStreamType(@C.StreamType int streamType) {
if (this.streamType == streamType) {
return;
}
this.streamType = streamType;
if (tunneling) {
// The stream type is ignored in tunneling mode, so no need to reset.
return;
}
reset();
audioSessionId = C.AUDIO_SESSION_ID_UNSET;
}