Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

playing a local video in a uiwebview

i load a local html file into an ipad application:

NSURL *baseURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]];
NSString *path = [[NSBundle mainBundle] pathForResource:@"lieferant1" ofType:@"html"];
NSString *content = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
[webView loadHTMLString:content baseURL:baseURL];

the webpage gets displayed, content of my html file:

<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>
    <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
<p>
    <video>
        <source src="banane.m4v">
    </video>
</p>

so, banane.m4v is in my root, just in some groups, but not in real directories. enter image description here

but the video section in my webview keeps black. no video gets loaded. i uploaded my html file and my .m4v video to my webserver to check if its not encoded properly, but everything works fine, surfing the html file with my ipad.

some ideas whats wrong?

like image 880
choise Avatar asked Jan 29 '11 11:01

choise


1 Answers

oh my god

<video controls>
    <source src="banane.m4v">
</video>

where controls is the magic word.

:X

like image 187
choise Avatar answered Oct 04 '22 02:10

choise