how to play mp3 in a web page - javascript

I'm going to play MP3 in my ASP.NET web app (VS 2008), I want user to have a nice GUI for play/pause/stop and selecting different musics. Is there any way to start playing music automatically at site start up? Of course music should not be restarted after a new page is being loaded, is there any way I can control music via server side code?
thanks, I've tested many players but I think I need more sources

Music media can be played using HTML5 or Flash. These are front-end technologies. You can, of course, 'fetch' urls and files using back-end asp.net code.
There are a few javascript libraries out there that will determine if a user has an HTML5 browser and if not, use Flash as a backup.
One of them I like to use is called jPlayer, for jQuery.
http://jplayer.org/

You can use this Server Control or you cane check these resources

Related

Linux/PHP/JS: How to play mp3 music on the server with a browser script?

I would like to have the following setup:
A Raspberry-Pi (Pi) with a "public" music directory (-web site), which is linked to my stereo amplifier from about 1986. OS is Raspbian.
Now I have my laptop and open the music directory web site on 192.168.0.X . I press a button and THE SERVER plays the music over the amplifier.
I have all set up except the button for the server play. The music directory is on the same machine like the sound output. I can play each file on the client with standard html5, no problem. But I want it played on the server.
Is there a PHP/JS/AJAX way to do such thing? Maybe some shell command executed with php? Also, can I stop/pause the music or start a new one in the middle of the old one, and how?
Does the functionality need to be so basic? Easy solution would be calling like shell_exec or something but.. You're on a pi and there's a few other decent solutions, check out Mopidy, https://www.mopidy.com/, this will allow you to control all the music on the pi and play it on any device you have connected. I use it myself along with https://github.com/jaedb/iris gives me a nice frontend to control all my local music on the pi and also Spotify.
If you still need to control from your own webpage on the server, you can still use mopidy and control it via it's Api.

How to disable video/audio downloading in web pages?

I have a website that I put my videos/audios on it.
I use HTML5 and tag to show videos.
But videos/audios can be downloaded if client opens view source page and then copy the file address.
How can I disable downloading these files, I just want client to see videos/hear audios in the web page.
Many online video/audio services like Youtube disabled downloading videos by this way. How they did that? What is a working way to disable, or at least make this progress much harder?
Youtube encodes their video into the MPEG-DASH format, which plays back through byte streams via the browser's implementation of the Media Source Extensions API. See See more on Wikipedia.
You can do the same by encoding your video into MPEG-DASH files, then playing it back in your code through a library like dash.js. Watch how the dash.js player works live by checking out the DASH Reference Client.
I've encoded MPEG-DASH video using Sorenson Squeeze, but there are other encoders you could use.
And just to clarify... this will make downloading more difficult... but will NOT provide a real DRM solution. For that you need to check out EME.
MPEG-DASH seems like a nice solution but is definitely not perfect. There are many ways to bypass this and still being able to download the video. On the other hand putting a lot of effort in protection might not be worth it since people can always make screen recordings etc.
But if you still want to go for a more secure option you can try using
Encrypted Media Extensions i.e. with Amazon s3 cloud.

How can I stream music from SoundCloud in a node-webkit app using JavaScript?

I am trying to use the hosted SoundCloud JS SDK in a node-webkit desktop app.
It seems like a lot of links in the API use //... instead of http://... and node-webkit gets confused because of this. It tries to find the resource at file://... I want to be able to stream music into a custom player using the SDK's streaming features.
How can I do one of these:
Trick node-webkit into looking at http:// instead of file://
Use JavaScript to stream music without the SDK into my own player with JavaScript
Should I just download and edit the SDK and include it in the app?
I would really love to use the SDK because it makes my life simpler.
Hmm, yeah I guess this was never thought of at the time. Personally, I'd go with 'forking' and specifying the urls (I'd also choose 'https').

Is javascript the only way for DOM and flash plugins to "talk"?

I've often seen that whenever flash plugins need to transfer data to the page (which is outside the flash plugin), javascript would be used as the intermediary.
I was wondering are there other solutions? i.e. is it possible for the page to "talk" to the plugin and viceversa while javascript is disabled on the client side ?
If javascript is disabled there could be communication between Flash and PHP. If there is no Javascript turned on there couldn't be real-time communication between the Flash and the page. For example: If you have a video site the client would request certain video. This means that javascript should determine which video is requested and then the server should deliver it. So in my opinion Javascript is very necessary in many cases concerning Flash plugins. I know many video sites excluding youtube where you can't watch a video without Javascript turned on.
yes, Javascript is the only way out here.

Play mms:// streams on my site

I'm building a "channel chooser" for a set of mms:// streams (Microsoft Media Server): a simple web GUI that lets the user chose which channel to listen to. For reference, here is the list of streams I'd like to use. I would like users to be able to play those streams on my site with a simple "play/stop" control. Nothing fancy.
How should I attack this? Any ideas or pointers appreciated! New angles and hacks around the problem too.
Javascript or Flash players are of course preferable, but I haven't been able to find any player that plays mms:// streams. My back-end language is Django if that helps anyone get any ideas.
MMS will require the user to have Windows Media Player installed. I believe you can embed mms:// content directly in an HTML page using <object> and/or <embed> tags and if it's installed, the WMP browser plugin will play the content.
Here's an Embedded Media HTML Generator; enter your mms:// url here and use the generated HTML in your video player page template.

Categories