The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Why does this playlist code work fine on only about half the browsers/platforms/html test sites?
SWLinPHX
post Jun 30 2018, 11:56 PM
Post #1





Group: Members
Posts: 9
Joined: 5-May 09
Member No.: 8,523



I have tested this code on three different test sites using three different browsers on two different MacOS versions. It works perfect on some and not at all on the others. I even tried an alternate manual playlist code wizard using SCM Player at https://scmplayer.co/ but the embed code that produced works nowhere. Anyway, here is the code that works half the time (placed within the tags). Any help would be greatly appreciated! smile.gif

Here is a link to the web page to see if works (plays music) on your browser or platform; maybe you can extract the code from there if necessary: Here is a link to the web page to see if works (plays music) on your browser or platform; maybe you can extract the code from there if necessary: http://rvratptcavailability.x10host.com/afhsclassof1986/

CODE
<script type="text/javascript">
var numberOfSongs = 26
var sound = new Array(numberOfSongs+1)
sound[0]= "http://rvratptcavailability.x10host.com/afhsclassof1986/highschoolflashbacksongs/Rio.mp3"
sound[1]= "http://rvratptcavailability.x10host.com/afhsclassof1986/highschoolflashbacksongs/Alive%20And%20Kicking.mp3"
sound[2]= "http://rvratptcavailability.x10host.com/afhsclassof1986/highschoolflashbacksongs/Key%20Largo.mp3"
sound[3]= "http://rvratptcavailability.x10host.com/afhsclassof1986/highschoolflashbacksongs/Come%20On%20Eileen.mp3"
sound[4]= "http://rvratptcavailability.x10host.com/afhsclassof1986/highschoolflashbacksongs/Tainted%20Love.mp3"
sound[5]= "http://rvratptcavailability.x10host.com/afhsclassof1986/highschoolflashbacksongs/Everybody%20Wants%20You.mp3"
sound[6]= "http://rvratptcavailability.x10host.com/afhsclassof1986/highschoolflashbacksongs/Eyes%20Without%20A%20Face.mp3"
sound[7]= "http://rvratptcavailability.x10host.com/afhsclassof1986/highschoolflashbacksongs/Hungry%20Like%20The%20Wolf.mp3"
sound[8]= "http://rvratptcavailability.x10host.com/afhsclassof1986/highschoolflashbacksongs/I%20Ran%20%28So%20Far%20Away%29.mp3"
sound[9]= "http://rvratptcavailability.x10host.com/afhsclassof1986/highschoolflashbacksongs/If%20I%27d%20Been%20The%20One.m4a"
sound[10]= "http://rvratptcavailability.x10host.com/afhsclassof1986/highschoolflashbacksongs/It%27s%20My%20Life%20%5BTalk%20Talk%5D.mp3"
sound[11]= "http://rvratptcavailability.x10host.com/afhsclassof1986/highschoolflashbacksongs/Let%27s%20Go%20%5BWang%20Chung%5D.mp3"
sound[12]= "http://rvratptcavailability.x10host.com/afhsclassof1986/highschoolflashbacksongs/Obsession.mp3"
sound[13]= "http://rvratptcavailability.x10host.com/afhsclassof1986/highschoolflashbacksongs/On%20The%20Dark%20Side.mp3"
sound[14]= "http://rvratptcavailability.x10host.com/afhsclassof1986/highschoolflashbacksongs/The%20Other%20Guy.mp3"
sound[15]= "http://rvratptcavailability.x10host.com/afhsclassof1986/highschoolflashbacksongs/Promises%20Promises.mp3"
sound[16]= "http://rvratptcavailability.x10host.com/afhsclassof1986/highschoolflashbacksongs/Rock%20Me%20Amadeus.mp3"
sound[17]= "http://rvratptcavailability.x10host.com/afhsclassof1986/highschoolflashbacksongs/The%20Safety%20Dance.mp3"
sound[18]= "http://rvratptcavailability.x10host.com/afhsclassof1986/highschoolflashbacksongs/She%27s%20A%20Beauty.mp3"
sound[19]= "http://rvratptcavailability.x10host.com/afhsclassof1986/highschoolflashbacksongs/Somebody%27s%20Baby.m4a"
sound[20]= "http://rvratptcavailability.x10host.com/afhsclassof1986/highschoolflashbacksongs/Someday%20%5BGlass%20Tiger%5D.mp3"
sound[21]= "http://rvratptcavailability.x10host.com/afhsclassof1986/highschoolflashbacksongs/Vacation.m4a"
sound[22]= "http://rvratptcavailability.x10host.com/afhsclassof1986/highschoolflashbacksongs/Whisper%20To%20A%20Scream%20%28Birds%20Fly%29.mp3"
sound[23]= "http://rvratptcavailability.x10host.com/afhsclassof1986/highschoolflashbacksongs/What%20Is%20Love_.mp3"
sound[24]= "http://rvratptcavailability.x10host.com/afhsclassof1986/highschoolflashbacksongs/Take%20It%20Easy%20On%20Me.mp3"
sound[25]= "http://rvratptcavailability.x10host.com/afhsclassof1986/highschoolflashbacksongs/The%20Old%20Man%20Down%20The%20Road.mp3"
function randomNumber(){
var randomLooper = -1
while (randomLooper < 0 || randomLooper > numberOfSongs || isNaN(randomLooper)){    randomLooper = parseInt(Math.random()*(numberOfSongs+1))
}
    return randomLooper
}
var randomsub = randomNumber()
var soundFile = sound[randomsub]
document.write ('<EMBED src= "' + soundFile + '" hidden=true type="audio/mpeg" autostart=true loop=true>')
</script>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
SWLinPHX
post Jul 1 2018, 06:32 PM
Post #2





