e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
321 stars 214 forks source link

self-hosted mp4 files and problems with videos #3200

Open Jimmi08 opened 6 years ago

Jimmi08 commented 6 years ago

I tried to use Media manager at first -

A. I created category with type video owner gallery

http://localhost/e107/thumb.php?src=e_MEDIA_VIDEO%2F2018-06%2Fcyruugevyt89xjmv.mp4&w=800&h=0

I don't know it this is correct path, but with images it looks different .

So I use in TinyMce this path and I hoped it would be parsed or so, but nothing. this one: image

2. I tried news - images fields.

File was uploaded, result it admin area: image

Result in Frontend: xx{NEWSVIDEO: item=1} xx image

If I add this line to .htaccess ReWriteRule ^media\/video\/(a)?([\d]*)x(a)?([\d]*)\/(.*)?$ thumb.php?src=e_MEDIA_VIDEO/$5&$1w=$2&$3h=$4 [NC,L]

I got message that File is not a valid image.

If I want edit media file, I get this:

image

What is correct path to use in tinymce media button to get video displayed? This one doesn't work: http://localhost/e107/media/videos/2018-06/UGEvYT89Xjmv.mp4

Only way I found is full path with media folder and hash name in it.

Moc commented 6 years ago

@CaMer0n Any idea on this one?

CaMer0n commented 6 years ago

thumb.php is for IMAGE thumbnails. So there's a bug there with the generated URL, but also, you shouldn't make a rewrite rule to send videos to thumb.php. Try using a full-path to the video file in TinyMce.

Jimmi08 commented 6 years ago

It was just attempt to fix it. Do you mean full path with hash folder? Yes, I did it. And this doesn't solve problem with news images as video.

CaMer0n commented 6 years ago

Work-in-progress committed.

Enable with define('e_DEBUG_VIDEO', true); in e107_config.php and then add an image to a 'news' item for example ( using imagepicker, not Tinymce)

The challenge right now is the 'preview' image. The media manager simply changes the 'src' attribute of the 'preview' box (image-picker) in the main form when we select the media item we wish to use. Obviously, it won't work to place a .mp4 or .mp3 URL into the 'src' of an img tag. So, imagepicker() will need to be modified in order to receive html (video tag, audio tag, div etc) from the media-manager modal window, rather than just the 'src' value. And of course, use the appropriate tag when existing data is loaded from the DB.

It may be easier to add a new universal 'mediapicker' method to the form handler for this. ie. It would handle images, file, glyphs, audio and video previews and work with the existing media-manager modal window.

@SimSync fyi

CaMer0n commented 6 years ago

@SimSync You can test on admin > news with define('e_DEBUG_MEDIAPICKER', true) in e107_config.php Media Selection isn't working yet with videos and audio.. (TBD) so you'll need to go to Line 1387 of form_handler and manually enter some URLs to local files of different types.