简体   繁体   中英

passing .m3u8 file to AudioStreamer iOS

Can any one suggest me a m3u8 parser that works on iOS 10. I used this but its giving me errors

M3U8_BASE_URL undecleared indentifier, No visible interface declared in NSString for isExtendedM3Ufile these kind of errors,, more than 17

in NSString+m3u8.m . I want to pass an m3u8 file to AudioStreamer .

Please help me. Thanks

在此输入图像描述 According to the screenshot, I copied all the files into one folder and import to the project.

Then m3u8 file URL to the M3U8PlaylistModel

       let playlistModel = M3U8PlaylistModel(url: self.m3u8_url)
        guard let m3u8PlaylistModel =  playlistModel else {
            return
        }
        guard let masterPlaylist = m3u8PlaylistModel.masterPlaylist else {
            return
        }
        guard let streamList = masterPlaylist.xStreamList else {
            return
        }

        streamList.sortByBandwidth(inOrder: .orderedAscending)

        for i in 0 ..< streamList.count {
            if let extXStreamInf = streamList.xStreamInf(at: i){

                /* you can get below properties, using this extXStreamInf object

                @property (nonatomic, readonly, assign) NSInteger bandwidth;
                @property (nonatomic, readonly, assign) NSInteger programId;        // removed by draft 12
                @property (nonatomic, readonly, copy) NSArray *codecs;
                @property (nonatomic, readonly) MediaResoulution resolution;
                @property (nonatomic, readonly, copy) NSString *audio;
                @property (nonatomic, readonly, copy) NSString *video;
                @property (nonatomic, readonly, copy) NSString *subtitles;
                @property (nonatomic, readonly, copy) NSString *closedCaptions;
                @property (nonatomic, readonly, copy) NSURL   *URI;
            */

            }
        }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM