• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.5 SCM Music Player

#1
Hello,

I was wondering about creating a special feature for members to use. Is it possible to allow users to use the SCM Player on users profiles? http://scmplayer.net/

I am a member in another site and they are IPB 3.4.9 When you visit my profile the SCM player begins playing whatever song I set up as shown here:




in my profile options where I can edit everything, I can choose to create the playlist and change the player skin and play options:



If this is possible in IPB 3.4.x I suppose it can be done here in XF too. But how would one go about to adding the files as part of the profile so all the groups can have a music player in their profiles?

All the files for the music player are here: https://github.com/cshum/SCM-Music-Player/

Thanks in advance.
 

Optic

Well-known member
#2
Looking at the embed code, if you just want one song in the playlist it's straightforward:
HTML:
<script type="text/javascript" src="http://scmplayer.net/script.js"
data-config="{'skin':'skins/tunes/skin.css','volume':50,'autoplay':false,'shuffle':false,'repeat':1,'placement':'top','showplaylist':false,'playlist':[{'title':'Test','url':'http://test.net/song1.mp3'}]}" ></script>
You could implement it as a custom user field (member puts URL of song) which then you can replace as a variable when displaying as HTML replacement:
https://xenforo.com/help/custom-user-fields/

On mobile but that should get you started.
 
#3
Looking at the embed code, if you just want one song in the playlist it's straightforward:
HTML:
<script type="text/javascript" src="http://scmplayer.net/script.js"
data-config="{'skin':'skins/tunes/skin.css','volume':50,'autoplay':false,'shuffle':false,'repeat':1,'placement':'top','showplaylist':false,'playlist':[{'title':'Test','url':'http://test.net/song1.mp3'}]}" ></script>
You could implement it as a custom user field (member puts URL of song) which then you can replace as a variable when displaying as HTML replacement:
https://xenforo.com/help/custom-user-fields/

On mobile but that should get you started.
Thank you it seems to work, only that when I visit other areas the song keeps playing
 

Optic

Well-known member
#4
It looks like the script is designed to be "persistent" - great for traditional websites/blogs... not so great for forums..

I'm not familiar with this script - you'll have to see if there's an option to change this behaviour..
 

EQnoble

Well-known member
#5
There is no option to disable that with this script it looks like. The only solution I can think of without really exerting effort would be to write a js function that removes playlist entries and then kills the player if no media for the player is detected as specified on the page being viewed.

All in all it would probably just be easier to use a different player for this.
 
#6
There is no option to disable that with this script it looks like. The only solution I can think of without really exerting effort would be to write a js function that removes playlist entries and then kills the player if no media for the player is detected as specified on the page being viewed.

All in all it would probably just be easier to use a different player for this.
What are other good players that can be used with XF
 

EQnoble

Well-known member
#7
I suppose this one would work http://www.wimpyplayer.com/

I have my own preference but my personal choice would be much more complicated to implement.

Wimpy player is straight forward and decently documented so with some motivation and some time you should be able to get this to work for your needs.