Got '206 Partial Content' Status on requesting webm videos from my server - macos

I'm using XAMPP server on my MAC.
I've created a page which has a video tag on it ! (i'm using video.js framework)
The video file doesn't play, When i check it on firebug (the plugin on firefox) ,the GET operation returns '206 Partial Content' status for that file.
How can i make it work ?
Thank you for your time

The answer of longilong works great. I just want to explain how to add mime-types which i wasn't know until i had some googling.
1- create a text file named '.htaccess' in the directory of your site (the path where your pages exists)
the htaccess file is just a apache configuration file which override the main apache configurations for just that path which it resides
2- add these lines to your new .htaccess file:
# Audio
AddType audio/ogg oga ogg
AddType audio/mp4 m4a
# Video
AddType video/ogg ogv
AddType video/mp4 mp4 m4v
AddType video/webm webm

as far as i know, WebM is supported in Firefox 4+. This error also could occur, if your server is not well configured. for example if the mime-types are not added. check this post here: Playing a movie/DVD on a website .hope it helps

Related

How can I avoid "Zip end of central directory signature not found (Zip::Error)" with rubyzip?

I'm reading a lot of zip file with rubyzip.
However this error message is always showing in only specific file even it is zip file.
/app/vendor/bundle/ruby/2.3.0/gems/rubyzip-1.2.1/lib/zip/central_directory.rb:143:in `get_e_o_c_d': Zip end of central directory signature not found (Zip::Error)
I guess this error occures in rubyzip.
How can I manage this error?
Here is my code.
url = 'http://example.zip'
zipfilename = open(url)
Zip::File.open(zipfilename, :allow_redirections => :all) do |zip_file|
entry = zip_file.glob("*ixbrl.htm").first
stream = entry.get_input_stream.read
puts stream
end
Thank you!
I faced this error when I try to extract data from a uploaded .xlsx file in my application. On my context, the .xlsx file was corrupted, so my solution was save the content (I usually handle the buffer file after the upload) as a csv file (in my application I dont need to worry about the file extension), fixing the content by force it to encode as utf-8, and extract it's data after it. here is a example of the code, I'm using roo-xls gem to handle .xls files and roo gem to handle .csv and .xlsx files.
I ran into the same error. Also only reproducible on Heroku. The error was fixed after I added an unzip buildpack (second, after Ruby).
https://github.com/davidlibrera/heroku-buildpack-unzip
If you're using a google docs xlsx file try checking if the access of the sheet link is public.

nReco.Video Converter ffMpeg Error

I am using Nreco Video Converter for take video thumbnail on my MVC project. App is working correctly on local but it shows error on live host
Error is
Access to the path 'C:\Inetpub\vhosts********\httpdocs\bin\ffmpeg.exe' is denied.
I did search this file in my code and host bin folder but I can't found. NReco's site says
Simple and easy to use video conversion .NET library: all you need is one assembly (FFMpeg is embedded)
There is no ffmpeg.exe file in local and host bin folder or anywhere.
How can i fix this?
Thanks.
VideoConverter is a .net wrapper for ffmpeg tool (I'm an author of this library) and ffmpeg.exe is extracted into app bin folder (default location) on first use. On your live host asp.net process cannot write to app bin folder; this may be fixed by specifying another location, for example:
var ffmpeg = new FFMpegConverter();
ffmpeg.FFMpegToolPath = System.Web.HttpContext.Current.Server.MapPath("~/App_Data");

How to stream MP4 files from subdirectories with Flowplayer?

I am using Wowza Media Server to enable streaming of MP4 files and as video player I use Flowplayer.
To get some structure for my content I use sub directories within the configured StorageDir for my Wowza application.
The problem I have is that no matter what URL-format I use, Wowza keep looking for the file in the root storage directory.
I've tried using the URL format specified by Wowza here, but with no luck:
rtmp://[wowza-ip-address]/myapp/_definst_/mp4:mysubdirectory/sample.mp4
I also tried everything suggested in posts on the Wowza forum:
https://www.wowza.com/community/questions/327/mp4-streaming-from-application-sub-directory.html
https://www.wowza.com/community/questions/215/subfolders-in-application-content-folder.html
But Wowza keeps looking in the root storage directory, throwing exceptions like these:
404 b0c9be70-a33c-41ce-9692-199e3a1caccf.mp4
open: java.io.FileNotFoundException:
C:\Program Files (x86)\Wowza Media Systems\Wowza Media Server 3.6.2\content\b0c9be70-a33c-41ce-9692-199e3a1caccf.mp4.flv
(The system cannot find the file specified)
Somehow Wowza thinks it should look for an FLV file in the root storage directory, even though the URL specify that it is an MP4 file in a subdirectory. Why is that?
After spending hours looking into this, I finally found this post on the Wowza forum.
The problem:
Apparently there is an issue with some flash-based video players (like Flowplayer that I use), that accept a single string for the RTMP connection and stream name. Some of these players do not separate the RTMP connection and stream name properly when using sub directories.
When breaking this URL apart:
rtmp://[wowza-address]:1935/vod/_definst_/mp4:subfolder/sample.mp4
The player will use this as the RTMP connection:
rtmp://[wowza-address]:1935/vod/_definst_/mp4:subfolder
The player will then try to play sample.mp4 instead of subfolder/sample.mp4 which will fail.
The solution:
To remedy this problem, there is a plugin for Wowza that fixes the URL, available for download here:
http://www.wowzamedia.com/downloads/forums/collection/WowzaServerAddOnCollection.zip
Unzip the package and copy the JAR file into your Wowza /libs directory, then add this to your /conf/[app-name]/Application.xml configuration file:
<Module>
<Name>ModuleFixStreamPath</Name>
<Description>ModuleFixStreamPath</Description>
<Class>com.wowza.wms.plugin.collection.module.ModuleFixStreamPath</Class>
</Module>
Doing so got it all working for me!
I fix this problem by creating symlinks using PHP code before output video component template
$relativeVideoLink = str_replace("/", "__", $videoFileRelativePath);
if (!file_exists($wowzaDir . $relativeVideoLink)) {
symlink($wowzaDir . $videoFileRelativePath, $wowzaDir . $relativeVideoLink);
}
After creating symlink i put it to tag
<video src="http://00.00.00.00:1935/vod/mp4:<?=$relativeVideoLink?>/manifest.mpd"></video>

Error uploading big extensions to joomla on a localhost

I get the following error when I tried uploading the Akeeba Backup extension on my localhost: "There was an error uploading this file to the server."
I tried uploading JCE Editor and it worked fine. I understand this error appears because I cannot upload extensions bigger than X MB (JCE is 1,5MB and Akeeba is 2,25MB). So my guess is I cannot upload extensions bigger than 2MB.
Researching I came across two solutions, neither worked for me.
First solution:
In the file ini.php find the following line upload_max_filesize = xM and replace "x" with a value of 10 (for example). I could not find the above mentioned line in the ini.php file.
Second solution:
In your .htaccess add the following:
php_value max_upload_size 10M
added the code, nothing happened.
I am using Joomla 3.2
Rather than trying to manually find the correct line to edit, in your code editor, use Ctrl + F which will open up the "find" box. Copy and paste upload_max_filesize and click "find". This will take you to the exact line where it is located. Once changed, save the file and restart Apache/All services on your localhost.

HTML 5 Cache manifest gets cached itself

I have a problem of that it seems that the cache.manifest file gets cached itself. Meaning every changes to the file are not being noted by (Mobile) Safari, so it will never update and always show the last cached files.
I tried to avoid it using an .htaccess file in the same directory as the cache.manifest file:
ExpiresActive On
ExpiresDefault "access"
That didn't help so I changed cache.manifest in a php file that contains the following headers:
header("Expires: Mon, 26 Jul 1990 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header('Content-Type: text/cache-manifest');
Anyone have other ideas of how I can make sure the cache file itself will get retrieved if possible?
Works on: Safari (Desktop), Chrome (Samsung Galaxy Tab v10.1), Firefox
Fails on: Chrome, Safari (iOS)
Renamed the cache.manifest.php back to cache.manifest and added the following lines to the .htaccess
<IfModule mod_expires.c>
Header set Cache-Control "public"
ExpiresActive on
# cache.manifest needs re-requests in FF 3.6 (thx Remy ~Introducing HTML5)
ExpiresByType text/cache-manifest "access plus 0 seconds"
</IfModule>
If I change the revision comment within the cache.manifest and refresh it on Safari (iOS) it still shows me the old file. I am clueless.
According to the HTML5 documentation, if an application cache manifest file is byte-for-byte the same as a previous one, regardless of HTTP cache headers for expiry/etc, it is considered to not require an update.
At the bottom of your cache manifest file, you need to include a comment at the bottom of the file with the timestamp of the most recently modified file, e.g.:
# last modified: Thu, 30 Jun 2011 01:19:46 GMT
This will break up the byte-for-byte identicalness, even if the list of files remains the same but a few are updated.
As alluded to in other answers, cache manifests are a real pain to deal with.
I've tweaked a PHP manifest "build" script for my HTML5 notepad app.
Tested and working on Chrome, Firefox, IE8+, Android and iOS.
It's open source and available here: https://github.com/JasonHanley/note5/blob/master/build.php
I also use the ExpiresByType text/cache-manifest "access plus 0 seconds" in my .htaccess and I believe that is necessary in addition to generated manifest timestamps.
I've just stumbled onto this one myself, and in a similar vein to SimpleCoders suggestion I'd suggest that if you are using Apache you can generate the cache.manifest using Server Side Includes, eg:
CACHE MANIFEST
# <!--#flastmod file="index.html"-->
# <!--#flastmod file="whatever.js"-->
# <!--#flastmod file="whatever.css"-->
whatever.js
whatever.css
That way, whenever any of those files are updated, the manifest will change automatically. You may also need to enable includes for that file and disable caching, eg: Apache config something like:
Alias /whatever /var/www/whatever
<Directory /var/www/whatever>
Options +Includes
AddHandler server-parsed .manifest
</Directory>
CacheDisable /whatever/ihealth.manifest
Check your server logs to make sure you're returning the file with a "200 Okay" rather than a "304 Not Modified".
The cache manifest is a terrible piece of technology.
The browser is not caching the manifest; instead, it's just failing to recognize that it has changed which is what you are observing. Try adding a random comment or two to your manifest (prepend comments with #) and then see if it works.
Just modifying files that the manifest references won't trigger the browser to redownload the manifest. If this is what you were hoping for, then try this: Use a PHP file to generate your manifest. Of course, use header to set the proper MIME type. After you have echoed out all of your resources, echo out the hash of the timestamp of all of those resources. That way, if one of them is modified, the manifest file changes. This is what I'm using:
// Collect a list of resources we need to check (customize to your needs)
$files = array(
"/scripts/script1.js",
"/scripts/script2.js",
"/scripts/script3.js",
"/scripts/script4.js",
"/css/style.css"
);
$filetime = 0;
foreach ($files as $file) {
$filetime += filemtime($file);
}
// This echoes out the hash of the filetimes as a comment
echo "#" . sha1($filetime);

Resources