0
我有一個按鈕,創建一個視頻標籤:結束動態功能動態創建的視頻標籤
$("#btn").click(function() {
var video = $('<video />', {
id: 'myVid',
src: "vid1.mp4",
type: 'video/mp4',
controls: false
});
$('body').append(video);
var btn = $('<button id="btnPP">Play Video</button>');
$('body').append(btn);
});
$(document).on('ended', "#myVid", function() {
alert("fini");
});
我的代碼看起來還好,但是當影片結束後,它不會執行任何代碼裏面的ended
功能。