SoundCloud BBcode Media Site [Deleted]

Working on Xenforo 1.3.2! But how to control size (width and height) when it display?
I'd like to know this too.

It embeds the song OK, but is the same size as a video, rather than looking like a linear audio track.
 
what if change true to false??

PHP:
<?php
class MediaSites_Soundcloud
{
    public static function buildEmbed($mediaKey, array $site)
    {
        $urlKey = urlencode($mediaKey);
        $scUrl = 'http://soundcloud.com/oembed?iframe=true&url=http%3A%2F%2F' . $urlKey;
        $datas = @file_get_contents($scUrl);
        $xObj = simplexml_load_string($datas);
        $embedHtml5 = $xObj->html;
        if (isset($embedHtml5)) {
                return $embedHtml5;   
        }   
        else return '<a href="http://' . $mediaKey . '">http://' . $mediaKey . '</a>';
    }
}
 
what if change true to false??

PHP:
<?php
class MediaSites_Soundcloud
{
    public static function buildEmbed($mediaKey, array $site)
    {
        $urlKey = urlencode($mediaKey);
        $scUrl = 'http://soundcloud.com/oembed?iframe=true&url=http%3A%2F%2F' . $urlKey;
        $datas = @file_get_contents($scUrl);
        $xObj = simplexml_load_string($datas);
        $embedHtml5 = $xObj->html;
        if (isset($embedHtml5)) {
                return $embedHtml5; 
        } 
        else return '<a href="http://' . $mediaKey . '">http://' . $mediaKey . '</a>';
    }
}

No don't do that, it will make it use the old flash container.

Hi, thanks for this addon.

Is it possible to make it smaller?
Yes, but I don't have time to test it though so I will paste it in here in hopes that you can check it out and let me know if it works for you. If it does I will upload an update at some point.

Find the file at 'library/MediaSites/Soundcloud.php' , delete everything and replace it with the following and save it.
PHP:
<?php
class MediaSites_Soundcloud
{
   public static function buildEmbed($mediaKey, array $site)
   {
     $urlKey = urlencode($mediaKey);
     if(preg_match('#/sets/#siu', $mediaKey, $large)){ $mh = '305'; }else{ $mh = '81'; }
     $scUrl = 'http://soundcloud.com/oembed?iframe=true&url=http%3A%2F%2F' . $urlKey . '&maxheight=' . $mh;   
     $datas = @file_get_contents($scUrl);
     $xObj = simplexml_load_string($datas);
     $embedHtml5 = $xObj->html;
     if (isset($embedHtml5)) {
         return $embedHtml5;   
     }   
     else return '<a href="http://' . $mediaKey . '">http://' . $mediaKey . '</a>';
   }
}


This should make singles use the short layout and sets use a larger one as needed to include the playlist element.
 
If the media site get's rewritten from scratch as a custom bbcode I suppose it could but at this moment I can not afford the time it would take to do so.
 
The player is smaller now, but where do I set the 500 x 300 ?

View attachment 97463

They only offer a hard coded height which I have accounted for and you can set by modifying the callback (I was going to add an option for this but seeing as this is a set once and probably never change thing editing the file does the job)

Find the file at 'library/MediaSites/Soundcloud.php'

edit the following numbers to your liking, both are for height

$mh = '305'; }else{ $mh = '81'; }

the 305 is for sets/playlists , the 81 is for single tracks.

I have just uploaded a quick update (you don't need to reinstall just re-upload the file to the correct directory) which wraps a class around the sc iframe which you can set css max-width on to make it X-width or less by pasting this in your EXTRA.css template and editing the max width to your liking.
Code:
.scWrapper {
    max-width: 500px;
}
 
Top Bottom