iOS Stream Audio from one iOS Device to Another

后端 未结 2 824
礼貌的吻别
礼貌的吻别 2020-12-02 06:34

I get a song from the device iTunes library and shove it into an AVAsset:

- (void)mediaPicker: (MPMediaPickerController *)mediaPicker didPickMediaItems:(MPMe         


        
2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-02 07:35

    What's your purpose? and How do you call [match sendDataToAllPlayers:...] ? It decides how do you get AVAsset back from data received.

    There are steps mentioned:

    1. get NSData from mediaPicker for music
    2. create AVAsset (are you really doing it?)
    3. send to GKPlayers ?
    4. recieving NSData from gamecenter
    5. get back AVAsset if you are dong 2.
    6. use AVPlayer:playerWithPlayItem to get AVPlayer and play

    If you are doing some encoding and transmission on your own method, like use AVAssetReader to get raw data and sending, then just do it reversely.

提交回复
热议问题