Play music on background , Ruby on rails - ruby-on-rails

What is SIMPLE and good practice to play background music in Rails App.
It's a really simple rails website. It has several static pages.
How do I playing music on background?
thanks!
I am not looking for detailed answer or code.
I just want somebody kindly point me some links, or some keywords I can search.
I googled around and did not find what I want/ Or I didnt realize that was I need.

with HTML 5, you can now use the tag like this. You can place this on any page that you want your music to play on. (layouts/application.html.erb if you want site-wide)
<audio src="public/my_audio_file.mp3" autoplay controls loop>
<p>Your browser does not support HTML5 audio playback</p>
</audio>
This link provides further details and options
https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_HTML5_audio_and_video

Add this to the pages on which you want the sound
<embed src="path/to/background.mp3" autostart="true" loop="true" hidden="true"><embed>
Add it to the layout if you want it in all the pages

Related

Create a powerpoint video player?

Is it possible to create some sort of widget/control which is similar to a youtube video player which I will be able to control in powerpoint. I have worked with the javascript youtube player and I really need to be able to do the same in powerpoint.
I'm not quite sure if I understand your question, but if you want a controllable YouTube player in PowerPoint, this might work:
Create a website with a player and the controls you like and embed the whole website into your presentation using the method described in this tutorial.
However, I don't know if the solution will be interactive or if it's just a freeze-frame since I haven't tried myself.

Playing an MP3 throughout entire rails app

I want to show an MP3 player that the user can control while navigating the rails app. When they load new pages, the MP3 will continue playing. My first thought was to make every page load with AJAX, and have the MP3 player on the main page. So new content loads, but the MP3 player just stays in place.
Second thoughts: I would need to 'ajaxify' the whole rails app just to show the mp3 player. In addition, I suspect this is less search-engine friendly than a normal app. I would appreciate your opinions and options on this matter. Or isn't the SEO thing a problem? Thanks in advance for your help!
You can catch the changing url in JavaScript and modify the page content dynamically without actually reloading the page. A popular library function that handles this is Angular's routing capabilities.

Play a remote MOV in a UiWebView

I have a rather complex application that mostly works in a UiWebView. I would like to autoplay a MOV file from a URL full screen. My problem is that when I link to the MOV file the play icon is crossed out or video loads but does not play. Any ideas?
Are you embedding the video in html? What does your html look like?
If you're using html5 note that auto play is not permitted.
I would recommend getting things working first using a video you know if of the correct format/codec type, then when that works switch your video.
You can download a set of supported reference videos from Apples web site.
Or use this to ensure your video is of the correct format:
http://www.mirovideoconverter.com/
Also you might want to read this:
http://developer.apple.com/library/safari/#documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Introduction/Introduction.html

Can someone explain the difference between these two Youtube URLs?

Im building a site which opens Youtube videos onsite using Shadowbox.
I have found out that linking to a video this way ...
http://www.youtube.com/watch?v=wDZFf0pm0SE
..doesn't work (Shadowbox opens, video doesnt play). But linking this way...
http://www.youtube.com/v/wDZFf0pm0SE
.. does.
Can someone explain to me what is going on here?
The /v/ link is a direct link to the video, which is used for embedding it. You use it like this:
<embed src="http://www.youtube.com/v/wDZFf0pm0SE&autoplay=1" type="application/x-shockwave-flash" wmode="transparent" width="800" height="600"></embed>
However, due to licensing restrictions some videos will fail to play in the /v/ format.
The &autoplay=1 part just tells it to start the video on page-load. (Remove it to not do that).
The normal link is used to watch the video from Youtube itself.
Hope this helps.

youtube: use youtube player in website

I am not sure , But is there any way to use YouTube video player for playing .flv file , which are stored in my own server.
any idea ?
I don't think so, you can only use it to play content hosted on their site, but there are plenty of other flash players around. Flowplayer is a common one, and there are loads more if you Google.
No.
You would have to upload the files to Youtube to use their player (which you can embed)
How ever there are many Youtube-like players (which will play .flv files on your own server), for example:
flvplayer
FPlayer
BitGravity
JW FLV Player
Flowplayer
Not that I'm aware of, but there are other options available that are very very similar.
Check out the JW Player here
I don't think so.
If you don't mind targetting just cutting-edge browsers though, you could make use of the HTML5 <video> tags:
<video src="path/to/your/video">Your browser doesn't support this.</video>
I know the beta versions of FF3.5 support this, but it is a new feature that's not widely supported yet.
Otherwise, use something like FlowPlayer as suggested in other responses.
Why not just upload the video to YouTube and embed the player?

Resources