NetStream doesn't play mp4 packaged with app - but plays same file over http

I'm using StageVideo to play an h264 encoded mp4 file in an iPhone app.
When I package the mp4 file with the app (in the root), the app doesn't play the video at all. When I simply change the video's location to a http location where the exact same file is located, it plays fine.
In other words, the only change I'm making is:
Packaging mp4 in root of app:
var _videoURL:String = "video_h264.mp4" ;
_nc = new NetConnection ( ) ;
_nc.connect ( null ) ;
_ns = new NetStream ( _nc ) ;
_ns.client = this ;
_ns.play ( _videoURL ) ;
_stageVideo.attachNetStream ( _ns ) ;
to
Hosting video remotely:
var _videoURL:String = "http://www.myDomain.dk/video_h264.mp4" ;
_nc = new NetConnection ( ) ;
_nc.connect ( null ) ;
_ns = new NetStream ( _nc ) ;
_ns.client = this ;
_ns.play ( _videoURL ) ;
_stageVideo.attachNetStream ( _ns ) ;
Does anyone know if there's some restriction when using NetStream that could explain this?

You can get away with just the relative path. But, do make sure you added the folder with the videos in the General tab.
Another thing to know, you may not get a StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, that may have already happened before you start looking for it. In case like that you can get remote videos to work, and local videos will sometimes work. Seems to be  amateur of timing.
The way I worked around that issue was to check the stagevideos before listening for the event. Like this:
if ( stage.stageVideos.length >= 1 ) {
  enableStageVideo();
}else{
  stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, _onStageVideoAvailability);
That seems reliable. enableStageVideo is just a function to set up the stageVideo variable, and its viewPort.

