I need to execute a page that contains an audio player when I click the extension I'm building. But when I click outside of it, the player stops. I need to keep it running.
I tried to use the "background" attribute on the manifest file, but I think it only works with javascript files.
Any sugestions?
You should use a background page or an event page (according to a permanent or temporary need).
http://developer.chrome.com/extensions/background_pages.html
You just have to provide a page attribute to the background property. As mentioned in the above page.
Related
I have an Oracle Apex application running on a Android device, which some specific sounds need to be played on multiples pages when a button is clicked, e.g. A notification..
The way I did it is, create the audio object on the header of the page,
var audio = new Audio('/path/Alert.mp3');
And trigger the play event when a button is clicked,
$('#btn_alert').click(function(){
audio.play();
})
This doesn't work as expected for 2 reasons,
When the button gets clicked for the first time, there always a delay before the sound gets played, seems like the page is loading the file or somehow. And from the second time onwards, the sound gets played immediately (looks like its been cached). How do I preload the audio file on a mobile device?
Is there anyway to define the audio object in global scope, so I don't have to repeat the same code on every page?
Thanks a lot
If you add and item to a Global Page - a specific type of page - it will be available on all pages in the APEX application. More here, and in the docs.
WRT to the audio, this may help. Also you might try a dynamic action on page load to load the file.
I have the following scenario,
I'm loading an iframe in a page where I have full control over,
The inside of the iframe is a webpage that embeds a flash file. I have no control over the inside of the iframe (that includes the actual flash and the webpage that embeds the flash).
I want to know if there was a GET request to download a certain image. The GET request is originated by the flash file.
Note: I can see the images that the flash loads if I click CTRL+SHIFT+I on Chrome under resources if that helps you understand how the flash movie gets the images.
Is that possible?
Directly no; you can't to this regardless of whether you own the iframe and the SWF or not. So the answer is a no, not unless you own the images being requested and you can implement some sort of server-side static resources tracker.
Or you can always decompile the swf file (which is highly discouraged).
I am working on a pop out for videos on a website I am doing some development work for. The idea is to click on a thumbnail of the video and then the video pop's off the page. Like how facebook works with their image viewer. I currently have a div tag with it's CSS display attribute set to hidden and an iframe with no src. When a user clicks on the thumbnail for the video I have JavaScript load the appropriate youtube embed link into iframe by this method:
document.getElementById('iframe-id').src = "http://www.youtube.com/embed/(videoID)";
The video is set to automatically start playing. When a user exits the popped off content the src of the iframe is then set to "" by the same method. It works fine, and the video is no longer in the iframe. The issue is with the back button.
Here is my process leading to my problem:
I click on the thumbnail and the
video pops off and starts playing.
I close the popped off content.
I press the back button.
The video I popped off previously is playing in the background. (The Problem)
Here is what I know of the process that is happening:
The page that is being viewed has two
instances created back to back in the
history of a browser. (ie I press the
back button and I am on the same page
still.. this is also when the video
starts playing in particular
browsers)
When I leave the popped off content
open and press the back button I see
just an empty iframe.
I believe my issue lies in the fact that I am changing the src to the iframe. The process of that seems to be causing the browser to load the page again and create a second instance of the same page in the history (where reloading a page does not). When the back button is pressed the page goes to the previous instance, but depending on the browser the hidden iframe is not always empty and the video is playing.
My question(s):
Can this issue be resolved with
JavaScript?
If it can't what could accomplish the task I am trying with out the issue creating two seperate instances of the same page? I was thinking AJAX might be the solution, but I don't know. I am still a little new to this all.
This can be resolved within javascript.
Additionally, AJAX has nothing to do with the problem you're having. AJAX is a mechanism for moving data around, not manipulating HTML documents.
If you just need to display a video, you don't need to use an iframe to do so. I'd suggest keeping a hidden div somewhere on the page and use that as a container for your video pop-up. When you need to display a video, insert whatever HTML you need to get it working into the div and display it when it's ready.
I have a few Flash objects in my html page, and all these Flash objects respond to mouseOver and mouseOut.
On mouseOver, the Flash objects will play a movieclip in place.
On MouseEvent.CLICK, I would like the Flash objects to make the html page create a new iFrame with embedded .mov movie file in a lightbox effect.
I can't seem to get it to work.
I have tried ExternalInterface.call(), navigatetoURL(), I have tried simulating a click event in javascript.
Essentially, I want a mouse-click that is captured in Flash to open a jquery/javascript-lightbox in an iframe.
Thanks for any suggestion.
You should be able to do this using ExternalInterface.call().
However, calls to the external API only work if you set the right value for allowScriptAccess in your HTML object/embed tags. Be sure to set allowScriptAccess="sameDomain" or allowScriptAccess="always".
Try to call a function containing a simple JavaScript alert first, so you know it's working, before you implement your functionality.
I have a big problem. I've made a simple Google Chrome plugin (based on the old Youtube Video Downloader) but I have some problems with it. The first problem is that it won't pop up a new save window on click, but opens a new page with the video in the default Chrome player. The second is, that when the user clicks right click-save, they won't get the video name but a standardized name.
Is there any way to make a file save dialog with a specified file save name?
EDIT:
The link is automatically generated based on the Youtube video link, this way:
document.getElementById('watch-description-body').innerHTML+='<button id="download-youtube-video-button" data-button-listener="" data-tooltip-timer="300" class="yt-uix-button yt-uix-tooltip" data-tooltip="Right-click and click Save Link As... to download" type="button">'+'FLV</button>' ;
So basically it ads a button to the existing page, with a specified link:
http://www.youtube.com/get_video?video_id='+video_id+'&t='+t+'=
Where video_id is the Video ID number, and t is the time the player was stopped.
1) To 'force' a download, rather than a page load you will need to deliver a Content-Disposition: attachment HTTP header.
Or you could just use the new HTML5 property download in the anchor tag of your html.
The code will look something like
<a download href="path/to/the/download/file"> Clicking on this link will force download the file</a>
It works on firefox and chrome latest version. It also seems to work IE6+