Skip to content

Instantly share code, notes, and snippets.

@brandon-beacher
Created December 4, 2012 01:14
Show Gist options
  • Save brandon-beacher/4199625 to your computer and use it in GitHub Desktop.
Save brandon-beacher/4199625 to your computer and use it in GitHub Desktop.
GPB.Controls.Stencil.Audio = function (stencil) {
var API = { constructor: GPB.Controls.Stencil.Audio }
API.maskTagName = 'div';
API.findElements = function (doc) {
return doc.querySelectorAll('.audio-placeholder');
}
API.fitMask = function (audioPlaceholder, audioMask) {
var audio = audioMask.dom.append("audio");
audio.setAttribute('controls', audioPlaceholder.getAttribute('data-audio-controls'));
audio.setAttribute('preload', audioPlaceholder.getAttribute('data-audio-preload'));
audio.setAttribute('src', audioPlaceholder.getAttribute('data-audio-src'));
audio.setAttribute('type', audioPlaceholder.getAttribute('data-audio-type'));
var link = audioMask.dom.append("a");
// set up link here
}
return API;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment