Play music from link

0 favourites
  • 14 posts
From the Asset Store
Casual Gameplay Music is a royalty free collection of background music tracks and loops.
  • Is it possible play music from a URL? I haven't found a way to do this, but maybe it's possible... if it's not possible, is there plans to make this possible? Perhaps a 3rd party plugin out there already?

  • Is it possible play music from a URL? I haven't found a way to do this, but maybe it's possible... if it's not possible, is there plans to make this possible? Perhaps a 3rd party plugin out there already?

    Ive been doing a bit of experimenting with regards to sounds, and there is way to play sounds if you add stuff to the index.html file.

    I added it to the bottom of my 'falling leaves' example...

    LEAVES

    Press play and a short audio file is loaded from my dropbox folder.

    I tried to do it with the html-elements plugin but couldnt get it to work.

    If you save the page, you can open it in a text editor to see how its done.

    This isnt a tutorial, its just something I have been playing around with.

  • chrisbrobs: I see, so you used html5's audio tag. I was thinking more of doing it within C2, But you said you tried and didn't work. I guess we'll just have to wait and see if this is implemented later. Thank you.

    Also, very nice falling leaves effect!

  • chrisbrobs: I see, so you used html5's audio tag. I was thinking more of doing it within C2, But you said you tried and didn't work. I guess we'll just have to wait and see if this is implemented later. Thank you.

    Also, very nice falling leaves effect!

    It might work, i just dont know what settings need to be added to get it to work? In the capx that comes with the plugin, there isn't an Audio example.If Jesse Johnston reads this, he might post an example?

  • It might work, i just dont know what settings need to be added to get it to work? In the capx that comes with the plugin, there isn't an Audio example.If Jesse Johnston reads this, he might post an example?

    That would be most appreciated indeed.

  • I was just thinking! If you have your sound hosted on youtube, make it private or something.

    The use this plugin: http://www.scirra.com/forum/plugin-jessejohs-html-elements-pack_topic47084_post294874.html <-- the HTML IFrame one. you can call the youtube link and play the track, Meaning you'll have audio!!.

    you'll want to place it out of view though <img src="smileys/smiley1.gif" border="0" align="middle">

  • Like this: http://activeden.net/item/youtube-music-player/162816?WT.ac=free_file&WT.seg_1=free_file&WT.z_author=CodingJack Obviously this is AS3 but this is what i mean <img src="smileys/smiley1.gif" border="0" align="middle">

  • Like this: http://activeden.net/item/youtube-music-player/162816?WT.ac=free_file&WT.seg_1=free_file&WT.z_author=CodingJack Obviously this is AS3 but this is what i mean <img src="smileys/smiley1.gif" border="0" align="middle">

    I tried the HTML-div plugin first, but I just can't get my head around the actual settings?

  • Hey there chrisbrobs Pode

    I did some tests too and it does work just fine with the div plugin :]

    Just add the plugin to your layout, and use the "Set innerHTML" action with something like this:

    (In this example, I'm also styling the player in the case you want to show it. You could also use variables to change the track name)

    "<style type='text/css'>audio{opacity:0.5; width: 500px;}</style><audio controls autoplay loop><source src='http://glitched.heliohost.org/music/Caverns.ogg' type='audio/ogg'><source src='http://glitched.heliohost.org/music/Caverns.mp3' type='audio/mpeg'></audio>"

    I have a quite big music library, so I decided to use this method for more flexibility with the hosting ^^

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Interesting. Wonder if the audio tag could be adapted to connect to a stream. In game radio might be a unique feature for some games.

  • theubie Looks like you can

    http://www.wowza.com/forums/showthread.php?14071-Streaming-to-HTML5-audio-tag

    EDIT: You would need a webradio that streams both ogg and mp3 though for browser compatibility...

    Here is stream that works in Firefox and Chrome for example (Div plugin):

    On start of layout -> Set innerHTML to:

    "<audio controls autoplay src='http://radio.goha.ru:8000/grindfm.ogg' type='audio/ogg'>"

  • Just want to point out use of MP3 can incur a fee of $2500. You should never even think about using MP3; just go for AAC instead (aka MP4 or MPEG-4 AAC), which is better than MP3 and doesn't have any fees!

  • Ashley Thx for the advice

    Just tested this method and the audio tag with Safari and m4a and it works indeed^^

    I simply followed the compatibility page I linked above (weird that they don't even list aac), but I guess it just works like usual C2 audio then, back to ogg/m4a!

    (btw your chart has lost its content apparently)

  • Having worked in the Broadcast industry, I can spend hours and hours going over the finer points of online music licensing...luckily that's not something that most people would have to deal with.

    Most of the really good streaming servers offer ogg/m4a, so that wouldn't be an issue at all for use in an online game.

    I've got half a mind to put my internet radio station back on the air, and if I do, I'm going to integrate the stream into the major project I'm working on, assuming I can find a reasonable way to make all this work. ;)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)