Skip to content

Commit f961b7a

Browse files
authoredNov 3, 2016
Merge pull request qiniu#235 from longbai/fixed_pili_streaming_expire
fixed streaming expired
2 parents 1a19c5d + f51350d commit f961b7a

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed
 

‎CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#Changelog
22

3+
## 7.2.1 (2016-11-03)
4+
### 修正
5+
* streaming publish url 过期时间单位问题
6+
37
## 7.2.0 (2016-11-02)
48
### 增加
59
* 为多存储区 增加 autozone, zone2

‎src/main/java/com/qiniu/common/Constants.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public final class Constants {
99
/**
1010
* 版本号
1111
*/
12-
public static final String VERSION = "7.2.0";
12+
public static final String VERSION = "7.2.1";
1313
/**
1414
* 块大小,不能改变
1515
*/

‎src/main/java/com/qiniu/streaming/UrlFactory.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
import com.qiniu.util.Auth;
44

5-
import java.util.Date;
6-
75
/**
86
* Created by bailong on 16/9/22.
97
*/
@@ -37,7 +35,7 @@ public String rtmpPublishUrl(String streamKey) {
3735
}
3836

3937
public String rtmpPublishUrl(String streamKey, int expireAfterSeconds) {
40-
long expire = new Date().getTime() + expireAfterSeconds;
38+
long expire = System.currentTimeMillis() / 1000 + expireAfterSeconds;
4139
String path = String.format("/%s/%s?e=%d", hub, streamKey, expire);
4240
String token;
4341
try {

0 commit comments

Comments
 (0)
Please sign in to comment.