pili-engineering / pili-sdk-java Goto Github PK
View Code? Open in Web Editor NEWPili Streaming Cloud server-side library for Java
License: MIT License
Pili Streaming Cloud server-side library for Java
License: MIT License
保存直播回放的api参数和官网描述不一致,比如参数文件名,开始时间,结束时间。官网中说可以不指定文件名,开始时间和结束时间也可以为0
但是sdk的api里都是强制必须填写的参数,时间参数如果为0也不行。
如果一个直播流使用过后他会永远存在吗?会不会被自动删除?没有看到有删除的api,那过很长时间再用同样的streamkey推送直播可以吗?
# https://github.com/pili-engineering/pili-sdk-java/blob/master/src/main/java/com/qiniu/pili/RPC.java
if (response.isSuccessful()) {
ResponseBody responseBody = response.body();
String responseString = responseBody.string();
if (responseBody != null)
responseBody.close();
return responseString;
} else {
throw new PiliException(response);
}
上述代码在远程未正常返回200时,执行throw new PiliException(response); 这句代码时无法释放引用,出现以下报错,在抛异常前调用response.close()即不会出现该问题.
2020-09-02 19:33:26.054 WARN 14216 --- [ ConnectionPool] okhttp3.OkHttpClient : A connection to http://pili.qiniuapi.com/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);
2020-09-02 19:33:26.054 WARN 14216 --- [ ConnectionPool] okhttp3.OkHttpClient : A connection to http://pili.qiniuapi.com/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);
com.pili.PiliException: status code 619
at com.pili.API.saveAs(API.java:374)
at com.pili.API.hlsPlaybackUrl(API.java:538)
at com.pili.Stream.hlsPlaybackUrls(Stream.java:165)
麻烦能提供详细些的报错么?
import com.pili.Hub;我目前是这个包,而github是这个包com.pili.qiniu.Hub,是更新版本了么,hub的listlive方法等都没有
问题1.假如我要获取StreamInfo对象,加入我接口返回中
问题2.假如我要使用自定义Gson对象
这个对象要么个可以给我返回StreamInfo,要么可以给我一个可以设置Gson,而这个类完全没法扩展
RT
使用的是pili-sdk-java-1.5.4版本,之前碰到的问题是通过 stream.segments 方法,获取推流历史记录,偶尔会返回 Segment is null;最近两天,每次可以返回SegmentList,但是这个对象中的 List是[];在七牛云后台直播流管理里面也可以看到正在活跃的流,后来的解决方法是,结束推流以后,再次通过stream.segments 方法,可以正常返回推流历史记录,所以想咨询下这个问题
2020-02-19 22:19:07.585 WARN 26140 --- [ ConnectionPool] okhttp3.OkHttpClient : A connection to http://pili.qiniuapi.com/ was leaked. Did you forget to close a response body? To see where this was allocated, set the OkHttpClient logger level to FINE: Logger.getLogger(OkHttpClient.class.getName()).setLevel(Level.FINE);
GET /v1/streams/:streamId/segments?start=<StartUnixTimestamp>&end=<EndUnixTimestamp>&limit=<Limit>
200 OK
{
"start": <StreamStartUnixTimestamp>,
"end": <StreamEndUnixTimestamp>,
"duration": <TotalDurationOfRequestSegments>,
"segments": [
{
"start": <StartUnixTimestamp>,
"end": <EndUnixTimestamp>
},
{
"start": <StartUnixTimestamp>,
"end": <EndUnixTimestamp>
}
]
}
400 Bad request
{
"error": "bad request",
"details"; {
"<Key>": "<Reason>"
}
}
401 Unauth
{
"error": "unauth"
}
404 Not Found
{
"error": "not found"
}
直播在线人数 直播带宽
https://developer.qiniu.com/pili/kb/3897/live-online-broadcast-bandwidth-api
这个api 什么时候可以支持呢?
maven仓库中的是1.5.4版本 但是 github上的 是2.1.0版本 是同一个吗?
客户想确认一下saveas不转格式 format是传null还是"", 还有客户反应saveas 传start=0,end=max报错,要用start=1才可以.
// Replace with your hub name
public static final String HUB = "Pili_Hub_Name"; // The Hub must be exists before use
what is hub? how can i get?
I have AK/SK
Dear Engineering Team,
I 'v check out the latest version ,I got qiniu AppKey & Secret, and it's work fine in uploading files. but not working here .
the error code when I run the Example.java
{"error":"invalid authorization","key":"unauthorization","errno":401001}
Thanks & Regards
Eric
原使用v1版本,现建议我们升级到v2,但原程序使用的activeUsers和rejectUser两个接口被注释,试过也确实无法调用,无法升级版本
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.