Similar Messages

  • NetStream doesn't play mp4 packaged with app

    I'm using StageVideo to play an h264 encoded mp4 file in an iPhone app. When I package the mp4 file with the app (in the root), the app doesn't play the video at all. When I simply change the video's location to a http location where the exact same file is located, it plays fine.
    In other words, the only change I'm making is:
    Packaging mp4 in root of app:
    var _videoURL:String = "video_h264.mp4" ;
    _nc = new NetConnection ( ) ;
    _nc.connect ( null ) ;
    _ns = new NetStream ( _nc ) ;
    _ns.client = this ;
    _ns.play ( _videoURL ) ;
    _stageVideo.attachNetStream ( _ns ) ;
    to
    Hosting video remotely:
    var _videoURL:String = "http://www.myDomain.dk/video_h264.mp4" ;
    _nc = new NetConnection ( ) ;
    _nc.connect ( null ) ;
    _ns = new NetStream ( _nc ) ;
    _ns.client = this ;
    _ns.play ( _videoURL ) ;
    _stageVideo.attachNetStream ( _ns ) ;
    Does anyone know if there's some restriction when using NetStream that could explain this?

    You can get away with just the relative path. But, do make sure you added the folder with the videos in the General tab.
    Another thing to know, you may not get a StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, that may have already happened before you start looking for it. In case like that you can get remote videos to work, and local videos will sometimes work. Seems to be  amateur of timing.
    The way I worked around that issue was to check the stagevideos before listening for the event. Like this:
    if ( stage.stageVideos.length >= 1 ) {
      enableStageVideo();
    }else{
      stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, _onStageVideoAvailability);
    That seems reliable. enableStageVideo is just a function to set up the stageVideo variable, and its viewPort.

  • TS1424 Songs availble with album purchase only show downloaded with album but play will not play past the first few seconds of the song.  Solution???

    Purchased entire album.  Songs available only with album purchase show completed download with album, but play only a short demo of song (both PC and iPod).  This is my first iTunes purchase so I likely missed a step.  Is this a user of iStore error?  Solution(s)?

    If your country's iTunes Store allows you to redownload purchased tracks, I'd delete your current copies of the dodgy tracks and try redownloading fresh copies. For instructions, see the following document:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    Otherwise, I'd report the problem to the iTunes Store.
    Log in to the Store. Click on "Account" in your Quick Links. When you're in your Account information screen, go down to Purchase History and click "See all".
    Find the items that are not playing properly. If you can't see "Report a Problem" next to the items, click the "Report a problem" button. Now click the "Report a Problem" links next to the items.

  • HT1926 Quicktime stuttering, MOV file plays fine on my iphone but play it in my PC the sound and video stutters. happened only after the last update. how to fix

    Quicktime stuttering, MOV file plays fine on my iphone but play it in my PC the sound and video stutters. happened only after the last update. how to fix?

    Hi Richmoller51,
    Welcome to Apple Support Communities.
    See this article for some troubleshooting steps that can help with video playback in iTunes or Quicktime:
    Troubleshooting iTunes for Windows Vista or Windows 7 video playback performance issues
    http://support.apple.com/kb/ts1718
    Best,
    Jeremy

  • When I purchased ringtones for my texts and two of them dont play when someone texts me,but plays when they call

    When I purchased ringtones for my texts and two of them dont play when someone texts me,but plays when they call

    Hi Kel134,
    Welcome to the Apple Support Communities!
    I understand that you are having microphone issues on your iPhone when you place a call to someone and they cannot hear you unless you activate the speaker function. In this situation I would recommend the steps in the following article to help isolate and resolve the situation. 
    iPhone: Microphone issues
    http://support.apple.com/kb/ts5183
    Resolve the issue
    Follow these steps, testing after each.
    Make sure nothing is plugged in to the jack connector.
    Make sure nothing is blocking any of the microphones (refer to the pictures below to find your device's microphones). Check for these:
    Dirt or debris
    A screen protector or case
    When you're holding your phone next to your ear, make sure you don't block the microphone with your fingers or shoulder and make sure to speak into the microphone
    Turn the iPhone off and then on.
    Update to the latest version of iOS.
    If necessary, find general iPhone hardware troubleshooting suggestions.
    For further assistance, contact Apple Support.
    I hope this helps,   
    -Joe

  • Play an audio file over HTTP

    Hello everybody,
    I'm trying to play an audio file over HTTP protocol. The code is the following:
    public class HTTPClientJMF {
         static String url = "http://localhost/audio/Reklam1.wav";
         static String urlFile = "file:///C://tmp/audio/Reklam1.wav";
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              try {
                   DataSource dataS = new URLDataSource(new URL(url));
                   dataS.connect();               
                   Player player = Manager.createPlayer(dataS);
                   player.start();
              } catch (MalformedURLException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (NoPlayerException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    }Now, if I'm trying to play the file from the local disk (+urlFile+ - using file protocol), everything goes well, but if I'm trying to play the same file from the network (using http protocol) I get the following exception:
    javax.media.NoPlayerException: Cannot find a Player for: javax.media.protocol.URLDataSource@fa9cf
    Can somebody tell me what I'm doing wrong?
    Thank you!

    Ah',..okay. I constructed the DataSource like follows:
    Buffer mediaBuffer = new Buffer();;
              String mediaURL = "http://ares.inescn.pt/video/Reklam1.wav";
              URL url;
              try {
                   url = new URL(mediaURL );
                   InputStream in = url.openStream();
                   BufferedInputStream bufIn = new BufferedInputStream(in);
                   for (;;) {
                        int data = bufIn.read();
                        // Check for EOF
                        if (data == -1)
                             break;
                        else
                             mediaBuffer.setData(data);
                   System.out.println(mediaBuffer.getLength());
                   if (mediaBuffer.getLength() != 0) {
                        DataSource ds = new DataSource();
                        HttpStream[] httpStream = ds.getStreams();
                        System.out.println(httpStream.length);
                        httpStream[0].read(mediaBuffer);
                        ds.connect();
                        ds.start();                         
                        Player player = Manager.createPlayer(ds);
                        player.start();But I still cannot play an audio file (wav format) over the HTTP. Application starts but nothing happened.
    I make the modification like you suggested. (into the DataSource, more exactly for method getStreams()).
    I renamed as well the HttpDatasource into HttpStream.
    Did you actually tried the code? I've been reading the instruction how to test the code but I did not be able to run the example.

  • Itunes plays purchased HD videos fine, but constantly stalls while trying to play home created videos converted to the same file format and bit rate?

    Itunes plays purchased HD videos fine, but constantly stalls while trying to play home created videos converted to the same file format and bit rate.
    System specs
    Win 7pro x64
    ATI 5830
    Phenom x6 1055t
    8gigs ram
    1tb 7200rpm sata hdd
    500 gig 5400 rpm sata hdd

    Itunes plays purchased HD videos fine, but constantly stalls while trying to play home created videos converted to the same file format and bit rate.
    System specs
    Win 7pro x64
    ATI 5830
    Phenom x6 1055t
    8gigs ram
    1tb 7200rpm sata hdd
    500 gig 5400 rpm sata hdd

  • I downloaded Vtok to my new iTouch but half my contacts are random letters and numbers and there are no profile pictures.  I tried reinstalling the app but the same thing happened.  Any suggestions?

    I downloaded Vtok to my new iPod touch but half the contacts came up as random letters and numbers and there are no profile pictures.  I tried reinstalling the app but the same thing happened.  Any suggestions?

    Go to the developer's support site.
    iOS: Troubleshooting applications purchased from the App Store

  • HTML5 quiz project plays if published with CP8, but not CP7

    I have a project that only consists of a title page and quiz questions that is published to HTML5 with CP7.  It plays fine on an iPad, but will not load on a desktop browser like IE and Chrome; the wheel spins for a second and then just a blank page.
    What's funny is that I just tried publishing the same project with the trial version of CP8 and now the project plays fine from my LMS.  What's even more bizarre is that I have other project files that are a mix of regular pages and quiz questions, and they play fine in HTML5 on the iPad and desktop, all published with CP7; it's just this one project file that consists of quiz questions that's causing problems.
    Any clues on how to get the project running in HTML5 on desktop when publishing with CP7?

    Sounds to me like you need to reinstall your FTP program instead.
    If the exact same files that you publish can be uploaded by your colleague and will work, then the problem is not with Captivate's output but in the transfer method.
    Perhaps your FTP program is messed up or perhaps you are uploading the files to the server with the wrong file permission settings.
    /Michael
    Click here to visit the www.captivate4.com blog

  • All is fine with JFrame, but the same code doesn't work in JApplet?

    I try to manage XML files using Xerces-perser,
    and all is ok if I work with JFrame,
    but when I try to do the same thing in JApplet,
    I get ClassDefNotFound error at the initializing
    of applet. It writes that the problem is with
    Xerces-classes (org.w3c.dom.Node f.e.),
    it seems to me that "appletviewer" (1.3.01) which
    I use to launch JApplet doesn't see these classes,
    while "java" does when I do the same with JFrame.
    May be, do you have some ideas?

    add "crimson.jar" and "jaxp.jar" in your archive list in your html, which lunch your applet.

  • Why Doesn't Project TV woek with IE but not Firefox? I tried the "Proxy" suggestion with no results.

    Project TV works fine with IE. It used to work with Firefox but no longer. I tried the "Proxy" suggestion and clearing History with no results?

    scher2000
    First and foremost, thank you for your help and concern. It is appreciated.
    Project TV works just fine with IE but will not work at all with Firefox although it did work a few days ago. I have tried::
    Clearing History, as suggested,
    Changing the "Proxy: settings, as suggested
    This has been all to no avail.
    Link:
    http://www.free-tv-video-online.me/
    Also, my WOW Speed test works fine with IE but not with Firefox; I just ried it on both.
    Link:
    http://speed.nap.wideopenwest.com/
    I prefer Firefox but it appears to be giving me problems resulting in having to use IE.
    Again, Thank you.:

  • Windows Integrated Security with SSRS, Sharepoint 2013 and SSAS over http

    I have the following setup and problem:
    Sharepoint 2013 with SSRS in Sharepoint integrated mode
    SSAS 2012 SP1 with http access (IIS + msmdpump) enabled on the same box as SSAS
    Every component I have tried works fine with this (PerformancePoint, .bism connections, SSIS packages etc.), connecting over http using Kerberos and windows integrated authentication.
    SSRS (.rsds) connections in Sharepoint fail a connection test when using the same http connection string + Windows integrated authentication which works for everything else. The error is: "Unsupported data format: -> Microsoft.ReportingServices.DataExtensions.AdomdTestConnectionException:
    Unsupported data format:"
    SQL server profiler shows that the windows username is reaching the SSAS server is all cases.
    Kerberos delegation is set up for SSAS and is working.
    Switching the .rsds connection to saved credentials (same user as I tried with Windows integrated auth) works fine and SQL server profile logs look the same as the Windows integrated case.
    So, everything seems to work with Kerberos + http apart from SSRS ... any idea welcome. I did read that SSPI is not supported for http connections but then again, there are sites which give examples of exactly such connection strings. I can't find any
    mention of this case or exact problem anywhere ...

    For information, this was fixed by applying the .NET 4.5.1 patch as advised by MS support. Now http connections from integrated mode SSRS work ok.

  • Automatically replace jpgs with tiffs of the same file name.

    Is there a way to relink automatically files replacing jpgs with tiffs of the exact same file name?
    Thank you!

    http://indesignsecrets.com/relink-from-one-image-file-type-to-another.php/comment-page-1
    Relink from One Image File Type to Another
    by:  David Blatner  | February 20, 2009
    18 Comments
    Share This
    Eugene asked an excellent question in the comments to this old post:
    Say if I do decide to change the .tif to .psd and I move the .tifs out to another folder, would it or would it not be a good idea if Indesign said, “Hey, those .tifs aren’t available, there’s a similar name with a .psd extension, would you like to use these instead?” Then you just press, yes use my .psd files.
    Many folks had asked for this ability, and so Adobe delivered: InDesign CS4 has a feature called Relink to Folder. It’s an awesome command (it lives in the LInks panel menu) because it basically directs InDesign to some other folder on your computer (or server, or whatever), where your images may live. So you can relink a hundred images from one folder to another quickly.
    But even cooler, you can tell InDesign whether to insist on the same file type or use a different one. Here’s the control in the Relink to Folder dialog box:
    So, you select one or more images in the Links panel, choose Relink to Folder, tell it which folder to look in, and choose a file extension. The original image doesn’t even have to be “Missing”! In fact, the two images (psd and tiff, in your case) can even live in the same folder.
    Sweet, yes?

  • Quicktime player does not play video clip on desktop but plays in iPhoto

    QuickTime player opens the video clip but the screen remains blank and no sound either. What am I doing wrong? It plays perfectly well in iPhoto.

    Do they not play in iTunes?
    They should play in VLC:
    http://www.videolan.org/vlc/download-macosx.html

  • Itunes does not work when I want to play Mp4 videos with most recent versions

    When I want to play videos with mp4 format on itunes, it does not do anything and I have to close itunes with the windows system manager. Does any one know how to solve this problem? I did not have this isue with 10.5 and previous versions of itunes.

    I found the solution, the problem was the encoding of the configuration files.
    I put:
    => Encoding: UTF8 without signature
    => line endings: UNIX(LF)
    And now it works :)

Maybe you are looking for

  • Import Export Healthcare Endpoints

    Hi, I am currently exploring the healthcare pack for the Oracle SOA Suite Integration. While doing several POC's I often come across the need to somehow import/export the created healthcare endpoints onto some other SOA server, but everytime I have t

  • Cheapest posssible option to run Final Cut Express?

    Can anyone tell me the cheapest way to get set up with Final Cut Express? Thanks

  • BAPI_CUSTOMER_GETCONTACTLIST

    Hi! I want to display the data of a contact person (VAP3). When I insert <b>BAPI_CUSTOMER_GETCONTACTLIST</b> as a data source for the iView, what should I use as an entry value? The default input value of the BAPI is the required field <b>MAXROWS</b>

  • What is the email address for contacting apple

    I need to have pages and all my stuff that was on my laptop before my laptop hardrive crashed to put it on my new harddrive.  I need to email them the proof of that I had it.

  • Tx2525nr upgraded to windows 7 and now f11 recovery to vista does not work

    im new here and i hope to get any answers from my problem on this laptop. i owned a hptx2525nr and recently upgraded to windows 7, now i wanted to go back to vista but upon pressing f11 (the original recovery on hard drive), nothing happens. "f11 sys