I can play video files in WebView , but the videos are playing automatically without the user interaction. So now I am following different approach to achieve that.
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.businessfactors.de/bfcms/images/stories/videos/defaultscreenvideos.mp4\" type=\"application/x-shockwave-mp4\" \
width=\"%0.0f\" height=\"%0.0f\"></embed>\
</body></html>";
_webView = [[UIWebView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 412.0)];
[_webView setOpaque:NO];
NSString *html = [NSString stringWithFormat:embedHTML, _webView.frame.size.width, _webView.frame.size.height];
[_webView loadHTMLString:html baseURL:nil];
This way , I can play video file from the internet. But I want to play the files from the Local memory.
Even if tried to pass the local file path variable, the video is unable to play. Can anyone tell me how to embed my local file into the html so that I can play in webview as like the internet video ?
CASE 1 : Video automatically playing in WebView but play button is still in top. CASE 2 : Online Video URL is embedded as shown above and the video can be played. But I want to pass the local video file path instead of online video url