fix: 视频播放器封面异常
This commit is contained in:
@ -34,6 +34,9 @@ class NetworkImgLayer extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final int defaultImgQuality = GlobalData().imgQuality;
|
final int defaultImgQuality = GlobalData().imgQuality;
|
||||||
|
if (src == '' || src == null) {
|
||||||
|
return placeholder(context);
|
||||||
|
}
|
||||||
final String imageUrl =
|
final String imageUrl =
|
||||||
'${src!.startsWith('//') ? 'https:${src!}' : src!}@${quality ?? defaultImgQuality}q.webp';
|
'${src!.startsWith('//') ? 'https:${src!}' : src!}@${quality ?? defaultImgQuality}q.webp';
|
||||||
int? memCacheWidth, memCacheHeight;
|
int? memCacheWidth, memCacheHeight;
|
||||||
|
@ -332,11 +332,13 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
children: [
|
children: [
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: handlePlay,
|
onTap: handlePlay,
|
||||||
child: Image.network(
|
child: Obx(
|
||||||
vdCtr.videoItem['pic'],
|
() => NetworkImgLayer(
|
||||||
width: Get.width,
|
src: vdCtr.cover.value,
|
||||||
height: videoHeight,
|
width: Get.width,
|
||||||
fit: BoxFit.cover, // 适应方式根据需要调整
|
height: videoHeight,
|
||||||
|
type: 'emote',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
buildCustomAppBar(),
|
buildCustomAppBar(),
|
||||||
|
Reference in New Issue
Block a user