iphone - How to avoid auto-playing Youtube videos in UIWebView -
i want implement play , stop button same sd youtube when webview loaded youtube url. used below code when loads in webview starts playing (auto-play). want load in webview , not auto-play it. how can this?
this code:
uiwebview *videoview = [[uiwebview alloc] initwithframe:cgrectmake(10,80,275.0,150)]; nsurl *nsurl=[nsurl urlwithstring:strpreview]; nsurlrequest *nsrequest=[nsurlrequest requestwithurl:nsurl]; [videoview loadrequest:nsrequest]; [self addsubview:videoview];
thanks in advance
here code create load embedded video in iphone using iframe
nsstring *yoururl = @"http://www.cloudstringers.com:14556/ingcloud/users/400010003/mp4_320p/efda2f8a618be8e4a36b81d31251752820130710115909.mp4"; nsstring *embedhtml =[nsstring stringwithformat:@"\ <html><head>\ <style type=\"text/css\">\ body {\ background-color: #666666;\ padding:%f %f %f %f;\ color: blue;\ }\ </style>\ </head><body style=\"margin:0\">\ <iframe height=\"%f\" width=\"%f\" title=\"youtube video\" class=\"youtube-player\" src=\"%@" ></iframe>\ </body></html>",paddingtop,paddingright,paddingbottom,paddingleft,videoheight,videowidth,yoururl]; [self.webview loadhtmlstring:embedhtml baseurl:nil];
hope helps. let me know if need more.
Comments
Post a Comment