Hello,
The way mediafront handles views is not flexible enough for me, and many use cases, so I developed a new style plugin for views, allowing that. This needs a lot of work, as I'm not a views expert and don't know a lot about the appropriate methods to call.
Anyway, the patch I'll provide in first comment works, and allows what's describe below.
First, select Format "Media Player Advanced" : http://bit.ly/nCQFDV .
Then, in the format settings, more options appear. You can still choose your MediaFront preset, but you can also map a views field to the video, to the image preview, and to the title : http://bit.ly/nGUZtT .
At the moment, video and image support a raw file or media field, or any text field returning the full URL to the file. The title can be any field returning text (which means you could append author name, taxonomy, or anything views can append to a views field).
I need some help and suggestions to improve the way this style plugin is coded, especially get a better use of the Views API.
Regards,
David
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | mediafront_advanced_views_style-1230096-10.patch | 6.72 KB | David Stosik |
| #7 | mediafront_advanced_views_style-1230096-7.patch | 6.72 KB | David Stosik |
| #1 | mediafront_advanced_views_style-1230096-1.patch | 6.75 KB | David Stosik |
Comments
Comment #1
David Stosik commentedPatch is attached.
Comment #2
travist commentedI can definitely see where this may be useful. What I would do, though, is just incorporate these fields within the "Media Player" style settings, but just make them optional. If they don't provide them, then it just uses the old way of doing it. I may take a look at this further since I think you are on the right track.
Comment #3
David Stosik commentedWell I didn't want to alter the original Media Player style plugin because it goes too far calling functions that need a well formated node (with the right fields)...
To be true, I wondered if the module wouldn't need a rewrite, at least concerning the way it handles nodes. Node handling and playlist/player generation should be well separated, in my point of view. Moreover, the playlist/player generation should take abstracted objects, such as "playlist arrays" (a list of media with title, preview, etc.), and not take then parse nodes to find the appropriate field. This would provide a reusable API and more flexibility in the way the module could be used...
Comment #4
travist commentedDavid,
I completely agree with you. The reason why I even included the node parsing for media is simply to make it easier to use and get started. I actually went down this road with the dash media player module I wrote years back, and found that nobody could figure out how to configure it...
So, what I would like to propose is a mix between the two... Advanced settings for those who wish to pinpoint the fields they would like to populate the player ( thereby skipping the node parsing ), and then trigger the node parsing for the those who wish to have a more dynamic and easy to use setup.
Your thoughts?
Travis.
Comment #5
David Stosik commentedWell, maybe the code should be separated in various modules.
A mediafront_api, which would only provide tools, formatters, views integration, player presets...
A mediafront_node which would provide a Media content type, its fields, giving the user a powerful tool without much settings.
I don't think the node parser should reside in all installations.
Here are some features I'm still looking in a module like mediafront (and I am willing to help, on my free time) :
- Video / Media field formatter, displaying a mediafront video player
- better views integration (better code, more options than my previous patch)
- allow preset to display playlist only when many videos are retrieved (for example, choose a fallback preset in case there is only one video)
- Media presets (actually, providing this one would provide a way to format Field API Media fiels)
Comment #6
travist commentedDavid,
I really like your ideas. I think what you are talking about here is a version 2.0 of this module. If you would like to help out with that, I would happily make you a maintainer to get this branch started. I looked at your contributions and definitely see that you have the skills to do this if you are interested. Maybe we should setup a time to talk over Skype?
Let me know.
Travis.
Comment #7
David Stosik commentedThat would be a pleasure. I'm not sure I'd be able to implement all the features I listed, nor if I'll have enough time, but let's give it a try. :)
We can talk over Skype anytime you want.
By the way, here is a new version of the patch.
Comment #8
David Stosik commentedShould I open an issue to ask for maintenance rights ?
Comment #9
travist commentedDavid,
I just gave you commit rights to the project. On this particular patch, though, I would prefer to not define a new style to incorporate these changes. I think that there is a way to just incorporate these changes into the original style, but have a fallback mechanism where it uses the current way if these settings are not provided.
Also, I just created 6.x-2.x and 7.x-2.x branches for us to work off of since I am sure this will be a big change.
Let me know your thoughts on that.
Thanks,
Travis.
Comment #10
David Stosik commentedNew patch on last 1.x-dev version.
Comment #11
travist commentedApplied to 7.x-1.x branch with attribution.
Thanks David.
Comment #13
stevebab commentedFirst, excellent modules. Great work!
Second, I'm trying to add a counter after the title in Media Player Advanced like this:
Title of Video (1 of 5)
Other Video (2 of 5)
I have created a global text field and used the replacement patterns to get this output like this:
[title] ([counter] of [count])
Unfortunately, the token values are not coming through when I select my new global field as the Media Title itle in the "Media Player Advanced" settings.
Any ideas?
Comment #14
stevebab commentedAny ideas on how to include rewritten fields from views into the Media Title?
Comment #15
mrtoner commented@stevebab, hijacking a old topic is not the best way to get support. However, I've entered a feature request for this very issue:
#1561696: Allow MediaFront to use fields as rewritten by Views
Comment #16
travist commented@stevebab, I have written a small tutorial where I talk a little bit how this works here http://drupal.org/node/1563496. I will add more to it as I get the time, and am also planning a screen cast where I go over this. Please let me know if this at least helps you get started.
As for adding the ability to rewrite the output of fields, I am thinking that would help get the tokens to rewrite as you want, so I will look into that.
Thanks,
Travis.