Code Monkey home page Code Monkey logo

Comments (9)

eshaz avatar eshaz commented on September 4, 2024

Could you try playing your stream from the demo and see if the issues still occur?

Also, do you get any errors in the browser console when the playback doesn't start?

You might also check the network request tab in the dev tools to make sure iOS is fetching the stream properly each time you click play.

from icecast-metadata-js.

onenures avatar onenures commented on September 4, 2024

I'm not entirely sure if I did everything right. I turned on Web Inspector on the iPhone and looked at the errors in the console using Safari on the old Mac. Screenshot in attachment. I also made a little mistake with the Iphone model. In this case it is the iPhone SE.
invalid-state-error

I tried to run demo players, they work well, without problems on iOS.

from icecast-metadata-js.

eshaz avatar eshaz commented on September 4, 2024

Do you have a link to your code so I can take a look, or a link I can visit to reproduce it?

The first error in your screenshot might be significant, but I'm not sure what would be causing it.

from icecast-metadata-js.

onenures avatar onenures commented on September 4, 2024

Link here. Site on WP.

from icecast-metadata-js.

eshaz avatar eshaz commented on September 4, 2024

I wasn't able to reproduce the errors you saw, since it appears you changed the webpage and also added the html playback method sometime parameter after posting your initial screenshot.

I was able to edit your webpage to remove this and then also enable logging by passing the enableLogging: true property into the instantiation. Once logging was enabled, an error was logged, but not the same ones that you posted earlier. I'm not sure what is causing this one. I looked at your HTTP headers, and a couple other things that I think might cause this in the library, but everything looked fine. CORS shouldn't be an issue, since you are hosting your stream and webpage from the same domain name.

image

I would focus on narrowing down if one of your plugins or word press scripts is causing some issues by starting off with no plugins / scripts, and then adding and testing one at a time. You may also try a bisection search to narrow in on if a particular plugin is causing the issue.

from icecast-metadata-js.

eshaz avatar eshaz commented on September 4, 2024

This stack overflow post has a description of what can cause this error, but I already have a work around code for this in the library.

// hack for iOS Audio element controls support
// iOS will only enable AudioContext.resume() when called directly from a UI event
// https://stackoverflow.com/questions/57510426
const events = ["touchstart", "touchend", "mousedown", "keydown"];
const unlock = () => {
events.forEach((e) => document.removeEventListener(e, unlock));
const audioCtx = new AudioContext({
latencyHint: "interactive",
});
audioCtx.destination.channelCount = audioCtx.destination.maxChannelCount;
audioCtx
.resume()
.then(() => {
// hack for iOS to continue playing while locked
audioCtx
.createScriptProcessor(2 ** 14, 2, 2)
.connect(audioCtx.destination);
audioCtx.onstatechange = () => {
if (audioCtx.state !== "running")
audioCtx.resume().catch(audioCtxErrorHandler);
};
})
.catch(audioCtxErrorHandler);
IcecastMetadataPlayer.constructor[audioContext] = audioCtx;
};
events.forEach((e) => document.addEventListener(e, unlock));

from icecast-metadata-js.

onenures avatar onenures commented on September 4, 2024

Thank you for not giving up on my problem. First of all, I removed all scripts and HTML from the page, and also disabled all plugins and this gave the result. At this point, playback starts. I haven’t yet figured out what exactly the problem was, because I’m trying to solve another problem.

Currently, audio on iOS in Safari, Chrome and Firefox browsers does not resume after pressing the Stop button and then Play again. At the same time, using the Web Inspector, I see that after pressing Stop and pressing Play again, data is being transferred from the mounting point. That is, there is stream transmission, but there is no sound, and there are no errors in the Web Inspector console.

It seems that the error is due to the fact that the request contains "No request headers".

web-inspector-1
web-inspector-2

from icecast-metadata-js.

eshaz avatar eshaz commented on September 4, 2024

This is very puzzling that the stream works on the demo page, but not on your webpage, even with all the plugins / scripts removed. I would try just creating a raw HTML, only with a play and stop button and nothing else (no other scripts or wordpress logic of any kind), then gradually build it up to see what step is causing the issue.

If the raw HTML doesn't work, then I'm wondering if it might be something with your domain or your hosting. You might try running your website locally on your iPhone and seeing if it still faces the same issue.

from icecast-metadata-js.

eshaz avatar eshaz commented on September 4, 2024

Closing due to inactivity.

from icecast-metadata-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.