Hi all,

Has anyone managed to get the circle player (http://www.jplayer.org/latest/demo-05/) working with this module? I may have to dive into this for a client. I took a quick look at the current 7.x-dev version I don't see any development of this front yet.

Thanks

Nick

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jumptrnr’s picture

Nick - any luck with this one? Happy to help test a patch....

PESTO3567’s picture

I also would like to use the circle player, there's some initial theme support but it looks rather incomplete actually

nickgs’s picture

I read through most of the module and applied some basic code to enable the selection of "Circle" from the view field. I also looked into modifying some of the CSS for the current player to achieve a similar effect. I did notice that the circle player is using a different version of jplayer BUT I have not gotten deep enough to see if that is in fact a problem.

I am working through some other, more pressing, features for this client currently. I am looking at probably about a month before I can refocus on this.

I do think this would be a nice addition to this module and am glad to see some interest!

Thanks.

Nick

nickgs’s picture

I put a little thought into this last night. I am going back and forth with how this should be implemented.

The Circle Player seems to live in its own project. (https://github.com/maboa/circleplayer) and has a few additional dependencies (jquery.grab, jquery.transform). I am almost thinking this should be a separate module but that may be crazy talk.

If we don't make it a separate module we will have to do a bunch of tweeking in this module to make this work such as registering the additional libraries, directing output the correct theme calls, etc.

Anyone have any thoughts on this?

Thanks.

Nick

jlyon’s picture

A couple days ago, I tried integrating it into jplayer and ran into a bunch of the same issues that you describe above, so I'm thinking it should be its own module. I'm going to start working on a separate module and should have something in the sandbox in a few days. Perhaps jplayer could be used for the private file protection.

hedac’s picture

that would be a great module for audio formatter. Soundmanager2 ui360 is similar but still not working well in 7.x

nickgs’s picture

Ok, so I put my head back into this and began trying to get the Circle Player integrated without having to create a new module. I did this while watching the Super Bowl of course... :) Attached is my first attempt. Its not working yet BUT does bring in the Circle Player assets and exposes an option in the field formatter settings to select "Circle" as a mode option. It will also renders the player on the screen BUT there seems to be some Jquery issues with the way I am using the library currently.

To play with this simply download the CirclePlayer code here: https://github.com/maboa/circleplayer and drop the entire contents into your /sites/all/libraries directory and apply the patch.

Its not there yet BUT wanted to get something out for anyone that wants to take a crack at this OR may have some insights into what I am doing wrong with respect to the CirclePlayer to properly execute in the context of jquery. Once we get a working player we can do things such as dynamic ID's for multiple players on the page and passing in the JS settings array for actually playing our fields content.

Thanks.

Nick
http://nickgs.com

jlyon’s picture

FileSize
12.57 KB

Hey Nick,

Thanks, I'll try to take a look at it tomorrow. I got most of the stand-alone module working, but got stuck what sound like the same point you're at. I had all of the resources attached and the players were properly styled, but they wouldn't play. Here's the code that I was working on. The project I was working on decided to just go with the standard jplayer, so I stopped working on it.

Thanks,
Jeff

shortspoken’s picture

Subscribing. Would love to see the Circle jPlayer working.

AliceEldridge’s picture

I second that

lunk rat’s picture

+1 for circle player

lunk rat’s picture

I am willing to sponsor development work on getting circle player as a D7 field display formatter option.

pwaterz’s picture

@Link Rat, please email me privately.

steve hawkins’s picture

I am also interested in seen circle player working. May have some funds to help make it happen.

nickgs’s picture

I have been a bit busy with other projects but I am still interested in what everyone thinks the best approach to implement this type of feature is. I have made good head way with the patch in #7, has any tried testing this? Any feedback would help push this along.

Thanks.

Nick

pwaterz’s picture

I was working on this over the last two days, and went down a few roads. Here are the implementations options I see could work:

1. Build a plugable theme system into jplayer and allow other modules to add theme/"styles"
I think this would be really nice because it would give more options to users and possibly require less tpl overriding and adding of additional css. This would require some abstraction of the current jplayer architecture because most themes will need to share some functionality.

Then build a separate module for circle player that plugs into jplayer

2. Do what the patch above attempted. Just kinda work it into the module. I personally dont like this because it makes things messy.

Appreciate anyones thoughts.

nickgs’s picture

Hi Pat,

I tend to agree. I was thinking along the same lines as your first thought. It would be nice if we expose a way for other modules to provide their own theming layer but still use much of the core jplayer work accomplished. I haven't read the code in a while but I do think it would require a rather large refactor to make this play nicely.

I also agree with not liking the approach I took above. Although I do think we could get it working, it is not very flexible and introduces some complexities in the code. It also will become a nightmare if/when other jplayer modes want to get rolled in.

I guess the question would be what types of hooks would we need to implement in order to expose a way for other modules to extend the jplayer.

Just thinking out loud here but my initial thoughts are we would need ways to do the following:

  • Provide a way to hook into the jplayer_theme function to provide templates.
  • Provide a way to hook into the jplayer_field_formatter_settings_form to provide additional modes (ex. Circle)
  • Provide a way to hook into the jplayer_field_formatter_view to provide ways to output the correct theme depending on mode.

I am sure I am missing some stuff here and may be misunderstanding some of the architecture of the current system but this was where most of my work above seems to have taken place. If those are the correct hook in points it may be a good starting point.

Thoughts?

Thanks.

Nick

pwaterz’s picture

NIck,

That is exactly what I was thinking. Here a few hooks I think that would work.

1. hook_jplayer_style_info
Would require returning an array like so

       array('circle' => array( 
       'label' =>  t('Circle'),
       'description' => t('Some Description'),
       'tpl' => 'templates/circle', // Optional, by default it will look in the current directory
       'js' => 'circle' //Optional, if this is set, then the default jplayer setup js will not be included.
        )
        );
       

2. Then jplayer_field_formatter_settings_form can invoke that hook and get a list of styles and provide a select list

3. I think it would also be necessary to have a settings form hook. something like hook_player_style_[SYTLE NAME]_settings_form. Then the settings form would change based on the style. If this hook doesnt exist then, just use the default form

4. hook_jplayer_style_{STYLE NAME}_render($args) this hook would be invoked from the default jplayer theme function and would add the necessary jplayer default settings and would dynamically change the tpl file based on the style choosen. The hard part will be trying to generalize the current setup. The JS file may also be tricky because each theme may need to have it's own custom js.

I think this would be a good start.

Another option that I have played with is using ctools plugin system. It is really simple and easy to use.

What are your thoughts?

ldweeks’s picture

This sounds really great. I'd really love to use this on a project I have coming up, and so I'm willing to test patches.

lunk rat’s picture

I like the direction that this is going. I am here to test patches and provide feedback. Thanks so much for moving this along! Rock!

OMD’s picture

subscribing

nickgs’s picture

Excellent, I think the ctools plugin system is a viable option. Just not sure if we want to introduce a dependency. Personally, I don't have much experience with the plugin system but have been following the D8 initiative to get a plugin system in core, which is modeled on ctools. Correct me if I am wrong, but using the ctools plugin system would enable us to expose a consistent interface to the jplayer module that would abstract the actual implementation. This would make it easier and less error prone for further implementations to plugin to the jplayer module?

I think we should probably vet these two strategies before jumping in. Unfortunately I don't have much time to code at the moment but this may change in the coming weeks.

Thanks.

Nick

pwaterz’s picture

Nick,

It would defiantly abstract the functionality and make it less error prone. It would only require one hook to implement which is

hook_ctools_plugin_directory($module, $type)

If the ctools plugin system is going in to D8, then that is even more of a reason to go the ctools route. I think we should try both directions and see what comes up. If we go the ctools wrote in might need to do some custom work to get the field display settings to work properly.

I'll see if I can get a patch together this weekend.

Patrick

ldweeks’s picture

Any luck on this?

I know things get busy. Just checking in... Thanks!

cez’s picture

Hi,

is there anything new about this topic ?
Cheers

RachelIsland’s picture

Suscribing.

shortspoken’s picture

Knock knock. I'm still interested in this feature. Having the circle player available would be awesome!

bohemier’s picture

Subscribing too... This circle player is awesome.

lameei’s picture

Issue summary: View changes

Anything new?

aag4’s picture

Hey Nick,

responding to your post #7

I had a problem of jPlayer circle player not rendering properly in Safari. The green progress circle did not display correctly.

Happy Worm have a demo of two circle player buttons at - http://happyworm.com/jPlayerLab/circleplayer/v13/

Copying the source code and downloading the code from the source hrefs produced the two circle player buttons. They played fine in Firefox and Opera. However, for some reason, when I loaded all the code into a new website I was building the progress circle did not render correctly in Safari.

However, thank you to "nickgs" at #7 - https://github.com/maboa/circleplayer

Using the downloads provided by you I have managed to get the circle player rendering correctly in Safari in the website that I've been adding audio play buttons to. I have also been able to scale the button right down to 50px x 50px.

Thank you

jessZ’s picture

Any progress in getting this to work in D7? The blue monday default is so ugly and none of the 'customized' versions i have found offer any real implementation steps to even get the pink flag version working.

markie’s picture

All
So I spent some time this evening on getting other skins working with this module. The problem is that the HTML template for the circle player is different from the standard (default) Blue Monday skin. I will review the patches attached but the 7.x-2.x dev release has been modified a bit. Can you please re-roll your patches against the latest?

mark

markie’s picture

Status: Active » Postponed (maintainer needs more info)
rivimey’s picture

Status: Postponed (maintainer needs more info) » Needs review

I too am looking to move away from blue.monday and make use of circle player. I want to use jP 2.9.2.

I started working on enabling a 'skin' selection in the field config -- initially with the expectation that it wouldn't work to have two different skins in use on one page, but that on different pages it would be seamless. My reason is that I would like to use 'Circle' player on a views page but a different one - probably derived from pink.flag - on the node page.

[I found and addressed the issue with Version in the js file, by ignoring whether it's 'minified' and just check for the known regexes. While I did that hard-coded it would probably be better done via an array.]

I started by adapting the provided skins -- changing references to the skin image jpg to be a relative path (so css/X.css references ../images/Y.jpg). Then added to the jplayer admin form a skin selection in the variables, and used that in the _jplayer_get_css() function so the correct css file is loaded, which then pulls in the correct images. In all this I kept to the base two skins, figuring I could generalise that later. Having shown that working, I then moved the skin selection into the field settings (which is where I wanted it) and showed that working too. However, the template's html is not right.

And here I'm a but stuck for the best way forward. The only thing I'm sure of is that changing skin does need to change template html that is output, and that in the long run the whole lot should be providable from a different module or theme. So, I like the previous suggestions of using ctools for that.

There is still the problem of how, exactly, to discover and select the correct template. I am, for the moment, assuming that it is best to retain the jPlayer.org project's idea of a skin. Given this, I can see several options:

  1. Ignore ctools, provide a hook that returns arrays describing the skin to use. Expose the current skins by self-implementing the hooks. Simple to use, works.
  2. Use ctools to enable a jplayer plugin, which otherwise behaves similarly to (1).
  3. Go with custom code that checks in the theme folder.

My preference, I think, would be for (2). Alongside this are some questions:

  1. Should the skin hook/plugin call force one template file to apply for all modes?
  2. Should it even require a .tpl file: would it be better if it could be a tpl or a function call?
  3. It seems plausible that a skin might require additional 'libraries' and drupal modules, and to require additional JS/CSS on the page. That can be dealt with in the template if needed, but would be clearer if exposed?
  4. Should there be additional hook or preprocess opportunities provided, on top of those already present?
  5. The major problem with permitting different skins of the player on the same page is that the css names used are the same for each skin. Is that surmountable (or even desirable?)

I am happy to post a patch -- though I really haven't got that far. My main reason for posting is to gain better understanding of how to proceed, especially if there's a hope the result is committed to the module.

markie’s picture

Status: Needs review » Needs work

Looked at the patch and there are still some DPM's in there and a few other formatting issues. I have updated this thread (https://www.drupal.org/node/2485867) with a way to add custom css and js. combined with a tpl file I have gotten the circle player to work, but have not written up any documentation about it. It's in my todo list.