Yii 1.1: yii-soundcloud-player-widget

Yii Framework widget to embed Soundcloud Player Widget into your web apps.
6 followers

This is a simple widget to embed the Soundcloud.com html5 Player widget into your yii web apps.

The widget is able to embed, single or multi soundcloud urls. Either User profile, Groups, Playlists or Tracks direct link. (see below)

Project Home

Changelog

  • 0.0.3
    1. Code optimization
  • 0.0.2
    1. Added devel parameter to print out or not, the cURL and Soundcloud API errors
    2. Cache support for high-traffic web apps and Soundcloud api polite usage :) params cache and cacheTime (see Full Parameters Example for usage)
  • 0.0.1
    1. Initial Release

Requirements

  • PHP >= 5.x with cURL extension
  • Yii 1.1.12 (Should work with lower versions, but not tested)

Instalation

  1. Copy yiiSoundcloudPlayerWidget.php into your /protected/extensions/
  2. Inside your View file call the widget! :)

Examples

Minimal Parameters Single Url

<?php $this->widget('ext.yiisoundcloudplayerwidget', array(           
    'url' => 'http://www.soundcloud.com/cutloosemusic'  // you can put here a profile, 
                                                        // group, playlist or track url
)); 
?>

Minimal Parameters Multi Url

<?php $this->widget('ext.yiisoundcloudplayerwidget', array(           
    'url' => array('http://www.soundcloud.com/cutloosemusic', // this is a profile
        "http://soundcloud.com/hybrid-species/she-wants-revenge-take-the" // this a direct link to a track
    ),          
)); 
?>

Full Parameters

<?php $this->widget('ext.yiisoundcloudplayerwidget', array(
    'devel'         => false,      // default is true. if true all curl and api errors 
                                   // will be printed out, if any.
    'cache'         => false,      // default is true. will use Yii cache system.
    'cacheTime'     => 600,        //default is 300 (seconds). to keep data in cache server.
    'maxwidth'      => 50,         // default I believe is 100. maxwidth in px.
    'maxheight'     => 305,        // default is 81 for tracks and 305 for all others.
    'color'         => 'ffaa66',   // default is Soundcloud color. hex triplet for player 
                                   //primary color.
    'auto_play'     => false,      // default is false.                
    'show_comments' => false,      // default is true. TimeBased comments on waveform.
    'iframe'        => true,       // default is true => html5 player. false => old Adobe Flash player.        
    'url' => array('http://www.soundcloud.com/cutloosemusic', // this is a profile
        "http://soundcloud.com/hybrid-species/she-wants-revenge-take-the" // this a direct link to a track
    ),      
)); 
?>

Feedback

If you have improvements, feature requests or simply found a bug please visit the widget github page and open an issue!

Be the first person to leave a comment

Please to leave your comment.

Create extension