Search code examples
iosurllocalhostmpmovieplayercontrollerdrm

How can MPMoviePlayerController play localhost URL?


I'm using Widevine to deal with DRM movies. After WV_Initialize and WV_Play, I get a responseURL that is "http://127.0.0.1:20001/movie.m3u8"

I then pass it to MPMoviePlayerController

self.playerController = [[MPMoviePlayerController alloc] initWithContentURL:responseURL];
self.playerController.movieSourceType = MPMovieSourceTypeStreaming;
self.playerController.shouldAutoplay = YES;
[self.playerController prepareToPlay];
[self.playerController play];

And the movie is played. What is happening here? How can MPMoviePlayerController play localhost URL?


Solution

  • Widevine actually opens a local media proxy on you machine. it connects on one hand to the "real" video server, takes the media and - after decrypting and doing other stuff - procides it for you on your 127.0.0.1:PORT via RTMP/http.