This is my h5 code:
id="myVideo" src="xxxapp://***.***.xx/***/***.mp4" style="object-fit:cover;opacity:1;width:100%;height:100%;display:block;possition:absolute;" type="video/mp4"></video>
I want to load local large video, so, I use WKURLSchemeHandler.
- (void)webView:(WKWebView *)webView startURLSchemeTask:(id<WKURLSchemeTask>)urlSchemeTask {
NSURLRequest *request = [urlSchemeTask request];
NSURL *url = request.URL;
NSString *urlString = url.absoluteString;
NSString *videoPath = [[NSBundle mainBundle] pathForResource:@"***" ofType:@"mp4"];
NSData *videoData = [NSData dataWithContentsOfFile:videoPath options:nil error:nil];
NSURLResponse *response = [[NSURLResponse alloc] initWithURL:url MIMEType:@"video/mp4" expectedContentLength:videoData.length textEncodingName:nil];
[urlSchemeTask didReceiveResponse:response];
[urlSchemeTask didReceiveData:videoData];
[urlSchemeTask didFinish];
}
but its not work, data is not nil, but video do not play. I would greatly appreciate it if someone could help me find a solution!!
ps: can make it, but we cannot use it due to some reasons.
Post
Replies
Boosts
Views
Activity
This is my h5 code:
<video id="myVideo" src="xxxapp://***.***.xx/***/***.mp4" style="object-fit:cover;opacity:1;width:100%;height:100%;display:block;possition:absolute;" type="video/mp4"></video>
I want to load local large video, so, I use WKURLSchemeHandler.
- (void)webView:(WKWebView *)webView startURLSchemeTask:(id<WKURLSchemeTask>)urlSchemeTask {
NSURLRequest *request = [urlSchemeTask request];
NSURL *url = request.URL;
NSString *urlString = url.absoluteString;
NSString *videoPath = [[NSBundle mainBundle] pathForResource:@"***" ofType:@"mp4"];
NSData *videoData = [NSData dataWithContentsOfFile:videoPath options:nil error:nil];
NSURLResponse *response = [[NSURLResponse alloc] initWithURL:url MIMEType:@"video/mp4" expectedContentLength:videoData.length textEncodingName:nil];
[urlSchemeTask didReceiveResponse:response];
[urlSchemeTask didReceiveData:videoData];
[urlSchemeTask didFinish];
}
but its not work, data is not nil, but video do not play.
I would greatly appreciate it if someone could help me find a solution!!
ps: can make it, but we cannot use it due to some reasons.
When I update my Xcode12 beta4,I connot run it.It will show me the error that
No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=arm64 armv7).
And then, I go to compare it to Xcode12 beta2, I find that my target has no 'Valid Architectures' option in beta4.
Then I go to see <Xcode 12 Beta 4 Release Notes>, it said:
'The stand-alone system assemblers for i386, x86_64, and arm are deprecated and may be removed in a future Xcode release. '
But I don't know how to fix that...
Has anyone solved the problem???