Skip to content

iOS Safari Compatibility #40

Description

@W3AXL

It's me again, with another interesting issue.

I have the IcecastReadableStream object working flawlessly on every desktop browser I can test with. I'm compiling the javascript using webpack for Node, as opposed to the recently-created standalone JS player, because I'm lazy and don't want to port over all my code.

Anyway, I'm now trying to get my stream player working on mobile devices, and iOS safari is the first browser I'm hitting (since I own apple devices).

Safari on iOS doesn't support MSE, but I believe I have a workaround using the web audio API. That remains to be seen, but I'm getting hung up with getting stream data at all.

I instantiate the reader in what I believe is a normal way:

// fetch the stream
    fetch(streamUrl, {
        method: "GET",
        headers: {
            "Icy-MetaData": "1",
        },
        signal: signal
    })
    // create the icecast metadata reader
    .then(async (response) => {
        console.log("creating icecast readable stream");
        const icecast = new IcecastReadableStream(
            response,
            {
                onStream: pushStream,
                onMetadata: pushMetadata,
                metadataTypes: ["icy"]
            }
        );
        await icecast.startReading();
    });

However, iOS gives me the following console error (I'm using the remotedebug-ios-webkit-adapter npm package for remote debugging) when I call icecast.startReading():

[native code]:1 Unhandled Promise Rejection: TypeError: icecast.startReading is not a function. (In 'icecast.startReading()', 'icecast.startReading' is undefined)

Again, this same code works flawlessly in desktop browsers. I'm guessing something inside the library doesn't play nice with iOS safari.

This is definitely a "nice to have" but it would be useful for my application to be able to display metadata in mobile browsers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions