Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added support for private tracks

  • Loading branch information...
commit ce9285f3b08e72a69b3bfa2eed1dea85766367d0 1 parent be06165
@leemartin leemartin authored
View
21 app/views/posts/_player.html.haml
@@ -1,7 +1,14 @@
-%div
- %object{:height => SETTINGS["player"]["height"], :width => SETTINGS["player"]["width"]}
- %param{:name => 'bgcolor', :value => '000000'}
- %param{:name => 'movie', :value => "http://player.soundcloud.com/player.swf?url="+SETTINGS["track"]+SETTINGS["player"]["params"]+"&player_type="+SETTINGS["player"]["type"]}
- %param{:name => 'allowscriptaccess', :value => 'always'}
- %param{:name => 'wmode', :value => 'transparent'}
- %embed{:wmode => 'transparent', :allowscriptaccess => 'always', :height => SETTINGS["player"]["height"], :src => "http://player.soundcloud.com/player.swf?url="+SETTINGS["track"]+SETTINGS["player"]["params"]+"&player_type="+SETTINGS["player"]["type"], :type => 'application/x-shockwave-flash', :width => SETTINGS["player"]["width"], :bgcolor => '000000'}
+%div#player
+
+ - if SETTINGS["public"]
+
+ %object{:height => SETTINGS["player"]["height"], :width => SETTINGS["player"]["width"]}
+ %param{:name => 'bgcolor', :value => '000000'}
+ %param{:name => 'movie', :value => "http://player.soundcloud.com/player.swf?url="+SETTINGS["track"]+SETTINGS["player"]["params"]+"&player_type="+SETTINGS["player"]["type"]}
+ %param{:name => 'allowscriptaccess', :value => 'always'}
+ %param{:name => 'wmode', :value => 'transparent'}
+ %embed{:wmode => 'transparent', :allowscriptaccess => 'always', :height => SETTINGS["player"]["height"], :src => "http://player.soundcloud.com/player.swf?url="+SETTINGS["track"]+SETTINGS["player"]["params"]+"&player_type="+SETTINGS["player"]["type"], :type => 'application/x-shockwave-flash', :width => SETTINGS["player"]["width"], :bgcolor => '000000'}
+
+ - else
+
+ = image_tag 'artwork.jpg', :height => SETTINGS["player"]["height"], :width => SETTINGS["player"]["width"]
View
4 config/initializers/load_settings.rb
@@ -1 +1,3 @@
-SETTINGS = YAML.load_file(File.join(Rails.root, "config", "settings.yml"))
+SETTINGS = YAML.load_file(File.join(Rails.root, "config", "settings.yml"))
+
+HTTParty.get(SETTINGS["track"]).code == 200 ? SETTINGS["public"] = true : SETTINGS["public"] = false
View
6 public/stylesheets/application.css
@@ -23,12 +23,12 @@ h1, h2 {
h2 {
margin: 0 0 10px 0; }
-object {
- -webkit-box-shadow: 0 0 20px grey; }
-
#logo {
margin: 30px 0 20px 0; }
+#player object, #player img {
+ -webkit-box-shadow: 0 0 20px grey; }
+
/* BUTTON */
.button {
background: #e3e3e3 -webkit-gradient(linear, 0 0, 0 100%, from(white), to(#e3e3e3));
View
4 public/stylesheets/application.scss
@@ -18,10 +18,10 @@ h1, h2{ color: #06C; font-weight: normal; }
h2{ margin: 0 0 10px 0; }
-object{ -webkit-box-shadow: 0 0 20px grey; }
-
#logo{ margin: 30px 0 20px 0; }
+#player{ object, img{ -webkit-box-shadow: 0 0 20px grey; } }
+
/* BUTTON */
.button{
Please sign in to comment.
Something went wrong with that request. Please try again.