问题
I would like to change flash player SoundCloud to HTML5 player to my site in WordPress. The audios are add in pages.
I'm having problems because i cant find a code no user, just a player that work.
The flash code:
<object height="100%" width="100%">
<param name="movie"
value="http://player.soundcloud.com/player.swf?url=<?=print_field($data,'sound_link') ?>&auto_play=false&player_type=artwork&color=000000"></param>
<param name="allowscriptaccess" value="always"></param>
<embed allowscriptaccess="always" height="100%" src="http://player.soundcloud.com/player.swf?url=<?=print_field($data,'sound_link') ?>&auto_play=false&player_type=artwork&color=000000" type="application/x-shockwave-flash" width="100%"></embed>
</object>
回答1:
Did you try code like this?
Simply create a new Wordpress post, give a title, then in main text area just insert the shown code below into it as if it was usual article text: (click "Save draft" and then try "Preview") :
[soundcloud url="http://api.soundcloud.com/tracks/34019569" params="color=000000" width="100%" height="166" iframe="true" /]
note: You must use http://
not the SSL version of https://
.
EDIT :
First make sure you install the SoundCloud Short Code plugin (made by SoundClound Inc) :
For using SoundCloud URL as link, you can now try:
[soundcloud url="https://soundcloud.com/soulmovementrecords/dj-fleg-new-horns" params="auto_play=false&show_comments=false" width="100%" height="150" /]
Here is a link to an example: SoundCloud Player test (using a page URL not user or track ID)
I assume using your code, you can try something like:
[soundcloud url="sound_link" params="auto_play=false&show_comments=false" width="100%" height="150" /]
来源:https://stackoverflow.com/questions/33792843/player-html5-soundcloud