Treat remote http URLs as local ones - android

I don't know how to call it correctly and how to do it, but I will try to explain what I want to achieve.
Remote server provides URLs to mp3 files (downloadable) like so:
http://someremotehost.com/song1.mp3
I need this link to be local, for example:
http://192.168.0.20:78787/song1.mp3
So that I could send the local URL to my DLNA player, which would understand it as a local URL, though the mp3 file would be played from remote host.
One of my ideas was to setup a http server that would map somehow remote URL to local ones, possibly downloading mp3 files from remote host and providing a URL of it on hard disk. But I'm not good at such things, so I wonder what are the options and how to do it right.
It is an Android app I'm developing, so I would appreciate approaches that could easily fit within an app.
Thank you

Related

For casting local media files, do we need server to upload files

In my app i implemeted a chromecast support for casting local audio files to Android TV. I dig out on google about my query but did't get a any answers which will clear my doubt.
My dobut is for casting any local audio files do i need to create a http server and uplaoding audio files to it and then passing URL for casting to cast receiver devices. I don't think this will be the approach.
I heard somewhere that, we have to use any embedded Http library but i dont know how to use it and i have no any idea. it seems bit complicated.
Any sugesstion how can i cast my local audios.
I used xampp to host some video files locally. This way I can just use the url: http://192.168.x.x/myvideo.mp4 (x.x would be the IP your xampp is running on) to cast my own videos. Audio Files should work the same I guess.

Play a streaming url without save temporary files on device

i've created an Android application that connects to a streaming page. I'd like to know if some data will be stored on my device (like on a temporary folder or similar). This video should be only accessed by the URL so i'd like to prevent any download.
Is there a way to prevent the 'download' of the streaming data on my device? Or if it must be downloaded, can i be sure that no one can use this data if found in a temp file?
Thanks
EDIT
For the web page, i've used this code: http://codesamplez.com/programming/php-html5-video-streaming-tutorial
There is a better way? I was thinking about create an HTML5 video player and use it in my android application as a web view. As i said before, the important thing is to deny any download.

share local files (audio,video) via local http server in android

i want to share my local audio and video files inside the phone through a HTTP server by creating a link.and through that link i can access my local file any where on the network.i used this open source project this but i doesn't share video files i think because of large size.I also tried to use nano httpd server but it has same issue too.Can any one tell me any other open source server as i cant be able to find one
Jetty is the most popular one. http://www.eclipse.org/jetty/

Save File to a remote Url

first of all sorry for my english , not my main lang.
I need to export some data to a remote folder from android.
I have a file on android "file.xml" and i need to export it to a folder (under iis)
"http://192.168.x.xx/folder/fileuploaded.txt"
It seems most of the examples out there are using an upload script in php, but i need to do it only from android. Doing the opposite way (from remote url to android app) is easy with Url.openStream(), but i cannot find a working example to put back the file on the server.
Maybe im missing something, this is my first android (and java btw) app.
anyone could point me in the right direction?
Thanks!
Diego, what you are trying to achieve is not possible only from Android. You cannot put a file on the server using HTTP unless there is a receiving application running.
You can only post your binary data to the server (url) but to write it locally and make it available on the http again for download, can only be done if you have a server app. It could be created using any language PHP, JSP, ASP etc.
You cannot just upload files to server of your wish unless there is something on the server side that allows file uploads. That is usually a ASP/Perl/PHP script.
If you don't want to use such a script, then one way to do this is to run ftp on your server and upload files using that.

How to play local video files in a browser

Am looking for the way to play video inside my android browser locally. There may be two or more video's in a local page (like facebook contains video's).
Can anyone please help me out..
Without actually reading about the specifics of the Android built in browser I would safely say, you can't. Well, if you run a local html file it might work, but if you intend to have an external page from which you can play local videos it shouldn't work. I say shouldn't because in the early days of browsers some of them actually did give you access to the local file system. Javascript for example could use file://, something I used myself for image previewing before upload. But this was a major security concern and all modern browsers prevent this.
The difference is if you run a local file or a file on your own local web server. Since then, your local file system is actually part of the web servers file system and the web server can serve your local files.

Categories

Resources