Tuesday, April 5, 2011

Re: [YouTube-API] 'onError' callback is not triggered on iPad

I asked about this a long time ago and, not getting any response, I wrote it off to the fact that this interface is still experimental and not to be relied upon.

I guess we'll just have to be patient and hope some progress is being made by the YouTube development teams.

On Tue, Apr 5, 2011 at 5:49 AM, matghaleb <matghaleb@gmail.com> wrote:
I've been testing the new iframe API for several weeks and it seems
that when an error occurs any callback is triggered on the iPad
(neither 'onError' nor 'onStateChange' ).

I wrote a basic test page trying to load an invalid video (http://
matghaleb.free.fr/youtube_error.html) and here are the different
output on each device :

desktop :
=======
1. testing youtube iframe api with wrong videoId XXXXXXXXXXX
2. onStateChange: -1
3. onReady
4. onError: 100

iPad :
=====
1. testing youtube iframe api with wrong videoId XXXXXXXXXXX


Here's the code of my test page:

<html>
 <body>
   <div id="player"></div>

   <script>
     var tag = document.createElement('script');
     tag.src = "http://www.youtube.com/player_api";
     var firstScriptTag = document.getElementsByTagName('script')[0];
     firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

     var player;
     function onYouTubePlayerAPIReady() {
       alert('testing youtube iframe api with wrong videoId
XXXXXXXXXXX')
       player = new YT.Player('player', {
         height: '390',
         width: '640',
         videoId: 'XXXXXXXXXXX',
         events: {
           'onReady': onPlayerReady,
           'onStateChange': onPlayerStateChange,
           'onError': onPlayerError
         }
       });
     }

     function onPlayerReady(event) {
       alert('onReady');
       event.target.playVideo();
     }

     function onPlayerStateChange(event) {
       alert('onStateChange: ' + event.data);
     }

     function onPlayerError(event) {
       alert('onError: ' + event.data);
     }
   </script>
 </body>
</html>

--
You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
To post to this group, send email to youtube-api-gdata@googlegroups.com.
To unsubscribe from this group, send email to youtube-api-gdata+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/youtube-api-gdata?hl=en.




--
G. Bert Bonkowski
Founder, Screenius Inc.

--
You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
To post to this group, send email to youtube-api-gdata@googlegroups.com.
To unsubscribe from this group, send email to youtube-api-gdata+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/youtube-api-gdata?hl=en.

No comments:

Post a Comment