How do you make an embedded flash player open the little window telling them to update it? - html

The flash player has a little window that can be opened (similar to flash->settings) telling the user to update the player if the movie loaded is for a more recent version. How can you instruct the player to do this? ITV have managed it with their catchup-tv player.
Context: I am allowing users to copy flash into their PowerPoint presentations and would like to tell them to update their flash player if necessary. I am not embedding a web page in the power point so no JS can be run for checking etc (because I know this is not necessary).
Thanks in advance

For getting the current version of flash:
var version:String = Capabilities.version;
I don't know what ITV has done, but I don't know of any way of forcing the player to show that box, although it may do it automatically.
EDIT:
I just found a complete blog post that answers this.

There is no way to force the window to open itself. It's a user defined setting:

Have a look at the Security class. I have used it in some Flash to prompt users to increase storage limits. The panels that you can show are found in SecurityPanel. However, this may not be the way to prompt for outdated Flash version. (If you are looking to customize these panels, that is off limits.)
You can actually test the browser/Flash version in Javascript, so there really is no point in loading Flash to tell the user to upgrade Flash.

Related

Chrome: Wrong sound when changing the audio source for Audio element and MediaStreamAudioDestinationNode

I have a app where I play different code-generated sounds. I place these sounds in a AudioBufferSourceNode.
I allow the the user to choose what output device to play the sound through, so I use a MediaStreamAudioDestinationNode with its stream used as the source for an Audio Element. This way when the user chooses an audio output to play the sound to, I set the Sink Id of the Audio element to the requested audio output.
So I have AudioBufferSourceNode -> some Audio Graph (gain nodes, etc) -> MediaStreamAudioDestinationNode -> Audio element.
When I Play the first sound, it sound fine. But when I create a new source and connect it to the same MediaStreamAudioDestinationNode, the sound is played with the wrong pitch.
I created a Fiddle that shows the problem.
Is this a bug, or am I doing something wrong?
The problem was identified based on the OP Chrome Ticket.
It seems to come from the lack of sync between AudioElement and its source AudioNode (AudioBufferSourceNode, OscillatorNode, etc.) when you pause the source and play it back again.
The solution is to always call AudioElement.pause() and AudioElement.start() alongside your source stop and start.
https://jsfiddle.net/k1r7o0xj/3/
It's possible to dynamically change your graph layout by using .connect() and .disconnect(), even when audio is playing or sent through a stream (which could even be streamed over WebRTC).
I couldn't find a reference in the spec, so I'm pretty sure this is taken for granted.
For example, if you have two AudioBufferSourceNodes bufferSource1 and bufferSource2, and a MediaStreamAudioDestinationNode streamDestination:
bufferSource1.connect(streamDestination);
//do some other things here, and after some time, switch to bufferSource2:
//(streamDestination doesn't need to be explicitly specified here)
bufferSource1.disconnect(streamDestination);
bufferSource2.connect(streamDestination);
Example in action.
Edit 1:
Proper implementation:
According to the Editors Draft on the Audio Output API, it is planned/will be possible to choose a custom audio output device for the AudioContext as well (by means of new AudioContext({ sinkId: requestedSinkId });). I couldn't find any info on the progress, and even found a related discussion which the asker apparently read already. According to this and (many) other references, it doesn't seem te be an easy task, but it's planned for WA V1.
Edit:
That section has been removed from the API Draft, but you can still find it in an older version.
Current workaround:
I played around with your workaround (using a MediaStreamAudioDestinationNode and Audio object), and it seems to be related to nothing being connected. I modified my example to toggle a single buffer (similar to your example but with an AudioBufferSourceNode), and observed a similar frequency drop. However, when using a GainNode inbetween and setting it's gain.value to either 0 or 1, the frequency drops disappeared (this isn't gonna be the solution if you want to create and connect new AudioBuffers dynamically).

AS3: Recording sound as they are output/played

I understand how to record microphone input in AS3 from this doc.
Is it possible to record sound exactly as they are being output/played?
The reason is I applied some sound transform (via the global SoundMixer) to sounds that are currently playing; and I also want to record this sound data while it is being played.
I just saw this question, to clarify, I am not trying to record just all sounds on the user's computer (which is not possible). My flash app has a Youtube player in it (via their AS3 API), and it's playing some sounds. I applied transforms using SoundMixer.soundTransform, and I want to record what's being played when the user is playing it.
Thanks in advance.
Just a passing suggestion.. on my desktop it seems ABLE to record sound into Flash from a different tab playing Youtube (HTML5).. I don't know how it's doing that!!
I allow microphone here.. (none actually plugged in, and speaker out has in-ear headphones)
http://code.tutsplus.com/tutorials/create-a-useful-audio-recorder-app-in-actionscript-3--active-5836
PS: Anyone trying this must reduce Windows volume since anything above 10-20% is distorted audio into the Flash app.
And this HTML5 youtube trailer was recorded fine into the Wav file produced by Flash app above
http://www.youtube.com/watch?v=MVt32qoyhi0
So after a quick search it seems my Realtek Audio is classed as a Full-Duplex soundcard and also within its own control panel I have an option called "Multi-streaming" which is enabled/ticked. I think Full-Duplex is enough to do this though. Try options within your soundcard's own settings software. Don't know about your end-users. Some hardware will do it, some wont, there is no all-round solution outside of AIR (which makes desktop apps out of your AS3 code).

