我是一個總編程的新手,並且正在Adobe Edge Animate項目中工作。我創建了一個返回按鈕,讓用戶在播放視頻時點擊它,從而關閉視頻並將其返回到主菜單。然而,這可以工作,視頻音頻會在後臺繼續播放。Javascript關閉HTML5視頻時關閉
有誰知道如何讓視頻在返回主菜單的同時暫停播放?
這裏是我的代碼
(function ($, Edge, compId) {
var Composition = Edge.Composition,
Symbol = Edge.Symbol; // aliases for commonly used Edge classes
//Edge symbol: 'stage'
(function (symbolName) {
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 1000, function (sym, e) {
// sym.$("name") resolves an Edge Animate element name to a DOM
// element that can be used with jQuery
var vid = sym.$("Rectangle");
vid.html('<video width="1920" height = "1080" src = "video/OurChangingWorld_AirQuality_Final_v2.mp4" type ="video/mp4" controls autoplay></video>');
});
//Edge binding end
Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function (sym, e) {
sym.stop();
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_Button_AirQuality}", "click", function (sym, e) {
sym.play("Video 1");
});
//Edge binding end
Symbol.bindElementAction(compId, symbolName, "${_Return_button-01}", "click", function (sym, e) {
sym.play("Main");
});
//Edge binding end
})("stage");
//Edge symbol end:'stage'
})(jQuery, AdobeEdge, "EDGE-3854874");
什麼瀏覽器你得到這種行爲? – adamb