-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #560 from xiaoyaocz/dev
Release 1.7.5 / TV 1.2.2
- Loading branch information
Showing
40 changed files
with
2,958 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"version": "1.7.4", | ||
"version_num": 10704, | ||
"version_desc": "- 修复虎牙一起看播放中断 #543\n- 播放中断后取消保持亮屏 #541\n- 强制使用HTTPS链接 #538\n- Windows字体使用微软雅黑 #535", | ||
"version": "1.7.5", | ||
"version_num": 10705, | ||
"version_desc": "- 修复虎牙一起看播放中断 #543", | ||
"prerelease":false, | ||
"download_url": "https://github.com/xiaoyaocz/dart_simple_live/releases" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,96 @@ | ||
import 'package:simple_live_core/simple_live_core.dart'; | ||
import 'dart:io'; | ||
|
||
import 'package:dio/dio.dart'; | ||
import 'package:simple_live_core/src/model/tars/get_cdn_token_req.dart'; | ||
import 'package:simple_live_core/src/model/tars/get_cdn_token_resp.dart'; | ||
import 'package:tars_dart/tars/net/base_tars_http.dart'; | ||
import 'package:tars_dart/tars/tup/uni_packet.dart'; | ||
|
||
void main() async { | ||
CoreLog.enableLog = true; | ||
CoreLog.requestLogType = RequestLogType.short; | ||
LiveSite site = BiliBiliSite(); | ||
var danmaku = site.getDanmaku(); | ||
danmaku.onMessage = (event) { | ||
if (event.type == LiveMessageType.chat) { | ||
print("[${event.color}]${event.userName}:${event.message}"); | ||
} else if (event.type == LiveMessageType.online) { | ||
print("-----人气:${event.data}-----"); | ||
} else if (event.type == LiveMessageType.superChat) { | ||
var scMessage = event.data as LiveSuperChatMessage; | ||
print("[SC]${scMessage.userName}:${scMessage.message}"); | ||
} | ||
}; | ||
danmaku.onClose = (event) { | ||
print(event); | ||
}; | ||
|
||
//var search = await site.searchRooms("东方"); | ||
|
||
//var categores = await site.getCategores(); | ||
//print(categores.length); | ||
var detail = await site.getRoomDetail(roomId: '7734200'); | ||
// var playQualites = await site.getPlayQualites(detail: detail); | ||
// print(playQualites); | ||
// var playUrls = | ||
// await site.getPlayUrls(detail: detail, quality: playQualites.first); | ||
// for (var element in playUrls) { | ||
// print(element); | ||
// } | ||
//print(detail); | ||
|
||
danmaku.start(detail.danmakuData); | ||
|
||
await Future.wait({}); | ||
// CoreLog.enableLog = true; | ||
// CoreLog.requestLogType = RequestLogType.short; | ||
// LiveSite site = BiliBiliSite(); | ||
// var danmaku = site.getDanmaku(); | ||
// danmaku.onMessage = (event) { | ||
// if (event.type == LiveMessageType.chat) { | ||
// print("[${event.color}]${event.userName}:${event.message}"); | ||
// } else if (event.type == LiveMessageType.online) { | ||
// print("-----人气:${event.data}-----"); | ||
// } else if (event.type == LiveMessageType.superChat) { | ||
// var scMessage = event.data as LiveSuperChatMessage; | ||
// print("[SC]${scMessage.userName}:${scMessage.message}"); | ||
// } | ||
// }; | ||
// danmaku.onClose = (event) { | ||
// print(event); | ||
// }; | ||
|
||
// //var search = await site.searchRooms("东方"); | ||
|
||
// //var categores = await site.getCategores(); | ||
// //print(categores.length); | ||
// var detail = await site.getRoomDetail(roomId: '7734200'); | ||
// // var playQualites = await site.getPlayQualites(detail: detail); | ||
// // print(playQualites); | ||
// // var playUrls = | ||
// // await site.getPlayUrls(detail: detail, quality: playQualites.first); | ||
// // for (var element in playUrls) { | ||
// // print(element); | ||
// // } | ||
// //print(detail); | ||
|
||
// danmaku.start(detail.danmakuData); | ||
|
||
// await Future.wait({}); | ||
sendReq(); | ||
} | ||
|
||
void testHuyaReq() async { | ||
var reqBytes = await File('demo/getCdnTokenInfoReq.bin').readAsBytes(); | ||
// RequestPacket req = RequestPacket(); | ||
// req.readFrom(TarsInputStream(reqBytes)); | ||
// print(req.iVersion); | ||
|
||
UniPacket uniPacket = UniPacket(); | ||
//uniPacket.readFrom(TarsInputStream(reqBytes)); | ||
uniPacket.decode(reqBytes); | ||
var value = uniPacket.get<GetCdnTokenReq>('tReq', GetCdnTokenReq()); | ||
// GetCdnTokenReq reqData = GetCdnTokenReq(); | ||
// reqData.readFrom(TarsInputStream(req.sBuffer)); | ||
print(value.toString()); | ||
} | ||
|
||
void sendReq() async { | ||
var req = GetCdnTokenReq(); | ||
req.cdnType = "HW"; | ||
req.streamName = | ||
"1199637826638-1199637826638-5763635889762729984-2399275776732-10057-A-0-1"; | ||
|
||
BaseTarsHttp http = BaseTarsHttp("http://wup.huya.com", "liveui"); | ||
|
||
var data = await http.tupRequest("getCdnTokenInfo", req, GetCdnTokenResp()); | ||
|
||
var url = | ||
'http://hw.flv.huya.com/src/${data.streamName}.flv?${data.flvAntiCode}&codec=264'; | ||
print(url); | ||
await Dio().download( | ||
url, | ||
'live-stream.flv', | ||
options: Options( | ||
responseType: ResponseType.bytes, | ||
headers: {"user-agent": "HYSDK(Windows, 20000308)"}, | ||
), | ||
onReceiveProgress: (count, total) { | ||
var downBytes = count / 1024 / 1024; | ||
print('downloading: $downBytes MB'); | ||
}, | ||
); | ||
} | ||
|
||
void testHuyaResp() async { | ||
var respBytes = await File('demo/getCdnTokenInfoResp.bin').readAsBytes(); | ||
UniPacket uniPacket = UniPacket(); | ||
uniPacket.decode(respBytes); | ||
var value = uniPacket.get<GetCdnTokenResp>('tRsp', GetCdnTokenResp()); | ||
print(value.toString()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,6 @@ class CoreLog { | |
lineLength: 120, | ||
colors: true, | ||
printEmojis: true, | ||
printTime: false, | ||
), | ||
); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.