basicamente es algo muy sencillo, tengo un video en mi pargina y luego por medio de la funcion load() de jquery cargo otro video, pero como raro me genera un error solo en IE
aca el codigo utilizado:
Código HTML:
<script type="text/javascript" src="js/jquery-latest.js"></script> <script src="http://swfobject.googlecode.com/svn/tags/rc3/swfobject/src/swfobject.js" type="text/javascript"></script> <script type="text/javascript"> function updateHTML(elmId, value) { document.getElementById(elmId).innerHTML = value; } function setytplayerState(newState) { updateHTML("playerstate", newState); } function onYouTubePlayerReady(playerId) { ytplayer = document.getElementById("myytplayer"); setInterval(updateytplayerInfo, 250); updateytplayerInfo(); ytplayer.addEventListener("onStateChange", "onytplayerStateChange"); ytplayer.addEventListener("onError", "onPlayerError"); } function onytplayerStateChange(newState) { setytplayerState(newState); } function onPlayerError(errorCode) { alert("An error occurred: "+ errorCode); } function updateytplayerInfo() { updateHTML("bytesloaded", getBytesLoaded()); updateHTML("videotime", getCurrentTime()); } // functions for the api calls function stop() { if (ytplayer) { ytplayer.stopVideo(); } } function getPlayerState() { if (ytplayer) { return ytplayer.getPlayerState(); } } function getBytesLoaded() { if (ytplayer) { var total = ytplayer.getVideoBytesTotal(); var loaded = ytplayer.getVideoBytesLoaded(); var porcen = ((loaded*'100')/total); var myString = new String(porcen); var myArray = myString.split('.'); return myArray[0]; } } function getCurrentTime() { if (ytplayer) { var time = ytplayer.getCurrentTime(); var totaltime = ytplayer.getDuration(); var time = (totaltime-time); var myString = new String(time); var myArrayT = myString.split('.'); return myArrayT[0]; } } </script> <a href="#" onclick="$('#video').load('2.php');">Siguiente</a> <div id="video"> <div id="ytapiplayer"> You need Flash player 8+ and JavaScript enabled to view this video. </div> <script type="text/javascript"> // allowScriptAccess must be set to allow the Javascript from one domain to access the swf on the youtube domain var params = { allowScriptAccess: "always" }; // this sets the id of the object or embed tag to 'myytplayer'. You then use this id to access the swf and make calls to the player's API var atts = { id: "myytplayer" }; swfobject.embedSWF("http://www.youtube.com/v/IDVIDEO&border=0&enablejsapi=1&playerapiid=ytplayer&rel=0&autoplay=1", "ytapiplayer", "500", "404", "8", null, null, params, atts); </script> </div>
ojala alguien tenga la solucion
Saludos