In views, video duration is showing up as a number of seconds, i.e. 106, 2344, etc... . How do I break it up to display in hours, minutes & seconds?
In views, video duration is showing up as a number of seconds, i.e. 106, 2344, etc... . How do I break it up to display in hours, minutes & seconds?
Comments
Comment #1
timofey commentedI've done some digging, and it looks like it's a BUG. (I've updated the Post Title)
In modules/kaltura/plugins/kaltura_views/kaltura_views.module
and
Duration is handled as views_handler_field_numeric, causing duration to become #,###,### instead of ##:##:##.
A temporary fix can be to handle duration as a string and convert mysql duration field from INT to TIME
Comment #2
timofey commentedComment #3
timofey commentedI just made a fix. I don't know how to make the patches yet;) sorry...
Open modules/kaltura/plugins/kaltura_views/kaltura_views.module
On line 123, replace
'handler' => 'views_handler_field_numeric',with
'handler' => 'views_handler_field_kaltura_duration',Add the following code to line 330, right after class views_handler_field_kaltura_thumb extends views_handler_field { ... }
Open modules/kaltura/plugins/node_kaltura_entry/node_kaltura_entry.module
Add this to line 398:
Add this to line 563 (used to be line 560)
Add this to line 639 (used to be line 632)
That's all folks.
Comment #4
jweedman commentedBAM! Worked like a charm!
Thanks for your greatly detailed fix. Saved me a ton of time!
Comment #5
oferc commentedWe have released a new version of the Drupal module that works with Kaltura’s new platform version - Andromeda.
The new module should solve the issue discussed here, and it also includes great new and exciting features at
http://www.kaltura.org/features-coming-next-version
The new version is now available for download at http://drupal.org/project/kaltura#downloads.
If you wish to upgrade an existing account and migrate your content, you can learn more in our forums , or contact us for assistance at http://corp.kaltura.com/about/contact