Trouble finding way to determin when video is complete

here's the url to this project:
http://www.mespinach.com/picNpic/
A video starts playing when project loads.  Button ONE  pauses the video and places a smaller video over the first video.  When this second video completes I would like it to be removed and the first video resumed.  As it's currently written I have to use button Two to accomplish this task.  If someone could show me ho to determin when video is complete then I won't need to use button Two.
here's my code:
import fl.controls.ComboBox;
import fl.video.*;
import flash.filters.*;
var connection:NetConnection = new NetConnection();
var connection1:NetConnection = new NetConnection();
var stream:NetStream;
var stream1:NetStream;
var md_obj:Object = new Object();
var md_obj1:Object = new Object();
var dsObject:DropShadowFilter = new DropShadowFilter();
var bvlObject:BevelFilter = new BevelFilter();
var vidContainer:MovieClip = new MovieClip();
var vid:Video = new Video(320,240);
var vid1:Video = new Video(200,150);
var one_btn:One = new One();
var two_btn:Two = new Two();
var three_btn:Three = new Three();
one_btn.addEventListener(MouseEvent.CLICK, onOne);
two_btn.addEventListener(MouseEvent.CLICK, onTwo);
three_btn.addEventListener(MouseEvent.CLICK, onThree);
function onOne(e:MouseEvent):void {
    vid1.x = vid.x + 100;
    vid1.y = vid.y + 100;
    vid1.width = vid.width - 100;
    vid1.height = vid.height - 100;
    vidContainer.addChild(vid1);
    stream.pause();
    stream1.play("BnBshortSnd.flv");
//    stream1.addEventListener(Video.Complete, onComplete);
function onComplete():void{
    trace("I'm here!!");
    stream1.close();
    vidContainer.removeChild(vid1);
    stream.resume();
function onTwo(e:MouseEvent):void {
    stream1.close();
    vidContainer.removeChild(vid1);
    stream.resume();
function onThree(e:MouseEvent):void {
one_btn.x = stage.stageWidth * .75;
one_btn.y = 50;
two_btn.x = stage.stageWidth * .75;
two_btn.y = 75;
three_btn.x = stage.stageWidth * .75;
three_btn.y = 100;
one_btn.filters = [dsObject, bvlObject];
two_btn.filters = [dsObject, bvlObject];
three_btn.filters = [dsObject, bvlObject];
addChild(one_btn);
addChild(two_btn);
addChild(three_btn);
connection.connect(null);
connection1.connect(null);
stream = new NetStream(connection);
stream1 = new NetStream(connection1);
vid.attachNetStream(stream);
vid1.attachNetStream(stream1);
md_obj1.onMetaData = metaData;
md_obj.onMetaData = metaData;
stream.client = md_obj;
stream1.client = md_obj1;
stream.play("http://jimslounge.com/publicDomain/plan9FromOuterSpace.flv");
vidContainer.x = 25;
vidContainer.y = 25;
addChild(vidContainer);
vidContainer.addChild(vid);
    function metaData(info:Object):void {

Yeah, I tried and it doesn't work.
However, you could use polling to check the Netstream's current time against the duration you get in the metadata, and dispatch an event when appropriate. Something like this:
import flash.display.Sprite;
import flash.net.NetConnection;
import flash.net.NetStream;
import flash.events.NetStatusEvent;
import flash.media.Video;
import flash.utils.setTimeout;
import flash.events.*;
import flash.utils.Timer;
var nc:NetConnection = new NetConnection();
var ns:NetStream;
var duration:Number=0;
var vid:Video = new Video(300,300);
var obj:Object = new Object();
var videoURL:String = "test.flv";
nc.objectEncoding = 0;
nc.addEventListener(NetStatusEvent.NET_STATUS, onNCStatus);
nc.connect(null);
addChild(vid);
function onNCStatus(event:NetStatusEvent):void
switch (event.info.code)
    case "NetConnection.Connect.Success":
     ns = new NetStream(nc);
     ns.play(videoURL);
     ns.client = this;
     startPoll();
     vid.attachNetStream(ns);
     break;
var poll:Timer=null;
function startPoll()
if(poll==null){poll=new Timer(500);}
poll.addEventListener(TimerEvent.TIMER, pollHandler);
poll.start();
function stopPoll()
if(poll==null){return;}
poll.stop();
function pollHandler(event:TimerEvent)
trace(ns.time, "of", duration);
if(ns.time >= duration)
    stopPoll();
    dispatchEvent(new Event(Event.COMPLETE));
function onMetaData(info:Object):void
trace("metadata: duration=" + info.duration + " width=" + info.width + " height=" + info.height + " framerate=" + info.framerate);
// set the duration so we can check completion status
duration=info.duration;

Similar Messages

  • OSB JMS proxy.  Determine when processing is complete

    Basically, I need visibility into how many rows the JMS adapter is processing and when it is complete.
    I am doing a simple request\response proxy where the response is a second queue. Basically, it just moves messages from one queue to another.
    In our case, the source queue will be paused until a specific point in time where we resume it and let OSB process all the messages. I need to know when the process is complete. Anything I put in the pipeline is executed for each message.
    Any ideas?
    Thanks,
    Sam

    You don't have to check for every message. Why don't check once a minute or so? Alternatively, you can enqueue a special "finished" message and check for it in your proxy.
    Or you can try to describe what you need in more details. ;-)

  • Any way to know when iPhone is completely charged?

    Good afternoon.
    Just got my iPhone and it activated and ready to go!!!
    Been putting music, photos, etc. on to it, but was wondering...
    How do you know when it is completely charged? How long should you charge it initially?
    Thanks.

    Yes I do have the icon.
    I just didn't know if it said charged on the screen
    like the iPod or something like that...
    Thanks again.
    Yes, I see that the icon is green when charged, but then it is suddenly white as the phone is used. Are there supposed to be any in between indicators?

  • I can't get my Epson Stylus SX438W to work. Has anyone had trouble finding the correct model when installing the driver?

    I am having trouble completing the installation of my new Epson Stylus SX438W Wi-Fi printer. The printer is connected to my network and so is my Mac. I have put the Epson software disc in the Mac and followed the procedure to installing everything that is needed. I am stuck at a point that Epson have not been able to help with, and as advised to ask my router provider whether it does MAC filtering. It does not apparently. Then i have been advised to contact Apple. So that's where i am. The problem is that at the point where i have to add the printer to the printer list the correct model does not show in the provided list, so i hit the "more printers" tab. Not in here either. Epson have guided me through the installation of the latest driver and the prinnter still, does not show up in any lists. We have tried setting it up manually (i believe!, i am far, far from really knowing at all what i am doing). When trying to print a document from Microsoft word all that comes out is jargon on the sheets. Obviously not what i am after. I realise my description may be very unhelpful to you but i am REALLY stuck i don't know what to do now. Any help or guidance will be greatly appreciated.
    P.S. i have attached an image of the screen i have got to if that is of any help and i can get more screen shots etc. if anyone needs them!

    OK, let's try these................ 
    1 - Boot up from your install DVD and run "Repair Disk" from the Utility menu.  When done, restart back to your desktop, repair permissions and restart your computer.  Re-connect your printer. 
    2 - Download & install the Gimp drivers. Make sure the one you install is compatible w/your OS-Gutenprint 5.2.8-pre1.   Repair permissions, restart your computer & re-connect your printer when done.
    The Epson model I have, in order to get it to print wirelessly, I had to install a Gimp driver.
    3 - Check out the following KB Articles:
    Mac OS X 10.4 Help: Connecting to a network printer
    Epson Printer Drivers v2.10 OS X
    Adding a printer to your printer list in Mac OS X
    Mac OS X 10.4 Help: The printer I'm adding says "Driver not installed"
    ======================
    If still unsuccessful after trying all of the above, the problem could be your iBook or human error.  You can either call Epson & ask to speak with a Mac savy supervisor or return the printer & find another that is compatible w/your current OS.

  • Determine when a QT video has finished playing w/ javascript

    I need to determine when a video clip is finished playing so that I can trigger a function to perform other actions. I can find functions on how to monitor loading & that sort of stuff. But, I can't find a way to monitor when it's finished playing.
    The video clip will be loaded 100% first, then played without any controls (forced to play through), and then hopefully have a function to play it.
    I could always try to determine that if it's a 30 second clip that 30 seconds after it's loaded 100% to perform the action, but I'd rather just have something monitor when it's finished.
    Any suggestions?
    Thank you,
    scott

    Hi Tracy thanks for your reply!
    Yep sorry I know swfloader cant play video but what I have is
    actually a music video swf.
    Would you be able to give me a small example of how i can
    listen for that event please because I have tried listening for a
    'complete' event but it never gets fired?
    Many thanks
    Flexchief

  • I am having trouble keeping the quality of my video when exporting to my external drive.  I change the kind to "original" but when I view the video from the external drive once exported, the sound and picture are distorted.

    I am having trouble keeping the quality of my video when exporting to my external hard drive.  I have tried to export from iphoto with changing kind to "original" but when I open the video from the external drive the quality is effected.  I have also tried copying the video to my desktop and then dragging and dropping onto the drive...same problem. Any suggestions?  I would like to save everything to my external drive so that I can delete all of iphoto library and then reimport to correct a few things.

    The file sizes are identical.  In the finder I did a search for all .mov files.  Then when they came up, I went through them and named each one so that they would be easier to find.  I am a new mac user and am used to windows.  I realized later that I should not have done this....with a mac files should be named within iphoto app...not finder....When I went to open the videos in iphoto, it wouldn't allow me.  I had to go into finder, copy to desktop and reimport into iphoto.  Then the videos worked again.  However, I had the problem with the poor video quality when copied to external drive before that.  Actually the first problem I had was when I copied to ext drive...videos were copying as an image...so I learned that you have to change "kind" to original before exporting....then that problem was solved...now they are videos, not images but not of a great quality.  Skips, sound and images are not in sync...etc...

  • Is there a way to see when a plugin was last used so it could be determined if that plugin could no longer be needed?

    is there a way to tell if a plugin is no longer needed. In other words is there a way to tell when it was last used to determine if it should be deleted. for instance iphoto6,

    the 4-5th digits of the serial number indicate week of production
    ie 82327 = week 27 of the year.

  • My Ipod Video 30 GB isnt playing any songs any more, i can find them all but when i want to play one the player stops at 0:00, and i tried a reset and to formate it and so on but nohting seems to work, what can i do?

    My IPod Video 30 GB isn't playing any songs any more, i can find them all but when I want to play one the player stops at 0:00, and I tried a reset and to formatted it and so on but nothing seems to work, what can i do?

    Please helm me, has anyone got an idea?

  • I bought an iphone 5 online, its with o2 but when I went to o2 to get a sim card it did not connect according to the shop assistant, is there any way to determine if its stolen and if so is there anything i can do? HELP

    i bought an iphone 5 online, its with o2 but when I went to o2 to get a sim card it did not connect according to the shop assistant, is there any way to determine if its stolen and if so is there anything i can do? HELP

    it is dinner time but 72oz steak....whew dont know about that!  2 " of snow yesterday 60 degrees today.... gotta love the texas panhandle!

  • I shot some video on my iphone and can not find a way to upload the videos to my Mac.

    I shot some video on my iphone and can not find a way to upload the videos to my Mac. I can not find anything in the iPhone manual or in these discussions. I am sure there is an easier way than emailing each file to myself. Help!

    Connect your iPhone to your Mac and start the Image Capture app. It's in the Utilities folder which is in the Appliations folder on your Mac.

  • Using the warp tool I'm stabilizing  my video and getting rid of the edge artifacts. Analyizing is clear on how long the process will take, but when it stabilizes I only get three moving dots. I there a way to know when the process will stop? Thanks.

    I am using the warp tool to stabilize my video and get rid of the edge artifacts.  The program is very clear about how long it will take to analyze, but there is nothing about how long the stabilization will take nor when I know when it is complete.   Thanks ahead of time.

    Warp Stabilising is a two part process.
    Analysis and Stabilising.
    Both have a banner across the Program Monitor during the process ( unless you have turned that off.
    Analysis start automatically on forst application...but you can rock in there and start adjusting the parameters.
    You may need to hit "Analyse" Button again.
    You should see the number of frames and the estimated duration during this process.

  • Is there any way of storing audio- / video-elements in the browser cache in Safari in iOS?

    Hi there,
    I'm desperatly trying to find a solution for a web application that has to run on an iOS-Safari (e.g. on iPad, iPad2 and iPhone 4):
    It's a web-application I wrote some time ago which lets the user search for and listen to short music samples (MP3s, all from ~100 kB to ~1.5 MB). The audio player is Flash-based, so it doesn't work on iOS-devices at the moment and I'll have to implement an alternative either in HTML 5 or with a "direct" QuickTime-object.
    Both my HTML 5- and QuickTime-alternatives for iOS-devices work fine so far, but there's one major problem I can't find a solution to:
    Unlike Flash and most HTML 5-capable browsers on Windows Safari on my iPad 2 won't store the audiofiles in the browsercache after loading and playing them - neither with HTML 5 audio-tags nor with a QuickTime-Object. Every time I load an audio file for playback from the server (with JavaScript-Commands, so without changing or reloading the whole page) it's downloaded again completely.
    If a user listens to sample A and then to sample B, Safari forgot about having played sample A and downloads the whole MP3 again if I like to listen to it again. On a mobile device with a potentially narrow bandwith this behaviour is out of the question.
    Is there a way of storing downloaded audiofiles opened by HTML 5 or QuickTime in Safari's cache so it remembers already having downloaded them  -  like it caches usual "web-files" like HTML, CSS or JPEG-images, or like Flash stores such objects in its local cache?
    The Application Cache with a manifest-file is not an option - this only seems to work if the browser is offline, for example if the iOS-device is in "Airplane"-Mode.

    Yes, I watched it. It contains interesting stuff I have to admit I didn't know yet, but unfortunately I still can't find a solution to my problem:
    My first attempt was trying to use the Application Cache with a manifest file - although this is not really the intended purpose for my application... I don't have a static set of files that I want to have cached or "available offline"  -  I just want to cache MP3s which the user has played yet.
    It should be possible to use a "dynamic manifest": One that is parsed by the Apache PHP module and listing the files played so far from a PHP session - something like this:
    <?php
    session_start();
    header("Content-Type: text/cache-manifest, charset=UTF-8");
    echo "CACHE MANIFEST\n";
    foreach($_SESSION['playedSongs'] as $song)
        echo $song."\n";
    ?>
    So whenever a song is loaded / played, I could access the PHP session with AJAX, insert the filename of the played file and manually update the manifest by calling window.applicationCache.update().
    There are two problems with this:
    First of all: It doesn't work. And I didn't even get to the point of trying to use a dynamic manifest:
    <!DOCTYPE html>   
    <html manifest="cache.manifest">
        <head>
            <title>Test</title>
            <script type="text/javascript">
            function playStuff(id)
                if(id == 1)
                    window.document.getElementById("audio").innerHTML = '<audio controls preload="automatic" autobuffer><source src="song01.mp3" type="audio/mp3" /></audio>';
                else if(id == 2)
                    window.document.getElementById("audio").innerHTML = '<audio controls preload="automatic" autobuffer><source src="song02.mp3" type="audio/mp3" /></audio>';
            </script>
        </head>
        <body>
            <div id="audio"></div><br />
            <br />
            <input type="button" value="playStuff(1)" onclick="playStuff(1)" />
            <input type="button" value="playStuff(2)" onclick="playStuff(2)" />
        </body>
    </html>
    The cache.manifest looks like this:
    CACHE MANIFEST
    song01.mp3
    song02.mp3
    and is properly returned from Apache as "text/cache-manifest" by adding
    AddType text/cache-manifest manifest
    to the .htaccess of this directory.
    The Apache-logs clearly show that the Safari (respectively "AppleCoreMedia") doesn't care about the application cache when it comes to audio-files:
    Safari itself seems to acknowledge the manifest and indeed preload the files:
    192.168.0.40 - - [23/Jul/2011:12:45:46 +0200] "GET /websql/index2.html HTTP/1.1" 200 2619 "-" "Mozilla/5.0 (iPad; U; CPU OS 4_3_3 like Mac OS X; de-de) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5"
    192.168.0.40 - - [23/Jul/2011:12:45:46 +0200] "GET /websql/cache.manifest HTTP/1.1" 200 79 "-" "Mozilla/5.0 (iPad; U; CPU OS 4_3_3 like Mac OS X; de-de) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5"
    192.168.0.40 - - [23/Jul/2011:12:45:46 +0200] "GET /websql/cache.manifest?%3E HTTP/1.1" 200 79 "-" "Mozilla/5.0 (iPad; U; CPU OS 4_3_3 like Mac OS X; de-de) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5"
    192.168.0.40 - - [23/Jul/2011:12:45:46 +0200] "GET /websql/song02.mp3 HTTP/1.1" 200 120525 "-" "Mozilla/5.0 (iPad; U; CPU OS 4_3_3 like Mac OS X; de-de) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5"
    192.168.0.40 - - [23/Jul/2011:12:45:46 +0200] "GET /websql/song01.mp3 HTTP/1.1" 200 120525 "-" "Mozilla/5.0 (iPad; U; CPU OS 4_3_3 like Mac OS X; de-de) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5"
    Up to this point I did nothing but opening my test-application in Safari.
    Playing song01.mp3:
    192.168.0.40 - - [23/Jul/2011:12:47:25 +0200] "GET /websql/song01.mp3 HTTP/1.1" 206 2 "-" "AppleCoreMedia/1.0.0.8J2 (iPad; U; CPU OS 4_3_3 like Mac OS X; de_de)"
    192.168.0.40 - - [23/Jul/2011:12:47:25 +0200] "GET /websql/song01.mp3 HTTP/1.1" 206 120525 "-" "AppleCoreMedia/1.0.0.8J2 (iPad; U; CPU OS 4_3_3 like Mac OS X; de_de)"
    192.168.0.40 - - [23/Jul/2011:12:47:25 +0200] "GET /websql/song01.mp3 HTTP/1.1" 206 120525 "-" "AppleCoreMedia/1.0.0.8J2 (iPad; U; CPU OS 4_3_3 like Mac OS X; de_de)"
    192.168.0.40 - - [23/Jul/2011:12:47:25 +0200] "GET /websql/song01.mp3 HTTP/1.1" 304 - "-" "AppleCoreMedia/1.0.0.8J2 (iPad; U; CPU OS 4_3_3 like Mac OS X; de_de)"
    192.168.0.40 - - [23/Jul/2011:12:47:25 +0200] "GET /websql/song01.mp3 HTTP/1.1" 206 120525 "-" "AppleCoreMedia/1.0.0.8J2 (iPad; U; CPU OS 4_3_3 like Mac OS X; de_de)"
    192.168.0.40 - - [23/Jul/2011:12:47:29 +0200] "GET /websql/song01.mp3 HTTP/1.1" 304 - "-" "AppleCoreMedia/1.0.0.8J2 (iPad; U; CPU OS 4_3_3 like Mac OS X; de_de)"
    192.168.0.40 - - [23/Jul/2011:12:47:29 +0200] "GET /websql/song01.mp3 HTTP/1.1" 206 120525 "-" "AppleCoreMedia/1.0.0.8J2 (iPad; U; CPU OS 4_3_3 like Mac OS X; de_de)"
    Playing song2.mp3:
    192.168.0.40 - - [23/Jul/2011:12:48:04 +0200] "GET /websql/song02.mp3 HTTP/1.1" 206 2 "-" "AppleCoreMedia/1.0.0.8J2 (iPad; U; CPU OS 4_3_3 like Mac OS X; de_de)"
    192.168.0.40 - - [23/Jul/2011:12:48:04 +0200] "GET /websql/song02.mp3 HTTP/1.1" 206 120525 "-" "AppleCoreMedia/1.0.0.8J2 (iPad; U; CPU OS 4_3_3 like Mac OS X; de_de)"
    192.168.0.40 - - [23/Jul/2011:12:48:04 +0200] "GET /websql/song02.mp3 HTTP/1.1" 206 120525 "-" "AppleCoreMedia/1.0.0.8J2 (iPad; U; CPU OS 4_3_3 like Mac OS X; de_de)"
    192.168.0.40 - - [23/Jul/2011:12:48:04 +0200] "GET /websql/song02.mp3 HTTP/1.1" 304 - "-" "AppleCoreMedia/1.0.0.8J2 (iPad; U; CPU OS 4_3_3 like Mac OS X; de_de)"
    192.168.0.40 - - [23/Jul/2011:12:48:04 +0200] "GET /websql/song02.mp3 HTTP/1.1" 206 120525 "-" "AppleCoreMedia/1.0.0.8J2 (iPad; U; CPU OS 4_3_3 like Mac OS X; de_de)"
    192.168.0.40 - - [23/Jul/2011:12:48:05 +0200] "GET /websql/song02.mp3 HTTP/1.1" 304 - "-" "AppleCoreMedia/1.0.0.8J2 (iPad; U; CPU OS 4_3_3 like Mac OS X; de_de)"
    192.168.0.40 - - [23/Jul/2011:12:48:05 +0200] "GET /websql/song02.mp3 HTTP/1.1" 206 120525 "-" "AppleCoreMedia/1.0.0.8J2 (iPad; U; CPU OS 4_3_3 like Mac OS X; de_de)"
    Playing song1.mp3 again:
    192.168.0.40 - - [23/Jul/2011:12:48:38 +0200] "GET /websql/song01.mp3 HTTP/1.1" 304 - "-" "AppleCoreMedia/1.0.0.8J2 (iPad; U; CPU OS 4_3_3 like Mac OS X; de_de)"
    192.168.0.40 - - [23/Jul/2011:12:48:38 +0200] "GET /websql/song01.mp3 HTTP/1.1" 206 120525 "-" "AppleCoreMedia/1.0.0.8J2 (iPad; U; CPU OS 4_3_3 like Mac OS X; de_de)"
    192.168.0.40 - - [23/Jul/2011:12:48:38 +0200] "GET /websql/song01.mp3 HTTP/1.1" 206 120525 "-" "AppleCoreMedia/1.0.0.8J2 (iPad; U; CPU OS 4_3_3 like Mac OS X; de_de)"
    192.168.0.40 - - [23/Jul/2011:12:48:38 +0200] "GET /websql/song01.mp3 HTTP/1.1" 304 - "-" "AppleCoreMedia/1.0.0.8J2 (iPad; U; CPU OS 4_3_3 like Mac OS X; de_de)"
    192.168.0.40 - - [23/Jul/2011:12:48:38 +0200] "GET /websql/song01.mp3 HTTP/1.1" 206 120525 "-" "AppleCoreMedia/1.0.0.8J2 (iPad; U; CPU OS 4_3_3 like Mac OS X; de_de)"
    192.168.0.40 - - [23/Jul/2011:12:48:40 +0200] "GET /websql/song01.mp3 HTTP/1.1" 304 - "-" "AppleCoreMedia/1.0.0.8J2 (iPad; U; CPU OS 4_3_3 like Mac OS X; de_de)"
    192.168.0.40 - - [23/Jul/2011:12:48:40 +0200] "GET /websql/song01.mp3 HTTP/1.1" 206 120525 "-" "AppleCoreMedia/1.0.0.8J2 (iPad; U; CPU OS 4_3_3 like Mac OS X; de_de)"
    Playing song2.mp3 again:
    192.168.0.40 - - [23/Jul/2011:12:49:12 +0200] "GET /websql/song02.mp3 HTTP/1.1" 304 - "-" "AppleCoreMedia/1.0.0.8J2 (iPad; U; CPU OS 4_3_3 like Mac OS X; de_de)"
    192.168.0.40 - - [23/Jul/2011:12:49:12 +0200] "GET /websql/song02.mp3 HTTP/1.1" 206 120525 "-" "AppleCoreMedia/1.0.0.8J2 (iPad; U; CPU OS 4_3_3 like Mac OS X; de_de)"
    192.168.0.40 - - [23/Jul/2011:12:49:12 +0200] "GET /websql/song02.mp3 HTTP/1.1" 206 120525 "-" "AppleCoreMedia/1.0.0.8J2 (iPad; U; CPU OS 4_3_3 like Mac OS X; de_de)"
    192.168.0.40 - - [23/Jul/2011:12:49:12 +0200] "GET /websql/song02.mp3 HTTP/1.1" 304 - "-" "AppleCoreMedia/1.0.0.8J2 (iPad; U; CPU OS 4_3_3 like Mac OS X; de_de)"
    192.168.0.40 - - [23/Jul/2011:12:49:12 +0200] "GET /websql/song02.mp3 HTTP/1.1" 206 120525 "-" "AppleCoreMedia/1.0.0.8J2 (iPad; U; CPU OS 4_3_3 like Mac OS X; de_de)"
    192.168.0.40 - - [23/Jul/2011:12:49:13 +0200] "GET /websql/song02.mp3 HTTP/1.1" 304 - "-" "AppleCoreMedia/1.0.0.8J2 (iPad; U; CPU OS 4_3_3 like Mac OS X; de_de)"
    192.168.0.40 - - [23/Jul/2011:12:49:13 +0200] "GET /websql/song02.mp3 HTTP/1.1" 206 120525 "-" "AppleCoreMedia/1.0.0.8J2 (iPad; U; CPU OS 4_3_3 like Mac OS X; de_de)"
    Every file is downloaded again completely when playing it. So "AppleCoreMedia" (whatever this may be exactly, the QuickTime-plugin that is triggered by the HTML 5 audio-element I suppose?) either doesn't have access to the Application Cache or simply just doesn't realize the files in it. So if I switch my iPad to "Airplane Mode" now, the Safari is unable to access / load / play the files.
    I also tried using a QuickTime-object instead of an HTML 5 audio-tag (as far as I know HTML 5 audio and video in Safari always use QuickTime?) and controlling it with something like:
    document.movie1.SetURL('song02.mp3');
    Nothing changes, it's just like using HTML 5 audio and everything gets downloaded again when loading/playing it.
    And even if this would work there'd still be a problem:
    To properly implement that I would have to load the MP3-file in the Application Cache before playing it. When doing this it seems impossible to show a "real" progress: The ProgressEvent that is fired from the Application Cache after updating it doesn't seem to provide any information about data loaded so far and the complete size of a file. It's just "File 1 from 2" and so on, and not a "real" progress where I could determine something like: "100 kB of 1.2 MB loaded" as I can with the audio-element.
    All the other storage-approaches like Web SQL / Web Database or Local Storage are no help either:
    I don't see any way of getting the MP3 data into Local Storage or Web Database or getting it out again to play it. The HTML 5 Canvas-element has a toDataURL()-function to produce a Base64-encoded representation and use it for storage  -  the Audio-element doesn't seem to have anything like this.
    My last really "dirty" approach was trying to load "manually" Base64-encoded-MP3s with a combination of AJAX and PHP: A PHP-script outputs a Base64-representation of a MP3-file and is loaded by AJAX, so I could store the Base64-representation e.g. as Local Storage or in Web Database:
    <?php
    $infile = 'song01.mp3';
    $contents = file_get_contents($infile);
    $base64 = base64_encode($contents);
    $audio = 'data:audio/mp3;base64,'.$base64.'';
    echo $audio;
    ?>
    I tried using the resulting AJAX responseText as the source-argument in an audio-source-tag. Suprise: It doesn't work in Safari on my iPad 2, the player just fails to load the "file", although this works fine in Chrome on Windows. Possibly a size limitation for Base64-URIs on Safari / iOS.
    And again: Even if this was working in iOS/Safari I don't know of a way to determine a real progress from an AJAX-query...
    The last thing I could think of is not replacing the audio- or source-tags when loading a song but leaving them in the DOM-structure, check if it's already there when a song is loaded and just add a new audio-tag if a song hasn't been loaded yet.
    This solution would be my last resort: I'd have to rewrite nearly the whole application to completely operate on JavaScript / AJAX to stay on one site in the browser - else the "cached" audio data would be lost again when changing to another site in Safari.
    Furthermore I think there'll be a small cache limit somewhere when doing this?
    Any ideas?

  • Is there a way to determine exactly where a breakpoint occurs?

    Hello everyone:  I am having trouble getting my head around this problem I am having, so I'm hoping someone here has run into something like this and has a tip for me.
    I have a PXI-7354 that I am using to control a rotary stage which has an 8000 lpr encoder, and a 10:1 reduction gear, so I have 80,000 lpr effectively.
    I am using the 7354 to generate a Breakpoint Pulse every 100 encoder counts, so I should be getting 800 pulses per revolution.  (I use the breakpoint pulses to trigger a second device and aPXIe-5122 data acquisition card to synchronize the production and acquisition of a data record.)
    However, and here's the problem:
    When I rotate 1 revolution, I see 799 pulses
    When I rotate 2 revolutions, I see 1598 pulses
    When I rotate 3 revolutions, I see 2397 pulses
    etc. 
    I am losing 1 pulse per revolution. I haven't figured this out yet, as I am using periodic breakpoints with a whole number of breakpoints as a period.
    THe problem is that I "count" the number of breakpoint pulses that I get in order to derive the angular position where the breakpoint occurs.  For instance, if I start at 0 degrees, and I have 0.45 degree spacing between breakpoints, after 10 pulses, I should be at 4.05 degrees.  After 100 pulses, I should be at  44.55 degrees.
    As I am missing one count per rev, however, my derived angular position is incorrect.
    I need a way to determine the actual position of each breakpoint.  The most obvious way to do this is to use the HS capture functionality of the board, and I could (further) share the breakpoint pulse with the HS Capture input on the motion card to do HS capture, but is there any way to do this internally on the 7354?
    Thanks for looking at this, any help is appreciated.
    Wes
    Wes Ramm, Cyth UK
    CLD, CPLI
    Solved!
    Go to Solution.

    Thanks for your response, Matt.
    I have already got the BP signal going to my external device via a UMI-7774, so this is not a problem.  The tricky part of this question is whether there is an easy way to "share" the BP information with the HS Capture INPUT line so that I can grab a HS position when the BPs are generated, so that I'd have a buffer of ACTUAL position, rather than relying on the BPs being in the correct location (and DERIVING the instantaneous position of the BPs by counting the BPs).  It seems that it is NOT possible to share the signal by routing the BP1 Out simultaneously to the external UMI 7774 pin AND to either the HS Capture INPUT OR to my data acquisition card.  I know that I can route my encoder signal and other things to my DAQ card, but this won't help me in this case.  Furthermore, I can only have 1 BP per axis, so it isn't possible to replicate that functionality on a second BP generator.
    I am working on setting up a third device to count the pulses generated by the 7354 when I exercise the stage through motion, so I'll have more data later today.
    I'll post here any findings.
    Thanks again,
    Wes
    Wes Ramm, Cyth UK
    CLD, CPLI

  • HT4009 I'm in Subscription **** on the iPad.  Is there an App or faster way to determine current Magazine subscriptions?

    How can I easily be sure I don't already have a magazine subscription or a single issue in Newsstand (or Zinio) when confronted with a purchase option. Is there an App or faster way to determine this information?  Both Newsstand and Zenio have seen fit to "hide" this data deep in another App or menu, perhaps as a marketing tool to get you to buy multiple copies of the same magazine.  I travel for a living and buy and delete digital magazine all the time.  Sometimes, I buy them and am unable to download immediately due to slow WiFi or restrictions in airports, this adds to the confusion as what I have bought, deleted, or never downloaded, especially with multiple readers.  Additionally, the App store manages current subscriptions on one menu and single purchases in another.    I love reading on the new iPad, but the management of subscriptions has been an absolute nightmare.   Is there another Newstand App that is easier to use or perhaps a Subscription Management App?     

    Take a look here:
    http://support.apple.com/kb/HT4098
    Other than looking in the various locations or doing a search for the title, I don't know of any way to easily find single-issue purchases.
    Regards.

  • Determine Which Video is Playing in iAd Producer

    Hi,
    Can someone help me how to check what video is playing on my iAd creative? I'm working on a multi video creative banner and I would like to call an analytics code depending on which video is playing. I have a carousel object that controls which video to play. The thing is, the analytic tracking should be called when the video reaches 25%, 50% and 75% of its duration.
    I'm finding ways to execute this through the CODE WINDOW and not within the Inspector or Action Lists panels.
    Thanks!
    Mark

    The code window is where you would hook in your own calls. Otherwise, you could check the boxes in the Analytics window for the default events.  Be sure that you've discussed getting this type of reporting with whomever is running your ad since video quartiles may not be part of the standard reporting roll-up.
    -Mark

Maybe you are looking for

  • Can you get games/ringtones on the iphone?

    can you get games and ringtones on iphone? there are many companies promising games or ringtones on the iphone. they tell you to enter your phone number and pay a fee to get them. should we trust them?

  • Lost all my apps after I did a system restore on my replacement I phone 4

    Hi, I got my I phone stolen and got a replacement phone, I did a system restore and everything came over except for all my apps.  What can I do?  Yes I did back up my phone prior to it being stolen.  I did remember seeing all my apps on my itunes at

  • Function of Pin 20 in cFP Backplane

    Hello: I'd like to know what is the function of the Pin 20 of the connector for the Connector Block in a Compact FieldPoint Backplane.  Accidentally we broke it, but I'd like to know what the pin is for. Thanks in advance! Robst - CLD Using LabVIEW s

  • Dynamically changing DISPLAY on Linux

    Hi, :. I've got a Java Daemon program that listens for incoming requests. How on earth do I manage to show a graphic interface, dialogs, etc. for each client that has, obviously, a different value in DISPLAY variable? Many Thanks. Roque

  • Transactional Session JMS Adapter

    Hi, i'm using a JMS sender and receiver adapter. Everything works but i can't understand if it'could be better to use a Transactional Session in Jms setting. I've found a lot of documentation about jms adapter configuration, but not so much informati