|
Home > Archive > Macromedia Flash Server > July 2006 > Embarrassing myself yet again (was: Video speeds up,
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Embarrassing myself yet again (was: Video speeds up,
|
|
| Dennie S Hoopingarner 2006-07-15, 1:11 am |
| It turns out that I can humiliate myself without any help from the list at
all.
Here's the code that I inadvertently erased from the message as soon as I
pasted it in, then hit the SEND button without looking at the #&*^@ message.
import flash.external.*;
ExternalInterface.addCallback("playMedia", this, playVid);
ExternalInterface.addCallback("recAudio", this, recAudio);
ExternalInterface.addCallback("playAudio", this, playAudio);
ExternalInterface.addCallback("stopAudio", this, stopAudio);
sawStop = false;
isPlaying = false;
flashcomserver = "rtmp://path.to.server/path.to.app";
myNC = new NetConnection();
myNC.onStatus = function(info) {
if (info.code == "NetConnection.Connect.Success") {
vidNS = new NetStream(myNC);
vidNS.onStatus = function(info){
//trace(info.code);
}
vidNS.setBufferTime(3);
myVid.attachVideo(vidNS);
}
};
myNC.connect(flashcomserver+"/media");
function playVid(myTimes){
metaArray = myTimes.split("~");
for(x=0; x<metaArray.length; x++){
tempArray = metaArray[x].split(":");
vidNS.play(tempArray[0], tempArray[1], (tempArray[2]-tempArray[1]), 3);
}
}
audioNC = new NetConnection();
audioNC.connect(flashcomserver+"/recordings");
myMic = Microphone.get();
myMic.setRate(22);
audioNS = new NetStream(audioNC);
audioNS.setBufferTime(2);
audioNS.onStatus = function(info) {
if(info.code == "NetStream.Play.Stop"){
sawStop = true;
}
if((info.code == "NetStream.Buffer.Empty") && (sawStop == true) &&
(isPlaying == true)){
ExternalInterface.call("soundDone");
}
};
audioNS.attachAudio(myMic);
stop_btn.onRelease = function(){
vidNS.play(false);
}
pause_btn.onRelease = function(){
vidNS.pause();
}
function recAudio(mySound){
isPlaying = false;
audioNS.publish(mySound, "record");
}
function stopAudio(){
audioNS.play(false);
audioNS.publish(false);
}
function playAudio(mySound){
isPlaying = true;
sawStop = false;
vidNS.play(false);
audioNS.play(false);
audioNS.play(mySound);
}
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
| |
| Bill Sanders 2006-07-15, 7:11 am |
| Dennie,
I'm wondering why you use two different NetConnections. I can see
that you have two different folders (media and recordings) that you
want to access, but otherwise, I'm not sure why you're doing that.
Just for the process of untangling everything, try it with a single NC.
Bill
On Jul 14, 2006, at 9:25 PM, Dennie S Hoopingarner wrote:
> It turns out that I can humiliate myself without any help from the
> list at all.
> Here's the code that I inadvertently erased from the message as
> soon as I pasted it in, then hit the SEND button without looking at
> the #&*^@ message.
>
>
> import flash.external.*;
> ExternalInterface.addCallback("playMedia", this, playVid);
> ExternalInterface.addCallback("recAudio", this, recAudio);
> ExternalInterface.addCallback("playAudio", this, playAudio);
> ExternalInterface.addCallback("stopAudio", this, stopAudio);
> sawStop = false;
> isPlaying = false;
> flashcomserver = "rtmp://path.to.server/path.to.app";
> myNC = new NetConnection();
> myNC.onStatus = function(info) {
> if (info.code == "NetConnection.Connect.Success") {
> vidNS = new NetStream(myNC);
> vidNS.onStatus = function(info){
> //trace(info.code);
> }
> vidNS.setBufferTime(3);
> myVid.attachVideo(vidNS);
> }
> };
> myNC.connect(flashcomserver+"/media");
> function playVid(myTimes){
> metaArray = myTimes.split("~");
> for(x=0; x<metaArray.length; x++){
> tempArray = metaArray[x].split(":");
> vidNS.play(tempArray[0], tempArray[1], (tempArray[2]-tempArray[1]),
> 3);
> }
> }
> audioNC = new NetConnection();
> audioNC.connect(flashcomserver+"/recordings");
> myMic = Microphone.get();
> myMic.setRate(22);
> audioNS = new NetStream(audioNC);
> audioNS.setBufferTime(2);
> audioNS.onStatus = function(info) {
> if(info.code == "NetStream.Play.Stop"){
> sawStop = true;
> }
> if((info.code == "NetStream.Buffer.Empty") && (sawStop == true) &&
> (isPlaying == true)){
> ExternalInterface.call("soundDone");
> }
> };
> audioNS.attachAudio(myMic);
> stop_btn.onRelease = function(){
> vidNS.play(false);
> }
> pause_btn.onRelease = function(){
> vidNS.pause();
> }
> function recAudio(mySound){
> isPlaying = false;
> audioNS.publish(mySound, "record");
> }
> function stopAudio(){
> audioNS.play(false);
> audioNS.publish(false);
> }
> function playAudio(mySound){
> isPlaying = true;
> sawStop = false;
> vidNS.play(false);
> audioNS.play(false);
> audioNS.play(mySound);
> }
>
>
> ________________________________________
_______
> FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
bill sanders | www.sandlight.com | bloomfield, ct | 860-242-2260
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
| |
|
| Unless your application is connecting to 2 different FMS application
instances, you do not need 2 NetConnections.
[a /]
-----Original Message-----
From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
[mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of Bill Sanders
Sent: 15 July 2006 09:24
To: FlashComm Mailing List
Subject: Re: [FlashComm] Embarrassing myself yet again (was: Video speeds
up,audio plays just fine)
Dennie,
I'm wondering why you use two different NetConnections. I can see
that you have two different folders (media and recordings) that you
want to access, but otherwise, I'm not sure why you're doing that.
Just for the process of untangling everything, try it with a single NC.
Bill
On Jul 14, 2006, at 9:25 PM, Dennie S Hoopingarner wrote:
> It turns out that I can humiliate myself without any help from the
> list at all.
> Here's the code that I inadvertently erased from the message as
> soon as I pasted it in, then hit the SEND button without looking at
> the #&*^@ message.
>
>
> import flash.external.*;
> ExternalInterface.addCallback("playMedia", this, playVid);
> ExternalInterface.addCallback("recAudio", this, recAudio);
> ExternalInterface.addCallback("playAudio", this, playAudio);
> ExternalInterface.addCallback("stopAudio", this, stopAudio);
> sawStop = false;
> isPlaying = false;
> flashcomserver = "rtmp://path.to.server/path.to.app";
> myNC = new NetConnection();
> myNC.onStatus = function(info) {
> if (info.code == "NetConnection.Connect.Success") {
> vidNS = new NetStream(myNC);
> vidNS.onStatus = function(info){
> //trace(info.code);
> }
> vidNS.setBufferTime(3);
> myVid.attachVideo(vidNS);
> }
> };
> myNC.connect(flashcomserver+"/media");
> function playVid(myTimes){
> metaArray = myTimes.split("~");
> for(x=0; x<metaArray.length; x++){
> tempArray = metaArray[x].split(":");
> vidNS.play(tempArray[0], tempArray[1], (tempArray[2]-tempArray[1]),
> 3);
> }
> }
> audioNC = new NetConnection();
> audioNC.connect(flashcomserver+"/recordings");
> myMic = Microphone.get();
> myMic.setRate(22);
> audioNS = new NetStream(audioNC);
> audioNS.setBufferTime(2);
> audioNS.onStatus = function(info) {
> if(info.code == "NetStream.Play.Stop"){
> sawStop = true;
> }
> if((info.code == "NetStream.Buffer.Empty") && (sawStop == true) &&
> (isPlaying == true)){
> ExternalInterface.call("soundDone");
> }
> };
> audioNS.attachAudio(myMic);
> stop_btn.onRelease = function(){
> vidNS.play(false);
> }
> pause_btn.onRelease = function(){
> vidNS.pause();
> }
> function recAudio(mySound){
> isPlaying = false;
> audioNS.publish(mySound, "record");
> }
> function stopAudio(){
> audioNS.play(false);
> audioNS.publish(false);
> }
> function playAudio(mySound){
> isPlaying = true;
> sawStop = false;
> vidNS.play(false);
> audioNS.play(false);
> audioNS.play(mySound);
> }
>
>
> ________________________________________
_______
> FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
bill sanders | www.sandlight.com | bloomfield, ct | 860-242-2260
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
|
|
|
|
|