本文整理汇总了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);
}