Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: anpassungen an neue confluence version

...

  1. Legen Sie in der HTML-Seite im object-Tag der SWF-Datei den folgenden Parameter fest:
    Code Block
    borderColorgrey
    bgColor#eeeeee
    langactionscript
    borderStylesolid
    <param name="allowScriptAccess" value="always" />
    
  2. Fügen Sie in der SWF-Datei den folgenden ActionScript-Code ein:
    Code Block
    borderColorgrey
    bgColor#eeeeee
    langactionscriptactionscript3
    borderStylesolid
    flash.system.Security.allowDomain( sourceDomain )
    

...

Code Block
borderColorgrey
bgColor#eeeeee
langactionscriptactionscript3
borderStylesolid
 var nsClient:Object = {};
 nsClient.onMetaData = ...
 nsClient.onCuePoint = ...  

 nc = new NetConnection();
 nc.connect(null);

 ns = new NetStream(nc);
 ns.play(streamlocation);
 ns.client = nsClient;

 video = new Video();
 video.attachNetStream(ns);
 
 addChild(video);
                
 var tracker:SpringStreams = new SpringStreams("test");
 tracker.track(ns,{"stream":"videos/teststream","sx":video.width,"sy":video.height});

...

Code Block
borderColorgrey
bgColor#eeeeee
langactionscriptactionscript3
borderStylesolid
var nsClient:Object = {};
 nsClient.onMetaData = ...
 nsClient.onCuePoint = ...  

 nc = new NetConnection();
 nc.connect(null);

 ns = new NetStream(nc);
 ns.play(streamlocation);
 ns.client = nsClient;

 video = new Video();
 video.attachNetStream(ns);
 
 addChild(video);
                
 var tracker:SpringStreams = new SpringStreams("test");
 var stream:Stream = tracker.track(ns,{"stream":"videos/teststream","sx":video.width,"sy":video.height});

 stream.setDuration(600/*10 minutes*/);

...

Code Block
borderColorgrey
bgColor#eeeeee
langactionscriptactionscript3
borderStylesolid
var net:NetConnection = new NetConnection();
net.connect(null);
var ns:NetStream = new NetStream(net);
var currentPosition:Number = ns.time;

...

Code Block
borderColorgrey
bgColor#eeeeee
langactionscriptactionscript3
borderStylesolid
package 
{
import flash.media.SoundChannel;
import flash.net.NetConnection;
import flash.net.NetStream;
	
public class SoundNetStreamAdapter extends NetStream
{
	private var channel:SoundChannel;
	
	public function SoundNetStreamAdapter(net:NetConnection, c:SoundChannel)
	{
		super(net);
		channel = c;
	}
		
	override public function get time():Number { 
            // return the position in seconds
		return channel.position/1000;
	}

}
}

...

Code Block
borderColorgrey
bgColor#eeeeee
langactionscriptactionscript3
borderStylesolid
var tracker:SpringStreams = new SpringStreams("test");
			
var s:Sound = new Sound();
s.load(new URLRequest("file:///pathto/sound.mp3"));

var desc:Object = {
	"stream":"sounds/sound.mp3",
	"sx":0,"sy":0,
};
			
var nc:NetConnection = new NetConnection();
nc.connect(null);

var ns:NetStream = new SoundNetStreamAdapter(nc, s.play());
var stream:Stream = tracker.track(ns, desc);
stream.setDuration(s.length/1000); // duration in seconds

...

Code Block
borderColorgrey
bgColor#eeeeee
langactionscriptactionscript3
borderStylesolid
 var nsClient:Object = {};
 nsClient.onMetaData = ...
 nsClient.onCuePoint = ...  

 nc = new NetConnection();
 nc.connect(null);

 ns = new NetStream(nc);
 ns.play(streamlocation);
 ns.client = nsClient;

 video = new Video();
 video.attachNetStream(ns);
 
 addChild(video);
                
// 20:00 - 20:15 Tagesschau
// 20:15 - 21:00 PlusMinus
var tracker:SpringStreams = new SpringStreams("test");
// 20:00
var stream:Stream = tracker.track(ns,     {"stream":"livestreams/ard/Tagesschau","sx":video.width,"sy":video.height});

// 20:15
stream.stop();
stream = tracker.track(ns,{"stream":"livestreams/ard/PlusMinus","sx":video.width,"sy":video.height});

...

Code Block
borderColorgrey
bgColor#eeeeee
langactionscriptactionscript3
borderStylesolid
...
ns1 = new NetStream(...);
...
ns2 = new NetStream(...);
...
var tracker:SpringStreams = new SpringStreams("test");
var stream1:Stream = tracker.track(ns1,{"stream":"streams/stream1","sx":video.width,"sy":video.height});
var stream2:Stream = tracker.track(ns2,{"stream":"streams/stream2","sx":video.width,"sy":video.height});