I have a view and some nodes have associated video. If there's no video, we detect that the rendered field is empty and display instead the image.

If I use the html5_player formatter from html5_media, the returned view shows no output from the media field with no data. When switched to Mediaplayer, the view renders instead an empty set of media player controls.

Possibly a regression of #1000432: Hide player when an empty view is returned. for 7.x-2.x?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

xurizaemon’s picture

Status: Active » Needs review
FileSize
517 bytes

I see that you're accepting an array of fields (rather than just a field label) so have included a foreach to pick up if the field(s) are empty or not.

I'm not familiar with the module so this might not be the ideal approach - may be inappropriate if the array is for fallback, may not be right for playlist usage, but works for me today :D

travist’s picture

Status: Needs review » Fixed

Looks good to me. I just added an if (!empty($args[1]['variables']['#fields'])) around it so that it only applies to that specific use case.

Committed to HEAD with attribution. Thanks for your contributions!

Travis.

travist’s picture

Status: Fixed » Active

I just noticed that this breaks a grid view player display in Views. I had to revert to figure out what is going on here...

travist’s picture

Status: Active » Needs work