本文整理匯總了Java中net.sourceforge.servestream.transport.HTTP類的典型用法代碼示例。如果您正苦於以下問題:Java HTTP類的具體用法?Java HTTP怎麽用?Java HTTP使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
HTTP類屬於net.sourceforge.servestream.transport包,在下文中一共展示了HTTP類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getMediaPlayer
import net.sourceforge.servestream.transport.HTTP; //導入依賴的package包/類
/**
* Detects the appropriate media player depending on the URI of
* a file.
* @param uri path to a file.
* @return a media player.
*/
private AbstractMediaPlayer getMediaPlayer(String uri) {
if (uri.startsWith(HTTP.getProtocolName())) {
return mNativeMediaPlayer;
} else if (uri.startsWith(HTTPS.getProtocolName())) {
return mNativeMediaPlayer;
} else if (uri.startsWith(File.getProtocolName())) {
return mNativeMediaPlayer;
} else if (uri.startsWith(RTSP.getProtocolName())) {
return mNativeMediaPlayer;
} else if (uri.startsWith(MMS.getProtocolName())) {
return getFFmpegPlayer();
} else if (uri.startsWith(MMSH.getProtocolName())) {
return getFFmpegPlayer();
} else if (uri.startsWith(MMST.getProtocolName())) {
return getFFmpegPlayer();
} else {
return mNativeMediaPlayer;
}
}
示例2: setDataSource
import net.sourceforge.servestream.transport.HTTP; //導入依賴的package包/類
@Override
public void setDataSource(Context context, long id) throws IOException,
IllegalArgumentException, SecurityException, IllegalStateException {
mId = id;
String path = getUri(context, id);
Uri uri = TransportFactory.getUri(path);
if (uri == null ||
(!uri.getScheme().equals(HTTP.getProtocolName()) &&
!uri.getScheme().equals(HTTPS.getProtocolName()))) {
throw new IllegalArgumentException();
}
UriBean uriBean = TransportFactory.getTransport(uri.getScheme()).createUri(uri);
if (uriBean == null) {
throw new IllegalArgumentException();
}
mUrl = uriBean.getURL();
}
示例3: onContentTypeObtained
import net.sourceforge.servestream.transport.HTTP; //導入依賴的package包/類
@Override
public void onContentTypeObtained(String path, boolean useFFmpegPlayer,
String contentType) {
if (contentType.equalsIgnoreCase("video/x-ms-asf") ||
contentType.equalsIgnoreCase("application/vnd.ms-asf")) {
path = path.replace(HTTP.getProtocolName(), MMSH.getProtocolName());
} else if (contentType.equals("audio/aacp") ||
contentType.equals("audio/3gpp") ||
contentType.equals("audio/3gpp2")) {
useFFmpegPlayer = true;
}
setDataSource(null, path, -1, false, useFFmpegPlayer, contentType);
}
示例4: onContentTypeObtained
import net.sourceforge.servestream.transport.HTTP; //導入依賴的package包/類
@Override
public void onContentTypeObtained(String path, boolean isLocalFile,
boolean useFFmpegPlayer, String contentType) {
if (contentType.equalsIgnoreCase("video/x-ms-asf") ||
contentType.equalsIgnoreCase("application/vnd.ms-asf")) {
path = path.replace(HTTP.getProtocolName(), MMSH.getProtocolName());
}
setDataSource(path, isLocalFile, useFFmpegPlayer, contentType);
}
示例5: onContentTypeObtained
import net.sourceforge.servestream.transport.HTTP; //導入依賴的package包/類
@Override
public void onContentTypeObtained(String path, boolean useFFmpegPlayer,
String contentType) {
if (contentType.equalsIgnoreCase("video/x-ms-asf") ||
contentType.equalsIgnoreCase("application/vnd.ms-asf")) {
path = path.replace(HTTP.getProtocolName(), MMSH.getProtocolName());
}
setDataSource(null, path, -1, false, useFFmpegPlayer, contentType);
}