refresher-triggered="isRefreshing" @refresherrefresh="onRefresh" @scrolltolower="onLoadMore">
<list-item v-if="historyList.length == 0 && !isLoading" class="empty-container">
<text class="empty-text">暂无历史记录</text>
</list-item>
<list-item v-if="isLoading" class="loading-container">
<text class="loading-text">加载中...</text>
</list-item>
<list-item v-for="(item) in historyList" :key="item.time" class="history-item">
<text class="title">{{ item.input }}</text>
<view class="desc">
<text class="item-time">{{ item.occurTime }}</text>
</view>
<view class="divider"></view>
<view class="video-container">
<video v-if="item.videoUrl" :src="item.videoUrl" :key="item.time" controls class="generated-video"
show-center-play-btn="true" :show-fullscreen-btn="true"
show-play-btn="true" :enable-progress-gesture="true" object-fit="contain"></video>
<view v-else class="mask" @tap="getVideo(item.taskId)">
<image class="play" src="/static/play.png" mode="scaleToFill"></image>
</view>
</view>
</list-item>
<list-item v-if="!hasMore && historyList.length > 0" class="no-more-container">
<text class="no-more-text">没有更多了</text>
</list-item>
</list-view>
css样式如下:
.video-container {
position: relative;
width: 100%;
height: 0;
padding-top: 56.25%;
box-sizing: border-box;
overflow: hidden;
background: #000;
z-index: 1;
}
.generated-video {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: transparent;
}
在安卓显示的结果
如果换成scroll-view 组件
<scroll-view class="scroll-content" :scroll-y="true" :scroll-top="scrollTop" :refresher-enabled="true" :refresher-triggered="isRefreshing" @refresherrefresh="onRefresh" @scrolltolower="onLoadMore">
<view v-if="historyList.length == 0 && !isLoading" class="empty-container">
<text class="empty-text">暂无历史记录</text>
</view>
<view v-if="isLoading" class="loading-container">
<text class="loading-text">加载中...</text>
</view>
<view v-for="(item) in historyList" :key="item.time" class="history-item">
<text class="title">{{ item.input }}</text>
<view class="desc">
<text class="item-time">{{ item.occurTime }}</text>
</view>
<view class="divider"></view>
<view class="video-container">
<video v-if="item.videoUrl" :id="'' + item.taskId" :src="item.videoUrl" :key="item.videoUrl + '-' + item.occurTime" controls class="generated-video"
:autoplay="item.shouldAutoplay" :show-center-play-btn="true" :show-fullscreen-btn="true"
:show-play-btn="true" :enable-progress-gesture="true" object-fit="contain" @play="onVideoPlay(item)"></video>
<view v-else class="mask" @tap="getVideo(item.taskId)">
<image class="play" src="/static/play.png" mode="scaleToFill"></image>
</view>
</view>
</view>
<view v-if="!hasMore && historyList.length > 0" class="no-more-container">
<text class="no-more-text">没有更多了</text>
</view>
</scroll-view>
css样式一样的,显示结果为
list-view里面为什么对video的支持这么差,是什么原因造成的,有办法解决吗