Group: Members
Posts: 9
Joined: 5-May 09
Member No.: 8,523



I'm not sure what you mean by trying "my own computer/browser" (you mean just loading like the index.html file from my desktop into a browser? ...if so, that works).

However, the final code you gave me actually works now!!! It works on all three test sites and on all three browsers. You don't know how long I've been working on this. Thank you, thank you, THANK YOU!!! biggrin.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Jul 1 2018, 07:05 PM
Post #3


.
********

Group: WDG Moderators
Posts: 9,661
Joined: 10-August 06
Member No.: 7



QUOTE(SWLinPHX @ Jul 2 2018, 01:32 AM) *

I'm not sure what you mean by trying "my own computer/browser" (you mean just loading like the index.html file from my desktop into a browser? ...if so, that works).

No I was just speculating that maybe there was something wrong with only your own computer, but I suspect that EMBED is simply not well supported anymore...

QUOTE
However, the final code you gave me actually works now!!! It works on all three test sites and on all three browsers. You don't know how long I've been working on this. Thank you, thank you, THANK YOU!!! biggrin.gif

You're welcome! smile.gif

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jul 2 2018, 12:32 AM
Post #4


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,733
Joined: 9-August 06
Member No.: 6



Forgot to say, your original code worked for me in all browsers except K-Meleon (a few versions old gecko engine). FF, Iron (same as Chrome), IE, Edge. I only got controls in one browser though. Think it was Iron.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
SWLinPHX
post Jul 2 2018, 02:51 AM
Post #5





Group: Members
Posts: 9
Joined: 5-May 09
Member No.: 8,523



QUOTE(pandy @ Jul 1 2018, 10:32 PM) *

Forgot to say, your original code worked for me in all browsers except K-Meleon (a few versions old gecko engine). FF, Iron (same as Chrome), IE, Edge. I only got controls in one browser though. Think it was Iron.


Interesting Pandy. A couple people I asked said it wasn't working for them either. I know on mobile apps it's really difficult. With the new fix all worked on all test sites, browser and platforms except the newest Google Chrome because of their autoplay rules. I made a separate link to load the embed code page version because that bypasses their rules, or you can simply allow autoplay by going to chrome://flags/#autoplay-policy. And yes, I know autoplay can be annoying, but this is just for about less than 500 people to see and only for two months. They can use MUTE on their computer or hit PAUSE. And on mobile it won't autoplay anyway.

Thanks again both of you!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 27th April 2024 - 10:20 AM