This question is going to be quite generic since I'm novice in iOS, video-streaming, and Bluetooth (going to be an interesting project).
Basically I wish to be able to stream low-res video from one iOS device to another iOS device, either through WiFi or Bluetooth depending on which one is available. Bonjour is used for initial service discovery. (I know streaming video over Bluetooth is non-ideal but it's one of the project's requirements)
So the question is what video-streaming framework/library can be used in order to maximize the amount of code shared between streaming video over WiFi and streaming video over Bluetooth.
Here are the instructions to test video streaming through Multipeer Conectivity:
You need Cocoapods, if you have not installed it yet, go to http://cocoapods.org/#install
AVCaptureMultipeerVideoDataOutput/Sample
directory in the Terminal and execute pod install
NOTE: The Multipeer Connectivity requires iOS 7 and both devices should have either WiFi or Bluetooth activated, I have tested it successfully on WiFi, Bluetooth may be too slow.
I will suggest to use the MultipeerConnectivity
framework.
Here are the few delegate methods provided by MCSessionDelegate
MCSessionDelegate <NSObject>
// Received a byte stream from remote peer
- (void)session:(MCSession *)session didReceiveStream:(NSInputStream *)stream withName:(NSString *)streamName fromPeer:(MCPeerID *)peerID;
// Start receiving a resource from remote peer
- (void)session:(MCSession *)session didStartReceivingResourceWithName:(NSString *)resourceName fromPeer:(MCPeerID *)peerID withProgress:(NSProgress *)progress;
// Finished receiving a resource from remote peer and saved the content in a temporary location - the app is responsible for moving the file to a permanent location within its sandbox
- (void)session:(MCSession *)session didFinishReceivingResourceWithName:(NSString *)resourceName fromPeer:(MCPeerID *)peerID atURL:(NSURL *)localURL withError:(NSError *)error;`
Try to read http://nshipster.com/multipeer-connectivity/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With