diff --git a/pages/component/video/video.uvue b/pages/component/video/video.uvue index 0d0cccc3af9eca3175257b19dad1f6f414051c6c..30a3084c68e2ee7566e14da1b808c87858426d6a 100644 --- a/pages/component/video/video.uvue +++ b/pages/component/video/video.uvue @@ -223,7 +223,8 @@ }, pause: function () { console.log("pause"); - this.videoContext?.pause(); + (uni.getElementById("video") as UniVideoElement).pause(); //as写法测试。注意id不对时as会崩溃 + // this.videoContext?.pause(); }, seek: function (pos : number) { console.log("seek -> " + pos); @@ -239,7 +240,8 @@ }, stop: function () { console.log("stop"); - this.videoContext?.stop(); + uni.getElementById("video")?.stop(); //泛型写法测试 + // this.videoContext?.stop(); }, sendDanmu: function (danmu : Danmu) { console.log("sendDanmu -> " + danmu);