adrianrhodes's Recent Forum Activity

  • Hi Ashley

    Thank you for your reply.

    It allows me to assigning the object as a global variable and I can reference it from each new event, so my pause resume button works perfectly, but I'm referencing it from the JavaScript to do this not construct.

    i.e.

    runtime.globalVars.Player.play();

    or

    runtime.globalVars.Player.pause();

    I am not adding a global variable in construct for it though, only in the JavaScript.

    If I add the global variable in construct, it stops working.

    Do you know if there is a way to make the audio object play the stream rather than doing any of the above?

    If its beyond it capabilities, is there a tutorial or something where I can look at modifying the plugin? and do I have access to modify the plugin and resave it?

    Thank you for the help.

    Kindest regards

    Adrian

  • Just to add I have made the new audio instance global so that each event can access it to say play and pause for example.

    let audio = new Audio(runtime.globalVars.AudioURL);

    runtime.globalVars.Player = audio;

    runtime.globalVars.Player.play();

    Ashley

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I have written a radio mobile app which works great and plays the FM stations music which is being broadcast via 'broadcast radio'.

    The stream is basically the same as icecast/shoutcast and I believe is being broadcast as an mpeg.

    I am currently doing the following:

    Global string AudioURL = streaming.broadcast.radio/hitmixhigh

    let audio = new Audio(runtime.globalVars.AudioURL);

    audio.play();

    This works perfect and I can use script to play and pause the stream. However as its a mobile app it naturally loses focus or goes in to sleep mode after timing out or someone locking the phone.

    I can see that the Audio Object as a 'Play in background' option.

    Is there anyway of linking the script to the Audio object to get it play the MPEG audio stream?

    (Note that it is a stream and never downloads as it is constantly suppling more audio so the URL download will never end.)

    Any help would be appreciated.

    Adrian

  • You do not have permission to view this post

adrianrhodes's avatar

adrianrhodes

Member since 18 Jun, 2024

None one is following adrianrhodes yet!

Trophy Case

  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

4/44
How to earn trophies