Flash Movies and ActionScript - Stop the video from working offline

I posted a question on superuser which seems to have a code related answer, so here it goes. I have a problem; I need to share videos online, but need to find a way to either completely stop, or at least make it hard for people to download them and view them online. I'm aware that if it was possible, Hollywood would have done it already, but I have an idea...
Some years ago I stumbled across a video on newgrounds.com, a site for flash animators to post their content for users to rate, feedback and comment on, a place where I spent hours downloading videos to play them at school (oh the irony...), but I remember one video was diferent. After downloading, and opening the .swf file, it stoped playback and displayed a frame that said "Sorry, this animation was made to be viewed on newgrounds.com. You can find it there anytime!". I was mad at the time, but now it gave me an idea...
Is there some way I can get the animation to check the current location/directory of the file being played, so that if it finds out it's being played from a physical computer instead of the server it was meant to be played from, it stops playback completely???
You can get the URL that the SWF is playing on (generally the page's location, if embedded in HTML) through stage.loaderInfo.url, I believe. So you can just check that against the URL of your site.
This can be fooled, though. I could set up a vhost on my machine that could probably mimic your site's address in the loaderInfo which would allow me to play it. You'd be better off using a form of DRM than this. DRM is, in general, much more difficult to crack than faking a URL.
This functionality is called "Site locking". You can google that term for more information. Here is a link to the AS3 Games Blog "Emenuelle Ferronato" with a tutorial on how to sitelock a file.
http://www.emanueleferonato.com/2008/03/10/how-to-sitelock-a-flash-movie/
The blog gives the code in AS2, so I updated it below using AS3. This code needs to have access to the stage, and you need to call "sitelock(urls_allowed)" at the point the lock check should be perforemed.
urls_allowed = ["www.emanueleferonato.com", "www.triqui.com"];
sitelock(urls_allowed);
function sitelock(urls_allowed) {
lock = true;
domain_parts = stage.loaderInfo.url.split("://");
real_domain = domain_parts[1].split("/");
domain.text = real_domain[0];
for (x in urls_allowed) {
if (urls_allowed[x] == real_domain[0]) {
lock = false;
}
}
if (lock) {
stage.alpha = 0;// make sure this function has access to the stage.
}
}

As3 Google DoubleClick Video

I'm very frustrated with Google DoubleClick's AS3 documentation. I'm not an advanced ActionScript coder and I have limited experience with streaming video, but I feel like their API is omitting a lot of information about how these classes actually work.
I'm attempting to load an FLV to play in an expanded unit. Their video component API shows how to control playback of a video, but it doesn't say anything about how to actually load an flv file through code into the component.
http://www.google.com/doubleclick/studio/docs/sdk/flash/as3/en/com_google_ads_studio_video_VideoPlayer.html
I found a controller API, but I have no idea how a "controller" works, or what it is, and the API doesn't explain anything outside of vague general information. I assume the controller needs to be somehow associated with the video player component, but there's nothing anywhere on Google that explains this in any form.
http://www.google.com/doubleclick/studio/docs/sdk/flash/as3/en/com_google_ads_studio_video_VideoController.html
So, in conclusion, what I want is simple. I want to programically load an flv file into a video component on the stage, and have it play. I feel like this is a simple thing to do. I can do this with netstream objects and regular means, but Google has explained nothing in it's API on how to achieve this in studio rich media, and I have no idea how the inner workings of it's components function. Can anyone tell me how to achieve this?
For using video in Studio, you use either the basic or advanced video player component, and component inspector to specify your video, then upload all your assets.
You can literally browse through hundreds of templates, including filtering for features like video, and choose one that best fits your needs along with documentaion here.
http://www.richmediagallery.com/resources/template-database
Basic video overview
https://support.google.com/richmedia/answer/1719810?hl=en
I could only add 2 links to my answer above
Here is the AS3 API for video
http://www.google.com/doubleclick/studio/docs/sdk/flash/as3/en/com_google_ads_studio_video_VideoPlayer.html
And the one for video player advanced
http://www.google.com/doubleclick/studio/docs/sdk/flash/as3/en/com_google_ads_studio_video_VideoPlayerAdvanced.html

AS3 Camera selection

Has anyone build a AS3 Camera-Select-algorithm, ready to use?
With MacBooks you have the problem that the build-in webcam is not rightly choosen from the webplayer.
You have to select the USP-Cam by youself from the list
DV Video
IIDC FireWire Video
USB Video Class Video
by
camera = Camera.getCamera("2");
THNX!
I found kind of a workaround here
You cant actually set the camera programatically. The best you can do is prompt the user to set it next to a video panel to show them if the camera they've chosen actually works. example here: http://www.neave.com/webcam/
to prompt them to change cameras you use:
Security.showSettings(SecurityPanel.CAMERA)
there is no event to wait for, though you can poll your video panel's bitmap data for changes and prompt the user behind the security panel when you think they've chosen the right camera.
Having done battle with this problem, I would suggest that everyone use this library.
https://github.com/cataclysmicrewind/CameraDetection/
Flash + webcam should = easy + awesome.
Unfortunately, it is pain + suffering.