私はYoutube video player
アプリ内で作成しようとしています(それwebview
自体でビデオを再生します)。これに基づくチュートリアルまたはサンプルプログラムはありますか?
前もって感謝します。
私はYoutube video player
アプリ内で作成しようとしています(それwebview
自体でビデオを再生します)。これに基づくチュートリアルまたはサンプルプログラムはありますか?
前もって感謝します。
次のように、YouTube vids を webview に埋め込むことができます。
- (void)embedYouTubeInWebView:(NSString*)url theWebView:(UIWebView *)aWebView {
NSString *embedHTML = @"\
<html><head>\
<style type=\"text/css\">\
body {\
background-color: transparent;\
color: white;\
}\
</style>\
</head><body style=\"margin:0\">\
<embed id=\"yt\" src=\"%@\" type=\"application/x-shockwave-flash\" \
width=\"%0.0f\" height=\"%0.0f\"></embed>\
</body></html>";
NSString* html = [NSString stringWithFormat:embedHTML, url, aWebView.frame.size.width, aWebView.frame.size.height];
[aWebView loadHTMLString:html baseURL:nil];
}