Html5 video in Safari - Django - django

I'm trying to make a video cross-browser. I have encoded the video with the required codecs etc. When run through the Django server, both Chrome and Firefox show their respective video (Chrome displays the .mp4, and Firefox the .ogv). However Safari can not display the video. I know it is not an encoding problem because when I just open the raw html file and manually move the same video to the right directory, the video loads up just fine. And it's not a referencing error because the mp4 file is being played just fine in Chrome when running the Django development server.
I'm not sure what code I could give, because no errors are being thrown, even in the terminal the request for the video is a green HTTP 200, it just doesn't display. Are there any known errors with deploying videos from django?
I tried hardcoding urls, putting the video in static rather than media, but nothing works.
Versions: Latest of everything.
Edit: I have quicktime installed, which seems to be a the cause of this problem too.
If I right click on the empty video pane and click download video, it downloads the playable mp4 video.
If I copy the video path from the safari video and paste in chrome, the mp4 video plays fine in chrome. And still plays fine in Safari when the raw html is linked to the video.
I am adding the videos into my django uploaded media file through admin, could this be why? (Not sure why it would be given it's just Safari that's not working)
After playing around for a bit I got this error:
OSError: [Errno 41] Protocol wrong type for socket
[27/Mar/2016 05:04:01] "GET /media/media/uploads/SampleVideo25.mp4 HTTP/1.1" 500 59
Another edit:
After seeing many people say that it is just the django development server I deployed my site to Heroku. The same thing occurs. It works in Chrome and Firefox but not in Safari, and when checking the logs it just says it retrieved the video with a Http 200 status.
The only other option I could try is serving the videos through AWS3

This is a common issue for the development server. There are quite a few issues on Django project regarding this one, but I think the following describes the best why it is not addressed:
if we are adding runserver support for something that's not even supported by what I think is a fairly common web server, that seems like it will only encourage more people to use runserver in production.
Relevant issue #22479 but as mentioned above you can find many similar issues that are or could be related to your problem.
You can try to serve video from an outside url during your development, this should be a workaround. At least this is what I have done in the past.

For whatever reason, the video shows just fine when called from the AWS3.

Related

How to fix the error: 'This XML file does not appear to have any style information associated with it'

