How to upload mp4 video in wysiwyg editor in magento - file-upload

<adminhtml>
<cms>
<browser>
<extensions>
<allowed>
<mp4>1</mp4>
</allowed>
</extensions>
</browser>
</cms>
</adminhtml>
after I add this to my config.xml
I upload an mp4 file, but a warning of unsupported format of image shows up.

First thing, I recommend creating a local module to avoid to modify core files. Then, override the following Magento classes:
Mage_Core_Model_File_Validator_Image
Mage_Cms_Model_Wysiwyg_Images_Storage
Changing the validate function comparing with the video/mp4 filetype: mime_content_type($filePath) == 'video/mp4'
Adds the mp4 extension to the array of allowed and image_allowed from your config.xml located on your module folder, ex: Mycompany/Mymodule/etc/config.xml
<adminhtml>
<cms>
<browser>
<extensions>
<allowed>
<mp4>1</mp4>
</allowed>
<image_allowed>
<mp4>1</mp4>
</image_allowed>
</extensions>
</browser>
</cms>
</adminhtml>
After deploying the module on your Magento folder and clearing your cache, you should be able to upload mp4 videos through WYSIWYG editor.
Then, you can include videos on the CMS Pages like this:
<video width="1280" height="960" controls="controls">
<source src="{{media url="path_of_the_video.mp4"}}" type="video/mp4" />
</video>
I made an example that you can use as a reference:
https://github.com/fontelag/mag_videos_upload

Related

Imageresizer.net showing red dot in free version

I recently updated ImageResizer.NET to version 4.04 and a small red dot is now appearing on all the resized images. I understand this occurs if you don't have a paid for license but haven't entered the license key in the web.config. However, I am using the free version with no paid for plugins. According to the website, no license is required for the free version.
I have restarted the website and viewed different images so I don't think it's caching them.
Here is the output from resizer.debug:
Image resizer diagnostic sheet 1/25/2016 10:52:33 AM
0 Issues detected:
Assembly use report:
You do not seem to be using any plugins from (commerical/AGPL) editions.
Registered plugins:
ImageResizer.Plugins.Basic.DefaultEncoder
ImageResizer.Plugins.Basic.NoCache
ImageResizer.Plugins.Basic.ClientCache
ImageResizer.Plugins.Basic.Diagnostic
ImageResizer.Plugins.Basic.WebConfigLicenseReader
ImageResizer.Plugins.Basic.SizeLimiting
ImageResizer.Plugins.Basic.MvcRoutingShimPlugin
ImageResizer.Plugins.Basic.DefaultSettings
ImageResizer.Plugins.TinyCache.TinyCachePlugin
Configuration:
<resizer>
<plugins>
<add name="DefaultSettings" />
<add name="TinyCache" />
</plugins>
<defaultsettings explicitSizeScaleMode="Both" />
<clientcache minutes="1440" />
</resizer>
Accepted querystring keys:
quality, format, thumbnail, maxwidth, maxheight, width, height, w, h, crop, page, bgcolor, rotate, flip, sourceFlip, sFlip, sRotate, borderWidth, borderColor, paddingWidth, paddingColor, frame, useresizingpipeline, cache, process, margin, dpi, zoom, autorotate,
Accepted file extensions:
bmp, gif, exif, png, tif, tiff, tff, jpg, jpeg, jpe, jif, jfif, jfi,
How do I get rid of this red dot?
If you add &crop=10,10,-10,10, does the dot disappear?
If so, you've saved watermarked images to disk as originals. Perhaps you're using ImageResizer during upload or the storage process, and have unlicensed plugins for a different instance of ImageResizer.Configuration.Config? You can access the diagnostics page string from code - GetDiagnosticsPage() or write it to a file - WriteDiagnosticsTo(string path) to assist with troubleshooting.
The code which creates the red dot registers itself as a plugin, LicenseEnforcer. That plugin is not present in the diagnostics page, which tells me that the application process serving you the diagnostics page is likely different from the one serving your images. That, or you are using a custom Config instance at runtime.

HTML5 video (video.js) not loading in Chrome

