Package com.qiniu.streaming
Class UrlFactory
- java.lang.Object
-
- com.qiniu.streaming.UrlFactory
-
public final class UrlFactory extends java.lang.Object该类封装了构建直播相关地址的方法
-
-
Constructor Summary
Constructors Constructor Description UrlFactory(java.lang.String hub, Auth auth, java.lang.String rtmpPubDomain, java.lang.String rtmpPlayDomain)构建一个直播地址生成的UrlFactory对象UrlFactory(java.lang.String hub, Auth auth, java.lang.String rtmpPublishDomain, java.lang.String rtmpPlayDomain, java.lang.String hlsPlayDomain, java.lang.String hdlPlayDomain, java.lang.String snapshotDomain)构建一个直播地址生成的UrlFactory对象
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringhdlPlayUrl(java.lang.String streamKey)构建直播FLV播放地址java.lang.StringhlsPlayUrl(java.lang.String streamKey)构建直播HLS播放地址java.lang.StringrtmpPlayUrl(java.lang.String streamKey)构建直播RTMP播放地址java.lang.StringrtmpPublishUrl(java.lang.String streamKey)生成无鉴权的RTMP推流地址java.lang.StringrtmpPublishUrl(java.lang.String streamKey, int expireAfterSeconds)生成带有效期鉴权的RTMP推流地址java.lang.StringsnapshotUrl(java.lang.String streamKey)构建直播截图访问地址
-
-
-
Constructor Detail
-
UrlFactory
public UrlFactory(java.lang.String hub, Auth auth, java.lang.String rtmpPubDomain, java.lang.String rtmpPlayDomain)构建一个直播地址生成的UrlFactory对象- Parameters:
hub- hubauth- authrtmpPubDomain- rtmpPubDomainrtmpPlayDomain- rtmpPlayDomain
-
UrlFactory
public UrlFactory(java.lang.String hub, Auth auth, java.lang.String rtmpPublishDomain, java.lang.String rtmpPlayDomain, java.lang.String hlsPlayDomain, java.lang.String hdlPlayDomain, java.lang.String snapshotDomain)构建一个直播地址生成的UrlFactory对象- Parameters:
hub- hubauth- authrtmpPublishDomain- rtmpPublishDomainrtmpPlayDomain- rtmpPlayDomainhlsPlayDomain- hlsPlayDomainhdlPlayDomain- hdlPlayDomainsnapshotDomain- snapshotDomain
-
-
Method Detail
-
rtmpPublishUrl
public java.lang.String rtmpPublishUrl(java.lang.String streamKey)
生成无鉴权的RTMP推流地址- Parameters:
streamKey- 流名称- Returns:
- 推流地址
-
rtmpPublishUrl
public java.lang.String rtmpPublishUrl(java.lang.String streamKey, int expireAfterSeconds)生成带有效期鉴权的RTMP推流地址- Parameters:
streamKey- 流名称expireAfterSeconds- 流过期时间,单位秒- Returns:
- 推流地址
-
rtmpPlayUrl
public java.lang.String rtmpPlayUrl(java.lang.String streamKey)
构建直播RTMP播放地址- Parameters:
streamKey- 流名称- Returns:
- 播放地址
-
hlsPlayUrl
public java.lang.String hlsPlayUrl(java.lang.String streamKey)
构建直播HLS播放地址- Parameters:
streamKey- 流名称- Returns:
- 播放地址
-
hdlPlayUrl
public java.lang.String hdlPlayUrl(java.lang.String streamKey)
构建直播FLV播放地址- Parameters:
streamKey- 流名称- Returns:
- 播放地址
-
snapshotUrl
public java.lang.String snapshotUrl(java.lang.String streamKey)
构建直播截图访问地址- Parameters:
streamKey- 流名称- Returns:
- 直播截图访问地址
-
-