iphone Programming Glossary: findbuttoninview
YouTube video playback broken on iOS6 (works fine on iOS5) http://stackoverflow.com/questions/12462052/youtube-video-playback-broken-on-ios6-works-fine-on-ios5 safari. Below you can see a code snippet. This code works pefrectly fine under iOS5. However in iOS 6 the UIButton in findButtonInView is always nil. Any ideas what might be the reason youtubeWebView.delegate self youtubeWebView.backgroundColor UIColor clearColor.. NO manager displayNetworkActivityIndicator NO stop the activity indicator and enable the button UIButton b self findButtonInView _webView TODO this returns null in case of iOS 6 redirect to the youtube app if b nil NSURL movieTrailer if tmdbMovie movieTrailer.. sharedApplication openURL movieTrailer else b sendActionsForControlEvents UIControlEventTouchUpInside UIButton findButtonInView UIView view UIButton button nil if view isMemberOfClass UIButton class return UIButton view if view.subviews view.subviews..
Youtube video autoplay on iPhone's Safari or UIWebView http://stackoverflow.com/questions/3010708/youtube-video-autoplay-on-iphones-safari-or-uiwebview @ b85hn8rJvgw nil webView loadHTMLString htmlString baseURL NSURL URLWithString @ http youtube.com UIButton findButtonInView UIView view UIButton button nil if view isMemberOfClass UIButton class return UIButton view if view.subviews view.subviews.. class return UIButton view if view.subviews view.subviews count 0 for UIView subview in view.subviews button self findButtonInView subview if button return button return button void webViewDidFinishLoad UIWebView _webView UIButton b self findButtonInView..
How can I start a YouTube video without the user touching the UIWebView itself? http://stackoverflow.com/questions/5510429/how-can-i-start-a-youtube-video-without-the-user-touching-the-uiwebview-itself share improve this question Answering myself. I've found the solution. This code will autoplay the webview. UIButton findButtonInView UIView view UIButton button nil if view isMemberOfClass UIButton class return UIButton view if view.subviews view.subviews.. class return UIButton view if view.subviews view.subviews count 0 for UIView subview in view.subviews button self findButtonInView subview if button return button return button void webViewDidFinishLoad UIWebView _webView UIButton b self findButtonInView.. subview if button return button return button void webViewDidFinishLoad UIWebView _webView UIButton b self findButtonInView _webView b sendActionsForControlEvents UIControlEventTouchUpInside Youtube video autoplay on iPhone's Safari or UIWebView..
|