.SRT Captions not Playing in IE11 - html5-video

Any ideas why .srt files are not playing in IE11 and Chrome. I have encoded the files as UTF8. I also added the mime type on my server to text/srt. I also get the error Text Track: Unknown MIME type. hr=8007000b. in cosole.
1
00:00:22,000 --> 00:00:27,000
I'll teach thee Bugology, Ignatzes
2
00:00:40,000 --> 00:00:43,000
Something tells me
3
00:00:58,000 --> 00:01:59,000
Look, Ignatz, a sleeping bee

SRT sub-title files are not supported in HTML5 out of the box.
You must include/convert it to a WebVTT file.
Then you'd use the <track> element to include it with your video source, for example:
<video id="video" controls preload="metadata">
<source src="video/sintel-short.mp4" type="video/mp4">
<source src="video/sintel-short.webm" type="video/webm">
<track label="English" kind="subtitles" srclang="en" src="vtt/sintel-en.vtt" default>
<track label="Deutsch" kind="subtitles" srclang="de" src="vtt/sintel-de.vtt">
<track label="Español" kind="subtitles" srclang="es" src="vtt/sintel-es.vtt">
</video>
See this page for more details.

Related

resizer.debug reports "The FreeImage library is not available! All FreeImage plugins will be disabled."

I've got our Web app running on a dev server, a rented physical server and an Azure VM. The dev and Azure servers are running ImageResizer perfectly, but the rented server on Win2K12 has the following error in resizer.debug:
The FreeImage library is not available! All FreeImage plugins will be disabled.
I've tried deleting FreeImage.dll and letting it be downloaded, which it is doing successfully, but I still get the error.
I'm really stuck by what might cause this. Is it a permissions problem? And sorry if it's covered in the docs somewhere because I couldn't find it.
Full resizer.debug info below:
Diagnostics for ImageResizer 4.2.0 f80bfd38 at xxxxxxx generated 3/29/2019 6:49:54 PM
Please remember to provide this page when contacting support.
---------------------- Licensing OFF -----------------------
You are using a DRM-disabled version of ImageResizer. License enforcement is OFF.
DRM-enabled assemblies (if present) would see <licenses licenseError='Watermark'>
Need to change domains? Get a discounted upgrade to a floating license: https://imageresizing.net/licenses/convert
---------------------- Licensing OFF -----------------------
You are using ImageResizer Performance Edition plugins.
1 issues detected:
(Error): The FreeImage library is not available! All FreeImage plugins will be disabled.
Configuration:
<resizer>
<clientcache minutes="1440" />
<plugins>
<add name="AutoRotate" />
<add name="AzureReader2" prefix="~/cdn/" connectionString="[redacted]" endpoint="xxxxx" />
<add name="DiskCache" />
<add name="DiagnosticJsonPlugin" />
<add name="FreeImageDecoder" downloadNativeDependencies="true" />
<add name="FreeImageEncoder" downloadNativeDependencies="true" />
<add name="PrettyGifs" />
<add name="PsdReader" />
<add name="AnimatedGifs" />
<add name="Watermark" />
<add name="SimpleFilters" />
<add name="WebPEncoder" />
<add name="FFmpeg" downloadNativeDependencies="true" />
</plugins>
<watermarks>
[redacted]
</watermarks>
</resizer>
Registered plugins:
ImageResizer.Plugins.Basic.DefaultEncoder
ImageResizer.Plugins.Basic.NoCache
ImageResizer.Plugins.Basic.ClientCache
ImageResizer.Plugins.Basic.WebConfigLicenseReader
ImageResizer.Plugins.Basic.Diagnostic
ImageResizer.Plugins.Basic.MvcRoutingShimPlugin
ImageResizer.Plugins.Basic.LicenseDisplay
ImageResizer.Plugins.Basic.AutoRotate
ImageResizer.Plugins.AzureReader2.AzureReader2Plugin
ImageResizer.Plugins.LicenseVerifier.LicenseEnforcer`1[ImageResizer.Storage.BlobProviderBase]
ImageResizer.Plugins.DiskCache.DiskCache
ImageResizer.Plugins.LicenseVerifier.LicenseEnforcer`1[ImageResizer.Plugins.DiskCache.DiskCache]
ImageResizer.Plugins.DiagnosticJson.DiagnosticJsonPlugin
ImageResizer.Plugins.FreeImageDecoder.FreeImageDecoderPlugin
ImageResizer.Plugins.FreeImageEncoder.FreeImageEncoderPlugin
ImageResizer.Plugins.PrettyGifs.PrettyGifs
ImageResizer.Plugins.PsdReader.PsdReader
ImageResizer.Plugins.AnimatedGifs.AnimatedGifs
ImageResizer.Plugins.Watermark.WatermarkPlugin
ImageResizer.Plugins.LicenseVerifier.LicenseEnforcer`1[ImageResizer.Plugins.Watermark.WatermarkPlugin]
ImageResizer.Plugins.SimpleFilters.SimpleFilters
ImageResizer.Plugins.WebPEncoder.WebPEncoderPlugin
ImageResizer.Plugins.FFmpeg.FFmpegPlugin
Accepted querystring keys:
quality, format, thumbnail, diagnosticjson, usepreview, autorotate, page, frame, colors, dither, watermark, filter, s.grayscale, s.overlay, s.shift, s.sepia, s.alpha, s.brightness, s.contrast, s.saturation, s.invert, s.roundcorners, ffmpeg.seconds, ffmpeg.percent, ffmpeg.skipblankframes, maxwidth, maxheight, width, height, w, h, crop, bgcolor, rotate, flip, sourceFlip, sFlip, sRotate, borderWidth, borderColor, paddingWidth, paddingColor, useresizingpipeline, cache, process, margin, dpi, zoom
Accepted file extensions:
psd, avi, mp4, avchd, flv, fla, swf, mpg, mpeg, mpe, mov, m4v, mkv, wmv, bmp, gif, exif, png, tif, tiff, tff, jpg, jpeg, jpe, jif, jfif, jfi

Does xliff 1.2 supports custom annotations

I am working on a sample file in Xliff 1.2 but confused with annotation.As I didnot find anywhere whether it supports custom annotation or not?
Can anyone refer links for sample xliff1.2 file with annotations(if it supports any kind of annotations)
Thanks
you can read more about this in the following link:
http://docs.oasis-open.org/xliff/v1.2/cs02/xliff-core.html#note
This is an example:
<xliff version="1.2">
<file original="Graphic Example.psd"
source-language="en-US" target-language="ja-JP"
tool="Rainbow" datatype="photoshop">
<header>
<skl>
<external-file uid="3BB236513BB24732" href="Graphic Example.psd.skl"/>
</skl>
<phase-group>
<phase phase-name="extract" process-name="extraction"
tool="Rainbow" date="20010926T152258Z"
company-name="NeverLand Inc." job-id="123"
contact-name="Peter Pan" contact-email="ppan#example.com">
<note>Make sure to use the glossary I sent you yesterday.
Thanks.</note>
</phase>
</phase-group>
</header>
<body>
<trans-unit id="1" maxbytes="14">
<source xml:lang="en-US">Quetzal</source>
<target xml:lang="ja-JP">Quetzal</target>
</trans-unit>
<trans-unit id="3" maxbytes="114">
<source xml:lang="en-US">An application to manipulate and
process XLIFF documents</source>
<target xml:lang="ja-JP">XLIFF 文書を編集、または処理
するアプリケーションです。</target>
</trans-unit>
<trans-unit id="4" maxbytes="36">
<source xml:lang="en-US">XLIFF Data Manager</source>
<target xml:lang="ja-JP">XLIFF データ・マネージャ</target>
</trans-unit>
</body>
</file>
</xliff>

How to gzip static content in ASP.NET Core in a self host environment

Is there are way to serve gzip static cotent when using self host environment to publish an ASP.NET Core website?
[Edit 2016-11-13]
There is another way to serve gzipped files that replaces steps 2 and 3. It's basically quite the same idea, but there is a nuget package that does it all for you readily available. It basically checks if the is .gz or .br file that matches the requested one. If it exists it returns it with the appropriate headers. It does verify that the request has a header for the corresponding algorithm. Github code if you want to compile it yourself is here.
There is also an issue to support that in the official repository, so I really hope Microsoft will have the standard plugin to do that, since it's rather common and logical to use that nowadays.
I think I have found the most optimized way of serving the compressed content. The main idea is to pre-compress the files and since the default ASP.NET 5 way is to use gulp to build js, it is as easy to do as this:
1. Add a gulp step to gzip the bundled libraries:
gulp.task("buildApplication:js", function () {
return gulp.src(...)
...
.pipe(gzip())
...
});
This will produce something like libraries.js.gz in your bundles folder
2. Refernce the libraries.js.gz instead of libraries.js in the cshtml file
3. Amend the static file handler to fix the returned headers
We need to add Content-Encoding and change the Content-Type from default application/x-gzip to application/javascript because not all browsers are smart enough to read js properly from x-gzip
app.UseStaticFiles(new StaticFileOptions
{
OnPrepareResponse = context =>
{
if (headers.ContentType.MediaType == "application/x-gzip")
{
if (context.File.Name.EndsWith("js.gz"))
{
headers.ContentType = new MediaTypeHeaderValue("application/javascript");
}
else if (context.File.Name.EndsWith("css.gz"))
{
headers.ContentType = new MediaTypeHeaderValue("text/css");
}
context.Context.Response.Headers.Add("Content-Encoding", "gzip");
}
}
});
Now all there is no CPU cycles to waste to gzip the same content all the time and it's the best possible performance in serving the files. To improve it even further all of js has to be bunlded and minified before gzipping. Another upgrade is to set CacheControl max age in the same OnPrepareResponse to cache for one year and add asp-append-version="true" in the cshtml.
P.S. If you will host behind IIS you might need to turn off the static compression of js and css not to double compress, I am not sure how it will behave in this situation.
This is a fixed version of method 3 from Ilyas answer that works with ASP.NET Core 1 RTM, and it serves pre-zipped javascript files:
app.UseStaticFiles(new StaticFileOptions
{
OnPrepareResponse = context =>
{
IHeaderDictionary headers = context.Context.Response.Headers;
string contentType = headers["Content-Type"];
if (contentType == "application/x-gzip")
{
if (context.File.Name.EndsWith("js.gz"))
{
contentType = "application/javascript";
}
else if (context.File.Name.EndsWith("css.gz"))
{
contentType = "text/css";
}
headers.Add("Content-Encoding", "gzip");
headers["Content-Type"] = contentType;
}
}
});
#Ilya's Answer is very good but here are two alternatives if you are not using Gulp.
ASP.NET Core Response Compression Middleware
In the ASP.NET Core BasicMiddlware repository, you can find (at time of writing) a pull request (PR) for Response Compression Middleware. You can download the code and add it to you IApplicationBuilder like so (at time of writing):
public void Configure(IApplicationBuilder app)
{
app.UseResponseCompression(
new ResponseCompressionOptions()
{
MimeTypes = new string[] { "text/plain" }
});
// ...Omitted
}
IIS (Internet Information Server)
IIS (Internet Information Server) has a native static file module that is independent of the ASP.NET static file middleware components that you’ve learned about in this article. As the ASP.NET modules are run before the IIS native module, they take precedence over the IIS native module. As of ASP.NET Beta 7, the IIS host has changed so that requests that are not handled by ASP.NET will return empty 404 responses instead of allowing the IIS native modules to run. To opt into running the IIS native modules, add the following call to the end of Startup.Configure.
public void Configure(IApplicationBuilder app)
{
// ...Omitted
// Enable the IIS native module to run after the ASP.NET middleware components.
// This call should be placed at the end of your Startup.Configure method so that
// it doesn't interfere with other middleware functionality.
app.RunIISPipeline();
}
Then in your Web.config use the following settings to turn on GZIP compression (Note that I included some extra lines to compress things like .json files which are otherwise left uncompressed by IIS):
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<!-- httpCompression - GZip compress static file content. Overrides the server default which only compresses static
files over 2700 bytes. See http://zoompf.com/blog/2012/02/lose-the-wait-http-compression and
http://www.iis.net/configreference/system.webserver/httpcompression -->
<!-- minFileSizeForComp - The minimum file size to compress. -->
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files" minFileSizeForComp="1024">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
<dynamicTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<!-- Compress XML files -->
<add mimeType="application/xml" enabled="true" />
<!-- Compress JavaScript files -->
<add mimeType="application/javascript" enabled="true" />
<!-- Compress JSON files -->
<add mimeType="application/json" enabled="true" />
<!-- Compress SVG files -->
<add mimeType="image/svg+xml" enabled="true" />
<!-- Compress RSS feeds -->
<add mimeType="application/rss+xml" enabled="true" />
<!-- Compress Atom feeds -->
<add mimeType="application/atom+xml" enabled="true" />
<add mimeType="*/*" enabled="false" />
</dynamicTypes>
<staticTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="application/atom+xml" enabled="true" />
<add mimeType="application/xaml+xml" enabled="true" />
<!-- Compress ICO icon files (Note that most .ico files are uncompressed but there are some that can contain
PNG compressed images. If you are doing this, remove this line). -->
<add mimeType="image/x-icon" enabled="true" />
<!-- Compress XML files -->
<add mimeType="application/xml" enabled="true" />
<add mimeType="application/xml; charset=UTF-8" enabled="true" />
<!-- Compress JavaScript files -->
<add mimeType="application/javascript" enabled="true" />
<!-- Compress JSON files -->
<add mimeType="application/json" enabled="true" />
<!-- Compress SVG files -->
<add mimeType="image/svg+xml" enabled="true" />
<!-- Compress EOT font files -->
<add mimeType="application/vnd.ms-fontobject" enabled="true" />
<!-- Compress TTF font files - application/font-ttf will probably be the new correct MIME type. IIS still uses application/x-font-ttf. -->
<!--<add mimeType="application/font-ttf" enabled="true" />-->
<add mimeType="application/x-font-ttf" enabled="true" />
<!-- Compress OTF font files - application/font-opentype will probably be the new correct MIME type. IIS still uses font/otf. -->
<!--<add mimeType="application/font-opentype" enabled="true" />-->
<add mimeType="font/otf" enabled="true" />
<!-- Compress RSS feeds -->
<add mimeType="application/rss+xml" enabled="true" />
<add mimeType="application/rss+xml; charset=UTF-8" enabled="true" />
<add mimeType="*/*" enabled="false" />
</staticTypes>
</httpCompression>
<!-- Enable gzip and deflate HTTP compression. See http://www.iis.net/configreference/system.webserver/urlcompression
doDynamicCompression - enables or disables dynamic content compression at the site, application, or folder level.
doStaticCompression - enables or disables static content compression at the site, application, or folder level.
dynamicCompressionBeforeCache - specifies whether IIS will dynamically compress content that has not been cached.
When the dynamicCompressionBeforeCache attribute is true, IIS dynamically compresses
the response the first time a request is made and queues the content for compression.
Subsequent requests are served dynamically until the compressed response has been
added to the cache directory. Once the compressed response is added to the cache
directory, the cached response is sent to clients for subsequent requests. When
dynamicCompressionBeforeCache is false, IIS returns the uncompressed response until
the compressed response has been added to the cache directory.
Note: This is set to false in Debug mode to enable Browser Link to work when debugging.
The value is set to true in Release mode (See web.Release.config).-->
<urlCompression doDynamicCompression="true" doStaticCompression="true" dynamicCompressionBeforeCache="false" />
</system.webServer>
</configuration>
You could implement an action filter that compresses the contents of the response if the client supports it.
Here is an example from MVC5. You should be able to modify that to work with MVC 6:
http://www.erwinvandervalk.net/2015/02/enabling-gzip-compression-in-webapi-and.html

background image somehow covers up all the controls adobe flash builder 4.6

I created a skin using an image as background.
When my View imported the skin as skinClass, it covers up all the other controls.
How do i make all the controls display above the skin?
This is my Skin code called Background.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark">
<!-- host component -->
<fx:Metadata>
[HostComponent("spark.components.supportClasses.SkinnableComponent")]
</fx:Metadata>
<s:Image source="assets/Sunflower.gif" smooth="true" left="0" right="0" top="0" bottom="0">
</s:Image>
<s:states>
<s:State name="normal" />
</s:states>
</s:Skin>
This is the main view under default package
<?xml version="1.0" encoding="utf-8"?>
<s:TabbedViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" applicationDPI="160"
skinClass="BackgroundImage"
>
<s:ViewNavigator label="Add" width="100%" height="100%" firstView="views.AddView"/>
<s:ViewNavigator label="List" width="100%" height="100%" firstView="views.ListView"/>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
</s:TabbedViewNavigatorApplication>
It looks like your Z index should be adjusted for the controls.
You can change your z-index like this:
parent.setChildIndex(childObject, i)
So for example if you want your controls to always be on front you need:
myControls.parent.setChildIndex(myControls, myControls.parent.numChildren -1)
Hope this helps you, even tho it's hard to answer it without any code...

SWF behaves strangely when it is embeded in HTML

I have a SWF file and I am trying to embed it into an HTML.
I used the following code:
<object width="704" height="440">
<param name="movie" value="http://riskgames.ist.psu.edu/CyberLinkIT.swf"></param>
<embed src="http://riskgames.ist.psu.edu/CyberLinkIT.swf" type="application/x-shockwave-flash" menu="false" width="704" height="440">
</embed>
</object>
If you go to http://miaojiang.net/bug.html, you can see the problem. The button is blinking and all invisible text field are displayed.
However, if I open the swf file directly, there is no problem.
Any idea?
This is your problem.
SecurityError: Error #2149: Security sandbox violation: https://riskgames.ist.psu.edu/CyberLinkIT.swf cannot make fscommand calls to http://miaojiang.net/bug.html (allowScriptAccess is ).
at FSCommand$/_fscommand()
at global/flash.system::fscommand()
at CyberLinkIT_fla::MainTimeline/frame1()
<object width="704" height="440">
<param name="movie" value="http://riskgames.ist.psu.edu/CyberLinkIT.swf"></param>
<param name="AllowScriptAccess" value="always"></param>
<embed src="http://riskgames.ist.psu.edu/CyberLinkIT.swf" type="application/x-shockwave-flash" menu="false" width="704" height="440" AllowScriptAccess="always">
</embed>
</object>