Hi, I upload flv files but in jplayer module it show id is audio type, can help to update this? my item_type is file, choice file type in manage field part. that's reason, I can't choice ”Multimedia asset“ follow this http://www.ostraining.com/blog/drupal/media-field/

any suggestion about it? how can I change the type to correctly? thanks

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kingfisher64’s picture

Title: Flv file be point to audio type in jplayer » Video formats displayed with audio player
FileSize
6.1 KB
8.92 KB

I'm having a similar issue. It appears it's more than one format.

For me it's mp4 format.

I've read readme.txt and the jplayer instance is set to single not playlist. (screenshot attached)

How do I get the player to display as a video player?

steveburge’s picture

Hi nathan.zhu and kingfisher64

I wrote that original article. Since then, I think they've changed the way the Media module works. Choose the "file" field type, rather than ”Multimedia asset“.

valthebald’s picture

Title: Video formats displayed with audio player » Display video formats with video player and allow changing video size
Status: Active » Needs review
FileSize
7.07 KB

There are several issues with video displaying
1. jplayer expects m4v in playerSettings.supplied, but jplayer.module sends file extensions "as is". As a result, *.mp4 files are opened with audio (which is default)
2. jplayer supports changing video size from default 480x270, but there are no appropriate settings
3. (PHP5.3+ specific?) When jplayer_sort_files() gets $item_type = null, it does not treat it as default value ('file'), so setting file url fails

Attached patch solves these problems

kingfisher64’s picture

@ #2 SteveBurge - I did use file field not multimedia asset. THought maybe i'd done something else wrong but given #3 comments...

thanks valthebald

kingfisher64’s picture

Issue summary: View changes

update new description.

spgd01’s picture

Patch works for flv and mp4. However theme is a little off and I get the following error:
Notice: Undefined index: cssStyle in template_preprocess_jplayer() (line 54 of E:\Websites\drupaltest-7\website\sites\all\modules\jplayer\includes\jplayer.theme.inc).

kylesmith’s picture

Issue summary: View changes
FileSize
8.88 KB

Big thanks to valthebald for patch #3. I couldn't apply the patch automatically with the current 2.x-dev code, but I could manually make those changes and it solved this issue for me. I am updating patch #3 so those changes can be automatically applied.

This patch can be used to set a video player size in the admin/structure/types/manage//display page, either by specifying a custom CSS class or by setting the width and height in pixels. With patch #3 (and also this patch #6), using a CSS class will prevent the width/height settings from being applied.

Video files with *.mp4 file extensions will also display in the video player.

I am making a few other modifications:

  • correcting the 'cssStyle' index error spgd01 noticed in #5. Patch #3 used 'cssClass' as the index in most places, but 'cssStyle' in jplayer.theme.inc. It now uses 'cssClass' index everywhere and the CSS style can be applied. I noticed this is only applying to the interface div on a video player, so it applies only to the div containing the play/stop, volume controls. I'm not sure why the actual video player div is not getting this class applied to it.
  • Patch #3 only modified the admin/structure/types/manage//display form for nodes of 'video' content type (bundle). I've removed this condition because not everyone's video content types are named 'video', including my own.
  • I've updated the jplayer.tpl.php file so the interface block (which contains the play/stop, volume controls) uses the same width set in the admin/structure/types/manage//display form.
  • I've changed the logic in the jplayer.tpl.php file so the playlist block doesn't appear for the single player. I also updated the jplayer.css to add a bottom border to the interface block for the single player.
  • I've included the patch #6 from #1780386: Single player doesn't bring up right css classes because I can't automatically apply both patches, just one or the other.

Reviewers would be appreciated. I haven't tested this patch with audio files, and as I mentioned above, I couldn't get the custom CSS class to work to define width/height for my video player.