1

在模块的配置文件中,我将参数设置为

                <field
                name="file"
                type="media"
                default="video.mp4"
                directory="videos"
                label="MOD_PLAYER_FIELD_FILE_LABEL"
                description="MOD_PLAYER_FIELD_FILE_DESC"/>

然后我以管理员身份登录,打开模块管理器和该模块。当我单击“文件”字段旁边的选择按钮时,媒体管理器窗口会加载,但它只能查看/选择图像文件。如何使它能够选择视频文件?

谢谢!

4

1 回答 1

0

By default this sadly doesn't work (at least in Joomla 2.5.*). In an older project we had to hack the com_media component for this to work. You need to apply the following change

diff --git a/administrator/components/com_media/models/list.php b/administrator/components/com_media/models/list.php
index b97a930..ebee3f4 100644
--- a/administrator/components/com_media/models/list.php
+++ b/administrator/components/com_media/models/list.php
@@ -156,7 +156,7 @@ class MediaModelList extends JModel
                        default:
                            $tmp->icon_32 = "media/mime-icon-32/".$ext.".png";
                            $tmp->icon_16 = "media/mime-icon-16/".$ext.".png";
-                           $docs[] = $tmp;
+                           $images[] = $tmp;
                            break;
                    }
                }

Video and audio files will now show up using the "media" type, albeit with a broken image icon (as they have none). This patch could obviously be improved further by adding the necessary image information manually.

于 2013-10-16T15:07:25.707 回答