本文整理了Java中com.google.android.exoplayer.util.Util
类的一些代码示例,展示了Util
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util
类的具体详情如下:
包路径:com.google.android.exoplayer.util.Util
类名称:Util
[英]Miscellaneous utility functions.
[中]其他实用功能。
代码示例来源:origin: wanliyang1990/WliveTV
private String getUserAgent() {
return Util.getUserAgent(mAppContext, "IjkExoMediaPlayer");
}
代码示例来源:origin: googlesamples/androidtv-sample-inputs
public SmoothStreamingRendererBuilder(Context context, String userAgent, String url,
MediaDrmCallback drmCallback) {
this.context = context;
this.userAgent = userAgent;
this.url = Util.toLowerInvariant(url).endsWith("/manifest") ? url : url + "/Manifest";
this.drmCallback = drmCallback;
}
代码示例来源:origin: bitmovin/bitcodin-android-demo
/**
* Tests whether an {@code items} array contains an object equal to {@code item}, according to
* {@link Object#equals(Object)}.
* <p>
* If {@code item} is null then true is returned if and only if {@code items} contains null.
*
* @param items The array of items to search.
* @param item The item to search for.
* @return True if the array contains an object equal to the item being searched for.
*/
public static boolean contains(Object[] items, Object item) {
for (int i = 0; i < items.length; i++) {
if (Util.areEqual(items[i], item)) {
return true;
}
}
return false;
}
代码示例来源:origin: fire3/sailorcast
@Override
public byte[] executeKeyRequest(UUID uuid, KeyRequest request) throws Exception {
String url = request.getDefaultUrl();
if (TextUtils.isEmpty(url)) {
url = PLAYREADY_TEST_DEFAULT_URI;
}
return Util.executePost(url, request.getData(), KEY_REQUEST_PROPERTIES);
}
代码示例来源:origin: bitmovin/bitcodin-android-demo
chunkMediaSequence = Util.binarySearchFloor(mediaPlaylist.segments, seekPositionUs, true,
true) + mediaPlaylist.mediaSequence;
} else {
return;
if (!Util.areEqual(segment.encryptionIV, encryptionIvString)) {
setEncryptionData(keyUri, segment.encryptionIV, encryptionKey);
代码示例来源:origin: bitmovin/bitcodin-android-demo
@Override
public int getNextEventTimeIndex(long timeUs) {
int index = Util.binarySearchCeil(cueTimesUs, timeUs, false, false);
return index < cueTimesUs.length ? index : -1;
}
代码示例来源:origin: fire3/sailorcast
@Override
public byte[] executeProvisionRequest(UUID uuid, ProvisionRequest request) throws IOException {
String url = request.getDefaultUrl() + "&signedRequest=" + new String(request.getData());
return Util.executePost(url, null, null);
}
代码示例来源:origin: bitmovin/bitcodin-android-demo
@Override
public int getNextEventTimeIndex(long timeUs) {
int index = Util.binarySearchCeil(eventTimesUs, timeUs, false, false);
return index < eventTimesUs.length ? index : -1;
}
代码示例来源:origin: Dawish/ijkplayer-android-demo
private String getUserAgent() {
return Util.getUserAgent(mAppContext, "IjkExoMediaPlayer");
}
代码示例来源:origin: fire3/sailorcast
public SmoothStreamingRendererBuilder(Context context, String userAgent, String url,
MediaDrmCallback drmCallback) {
this.context = context;
this.userAgent = userAgent;
this.url = Util.toLowerInvariant(url).endsWith("/manifest") ? url : url + "/Manifest";
this.drmCallback = drmCallback;
}
代码示例来源:origin: googlesamples/androidtv-sample-inputs
@Override
public byte[] executeProvisionRequest(UUID uuid, ProvisionRequest request) throws IOException {
String url = request.getDefaultUrl() + "&signedRequest=" + new String(request.getData());
return Util.executePost(url, null, null);
}
代码示例来源:origin: bitmovin/bitcodin-android-demo
@Override
public boolean equals(Object obj) {
if (!(obj instanceof ContentProtection)) {
return false;
}
if (obj == this) {
return true;
}
ContentProtection other = (ContentProtection) obj;
return schemeUriId.equals(other.schemeUriId)
&& Util.areEqual(uuid, other.uuid)
&& Arrays.equals(data, other.data);
}
代码示例来源:origin: bitmovin/bitcodin-android-demo
/**
* Returns the sample index of the closest synchronization sample at or after the given timestamp,
* if one is available.
*
* @param timeUs Timestamp adjacent to which to find a synchronization sample.
* @return index Index of the synchronization sample, or {@link #NO_SAMPLE} if none.
*/
public int getIndexOfLaterOrEqualSynchronizationSample(long timeUs) {
int startIndex = Util.binarySearchCeil(timestampsUs, timeUs, true, false);
for (int i = startIndex; i < timestampsUs.length; i++) {
if (timestampsUs[i] >= timeUs && (flags[i] & C.SAMPLE_FLAG_SYNC) != 0) {
return i;
}
}
return NO_SAMPLE;
}
代码示例来源:origin: Dreamxiaoxuan/AndroidTvDemo
private String getUserAgent() {
return Util.getUserAgent(mAppContext, "IjkExoMediaPlayer");
}
代码示例来源:origin: Dawish/ijkplayer-android-demo
public SmoothStreamingRendererBuilder(Context context, String userAgent, String url,
MediaDrmCallback drmCallback) {
this.context = context;
this.userAgent = userAgent;
this.url = Util.toLowerInvariant(url).endsWith("/manifest") ? url : url + "/Manifest";
this.drmCallback = drmCallback;
}
代码示例来源:origin: googlesamples/androidtv-sample-inputs
@Override
public byte[] executeKeyRequest(UUID uuid, KeyRequest request) throws IOException {
String url = request.getDefaultUrl();
if (TextUtils.isEmpty(url)) {
url = defaultUri;
}
return Util.executePost(url, request.getData(), null);
}
代码示例来源:origin: bitmovin/bitcodin-android-demo
private void invokeRenderer(String text) {
if (Util.areEqual(lastRenderedCaption, text)) {
// No change.
return;
}
this.lastRenderedCaption = text;
if (textRendererHandler != null) {
textRendererHandler.obtainMessage(MSG_INVOKE_RENDERER, text).sendToTarget();
} else {
invokeRendererInternal(text);
}
}
代码示例来源:origin: bitmovin/bitcodin-android-demo
@Override
public int getNextEventTimeIndex(long timeUs) {
Assertions.checkArgument(timeUs >= 0);
int index = Util.binarySearchCeil(sortedCueTimesUs, timeUs, false, false);
return index < sortedCueTimesUs.length ? index : -1;
}
代码示例来源:origin: Dawish/BriskTVLauncher
private String getUserAgent() {
return Util.getUserAgent(mAppContext, "IjkExoMediaPlayer");
}
代码示例来源:origin: Dreamxiaoxuan/AndroidTvDemo
public SmoothStreamingRendererBuilder(Context context, String userAgent, String url,
MediaDrmCallback drmCallback) {
this.context = context;
this.userAgent = userAgent;
this.url = Util.toLowerInvariant(url).endsWith("/manifest") ? url : url + "/Manifest";
this.drmCallback = drmCallback;
}
内容来源于网络,如有侵权,请联系作者删除!