Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circle players from template #15

Open
neojski opened this issue Jul 23, 2013 · 0 comments
Open

Circle players from template #15

neojski opened this issue Jul 23, 2013 · 0 comments

Comments

@neojski
Copy link

neojski commented Jul 23, 2013

Hi,

if I want to use some templating system and create view which will generate CirclePlayer for me I can't as the following does not work:

var template = '<div><div id="jquery_jplayer_1" class="cp-jplayer"></div> <div id="cp_container_1" class="cp-container"> <div class="cp-buffer-holder"> <!-- .cp-gt50 only needed when buffer is > than 50% --> <div class="cp-buffer-1"></div> <div class="cp-buffer-2"></div> </div> <div class="cp-progress-holder"> <!-- .cp-gt50 only needed when progress is > than 50% --> <div class="cp-progress-1"></div> <div class="cp-progress-2"></div> </div> <div class="cp-circle-control"></div> <ul class="cp-controls"> <li><a class="cp-play" tabindex="1">play</a></li> <li><a class="cp-pause" style="display:none;" tabindex="1">pause</a></li> <!-- Needs the inline style here, or jQuery.show() uses display:inline instead of display:block --> </ul> </div></div>'

var $template = $(template);
var myCirclePlayer = new CirclePlayer($template.find("#jquery_jplayer_1"),
{
    m4a: "http://www.jplayer.org/audio/m4a/Miaow-07-Bubble.m4a",
    oga: "http://www.jplayer.org/audio/ogg/Miaow-07-Bubble.ogg"
}, {
    cssSelectorAncestor: "#cp_container_1"
});

$('body').append($template);

But the crazy thing is that if I move $('body').append($template) before new Cicr... then it works. The reason I don't want this workaround is that my view is not be responsible for self insertion into body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant