Skip to content

TypeError: videoPlayer.release is not a function #4

@wallowyou

Description

@wallowyou

官方 demo 中,TypeError: videoPlayer.release is not a function ,如果我想在同一个页面切换播放视频,是不是要销毁再创建

onBackPress(options) {
	console.log("返回上一页:", options);
	if (options.from === 'navigateBack' || options.from === 'backbutton') {
		// 从导航返回触发时执行
		var videoPlayer = this.$refs.player;
		videoPlayer.release((res) => {
			console.log("播放器销毁", res);
			uni.navigateTo({
				url: './index'
			});
		});
		return true;
	}
	return false;
}

报错截图:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions