我使用的语言是英语,是阿拉伯语.所以我想知道如何在iPhone中获得阿拉伯语键盘.
如何在iphone sdk的一个项目中集成两种语言(英语或阿拉伯语)?请帮助我使用对我有帮助的代码或其他任何内容.
我已经完成了这一切, 还制作了.ts和m3u8文件。在本地服务器和实时服务器中,我可以播放mp4文件,例如
<video width="320" height="240" controls="controls" autoplay="autoplay">
<source src="movie.mp4" type="video/mp4" />
</object>
</video>
Run Code Online (Sandbox Code Playgroud)
但是我在播放.m3u8文件时遇到问题
<video width="320" height="240" controls="controls" autoplay="autoplay">
<source src="movie.m3u8" type="video/m3u8" />
</object>
</video>
Run Code Online (Sandbox Code Playgroud)
我的mediafilesegmenter创建了两个.ts文件和一个.m3u8。我的m3u8文件是
#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-VERSION:4
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-I-FRAMES-ONLY
#EXTINF:1.0117,
#EXT-X-BYTERANGE:8084@376
fileSequence0.ts
#EXTINF:1.0117,
#EXT-X-BYTERANGE:7332@36096 and so on....
Run Code Online (Sandbox Code Playgroud)
那么mime.types是否有任何问题,因为我在mime.types中写了所有的困惑,就像-
application/x-mpegURL m3u8
video/MP2T ts
AddType appliction/x-mpegURL m3u8
AddType video/MP2T ts
#application/x-mpegURL m3u8
#video/MP2T ts
application/x-mpegURL.m3u8
video/MP2T.ts
#application/x-mpegURL.m3u8
#video/MP2T.ts
#AddType application/x-mpegURL m3u8
#AddType video/MP2T ts
#AddType application/x-mpegURL.m3u8
#AddType video/MP2T.ts
AddType application/x-mpegURL.m3u8
AddType video/MP2T.ts
Run Code Online (Sandbox Code Playgroud)
我无法在VLC中播放.m3u8文件,并收到该错误链接
我做到了
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"https://maps.googleapis.com/maps/api/place/search/json?location=30.722322,76.76126&radius=500&types=food&sensor=true&key=any_apiKey"]];
NSURLResponse *response;
NSError *error;
NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
NSString *strResponse = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
NSLog(@"%@",strResponse);
SBJSON *sbJason = [[SBJSON alloc] init];
NSMutableDictionary *getPlaceList = [sbJason objectWithString:strResponse];
Run Code Online (Sandbox Code Playgroud)
//但我得到了这个 -
{
"html_attributions" : [],
"results" : [],
"status" : "REQUEST_DENIED"
}
Run Code Online (Sandbox Code Playgroud)
**API Key是否有任何问题我已经写了谷歌地图给出的API密钥.api密钥有什么问题或者请告诉我这里是google api的链接
这里我发送带有一些参数的文件路径或文件.但是服务器没有收到视频.那么代码中的任何问题呢?或者你想要添加的东西.那请告诉我.你想告诉我在哪里遇到错误或设置响应的任何委托方法.
NSString *path = [[NSBundle mainBundle] pathForResource:@"hangover" ofType:@"mp4"];
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:[NSURL URLWithString:@"http://156.75.28.172:52/aircas/RestServices/fileUpload"]];
[request setPostValue:filename forKey:@"name"];
[request setPostValue:@"GUnit" forKey:@"title"];
[request setPostValue:@"133" forKey:@"user_id"];
[request setPostValue:@"8953d0e1c97ef83c9f0aff47" forKey:@"token"];
[request setPostValue:@"video song" forKey:@"desc"];
[request setPostValue:@"34" forKey:@"video_id"];
[request setPostValue:@"0" forKey:@"is_private"];
[request setFile:path forKey:@"video"];
[request setTimeOutSeconds:500];
[request setRequestMethod:@"POST"];
[request startSynchronous];
Run Code Online (Sandbox Code Playgroud) 让我用例子来解释这个问题。
我有两个协议,名为 - Mappable(在 Git 上可用)和 Responsable(我创建了符合 Mappable 协议的协议)
protocol Responsable: Mappable {
static func getResponse(map: Map) -> Self
}
Run Code Online (Sandbox Code Playgroud)
方法 1 然后我有结构“NSIResponse”,它是通用的并且符合 Mappable 和通用 T 是 Resposable 类型
struct NSIResponse<T>: Mappable where T: Responsable {
mutating func mapping(map: Map) {
response = T.getResponse(map: map)
}
}
Run Code Online (Sandbox Code Playgroud)
之后,我创建了符合 Responsable 协议的 User 对象的结构。
struct User: Responsable {
var id: Int ?
mutating func mapping(map: Map) {
id <- map["id"]
}
static func getResponse(map: Map) -> User {
guard let response = …Run Code Online (Sandbox Code Playgroud)