Youtube video autoplay inside UIWebview

前端 未结 4 981
广开言路
广开言路 2020-12-09 14:03

I found many questions in this forum regarding embedding youtube video and autoplay, but none of them cleared all my doubts.

I found two methods to embed youtube vid

4条回答
  •  有刺的猬
    2020-12-09 14:32

    Q. If I am correct that (2) is recommended

    A. Yes (2) method is for i-devices where no flash support.

    Q. Autoplay with (2) is not possible.

    A. No autoplay is not possible as of now.

    Update: I am able to autoplay youtube video by using Youtube JS APIs see https://developers.google.com/youtube/js_api_reference

    Just call playVideo from onPlayerReady

    function onPlayerReady(event) {
                    event.target.playVideo();                    
                }
    

提交回复
热议问题