concerto_audio 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/concerto_audio/version.rb +1 -1
- data/public/frontend_js/contents/audio.js +79 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb0020e7057089d1dd9b4edaebad1cde9e3bdc11
|
4
|
+
data.tar.gz: 7867f06f582a1ffe28969f4f33790fab9b388a39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03624032fb6a1e47feae2f37e6eac8dc1f2b08044d58a205833461fdbbda0b6ccefd5cce60d7ff0d5afbf629de45c3736a91aec35f1187b7e151a28ec735a0c6
|
7
|
+
data.tar.gz: 613745215e1e6fc35465b0ce2251227752bd255eb58ba5ea993c7077b376188a8a1206581a5e5ac2abaceed66025973fa2f63edbbf8cf58cfb64a9199681c3db
|
@@ -0,0 +1,79 @@
|
|
1
|
+
goog.provide('concerto.frontend.Content.Audio');
|
2
|
+
|
3
|
+
goog.require('concerto.frontend.Content');
|
4
|
+
goog.require('concerto.frontend.ContentTypeRegistry');
|
5
|
+
goog.require('goog.Uri');
|
6
|
+
goog.require('goog.dom');
|
7
|
+
goog.require('goog.events');
|
8
|
+
goog.require('goog.events.EventType');
|
9
|
+
goog.require('goog.style');
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
/**
|
14
|
+
* Audio.
|
15
|
+
*
|
16
|
+
* @param {Object} data Properties for this piece of content.
|
17
|
+
* @constructor
|
18
|
+
* @extends {concerto.frontend.Content}
|
19
|
+
*/
|
20
|
+
concerto.frontend.Content.Audio = function(data) {
|
21
|
+
concerto.frontend.Content.call(this, data);
|
22
|
+
|
23
|
+
/**
|
24
|
+
* The audio control being created.
|
25
|
+
* @type {Object}
|
26
|
+
*/
|
27
|
+
this.audio_control = null;
|
28
|
+
|
29
|
+
/**
|
30
|
+
* The URL for the audio.
|
31
|
+
* @type {string}
|
32
|
+
*/
|
33
|
+
this.url = data['render_details']['path'];
|
34
|
+
|
35
|
+
/**
|
36
|
+
* Extra parameters to include in the URL.
|
37
|
+
* @type {?string}
|
38
|
+
* @private
|
39
|
+
*/
|
40
|
+
this.url_parms_ = (data.field['config'] ? data.field['config']['url_parms'] : null);
|
41
|
+
if (goog.isDefAndNotNull(this.url_parms_)) {
|
42
|
+
this.url_parms_ = this.url_parms_.trim();
|
43
|
+
if (goog.string.startsWith(this.url_parms_, '?'))
|
44
|
+
this.url_parms_ = goog.string.remove(this.url_parms_, '?');
|
45
|
+
if (goog.string.startsWith(this.url_parms_, '&'))
|
46
|
+
this.url_parms_ = goog.string.remove(this.url_parms_, '&');
|
47
|
+
if (goog.string.contains(this.video_url, '?')) {
|
48
|
+
this.url_parms_ = '&' + this.url_parms_;
|
49
|
+
} else {
|
50
|
+
this.url_parms_ = '?' + this.url_parms_;
|
51
|
+
}
|
52
|
+
} else {
|
53
|
+
this.url_parms_ = '';
|
54
|
+
}
|
55
|
+
|
56
|
+
this.duration = 60 * 60 * 24; // 24 hours
|
57
|
+
};
|
58
|
+
goog.inherits(concerto.frontend.Content.Audio, concerto.frontend.Content);
|
59
|
+
|
60
|
+
// Register the content type.
|
61
|
+
concerto.frontend.ContentTypeRegistry['Audio'] =
|
62
|
+
concerto.frontend.Content.Audio;
|
63
|
+
|
64
|
+
|
65
|
+
/**
|
66
|
+
* Build the embed iframe and signal that we're ready to use it.
|
67
|
+
* @private
|
68
|
+
*/
|
69
|
+
concerto.frontend.Content.Audio.prototype.load_ = function() {
|
70
|
+
this.audio_control = goog.dom.createElement('audio');
|
71
|
+
this.audio_control.src = this.url + this.url_parms_;
|
72
|
+
this.audio_control.autoplay = 'autoplay';
|
73
|
+
goog.style.setSize(this.audio_control, '0', '0');
|
74
|
+
goog.style.setSize(this.div_, '0', '0');
|
75
|
+
goog.style.setStyle(this.audio_control, 'display', 'hidden');
|
76
|
+
goog.style.setStyle(this.div_, 'display', 'hidden');
|
77
|
+
goog.dom.appendChild(this.div_, this.audio_control);
|
78
|
+
this.finishLoad();
|
79
|
+
};
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: concerto_audio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marvin Frederickson
|
@@ -65,6 +65,7 @@ files:
|
|
65
65
|
- lib/concerto_audio.rb
|
66
66
|
- lib/generators/concerto_audio/install_generator.rb
|
67
67
|
- lib/tasks/concerto_weather_tasks.rake
|
68
|
+
- public/frontend_js/contents/audio.js
|
68
69
|
- LICENSE
|
69
70
|
- Rakefile
|
70
71
|
- README.md
|