本文整理匯總了Java中com.google.android.exoplayer2.util.Util.toLowerInvariant方法的典型用法代碼示例。如果您正苦於以下問題:Java Util.toLowerInvariant方法的具體用法?Java Util.toLowerInvariant怎麽用?Java Util.toLowerInvariant使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.android.exoplayer2.util.Util
的用法示例。
在下文中一共展示了Util.toLowerInvariant方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: inferContentType
import com.google.android.exoplayer2.util.Util; //導入方法依賴的package包/類
/**
* Infer content type int.
*
* @param fileName the file name
* @return the int
*/
@C.ContentType
public static int inferContentType(String fileName) {
fileName = Util.toLowerInvariant(fileName);
if (fileName.matches(".*m3u8.*")) {
return C.TYPE_HLS;
} else if (fileName.matches(".*mpd.*")) {
return C.TYPE_DASH;
} else if (fileName.matches(".*\\.ism(l)?(/manifest(\\(.+\\))?)?")) {
return C.TYPE_SS;
} else {
return C.TYPE_OTHER;
}
}
示例2: decodeApicFrame
import com.google.android.exoplayer2.util.Util; //導入方法依賴的package包/類
private static ApicFrame decodeApicFrame(ParsableByteArray id3Data, int frameSize,
int majorVersion) throws UnsupportedEncodingException {
int encoding = id3Data.readUnsignedByte();
String charset = getCharsetName(encoding);
byte[] data = new byte[frameSize - 1];
id3Data.readBytes(data, 0, frameSize - 1);
String mimeType;
int mimeTypeEndIndex;
if (majorVersion == 2) {
mimeTypeEndIndex = 2;
mimeType = "image/" + Util.toLowerInvariant(new String(data, 0, 3, "ISO-8859-1"));
if (mimeType.equals("image/jpg")) {
mimeType = "image/jpeg";
}
} else {
mimeTypeEndIndex = indexOfZeroByte(data, 0);
mimeType = Util.toLowerInvariant(new String(data, 0, mimeTypeEndIndex, "ISO-8859-1"));
if (mimeType.indexOf('/') == -1) {
mimeType = "image/" + mimeType;
}
}
int pictureType = data[mimeTypeEndIndex + 1] & 0xFF;
int descriptionStartIndex = mimeTypeEndIndex + 2;
int descriptionEndIndex = indexOfEos(data, descriptionStartIndex, encoding);
String description = new String(data, descriptionStartIndex,
descriptionEndIndex - descriptionStartIndex, charset);
int pictureDataStartIndex = descriptionEndIndex + delimiterLength(encoding);
byte[] pictureData = Arrays.copyOfRange(data, pictureDataStartIndex, data.length);
return new ApicFrame(mimeType, description, pictureType, pictureData);
}
示例3: evaluate
import com.google.android.exoplayer2.util.Util; //導入方法依賴的package包/類
@Override
public boolean evaluate(String contentType) {
contentType = Util.toLowerInvariant(contentType);
return !TextUtils.isEmpty(contentType)
&& (!contentType.contains("text") || contentType.contains("text/vtt"))
&& !contentType.contains("html") && !contentType.contains("xml");
}
示例4: setFontFamily
import com.google.android.exoplayer2.util.Util; //導入方法依賴的package包/類
public WebvttCssStyle setFontFamily(String fontFamily) {
this.fontFamily = Util.toLowerInvariant(fontFamily);
return this;
}