html 播放器准备好事件bug和变通方法。此错误已在SDL Media Manager 2.4或更早版本中修复。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html 播放器准备好事件bug和变通方法。此错误已在SDL Media Manager 2.4或更早版本中修复。相关的知识,希望对你有一定的参考价值。

<!DOCTYPE html>
<html>
<head>
	<!--<script src="jquery-2.0.3.min.js"></script>-->
	<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
	<script>
		$(document).ready(function() {
			$("#myPlayer").bind("player-ready", event_playerready);
			$(document).bind("MMPLAYERREADY", event_MMPLAYERREADY);
		});

		function event_playerready(event) {
			// former bug: the player-ready event would be triggered twice for every player
			var playerDiv = $(event.target);
			console.log("player-ready event fired for div with id: " + playerDiv.attr("id"));
		}

		function event_MMPLAYERREADY(event) {
			console.log("MMPLAYERREADY event fired on div with id " + event.value);
			// workaround: get the player div based on the string in event.value. The player-ready event would have the player dom node in the event.target parameter.
			// this workaround does not apply when you want to apply different logic on different players, as this function applies to all players in the document.
			var playerDiv = $("#" + event.value);
			console.log("  as a workaround we found the player div. id: " + playerDiv.attr("id"));
		}
	</script>
	<style type="text/css">
		.player {
			background-color: #E0E0E0;
			width: 600px;
			height: 338px;
		}
	</style>
</head>
<body>
</body>
	<div id="myPlayer" class="player">
		<script type="text/javascript" language="javascript" src="http://sdl-training.dist.sdlmedia.com/vms/distribution/embed/?o=2981B015-A171-4C6A-BEC6-9C0BC80B9F4E"></script>
	</div>
	<p>See the logging messages in the console</p>
</html>

以上是关于html 播放器准备好事件bug和变通方法。此错误已在SDL Media Manager 2.4或更早版本中修复。的主要内容,如果未能解决你的问题,请参考以下文章

html5播放器哪个好

html5 播放事件与视频标签中的播放事件

如何让 Hls.js 在准备好后自动播放视频?

MySQL 错误:准备好的语句协议尚不支持此命令

Firefox关于Audio事件的bug及解决方案

HTML5 音频加载