Is there a way to automatically start playing soundcloud audio and set it to repeat?

NimrodYanai
NimrodYanai

Title sort of says it all :P

Comments

  • thaen
    thaen
    Posts: 1,064

    Do you have an example soundcloud url?

    Obsidian Portal Developer

  • NimrodYanai
    NimrodYanai
    Posts: 101

    Sure, look at this one for example that I use in this page.

  • thaen
    thaen
    Posts: 1,064

    It appears the browsers have decided "you...shall...not...play!!!"  : )

    If you open the console, then refresh the page, you'll find the highlighted line in the screenshot:

     

    image

     

    If you go to the url, it explains more.

    But I even tried to use Custom JavaScript to wait a few seconds and then programmatically "click" the button, and it wouldn't do it.  I could programmatically click the button from the Console after I had interacted with the page, but not before ... and even that seemed to have rules to it that I couldn't 100% nail down because sometimes when I ran the command, it would play, and sometimes it wouldn't.

    So the short answer is, the browsers won't allow autoplay anymore.

     

    Obsidian Portal Developer

  • Abersade
    Abersade
    Posts: 417

    I had autoplay working somewhat recently, though the method and code to get it to work was... unorthodox. I'll take a look and see if I can scrounge something up.

    GM of Rise of the Durnskald: Wrath of the Fallen Goddess - February 2016 CotM

    GM of Core: The Ashes of Alcarna - April 2020 CotM

    GM of Stream of Kairos

    Need CSS Help? It may be covered here: Abersade's CSS Hub

  • Abersade
    Abersade
    Posts: 417 edited May 2022

    Mmm. kinda. Autoplay? Yes. Autoplay without the user approving it at least once? Negative.

    User @Toejam08 and I discussed this about 4.5 years ago (https://forums.obsidianportal.com/discussion/comment/41288), and it was that discussion which enabled me to get it working then.

    Now, either browsers flat out say no (at least at first) like @Thaen suggested OR I did something even weirder then that I didn't replicate today. Core was referenced by @Bortas and @cgregory (who broke down the process) in a similar discussion in 2018 (https://forums.obsidianportal.com/discussion/comment/41619/#Comment_41619) and it was still working as of that discussion. Unfortunately one of my players complained about the music and I disabled the autoplay sometime shortly before (or right after) April of 2020, and like an idiot I don't appear to have documented exactly what I did to get it working. I remember that it wasn't intuitive at all, I was essentially tricking the system into thinking it was some other type of media. I do occasionally pull backup dumps of my campaigns, I'll see what can be done there (if anything) but that may take a few days to locate if it even exists at all.

    That said, if you don't mind the limitation of it not auto-playing the first time: I downloaded the media file that I wanted to autoplay, saved it to my media library in my campaign, and then inserted that media using the Image Embed link. Unlike in the past this now appears to automatically recognize that the media is an audio file and automatically sticks it in a oembed cloudfront-audio class. From there, save the page, then load it. When you do the sound won't play, as expected. The next step is to then enable the playback of sound in the browser of your choice.

    For chrome this can be done by clicking on the lock icon in the address bar, choosing site settings, then changing the Sound setting from Automatic to Allow for the site. Then close the tabs and reopen, viola sound, which persists each time the page is opened.

    For Firefox this can be done by clicking on the permissions icon (looks like a pair of lines with toggles) in the address bar (it may even have a crossed out play button visible), then changing the Autoplay setting to Allow Audio and Video. Force a refresh or close and reopen the tab, viola sound, which persists each time the page is opened.

    Post edited by Abersade on

    GM of Rise of the Durnskald: Wrath of the Fallen Goddess - February 2016 CotM

    GM of Core: The Ashes of Alcarna - April 2020 CotM

    GM of Stream of Kairos

    Need CSS Help? It may be covered here: Abersade's CSS Hub

  • NimrodYanai
    NimrodYanai
    Posts: 101

    Well, the idea was for this to play to guests who visit the page. If they have to do all that on their end, then there isn't much point ;)

    thanks anyway!

Sign In or Register to comment.

March 2024
Wrath of the Highborn

Read the feature post on the blog
Return to Obsidian Portal

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Discussions