Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

New Member
Posts: 1
Registered: ‎04-19-2012
My Device: developer
My Carrier: t-mobile

Redirecting Blackberry After Embedded YouTube Finishes

I'm trying to have a page reload to another place after the end of an embedded YouTube video. It works in every browser I've tested so far ... except Blackberry. The video plays, but rather than redirect, instead it replays the video.

Here's the nifty code.

You can see the page in action at: http://bit.ly/I0csry



    // create youtube player
    var player;
    function onYouTubePlayerAPIReady() {
        player = new YT.Player('player', {
          videoId: '3MGQor2YaHA',
          events: {
            'onReady': onPlayerReady,
            'onStateChange': onPlayerStateChange

    // autoplay video
    function onPlayerReady(event) {

    // when video ends
    function onPlayerStateChange(event) {        
        if(event.data === 0) {
            window.location = "http://www.stage.celebritycruises.com/m/explore/destinations/home.do?dest=ALCAN";