Nativescript-vue 视频播放器加载完成回调不起作用
Nativescript-vue Video Player loading complete callback not working
我正在使用 nativescript-vue
和 Nativescript-videoplayer
插件构建本机移动应用程序。播放器运行良好,但 loadingComplete 回调函数不工作。
<template>
<Page >
<ActionBar title="test">
<StackLayout orientation="horizontal"
ios:horizontalAlignment="center"
android:horizontalAlignment="left">
<Image src="res://icon" width="30" height="30" stretch="aspectFill" />
</StackLayout>
</ActionBar>
<StackLayout>
<VideoPlayer ref="player" :src="video.file" autoplay="true" height="300" @loadingComplete="videoCompleted" @finished="videoFinished" loop="false" />
</StackLayout>
</Page>
</template>
<script >
export default {
props:['video'],
data() {
return {
}
},
methods:{
videoCompleted(){
console.log('Loading Completed');
},
videoFinished(){
console.log('Video finished');
}
}
}
</script>
loadingComplete
已更改为 playbackReady
,另一个处理程序附加到 finishedEvent
<VideoPlayer
@playbackReady="videoCompleted"
@finishedEvent="videoFinished"
/>
该演示已经过时了,但 documentation 看起来已得到维护。
我正在使用 nativescript-vue
和 Nativescript-videoplayer
插件构建本机移动应用程序。播放器运行良好,但 loadingComplete 回调函数不工作。
<template>
<Page >
<ActionBar title="test">
<StackLayout orientation="horizontal"
ios:horizontalAlignment="center"
android:horizontalAlignment="left">
<Image src="res://icon" width="30" height="30" stretch="aspectFill" />
</StackLayout>
</ActionBar>
<StackLayout>
<VideoPlayer ref="player" :src="video.file" autoplay="true" height="300" @loadingComplete="videoCompleted" @finished="videoFinished" loop="false" />
</StackLayout>
</Page>
</template>
<script >
export default {
props:['video'],
data() {
return {
}
},
methods:{
videoCompleted(){
console.log('Loading Completed');
},
videoFinished(){
console.log('Video finished');
}
}
}
</script>
loadingComplete
已更改为 playbackReady
,另一个处理程序附加到 finishedEvent
<VideoPlayer
@playbackReady="videoCompleted"
@finishedEvent="videoFinished"
/>
该演示已经过时了,但 documentation 看起来已得到维护。