ActionScript 3.0 :: Load MP4 As ByteArray And Append It To NetStream?
Feb 23, 2011Load an MP4 as ByteArray and Append it to NetStream?
View 4 RepliesLoad an MP4 as ByteArray and Append it to NetStream?
View 4 RepliesI need to append MIDI files: leave header (same for all files) and other meta information, just copy music/score part. I already have MIDI files in appropriate bytearrays, as I guessed I need to use writeBytes, but unfortunately couldn't find which bytes I need to take and copy. Something like this:
var newFileBytes:ByteArray=new ByteArray();
newFileBytes.writeBytes(firstMIDIBytes);
newFileBytes.writeBytes(secondMIDIBytes,8);
Works only partially, file is playable; first part fully and second - only some notes (then player hangs out)
To say truth byteArrays aren't my strong side, as the MIDI file structure.
I recently had to tell a client that I didn't want to work on their project because I was unclear about something. When you append a recording from a stream does the metadata get updated correctly after the append? I've worked with metadata before and from my recolection anytime a .flv was changed I had to manually update the metadata.
View 1 RepliesI have a load of information in a swf that I'm loading at runtime. From that swf I need to get raw vector data out of some MovieClips, and other MovieClips I need to instantiate and put on the stage.Currently I can get at the vector data by loading the swf as a ByteArray using a URLLoader and parsing it with a bit of help from as3swf.
However, if I want to instantiate one of the MovieClips directly I would usually load it with a Loader and get at the MovieClip via loaderInfo.applicationDomain.My question is: can I either load the swf as a ByteArray with URLLoader and somehow instantiate MovieClips from that, or can I load the swf as a DisplayObject using a Loader, get the MovieClips and then convert the swf to a ByteArray before giving it to as3swf for parsing?
Any way to load an FLV into a ByteArray, modify it (maybe add a water mark) and pass it to the Video Object for display?
View 2 RepliesI'm working on a local application ( it's not a website or nothing related ) and I have various FLVs with a very simple encryptation method (just like adding 10 at each byte). I can load/play them using NetStream.appendBytes() after my decrypt, but that happens only after I read all video data. What I really need is to stream those videos from a remote url, and decrypting while receiving data, using a OSMF player that I already have.
This is my current code just to play my decoded FLV byte array
private function playBytes(bytes:ByteArray):void
{
// detecting it's header
if (bytes.readUTFBytes(3) != "FLV")
[Code].....
I'm working on a local application ( it's not a website or nothing related ) and I have various FLVs with a very simple encryptation method by now (just like adding 10 at each byte).
I can load/play them using NetStream.appendBytes() after decrypting, but that happens only after I read all video data it's not streamed.
What I really need is to stream those videos from a remote url, and decrypting while receiving data, using a OSMF based player that I already have built. I'm lost on how OSMF deals with FLV, otherwise, I would try to create a plugin or something like. .
find a way to load a local file using OSMF, passing a ByteArray value, instead of a url (below). Or even giving me directions to create a OSMF plugin to solve my problem.
videoElement.resource = "video_url/video.flv";
This is my current code just to play my decoded FLV byte array
private function playBytes(bytes:ByteArray):void
{
// detecting it's header
if (bytes.readUTFBytes(3) != "FLV")
[Code].....
I would like to know if it is possible to load an external movie and add code with ByteArray inside, in order to add anymore properties, functions or why not Sprites?
View 2 RepliesI am working on a game, made with Flash (using AS3) The game has a fast ball and when this ball hits an object it has to make a sound... but the sound starts with delay (so the ball is far away when the sound is played).This sound is edited by me and it hasn't got any silences at the beginning.The method i'm currently using is the simplest one:
public var sonidoPuntos1:sonidopunto1 = new sonidopunto1()
and then...
sonidoPuntos1.play()
I am trying to introduce the file into a ByteArray and then playing it from there...
Using netstream to load in a video and have the buffer to basically load the entire video before it starts playing. So the video doesn't begin to play until the buffer is full but while the buffer is filling up, the cue points are being read and triggering actions.
View 4 RepliesThe main problem is that the FLV doesn't load/play, which most likely causes the secondary problems, such as the bufferClip always visible and no way to test the video and audio scrubbers.
[Code].....
I need help creating a video player which will load only 60 seconds of video from an external flv file which can be of any length (more than 60 seconds). I am able to play only 60 seconds of video but the player buffers the entire video which results in loss of bandwidth.
View 0 RepliesI'm using this code to create a netstream connection, to load my external FLV-files
ActionScript Code:
var nc:NetConnection = new NetConnection;
nc.connect(null);
var ns:NetStream = new NetStream(nc);
later in my script i use this code to attach a external video in my netstream and start to play it
ActionScript Code:
_root.contentFoto.contentFoto.holder.attachVideo(ns);
ns.play("vids/" + dataList[activeSub].dataInfo[item].pic);
How do I stop that clip and unload the movie of my netstream
I'm making a small video players in AS3, and I've found that after calling NetStream.pause() or NetStream.togglePause(), no status messages are being fired any more.If I click the "pause" button while the video is buffering, I never get the Buffer.Full message.Here is some code:
_connection = new NetConnection();
_connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
_connection.connect(null);[code].....
I am working on an app that will take a snapshot of an rtmp stream of an archived video, save it to a file, and ExternalInterface the file name to the hosting page to javascript it up for display.
I actually have all pieces working great. The only time an error is thrown is when I pause the video, seek to somewhere, and then try to take a snapshot. Then there is a runtime error of:
SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: mySwf.swf cannot access rtmp://myFlashServer/myApp. No policy files granted access.I've seen post after post of suggestions and have tried them, but without success.
I have the crossdomain.xml and my FlashMediaServer security setup fine (it is actually working, except for this one glitch). It just seems to be the pause-then-seek-then-BitMapData.draw() combination which is creating issues.
Another weird thing: after the error is thrown, if I resume the stream and take a snapshot, it works flawlessly again.
I know its a true Pain but does anyone know any way to convert wav ByteArray to mp3 ByteArray.
View 1 RepliesI am using NetStream, NetConnection and Video object to play an mp4 file which is hosted over a web server using http.This is an AIR application and the relevant code is pasted below:
var url:String = <some http url>;
connect_nc = new NetConnection();
connect_nc.connect(null);
[code]........
In my application I have a video playing from a NetStream. Every second on timer I update a text label with statistics like stream.info.currentBytesPerSecond. The problem occurs when the NetConnection associated with this NetStream closes: the getter for stream.info throws
[Code]...
I'm using a for loop to creat a bunch of identical movie clips I want to attach a different sound to each one of these clips. Is there a way to append a variable onto the end of another variable name. (ie. where i = [0,1,2,3,4,etc] variable[i] = variable0, variable1,variable2,variable3,variable4,etc.) below is the part of the code that I am trying to get working:
for (var i:Number = 0; i < xmlData.object_count; i++){
//create movie clips
var boxContainer_mc:boxContainer = new boxContainer();
[code]....
I'm writing an XML preferences file for an Adobe AIR project, and I'd really like to include XML comments. How does one append a comment to XML? The following doesn't work (the file just ends up with a blank line where the comment should be):
ActionScript Code:
var prefs:XML = new XML();
prefs.ignoreComments = false;
[code]....
What I would like to do is simply add to a dataProvider, but when I do, I get an error. Here's the code I'm trying to run...
dg.dataProvider.addItem(obj.ResultSet.Result[i]);
It's inside a for loop, using i as the integer. It works great doing...dg.dataProvider = obj.ResultSet.Result But that won't work for me, because I need to add to the dataprovider more than once. I'm getting results in batches of 10, and I need to add each batch to the dataProvider when it's received. I also tried to to do...
var dgDP:dataProvider = new dataProvider(); But for some reason Flex doesn't recognize it...
I need to append 4 letters to my variable name when referencing it to get either spanish or english XML data. I am trying to reuse my functions without writing an if statement.
like so:
//two options for
var spa_my_videos:XMLList;
var eng_my_videos:XMLList;
[Code].....
Is there a way to append an object that has already been created:
CODE:
userobject;
userobject = {uname:username, uage:so.data[username].age}
What if I wanted to add a phone property?
I have a flvplayer assigned to the id player and I am trying to set buffer times for videos I have embedded in an array, I understand how to pull the information from my array and have that value be set intoplayer.setBufferTime(value);but when ever I call that command it gives me the error1061: Call to a possibly undefined method setBufferTime through a reference with static type fl.video:FLVPlayback. player.setBufferTime(1);
View 2 RepliesXML append Child 's equivalent method?
View 2 RepliesI am trying to append onto a xml object dynamically. The format of the XML is as follows
[Code].....
I am using adobe dvrcast to record my live streams. the problem I am having is when I stop the encode during a live stream, a new file is not created, the existing stream is written over. How can I preventive this from occuring. Is there a way to have all vod files that are in one folder to roll over to the next file during play back.
View 12 RepliesI am using this method to fix the Active Content issue,[URL]but now I have come across a situation when I have to append the end of the .swf. EG: Active content fix script. It does not use the extension .swf
<script type="text/javascript" >
AC_FL_RunContent(
'codebase', 'https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0',
'width', '764',
[code]....
I need to add .swf?<%response.write qs%>" to the images/footer_graphic_1_about, because I am passing a variable through the .swf.
Eg: images/footer_graphic_1_about.swf?intro=no
Due to the target website restriction, it only accepts swf file, and I want to pass parameter to this, So I post http:[url]............pass the file parameter this way, and This worked before, But now it doesn't, Where do I do wrong?
View 1 RepliesI am using this method to fix the Active Content issue,[URL].. but now I have come across a situation when I have to append the end of the .swf. EG: Active content fix script. It does not use the extension .swf
<script type="text/javascript" >
AC_FL_RunContent(
'codebase', 'https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0',
'width', '764',
'height', '141',
[Code]...