where to copy media files to test widevine on chromcast - casting

I have to test playback of DASH Content on Cast device with custom receiver app.
Where should i copy my custom media files?
I have tested coping in drive and drop box but not playing.
Getting Error like Media Element State :"Stalled"
Media Player State :"underflow:true"
first I am getting Media Host State: "Success"
After few minutes "Fatal Error:code =3"

You need to use a server that supports, among other things, CORS headers. For testing purposes, it can be a simple apache server, for example. In production, you need to have SSL certs signed by a valid authority.

Related

Ant media server invalidate token while fetching VOD chunks

I have the ant media server VOD embedded on a different domain. While playing the stream it works fine for the first chunk request, but as soon as you click anywhere on the seek bar and it tries to fetch the required chunk, the one-time token invalidates.
There is a case conflict that I'm not able to understand.
If I play the stream directly in the browser, it works fine every time, which means it is a valid token and works when you request chunks from anywhere in the stream.
If I set the publish token to false in settings, everything works fine in the embedded page, which means it is not a Cors issue as well.
I'm wondering what could be the issue that can lead to such kind of conflict.
Are you trying to play with a non-https page? Ant Media Server one-time token system checks session IDs. If you trying to play with a non-https page, each request can get a different session ID. You need to use HTTPS in your system. Could you please try with HTTPS page?

Rendering images from REST response on localhost

I am trying to run a REST API on one port (8000) using django and consuming that API in an App running on port 9000 again using django.
My REST response is having an image field, now the problem is that i can not provide my desktop path in upload_to option in my API models and if i am giving the absolute path of API project in my App project index. Html, i get a browser error as "Not allowed to load resources from local path"
So i am having to create media folders with same name in both API and App projects and keeping image files in both and using only the file path from the REST response and rendering the image from App project itself.
Is there any way i can get away with this and consume the image from the Rest response only?
You need to convert image to base64 in server side then send those base64 string as response . Then consume this base64 string as response in calling api. Then use it accordingly either save in filesysyem or in database . But make sure to converse base 64 image string to bytes.

Django url port forwarding

I have set up a page in django which currently streams a video from another server on xxxx port.
Everything works fine except that one customer has a firewall and for x reason he can not modify it and the firewall is blocking the port where the video is streamed.
I was wondering if there is any way where i can serve the streaming url as one of my project url.
For example:
The streaming url: http://streamingurl.com:9999/video
My url: http://project.com/video
What i want is with my project to serve the streaming url with my url.
Is this possible with django? :)
This is not really a Django issue, but here are a number of possible options to pursue:
Have your customer contact their network administrator and see if an exception rule can be made for the firewall to allow the streaming video across this particular port from this website.
Look into using a web proxy that supports video streaming to get around the firewall rule if it cannot be changed.
See if there is an option to embed the video into your website that uses a different port.
Contact "streamingurl.com" and see if there is an alternative port that can be used to stream the video - some websites have an alternative even if it is not actively advertised.

Serving protected static media from django/nginx + streaming from a 3rd party app

We want to serve protected media from django, using something similar to the django nginx x-accel-redirect setup.
The only problem is that the static files are not located on the public facing django/nginx machine, but in a internal machine that streams the file via http/rest api.
Currently we download the file on the nginx machine and serve it via nginx x-accel-redirect, but we want to optimize this part and looking for options. x-accel-redirect has known problems with files that are streamed from another source.
We are contemplating using django itself as a quasi buffer, but are open to other options as integrating something like whizzer/twisted, or maybe even having another service altogether.
What would be the best option for serving those static files and preserving security?
Use: http://www.allbuttonspressed.com/projects/django-filetransfers
Make your own Django storage backend for the internal machine's http/rest api, that returns
a File object, and pass that object to filetransfer's server_file function.
That's how I do it in Mayan EDMS https://github.com/rosarior/mayan/blob/master/apps/documents/views.py#L300
django-storages' backends could help you get started.
https://bitbucket.org/david/django-storages/wiki/Home
Update:
Django_resto appears to have an http based storage class
https://github.com/aaugustin/django-resto/blob/master/django_resto/storage.py#L62
I had success doing something similar using django-http-proxy. This assumes that the image server is at least as reliable as the django server.
Then in my urls, I simply mapped the url to the http proxy view, something like:
(r'^protected/.*$', 'httpproxy.views.proxy'),
Then configured PROXY_FORMAT accordingly.
Implement a simple one-shot signature system in the media machine, using any very thin (django is OK, as it does not need to get to the database) code layer, and x-accel-redirect in nginx.
In the auth machines, generate the correct signature only when the user is allowed to get the resource, and return a 302 to the signed media.
The signature could be time-based, expiring in a fraction of a second, so a sniffer can't use the URL again.
You could use lighttpd to handle the streaming. It has a nice module to protect resources with signatures: http://redmine.lighttpd.net/wiki/1/Docs:ModSecDownload
So I'm thinking you could have nginx just proxy to the streaming server (that's lighttpd).
It's pretty easy to cook up the signature, here's a python example: init.py#cl-27">https://bitbucket.org/ionelmc/django-secdownload-storage/src/be9b18701015/secdownload_storage/init.py#cl-27

Issue with Incorrect URLs in the WSDL of a .NET Web Service

We have installed an ASP.NET web site on a client's server. This site has a web service with a couple of web methods that are called by a Flash object in order to display a news feed. If you browse to their site (ex: www.domain.com), everything's working fine except the flash.
The issue is that when we browse to the .asmx, the header shows that the Host is a subdomain internal to their network (internal.domain.com). Obviously this doesn't resolve to any public IP when browsing from outside of their network. This causes the Flash to fail since the flash object is embedded on a page and is therefore running client side.
I checked the computer name on the server in question, and it doesn't even match "internal.domain.com" - it is something completely different. Where is it getting this information from. It is not coming from IIS, since we have no host headers set up, and the IP for the site is set to (all unassigned).
We either need to force the web service to run against a specific host, or we need to change something on the server so that it resolves to a valid public-facing host name. Any and all help is greatly appreciated!!!!
The solution is to add a host header for www.domain.com
More details here
While you probably did this already, it's always a good first step:
Do a global Find in the source code of both the Flash object and the web service for the string in question.
It sounds like someone may have configured/coded the internal.domain.com string into the Flash object's request. (Host: is a HTTP Request header, not Response header, IIRC.)
Does the Flash object get the web service URL from the C# code? If so, it might be getting the default web service URL that you choose when adding a Web Reference to your project in VS. Therefore it might be pointing to a URL locally to the developer's machine/server which is not recognized on the live server.