1

Currently i am showing a stream using AVPlayer

AVPlayer * player = [AVPlayer playerWithURL:url];

Activating airplay with MPVolumeView with hidden volume slider works fine, and stream is presented on external device. But I would like to show stream video on both screens. After examining the AVPlayer documentation I have found no way to achieve this without having 2 AVPlayers one show on device with allowsExternalPlayback set to NO and another with it set to yes activating only when airplay is setup (have not tried this out yet).

It seams to me that there should be an easier solution to this, hopefully I missed something in the docs.

Dobroćudni Tapir
  • 3,082
  • 20
  • 37
  • This normally isn't what the user expects in an app with AirPlay integration. – David Wong Mar 07 '15 at 11:52
  • If you have any official statement considering this use case or something similar that supports your claim it would be greatly appreciated and would be considered an answer to the question. – Dobroćudni Tapir Mar 11 '15 at 12:23

1 Answers1

-1

Ok personally for this kind of thing I use an open source Github library called NSStreamGod. Its updated frequently and is very useful.

#import "NSStreamGod.h"

Then do the following to stream:

NSStreamGod *myStream = [[NSStreamGod alloc] init];
[myStream startNewStreamWithFile:@"movie.mp4"];
[myStream setVolume:22]; // this is percentage.
[myStream repeatStream:NO];
[myStream begin];
  • I find this question of no help in my case. Could you at least provide a link to the github page. And add some relevant information to make this answer more valuable? – Dobroćudni Tapir Mar 12 '15 at 22:05