我认为这是可能的,但您必须自己将 html 代码写入浏览器元素
wbYoutube.DocumentText = "";
这是html(你必须逃避它)
<html><head></head><body>
<script type='text/javascript' src='http://www.youtube.com/player_api'></script>
<iframe id="player" width="100%" height="100%" src="http://www.youtube.com/embed/VIDEO_ID?autoplay=1&controls=0&enablejsapi=1" frameborder="0" allowfullscreen></iframe>
<script type="text/javascript">
var player;
function onYouTubeIframeAPIReady() {
player = new YT.Player('player', {
videoId: 'VIDEO_ID',
events: {
'onStateChange': function(evt){
if(evt.data == 0){
window.external.Test('Video finished!!');
}
}
}
});
}
</script>
</body></html>
并查看实现 DHTML 代码和客户端应用程序代码之间的双向通信
在那里你可以找到其余的代码。