ime().then(function(seconds) {
                    position = seconds;
                });
                player.getDuration().then(function(seconds) {
                    duration = seconds;
                });
                window.location.href = "embed://onState?playback=" + playbackState + "&position=" + position + "&duration=" + duration + "&download=" + downloadProgress;
                invoke("initialize");
            }

            function onPlay(data) {
                playbackState = 1;
     