TDAndT

Total Design and Technology - Websites and Mobile Applications

Video plugin JPlayer and K2 category display bug

Rate this item
(0 votes)

First blog entryRan into a problem today working with the K2 Category display and the JPlayer video plugin.

Videos for the items in the category should be viewable when displayed on the category list but they still showed the <flv>...</flv> tags.  I use the JPlayer plugin to display videos (sometimes, other times I use the boVideos viewer... don't ask!)

Netbeans debugger showed that the JPlayer's 'onPrepareContent' plugin was being called correctly but it was expecting the item text to be in the text attribute!  K2 places the text in the fulltext attribute when calling the plugin from the category view but passes it in the text attribute when passing from the item view ???

Wrote a quick hack to the JPlayer content plugin to create a temp variable to  check the fulltext attribute  to see if it is populated (from the category view) otherwise use the text attribute (from the item view):

$text = (($article->text != null) AND ($article->text != '')) ? $article->text : $article->fulltext; 
if (preg_match($regex, $text) == FALSE) {
    return; }

Also had to change the bottom of the function to check whether to replace either the $article->text or $article->fulltext attributes!

Royce

Royce

Still here after all these years! 

@joomflix

Website: www.tdandt.com

Image Gallery

More in this category: Next »

Add comment


Musings, Hopes and Geeks

About Me

I've been a developer for several decades. For the past few years, I've specialized in web development and applications for small and medium businesses. I am also heavily involved in mobile augmented reality (AR) with the Layar platform. My main AR site is at AltWhatNow.

Hire me

We love to receive email. Drop us a line here..
CAPTCHA ImageReload Image