Skip to main content
Participant
November 3, 2011
Question

Local videos not playing in Flash/Dreamweaver Air app

  • November 3, 2011
  • 2 replies
  • 1010 views

Hi there. I am having trouble playing local video from an Air app created from Dreamweaver. I have found many similar [posts, but most are about Flex and so on. I need some help getting this working form Flash and Dreamweaver.

What I did wat create a jQuery site that uses Flash to play videos. It will be packaged as a desktop Air app using the Dreamweaver Air plugin.

From advice that I got here (http://soenkerohde.com/2008/06/playing-local-files-with-air/)

I started a new Air Project in Flash as suggested. Using an Air flash app makes more sence I guess, but I still need to imbed it into an HTML framework.

Here is the code I am using:

import flash.filesystem.File;

var myVideo:Video = new Video(stage.stageWidth, stage.stageHeight);

addChild(myVideo);

var nc:NetConnection = new NetConnection();

nc.connect(null);

var ns:NetStream = new NetStream(nc);

var client:Object = new Object();

client.onMetaData = function(metadata:Object):void {

trace(metadata.duration);

}

ns.client = client;

myVideo.attachNetStream(ns);

var f:File = new File("Special_Assignment_Title.flv");

ns.play(f.url);

When I run this I get the following error:

<blockquote cite="">ArgumentError: Error #2004: One of the parameters is invalid.

          at Error$/throwError()

          at flash.filesystem::File/set nativePath()

          at flash.filesystem::File()

          at videoPlayer_fla::MainTimeline/frame1()[videoPlayer_fla.MainTimeline::frame1:17]</blockquote>

Any suggestions on how to fix my problem? Any help would be greatly appreciated

This topic has been closed for replies.

2 replies

Known Participant
February 11, 2012

ever found a solution to this?

chris.campbell
Legend
February 14, 2012

Instead of using the File object, try URLRequest instead:

                                        var urlReq:URLRequest = new URLRequest("Special_Assignment_Title.flv");

                                        ns.play(urlReq.url);

Chris