Question

I'm learning how YouTube player works with Javascript. I have this code because I want to make a video gallery and it works perfectly in any browser (the idea is to switch between videos by the ID), the problem is when I try to test in on my ipad it doesn't display anything. Any suggestions for iOS? Thanks in advance!

swfobject.embedSWF("http://www.youtube.com/v/3sL8aaMw7ZQ?enablejsapi=1&rel=0&fs=1",
        "ytplayer-temp",
        "400",
        "226",
        "10.1",
        false,
        false,
        { allowScriptAccess: "always", allowFullScreen: "true" },
        { id: "ytplayer" }
    );
    function ytplayer_loadvideo(id) {
        var o = document.getElementById("ytplayer");
        if (o) {
            o.loadVideoById(id);
        }
    }
Was it helpful?

Solution

No flash support for iOS. You have to use html5 instead.

https://developers.google.com/youtube/getting_started

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top