I have a html5 video video that is not loading in chrome, it just shows the loading spinner from video.js.
I get the following error in chrome console too:
Uncaught TypeError: Cannot call method 'init' of undefined machinas.com/:830
["Video Error", Object]
0: "Video Error"
1: Object
length: 2
__proto__: Array[0]
.htaccess
AddType video/mp4 .mp4 .m4v
AddType video/webm .webm
AddType video/ogg .ogv .ogg
html
<video id="video-1" class="video-js vjs-default-skin"
width="100%" height="100%"
poster="videos/timelapse.jpg"
data-setup='{ "controls": true, "autoplay": false, "preload": "auto" }'>
<source src="videos/timelapse.mp4" type='video/mp4' />
<source src="videos/timelapse.webm" type='video/webm' />
<source src="videos/timelapse.ogv" type='video/ogg' />
Your browser doesn't support HTML5 video.
Download the video instead.
</video>
Anyone know what could be the issue?
I had same Problem after wrong Conversion.
Try to expand the problem in chrome console to check which video file produces the error. I think its the .mp4 version.
I used "miro video Converter" to convert from mp4 to mp4 and it works well but you get a little quality loss...
after that its possible that you have same problem like me... chrome doesnt play .webm files... no idea why :(
sry about bad english ^^
The good thing (or bad) is the fact that this is not the VideoJS issue. I had the same problem. Looking on the Internet we can find some informations (for example: https://github.com/flowplayer/flowplayer/issues/423) and it considered to be a Chrome bug. Issues was reported in JWPlayer and VideoJS forum as well.
AFAIK the only way to bypass this is loading webm file:
<source src="test.webm" type="video/webm" />
I tried to put webm source before mp4. Chrome recognized webm as "good" source and play it well. Sadly FF and IE won't play a thing. So we need to chose one format after browser-check (what is wrong but I in this point I don't see another way; this is not JS feature related problem...).
Why browser detection is generally bad idea? You can read more about this in Test-Driven Javascript Development book or here: http://jibbering.com/faq/notes/detect-browser/
As quick fix you can use something like this:
/* load webm for chrome */
if (window.chrome) {
videojs('videoTagId').src({ type: "video/webm", src: 'path/to/file.webm' });
}

Subtitles not showing using WebVTT

So I'm trying to add subtitles to a html5 video and found WebVTT. I've done some research on it and have even copied some example code to see if that'll work and yet I have no luck.
The subtitles just simply don't show up on the video.
Here's the HTML.
<video id="video" class="video" controls>
<source src="solar.mp4" type="video/mp4">
<source src="client2.ogv" type="video/ogv">
<source src="solar.webm" type="video/webm">
<source src="solar.flv" type="video/flv">
<track label="English Captions" kind="captions" srclang="en" src="english-subtitles.vtt">
</video>
and the test VTT file.
WEBVTT
1
00:00:13,00 --> 00:00:16,000
Man did you see that awesome thing like last week -
2
00:00:16,100 --> 00:00:20,100
- and i said wow a lot of people are starting to talk about this.
It doesn't work locally, you need to run it on a server.
You use the incorrect time-stamp format. There should a . (dot), after the second value.
It should be like this: 00:00:00.000 --> 00:00:10.000
I had the same problem you were having.
The problem is that Chrome has a security feature that does not allow files to run local files in Chrome.
The solution is to run Chrome with the allow local access flag. The link gives instructions for each OS.
Browsers do not support that feature locally
Except Mozilla Firefox 66.0.2

kaltura javascript video tag

I'm trying to use the KDP javascript API to implement a .mp4 file in HTML5 using the Klatura player. This is my code so far:
<div id="video" class="hide" >
<video name="player_123" id="player_123" width="330" type="video/mp4" height="480">
<source src="assets/91zVbVyKPSS.mp4" >
</video>
</div>
How could I use the Javascript API with what I have? I have no idea how to configure it. It seems that it's trivial with the object tag but not the video tag.
Switched to videojs.
Life is a little bit easier:
The point was, whatever you are about to do you should always use the HTML5 video tag. You should help the JS library of the video platform to identify the tag and everything should be automatic from there.

Special character encoding issue on Solaris with weblogic server

I have an application which uses fop and xslt to generate the PDF file. The special characters as §£?ÐÅÆ are appearing as ???? in PDF.
The weblogic server is running on solaris machine.
I have already tried with
<charset-params>
<input-charset>
<resource-path>/*</resource-path>
<java-charset-name>UTF-8</java-charset-name>
</input-charset>
<charset-mapping>
<iana-charset-name>UTF-8</iana-charset-name>
<java-charset-name>UTF-8</java-charset-name>
</charset-mapping>
</charset-params>
in weblogic.xml.
I have also tried with
transformer.setOutputProperty( OutputKeys.METHOD, "xml");
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
transformer.setOutputProperty( OutputKeys.INDENT, "yes");
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
Nothing seems to be working over there.
Have you set up fop to find fonts with those characters in? For instance, on Solaris 11
using fop (though not with weblogic) I had to set up paths for fonts in a fop-conf.xml:
<?xml version="1.0"?>
<!-- NOTE: This is the version of the configuration -->
<fop version="1.0">
<renderers>
<renderer mime="application/pdf">
<fonts>
<!-- register all the fonts found in a directory -->
<directory>/usr/share/fonts/TrueType/core/</directory>
<directory>/usr/share/fonts/TrueType/dejavu/</directory>
<directory>/usr/share/fonts/TrueType/liberation/</directory>
<directory>/usr/share/fonts/TrueType/unifont/</directory>
<!-- register all the fonts found in a directory and all of its sub directories (use with care) -->
<!-- directory recursive="true">C:\MyFonts2</directory -->
<!-- automatically detect operating system installed fonts -->
<auto-detect/>
</fonts>
</renderer>
<renderer mime="application/postscript">
<fonts>
<directory>/usr/share/fonts/X11/Type1/</directory>
<directory>/usr/share/ghostscript/fonts/</directory>
<directory>/usr/share/fonts/TrueType/core/</directory>
<directory>/usr/share/fonts/TrueType/dejavu/</directory>
<directory>/usr/share/fonts/TrueType/liberation/</directory>
<directory>/usr/share/fonts/TrueType/unifont/</directory>
</fonts>
</renderer>
</renderers>
</fop>
(Font paths will be different on older versions of Solaris.)
For more details, see:
http://xmlgraphics.apache.org/fop/trunk/fonts.html
http://www.sagehill.net/docbookxsl/AddFont.html#ConfigFontFop