11-22-2011 12:18 PM
Hello,
In our exploitation of Brightcove solution, we use IOS UIWebView to visualize HTML content that contain videos declared by JavaScript. The player work in safari mobile.
Any ideas ?
Thanks you.
Solved! Go to Solution.
11-30-2011 02:15 PM
Yes, if your player is set for HTML5 delivery you can embed it in the UIWebView. I have seen this combo working.
12-01-2011 04:08 AM
Thanks your help. I'think the problem is in the json stream that feed the UIWebview.
12-13-2011 03:10 PM
I've embedded the player in a UIWebView, but can't get the video to play. The play icon overlays the video image, but no playback. How do I enable the playback?
12-13-2011 03:19 PM
A couple of questions:
- Does the player work fine outside the UIWebView? Like does it play in the browser? If the content doesn't play there either it might be that you don't have the correct rendition for iOS which are h264 encoded files or HTTP Live Streaming from Apple
- What technique are you using the embed the player in the UIWebView?
12-13-2011 03:50 PM
Thanks for the quick response.
The player works fine outside of the app, but can't get it to play inside the app. In the UIWebView, I'm making a call to a web page that has the player code.
12-13-2011 03:55 PM
Sorry, forgot the code:
<div class='header'>%header%</div>
<br/>
<div class='mainContent'>
<!--
By use of this code snippet, I agree to the Brightcove Publisher T and C
found at https://accounts.brightcove.com/en/terms-and-condi
-->
<script language="JavaScript"type="text/javascript"src="http://admin.brightcove.com/js/BrightcoveExperienc
<object id="myExperienceSOMESTRING"class="BrightcoveExperience">
<param name="bgcolor"value="#FFFFFF" />
<param name="width" value="480" />
<param name="height"value="270" />
<param name="playerID"value="SOMESTRING" />
<param name="playerKey"value="SOMESTRING" />
<param name="isVid"value="true" />
<param name="isUI" value="true" />
<param name="dynamicStreaming"value="true" />
<param name="@videoPlayer"value="%videoid%" />
</object>
<!--
This script tag will cause the Brightcove Players defined above it to be created as soon
as the line is read by the browser. If you wish to have the player instantiated only after
the rest of the HTML is processed and the page load is complete, remove the line.
-->
<script type="text/javascript">brightcove.createExperiences();</script>
<!-- End of Brightcove Player --> </div>
THE CALL:
NSString *localPath;
NSString *html;
if( [[rssArrayobjectAtIndex:0] valueForKey:@"title" ] == nil ||
[[rssArrayobjectAtIndex:0] valueForKey:@"body" ] == nil
|| [[rssArray objectAtIndex:0] valueForKey:@"videoid" ] == nil ){
localPath = [NSStringstringWithFormat:@"%@/carStoryError.html",[[NSBundlemainBundle] resourcePath]];
html = [NSStringstringWithContentsOfFile:localPath encoding:NSUTF8StringEncodingerror:nil ];
}
else
{
localPath = [NSStringstringWithFormat:@"%@/carStory.html",[[NSBundlemainBundle] resourcePath]];
html = [NSStringstringWithContentsOfFile:localPath encoding:NSUTF8StringEncodingerror:nil ];
html = [ html stringByReplacingOccurrencesOfString:@"%header%"withString:[[rssArrayobjectAtIndex:0] valueForKey:@"title" ]];
html = [ html stringByReplacingOccurrencesOfString:@"%body%"withString:[[rssArrayobjectAtIndex:0] valueForKey:@"body" ]];
html = [ html stringByReplacingOccurrencesOfString:@"%videoid%"withString:[[rssArrayobjectAtIndex:0] valueForKey:@"videoid" ]];
}
12-31-2011 11:49 PM
This code worked for me:
NSString *path = [[NSBundle mainBundle] pathForResource:@"webViewContent" ofType:@"html"];
NSFileHandle *readHandle = [NSFileHandle fileHandleForReadingAtPath:path];
NSString *htmlString = [[NSString alloc] initWithData:
[readHandle readDataToEndOfFile] encoding:NSUTF8StringEncoding];
[self.webView loadHTMLString:htmlString baseURL:nil];
[htmlString release];
01-25-2012 04:36 AM
it is not owrking for me too.
i am using phonegap 1.3.0 to view an HTML page in my UIview,
The player javascript code works fine if I run the html page outside my app (i.e. in mobile Safari). But when i build the html with native UIview then it shows only a white background in place of the player.
please see the attahced screen shot.
any idea, wht could be my possible mistake?
-Rana
02-27-2012 04:07 PM
Any chance that you can post a simplified project to try out?
Brightcove Inc., a leading global provider of cloud content services, provides a family of products used to publish and distribute the world's professional digital media. The company's products include Brightcove Video Cloud, the market-leading online video platform, and Brightcove App Cloud, the pioneering content app platform. Together, more than 4,200 customers in 50 countries rely on Brightcove's cloud content services to build and operate exceptional media experiences across PCs, smartphones, tablets and connected TVs.
Brightcove Inc.
© 2012 Brightcove Inc.
