This commit is contained in:
macbook_max
2026-10-15 20:36:59 +08:00
commit 6bf949949c
7923 changed files with 1369582 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
import '../../models/video_item.dart';
import '../config/test_stream.dart';
/// 分享文案:「标题」#标签 #标签 播放链接(链接不可用时省略)
/// 一期走系统分享面板;分享落地页/海报属二期规划(《01-开发文档》2.10)
String buildShareText(VideoItem item, {String? testUrl}) {
final buffer = StringBuffer();
buffer.write(item.title.isNotEmpty ? '「${item.title}」' : '精彩视频');
for (final tag in item.tags) {
buffer.write(' #$tag');
}
final url = resolvePlayUrl(item, testUrl: testUrl);
// 仅 http(s) 绝对链接可分享(相对路径对外不可达)
if (url.startsWith('http://') || url.startsWith('https://')) {
buffer.write('\n$url');
}
return buffer.toString();
}