iOS開發 播放Youtube影片




UITextView *myUITextView1;

if(videoView == nil)
videoView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 37, 320, 260)];

videoView.backgroundColor = [UIColor clearColor];

videoView.opaque = NO;

[self.view addSubview:videoView];

NSString *htmlString =@"<html><head>"

"<meta name = \"viewport\" content = \"initial-scale = 1.0, user-scalable = no, width = 212\"/></head>"

"<body style=\"background:#FFFFF;margin-top:20px;margin-left:0px\">"

"<div><object width=\"320\" height=\"240\">"

"<param name=\"wmode\" value=\"transparent\"></param>"

"<embed src=\"\""

"type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"320\" height=\"240\"></embed>"


[videoView loadHTMLString:htmlString baseURL:nil];

1 則迴響於“iOS開發 播放Youtube影片

  1. Hey there, I think your website might be having browser compatibility issues. When I look at your website in Chrome, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, great blog!