2012-05-21 56 views
-1

我想玩mms協議音頻,對此有何想法?我聽說libmms是一個選擇。但是我不知道怎麼做。任何人都可以共享示例代碼最好從頭開始介紹。 在此先感謝!iOS dev ---如何處理mms://協議

回答

0

您需要在這裏查看DocumentInteractionController:https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/DocumentInteraction_TopicsForIOS/DocumentInteraction_TopicsForIOS.pdf文檔交互控制器是實現它的「Apple」方式,可能是您現在和將來版本的iOS中最安全的路徑。

如果你自己在你的包中的文件,你可以得到默認的應用從OS處理文件類型:

NSString *filePath = [documentsDirectory stringByAppendingPathComponent: fileName]; 

if ([[NSFileManager defaultManager] fileExistsAtPath:[self getFileCompletePath]]){ 
    NSString *filePath = [[NSString alloc] initWithFormat:@"%@", [self getFileCompletePath]]; 
    NSURL *url = [[NSURL alloc] initFileURLWithPath:filePath]; 

    if ([[UIApplication sharedApplication] canOpenURL:url]){ 
     [[UIApplication sharedApplication] openURL: url]; 
    } else { 
     NSLog(@"Not supported application to open the file %@", filePath); 
    } 

    [url release]; 
    [filePath release]; 
} 

祝您好運!

0

你基本上有兩種選擇:

  1. Libmms:該庫將只處理MMS協議。所以這取決於你做任何你想要的數據。
  2. FFmpeg:該庫可以處理mms協議,並且還具有音頻/視頻解碼功能。由於您將使用mms://協議進行音頻/視頻流式傳輸,因此選擇FFmpeg將是更好的選擇。