nnyby
nnyby

Reputation: 4668

Playing an ogg stream in iOS

Has anyone played an ogg stream from iOS? What can I use without having to write my own decoder?

I'm using Apple's AVPlayer to play the stream.

This question has been asked as part of this thread: iOS online radio streaming questions but it hasn't been answered.

Upvotes: 22

Views: 25403

Answers (3)

Ajith Renjala
Ajith Renjala

Reputation: 5152

Use the VLCKit – ibvlc bindings for macOS, iOS, iPadOS and tvOS in Objective-C.

It's a library from the well-known media player "VLC Media Player," and it supports Cocoapods and can play/stream .ogg files on iOS seamlessly.

  pod 'MobileVLCKit'

Check out this blog post for a more detailed tutorial.

Upvotes: 0

liruqi
liruqi

Reputation: 1524

.ogg file may also be encoded in Opus or FLAC, refer to Ogg wiki. IDZAQAudioPlayer may not cover all cases.

For Opus codec, you may refer Telegram for iPhone source code: https://telegram.org/apps

Upvotes: 2

idz
idz

Reputation: 12988

There is no built-in support for playing ogg files in iOS, however, the source code for ogg compression/decompression is readily available (from xiph.com). It is fairly straightforward to compile this code for iOS and use it in an app.

I had a chance to compile the libraries and have made them available: "Precompiled Ogg Vorbis Libraries for iOS".

I have also made some sample source code available on GitHub that shows how to play decoded Ogg Vorbis audio on iOS: IDZAQAudioPlayer

Upvotes: 22

Related Questions