Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
<script type="text/javascript">
function onYouTubePlayerReady() {
alert("geht");
ytplayer = document.getElementById("ytplayer");
ytplayer.addEventListener("onStateChange", "onytplayerStateChange");
}
function onytplayerStateChange(newState) {
alert("Player's new state: " + newState);
}
</script>
</head>
<body>
<center>
<div id="dasvideo">
<object width="640" height="390"><param name="movie" value="http://www.youtube.com/e/p5TkxjxsnwY?enablejsapi=1&version=3&playerapiid=ytplayer"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/e/p5TkxjxsnwY?enablejsapi=1&version=3&playerapiid=ytplayer" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="390"></embed></object>
</div>
<script type='text/javascript' src='http://www.karriere-online-test.de/swfobject/swfobject.js'></script>
<script type="text/javascript">
function onYouTubePlayerReady() {
alert("geht");
ytplayer = document.getElementsByTagName("embed")[0];
ytplayer.addEventListener("onStateChange", "onytplayerStateChange");
}
function onytplayerStateChange(newState) {
alert("Player's new state: " + newState);
}
</script>
</head>
<body>
<center>
<div id="dasvideo">
<object width="640" height="390"><param name="movie" value="http://www.youtube.com/e/p5TkxjxsnwY?enablejsapi=1&version=3&playerapiid=ytplayer"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/e/p5TkxjxsnwY?enablejsapi=1&version=3&playerapiid=ytplayer" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="390"></embed></object>
</div>
Note: To test any of these calls, you must have your file running on a webserver, as the Flash player restricts calls between local files and the internet.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html id="html" xmlns="http://www.w3.org/1999/xhtml" lang="de" xml:lang="de">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>YouTube API</title>
<script type="text/javascript">
function onYouTubePlayerReady() {
ytplayer = document.getElementsByTagName("embed")[0];
ytplayer.addEventListener("onStateChange", "onytplayerStateChange");
}
function onytplayerStateChange(newState) {
document.title = "Player's new state: " + newState;
}
</script>
</head>
<body>
<div id="dasvideo">
<object width="640" height="390"><param name="movie" value="http://www.youtube.com/e/p5TkxjxsnwY?enablejsapi=1&version=3&playerapiid=ytplayer"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/e/p5TkxjxsnwY?enablejsapi=1&version=3&playerapiid=ytplayer" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="390"></embed></object>
</div>
</body>
</html>