I'm trying to lose like this:

NSURL *url = [NSURL URLWithString:kApiFirstDigitalUrl]; _player = [[MPMoviePlayerController alloc] initWithContentURL:url]; _player.view.frame = CGRectMake(0, 0, 200, 200); [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myMovieFinishedCallback:) name:MPMoviePlayerPlaybackDidFinishNotification object:_player]; [self.view addSubview:_player.view]; [_player play]; 

an error comes to myMovieFinishedCallback: "You have the necessary hash in the URL bar.

    1 answer 1

    As far as I understand, how exactly to log in is a rather large degree of arbitrariness of the one who wrote the server part, so hardly anyone can help you with this description - we don’t actually know what to do in order for the server to give the video (I suspect that it gives 401 to HTTPResponse).

    The only thing - pay attention to the help of MPMoviePlayerController , there is something at the beginning about authorization, maybe this is just your case

    • The server gives this video to the computer, to android, etc. A link of this type: http: // [hash]: @ t.kraslan.ru: 8000 / 1t2? Box. In the same android, no difference is made, a link with authorization (that is, you need a hash to play and it is and it is correct) or not (the hash is not needed at all). line -> URI -> to play in the player; and everything works. If using the code above to run a video for which authorization is not needed, then everything is OK, but if needed, this error is issued, despite the fact that there is a necessary hash in the url. - anutakay
    • I read the help and there are a lot of examples, but all about basic auth, that is, about authorization by login and password, and not by hash. Yes, the server most likely returns 401, but this means that MPMoviePlayerController does not send it a hash. - anutakay
    • Well, something has already become clear, this is not a hash, this is the standard way to set the login-password directly in the address bar, a general view is login: password@youUrl.com , and the password is empty (if you need to use only the login, and then enter the password , then: not required). So even if you put a hash there, it is perceived as a login and naturally everything fails. Try to do it, add a password there, or remove:. But it’s really not so cool to transmit via http - it is not encrypted - aknew
    • It's not just that I have no password, this is the industry standard: ru.wikipedia.org/wiki/Digest_authentication . The information there is just encrypted, there are other security problems of this method, but not about that. I tried with a real login and password just to run through the parser url, the same thing. But about the fact that the hash in the expression is in place of the login, and the password is empty (well, just in form), I did not focus on this. Maybe if you use the same manuals and screw the authorization through the NSURLCredential with a hash instead of a login, it can take off. - anutakay
    • I know what a hash is, but it is usually placed either in the headers of the http package, or as a het parameter or a post, it is definitely not there. Well, either something is very tricky and non-standard on the server is screwed up, this also happens. By the way, does this thing have a webmord? Can there some firebug look just to see what it is and how the browser sends when you request a video? - aknew