How to play a playlist on Firefox OS? - audio-player

How can I play my playlist (m3u, pls) on Firefox OS?
If those formats aren't support, are there any other formats or workarounds to have your own playlists (instead of only albums and the predefined ones, like highest rated)?

The <audio> and <video> elements provide support for playing audio and video media in firefox-os, but the W3C HTML5 specification does not support playlist file formats.
However, you can create your own media player or use any existing media player libraries.
Remember, .m3u and .pls are plain text formats. You can request your playlist files with the Device Storage API or by ajax from within your apps root folder for further parsing.
See Firefox OS Media formats (MDN)

Related

Flask API for uploading a video

I like to write an api that accept from the user a video via a post command. Any body can let me know how can I use Flask-Uploads for extensions mp4 or other video extensions?
The version of Flask-Uploaded on PyPi is broken since February 2020.
You can use the drop in replacement: https://pypi.org/project/Flask-Reuploaded/
When you want a file extension, which is not contained in a pre-defined set, you just can create your own one.
e.g.
VIDEOS = tuple("mp4 mov")
and then configure Flask-Reuploaded as described in the documentation, i.e
videos = UploadSet('videos', VIDEOS)
If you do not want to use Flask-Reuploaded, there is a very good blog post by Miguel Grinberg explaining all the details - without using an upload extension:
https://blog.miguelgrinberg.com/post/handling-file-uploads-with-flask

How to restrict certain media types from being uploaded to custom media library folder in Sitecore 8 Content editor

i would to create two differents custom media folder templates in the Sitecore 8 media gallery:
Images Folder
Videos Folder
When clicking the upload files button, the first will accept only images, the second will be accept only videos. Which is the best way to do this?
There is a market place module for that, it's called Media Library Policeman.
Does exactly what you need.
You can download it here: https://marketplace.sitecore.net/en/Modules/Media_Library_Policeman.aspx

Cast image to ChromeCast

I am looking for an example of casting an image to a chrome cast from a url. There doesn't seem to be an image cast example in the google cast sample repositories but i feel this must have been done before.
I have little experience with the chrome cast sdk developer console as well as the development of the apps themselves so any information would be greatly appreciated.
I suggest you look at the CastHelloText-android (or ios) sample on out github repo. What you need to do is to use either a custom reeiver (say, start from the one used in CastHelloText) and add an image html tag and then use the cutom namespace data channel to send the url of your image to your receiver and set that as the source of your image tag. Alternatively, you can use a Styled (or the Default) receiver which supports showing images; create a MediaInfo from your image and just send load it like a video and that should work. Note that your image should be served from an accesisble web server.

Uploading videos and document

I am a freshman using ruby-on-rails, I want to build a website that provides users tutor videos. The problem is how can I upload a video or document on my webpage using ruby-on rails, my strategy is to save a link for that video or document in the data base so when I open a page contains a video or document it will upload automatically.
I am using Postgresql 9.3
Thanks.
Tyry using paperclip gem
It will be easier, you can look into this link
https://devcenter.heroku.com/articles/paperclip-s3

audio streaming server

I'm a php developer, trying to develop a website to stream on-demand music to the users.
After a lot of googling I'm confused about which kind of server or tools should I use? I've seen some like WOWZA or SHOUTCAST, but I don't know which one is the best for my needs.
I want to provide high quality audio files. So maybe I should use 320kbps mp3 format or something else but with the same quality.
I don't need live streaming. I just need on-demand streaming of the music files and the ability for the user to create his/her own playlists.
The user shouldn't be able to download the music files.
Icecast/SHOUTcast are not appropriate for your use. They take a single stream and send it to multiple connections simultaneously. They are not "on-demand" servers where each user can listen to separate content.
For your use case, you can implement something in PHP. All you are really doing is sending media files to the client. You mentioned that you wanted to keep the client from downloading those files... this is impossible. If the client can play it, the client can save it, and there is no way around this. However, there are some things you can do that prevent it from being as easy as linking to a file.
Don't store your audio in the web server's document root. All media files should be served only from your PHP scripts. This gives you control over the requests coming in. Look into readfile(). This also allows you an easy path to get off of simply loading files from disk (which you will want when you start to grow beyond 100k media files).
A URL for a media file should only work once, and for a specific user session ID. Generate these URLs on the fly, with a time limit on them. If the URL for the media file is requested by someone who doesn't have a valid session on your site, don't serve it. If the link is expired, don't serve it. This is what prevents someone from getting the URL and posting it on some message board. Only valid users of your site with current valid sessions should be able to get at your media files.
Rate-limit requests. Don't allow a user to be able to download more files at a time than is needed. If they request 100 files in 1 second, don't serve them.
Implementing all of these concepts is something I leave to you. How you do so depends your needs, and is not something that is typically done in a 5-line snippet of code.