Embed video from youtube.com into iphone app

前端 未结 6 576
耶瑟儿~
耶瑟儿~ 2021-02-04 19:42

i\'m trying to embed youtube video into my iphone application. I\'m using UIWebView and loading embed code from youtube as html string. So i have a layout with basic html markup

6条回答
  •  生来不讨喜
    2021-02-04 19:54

    There is one undocumented parameter "playsinline" now. I've tested it on iPhone 4S (iOS 6.1.2).

    player = new YT.Player('player', {
        height: '390',
        width: '640',
        videoId: 'u1zgFlCw8Aw',
        playerVars: {
            'playsinline': 1
        }
    });
    

    And you should set the webview as well.

    [webView setAllowsInlineMediaPlayback:YES];
    

提交回复
热议问题