I hosted a small django project on virtual machine on digital ocean. Before I started using digital ocean to serve static files everything worked fine. But immediately I created a storage space and push my static files there the static files are not being served on the webpage, including django admin page (the project pages are showing net::ERR_ABORTED 403 (Forbidden). I have already installed django_storages and boto3.
I got some hint as to the possible cause of the problem when I clicked on digital ocean aws bucket url that looks like https://django-space-storage.nyc3.digitaloceanspaces.com. When I cliked on it I got the following error:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
It seems the browser is rendering my django pages as xml instead of html. I might be wrong with this assumption because I'm finding a hard time trying to understand what is actually going on. My question is, how do I cause the browser to render my django pages as html instead of xml?

How to wait long enough for Django views results on Firefox?

I'm developing a website with Django 2.2, using :
Centos 7
Mozilla Firefox 60.6.0
Google Chrome 73.0.3683.86
Docker and Docker compose
The first page allows the user to submit data from a formatted file (equivalent to csv) and the second page shows the result of calculations (done row by row) in a datatable.
I have noticed a difference between Mozilla Firefox and Google Chrome:
For big files, on Chrome, the web browser waits long enough to receive and display the results of calculations. Whereas in Firefox, the web browser stops waiting for localhost and the "results" page is not loaded.
As the problem occured when the file exceeded a certain size, I have guessed that the app spent too much calculating time and Firefox stopped waiting for the response before to load the "results" page.
So I changed my view to accelerate calculations. The problem still persists with big files. With files from approximately 3.5Mo the results page os displayed or not (almost randomly).
I tried to raise "dom.max_script_run_time" in my Mozilla settings but this can't be done programatically.
I saw that Celery can be used for long time running calculations, but in my case, calculations can be performed on 1 or 3000 rows. I would like to find a solution without using Celery.
Another solution could be to use JavaScript to set a timeout when Firefox is detected as web browser, the to add a error message, I also would like to avoid this.
I expect my app to work well at least on Mozilla Firefox, Safari, Opera and Google Chrome Web browsers.
Thanks for your help !

Vimeo API returns inconsistent CDN URL

We're using the Vimeo API for a client to play 3 different 360 videos through Android and iOS apps - in some cases we had to make some exceptions in our app to work around special characters in the URL that were causing problems with our player - so we have some code to tidy up the final video URL.
This worked fine, at first, but now it seems as if the Vimeo API is returning different URLs for 2 out of 3 of our videos. Videos from fpdl.vimeocdn.com work fine. They all used this domain when we first created the app. But two of our videos changed to gcs-vimeo.akamaized.net and have a different syntax.
Is this something we can't control? Will the CDN targets change often? Will all 3 of our videos eventually change to the new URL? Before we go back and adjust code again - I need to evaluate if we should just use a different player instead, if this will happen frequently.
Vimeo uses different CDNs to host video files, and those CDNs should not matter to the viewer/enduser.
When getting the direct video file links (either using the API or from the video's Settings page), those links are HTTP 302 redirect links to the actual video file resource. The location of that resource changes every few hours, so always make sure you use the redirect URL provided, and make sure the player being used supports redirects.

Cannot select Image File using djangocms-filer

I hope someone can help out with this one. I have been using djangocms to build a simple frontend centric website for a client so they can maintain their own content. There is nothing fancy in this setup. Just a few template.html files, a little css and djangocms to pull it all together. There are no other forms, models, views or anything at this stage. Just pure djangocms.
Originally I was working with django 1.8.6 and the image picker seemed to work fine. I could upload my files and next to each one there is a selector icon which works and all was great. See below image. This was using cmsplugin-filer.
Then I tried to upgrade the website to Django version 1.11.13 and I started to run into this problem. The file select that you see above is no longer available to the user. I have spent days working on this and in my travels I found that apparently cmsplugin-filer is now deprecated. So I removed it and switched to the recommended djangocms-filer install thinking that might solve my problem...but no. After many many hours of head scratching I figured it must be something in my project throwing things out, so I have done a 100% clean install using the prescribed djangocms-installer. Other than connecting it to a postgresql database, it is a completely vanilla installation, and yet it still does not work. All I get is the image below. A simple tick box but no way of selecting the image nor anyway of saving what I have selected. Uploading files is fine and I can create folders and images upload into them perfectly fine.
Below is a snapshot of my pip freeze showing everything installed in my virtualenv and the associated versions.
My settings file is almost 100% standard so I don't understand why I can't get this to work. Note: If, when I am adding the plugin to my template, I don't select the Choose File Button but simply drag an image into the grey rectangle, it all works fine. My file gets uploaded into the unsorted uploads folder and the image is selected into my template all in one go, but using the choose file route, where I have more control over my files and how they are stored, doesn't.
Does anyone have any idea what I might be missing please?
UPDATE:
Django CMS overrides some static files and there are some old ones in your browser cache. You need to clear your caches or open the page using incognito window.

CF10 developer on IIS7.5 / WIN7 - CFM files run ok - but can't see .GIFs

Can anyone help with this strange problem.
I have just installed CF10 developer on Win7 which is using IIS7.5.
Installation went smooth, and can browse .cfm files no problem and connect to datasources no problem .. BUT: even though I can browse all my local cf sites, none of the sites will display images or styles for external .CSS files.
So, I get the site, content from the database, and all the functionality of cfm files being parsed OK, but no styles and no images.
If I browse directly (pasting the filepath in the browser) to one of the images I get a 404 error - file not found - even though the .gif file does indeed exist in the directory.
So, basically, I can run CFM files, and browse a local site built in coldfusion, but none of the images or externally referenced css files will be "found" by the browser/IIS.
Can anyone help?
Thanks in advance if someone can..
Sounds like an issue with those mimetypes, please see the following for information on installing the static content role to IIS and enabling those mimetypes to be served.
No Mime Types Option in IIS 7
Be sure to enable static content in IIS 7.
Had two occurrences of this problem lately.
See here:
http://weblogs.asp.net/anasghanem/archive/2008/05/23/don-t-forget-to-check-quot-static-content-service-quot-in-iis7-installation.aspx
Try restarting the IIS server. Close all browsers and restart.
You need to determine if it is a CF issue or an IIS issue. Try the following:
Check to see if this is an issue with images not being served vs broken paths to the images. There may be CFML code that is creating links to invalid locations.
If the locations are valid then it would be an issue with IIS not server image files.
Also check to see if there is a similar issue with JPEG and PNG files. If JPEGs and PNGs show up, this suggests an IIS issue.
Also try creating a simple HTML page that has an image on it. If it has an image on it, this suggests a CF issue