feat(app): 播放器增加清晰度档位入口
This commit is contained in:
1 parent
30a5fa0776
commit
2b2b7e9913
9 files changed
+242
-1
No files matched your search
@@ -0,0 +1,29 @@
|
||||
// Author: fruit.com.cn
|
||||
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:fruitshorts/core/data/models/play_ticket.dart';
|
||||
|
||||
void main() {
|
||||
test('should_parse_all_qualities_when_ticket_returns_multiple_tracks', () {
|
||||
final ticket = PlayTicket.fromJson(const {
|
||||
'episodeId': '12',
|
||||
'accessible': true,
|
||||
'accessType': 'FREE',
|
||||
'playUrl': '/files/episode/12.m3u8?e=1&s=abc',
|
||||
'qualities': ['AUTO', '720P', '1080P'],
|
||||
});
|
||||
|
||||
expect(ticket.qualities, ['AUTO', '720P', '1080P']);
|
||||
});
|
||||
|
||||
test('should_default_to_empty_qualities_when_field_is_missing', () {
|
||||
final ticket = PlayTicket.fromJson(const {
|
||||
'episodeId': '12',
|
||||
'accessible': true,
|
||||
'accessType': 'FREE',
|
||||
'playUrl': '/files/episode/12.mp4',
|
||||
});
|
||||
|
||||
expect(ticket.qualities, isEmpty);
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user