iphone - uiwebview detect youtube video is loaded completeley -
iphone - uiwebview detect youtube video is loaded completeley -
i playing youtube video in uiwebview using next code
nsstring *embedhtml = @"\ <html><head>\ <style type=\"text/css\">\ body {\ background-color: transparent;\ color: white;\ }\ </style>\ </head><body style=\"margin:0\">\ <embed id=\"yt\" src=\"http://www.youtube.com/embed/%@?autoplay=0&showinfo=0&controls=0\" type=\"application/x-shockwave-flash\" \ width=\"%0.0f\" height=\"%0.0f\"></embed>\ </body></html>"; nsstring *html = [nsstring stringwithformat:embedhtml, videotoken, videoview.frame.size.width, videoview.frame.size.height]; [videoview loadhtmlstring:html baseurl:nil];
my problem until youtube video not loaded want show loading or thing beingness loaded. tried observe in webview did finish load, comes 2-3 times in method.
please help
if want observe video loaded or not utilize below method , delegate method of uiwebview
you must set delegate of uiwebview in view controller class.
- (void)webviewdidfinishload:(uiwebview *)webview { //your code here }
let me know working or not!!!
happy coding!!!!
iphone ios7 uiwebview youtube
Comments
Post a Comment