nekomiyaxneko / flutter_mybilibili Goto Github PK
View Code? Open in Web Editor NEWbilibili in flutter
License: MIT License
bilibili in flutter
License: MIT License
live_danmuku_page.dart的decode方法中的String data = utf8.decode(body);报错:
[ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: FormatException: Bad UTF-8 encoding 0xec (at offset 2)
大佬比纯原生开发 - - 体验咋样 - -
danmaku_tile.dart中出了以下几处魔数,我研究了一下,提供几个改进思路,欢迎指正
controller = AnimationController(
duration: Duration(seconds: **15**),
vsync: this,
);
animation =
Tween(end: max-widget.danmaku.msg.length.toDouble() * **12**, begin: -widget.danmaku.msg.length.toDouble() * **15**)
其实window.physicalSize提供返回的大小并不正确(永远是屏幕分辨率),可用MediaQuery.of(context).size
替换试试看。
另外text大小可以测量,可以用MediaQuery.of(context).size,但要先渲染一个透明的text才能测
下面的方法似乎更好一点
Size _getTextSize(String str, TextStyle textStyle, BoxConstraints constrain){
//字符串的空格会直接造成函数返回空格出现前第一段字符串的大小,原因不明,所以删掉。
int spaceCount = ' '.allMatches(str).length;
str = str.replaceAll(" ", "");
RenderParagraph renderParagraph = RenderParagraph(
TextSpan(text: str, style: textStyle,),
textDirection: TextDirection.ltr,
);
renderParagraph.layout(constrain);
double width = renderParagraph.getMinIntrinsicWidth(textStyle.fontSize);
double height = renderParagraph.getMinIntrinsicHeight(textStyle.fontSize);
return Size(width, height);
}
flutter packages get
Running "flutter pub get" in flutter_MyBilibili-master...
The current Dart SDK version is 2.4.0.
Because flutter_MyBilibili depends on dio >=3.0.0-dev.1 which requires SDK version >2.4.0 <3.0.0, version solving failed.
pub get failed (1)
exit code 1
我用dart --version 查看是2.5.2了
到底为什么还出这个错?
我用mac Vscode 运行在iphone模拟器上的
报错信息:
I/flutter (13005): onchangepage
I/flutter (13005): Another exception was thrown: A VideoPlayerController was used after being disposed.
I/flutter (13005): Another exception was thrown: 'package:flutter/src/widgets/framework.dart': Failed assertion: line 2430 pos 16: '!_dirtyElements[index]._active || _dirtyElements[index]._debugIsInScope(context)': is not true.
"https://app.bilibili.com/x/v2/view?aid=57789195&appkey=1d8b6e7d45233436&build=5480400&ts=1570894094&sign=f152b3700bcf10f485e5f9d2711d0001"
sign算法为
aid=57789195&appkey=1d8b6e7d45233436&build=5480400&ts=1570894094560c52ccd288fed045859ed18bffd973
就是所有参数+560c52ccd288fed045859ed18bffd973
"https://pub.flutter-io.cn/packages/common_utils" 还有...播放数量和弹幕哪里可以直接用 Icon(BIcon.zan)
您好,我下载了您的项目flutter packages get后执行flutter run,因为我的是Mac,flutter的环境已经装好,但运行不了您的项目
在ubuntu下,使用dart2.7.2+flutter 1.12.13_hotfix8-stable编译MyBilibili,可以编译通过(由部分警告,说API过期)。安装后,点击视频的时候,视频长时间不播放,卡在“正在获取弹幕”的地方。
"https://s1.hdslb.com/bfs/seed/jinkela/header/images/user-auth.png" 这是那个认证图标,还有用户ID可以根据个人信息显示颜色的,会员和大会员显示黑色,年度显示红色字体,简介也是二个容器可以折叠(我还在查怎么做到)
你好,在阅读DanmakuView代码时,对弹幕编排逻辑不是很明白,烦请解析下,谢谢,尤其是方法addActionDanmaku:
///添加一条弹幕到屏幕上
addActionDanmaku(DanmakuItem item) {
setState(() {
for (int pos = 0; pos < _count; pos++) {
if (pos < _latestList.length &&
now.difference(_latestList[pos].dateTime).inSeconds >
12 * (_latestList[pos].msg.length.toDouble() * 10.0) / (max + _latestList[pos].msg.length.toDouble() * 10.0)) {
item.pos = pos;
item.dateTime = now;
_danmakus.add(item);
_latestList[pos] = item;
break;
} else if (pos >= _latestList.length) {
item.pos = _latestList.length;
item.dateTime = now;
_danmakus.add(item);
_latestList.add(item);
break;
}
}
});
}
播放的时候,发现进度条无法被拖动。
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.