Bräuchte Hilfe bei NetStream [Flash 8]
| 19.03.2010, 10:56 | | Beiträge: 6 Registriert: Jan 2009
| Bräuchte Hilfe bei NetStream Hi @ll ,
ich versuche (schon etwas länger ) eine Liste von Videos mit selbst erstellten Buttons der Titel via NetStream abspielen zu lassen.
Was mir fehlt sind die Zeilen damit , wenn Video 1 abgespielt wird und man Video 2 startet Video 1 gestoppt wird. Also wenn ein neues Video von der Liste per Button ausgewählt das andere stoppt.
codec bisher
PHP:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
<? var nc:NetConnection = new NetConnection ();
nc.connect(null);
// 1.Video
var ns1:NetStream = new NetStream(nc);
myVideo.attachVideo(ns1);
netStream.setBufferTime(5);
vid1_btn.onRelease = function(){
ns1.play("kinder_hamlet.flv");
}
//Video stoppen
stop_btn.onRelease = function(){
ns1.pause(true);
}
//Video abspielen
play_btn.onRelease = function(){
ns1.pause(false);
}
// 2. Video
var ns2:NetStream = new NetStream(nc);
myVideo.attachVideo(ns2);
netStream.setBufferTime(5);
vid2_btn.onRelease = function(){
ns2.play("musical2.flv");
}
//Video stoppen
stop_btn.onRelease = function(){
ns2.pause(true);
}
//Video abspielen
play_btn.onRelease = function(){
ns2.pause(false);
} ?>
|
Würde mich über guten lösungsvorschlag freuen
flockerl | |
| 19.03.2010, 15:02 | Re1 | Beiträge: 1151 Wohnort: Boston MA Registriert: Feb 2006
| ActionScript:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | ns.onStatus = function(info) {
//buffer full hide bufferclip
if(info.code == "NetStream.Buffer.Full") {
bufferClip._visible = false;
}
if(info.code == "NetStream.Buffer.Empty") {
bufferClip._visible = true;
}
//if end goto beginning of vid
if(info.code == "NetStream.Play.Stop") {
ns.seek(0);
}
}
if(info.code == "NetStream.Buffer.Full") {
bufferClip._visible = false;
}
if(info.code == "NetStream.Buffer.Empty") {
bufferClip._visible = false;
_root.mc_container.bufferClip._alpha = 100;
//_root.mc_bufferFace._alpha = 100;
trace("VIDEO NOT LOADED");
}
//////END OF VIDEO
//if end goto beginning of vid
if(info.code == "NetStream.Play.Stop") {
trace("STOP ME NOW");
_root.mc_container.bufferClip._alpha = 0;
//ns.seek(0); back to beginn
ns.pause();
tweenReplay();
}
}
|
no one died when clinton lied | |
| 19.03.2010, 15:39 | Re2 | Beiträge: 6 Registriert: Jan 2009
Themenautor/in
| Hi skoda,
schonmal danke für die Antwort aber das versteh ich net. Habe jetz schon eine Lösung zur Hilfe gestellt bekommen was das stoppen des Video1 angeht wenn das Video2 spielt, das funktioniert auch prima.
PHP:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
<? var film1Playing:Boolean = false;
var film2Playing:Boolean = false;
var nc:NetConnection = new NetConnection ();
nc.connect(null);
var ns1:NetStream = new NetStream(nc);
myVideo.attachVideo(ns1);
netStream.setBufferTime(5);
vid1_btn.onRelease = function(){
if(film2Playing) ns2.close();
ns1.play("kinder_hamlet.flv");
film1Playing = true;
}
//Video stoppen
stop_btn.onRelease = function(){
ns1.pause(true);
}
//Video abspielen
play_btn.onRelease = function(){
ns1.pause(false);
}
var ns2:NetStream = new NetStream(nc);
myVideo.attachVideo(ns2);
netStream.setBufferTime(5);
vid2_btn.onRelease = function(){
if(film1Playing) ns1.close();
ns2.play("musical2.flv");
film2Playing = true;
}
//Video stoppen
stop_btn.onRelease = function(){
ns2.pause(true);
}
//Video abspielen
play_btn.onRelease = function(){
ns2.pause(false);
} ?>
|
aber jetz gibs noch ein kleines Problemchen : Mir scheint als wenn der Codec von unten nach oben gelesen wird. Das heisst die play/ stop Funktion funktioniert nur bei Video2 nich bei Video1. Wenn ich den Codec von Video2 wegmache gehts bei Video1 aber doch (play/stop).
und wenn ich Video1 anklicke spielt nur der Ton kein Bild, von Video2 spielt Bild mit Ton. Mache ich den Codec von Video2 weg dann kommt auch Bild und ton von video1, was mache ich denn da falsch ?
grüße
flockerl | Geändert von flockerl am 19.03.10 um 15:46 Uhr
| |
|
| | | nicht sichtbar bei eingeloggten Mitgliedern |
|
| 20.03.2010, 17:40 | Re3 | Beiträge: 6 Registriert: Jan 2009
Themenautor/in
| Problem gelöst !!!
PHP:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
var film1Playing:Boolean = false;
var film2Playing:Boolean = false;
var nc:NetConnection = new NetConnection ();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
myVideo.attachVideo(ns);
vid1_btn.onRelease = function(){
if(film2Playing) ns.close();
ns.play("kinder_hamlet.flv");
film1Playing = true;
}
vid2_btn.onRelease = function(){
if(film1Playing) ns.close();
ns.play("musical2.flv");
film2Playing = true;
}
//Video stoppen
stop_btn.onRelease = function(){
ns.pause(true);
}
//Video abspielen
play_btn.onRelease = function(){
ns.pause(false);
}
|
thx for help | |
| | Themen Ähnliche Beiträge zum Thema | 14.07.2010 - robertochampa 09.10.2009 - yeah666 02.09.2009 - DianaL 13.04.2010 - kite54 |
|
Flashhilfe.de Flash Platform Tipps & Tutorials Flash Platform Andere Programmiersprachen Jobangebote Diskussionen
Flashhilfe News 
Regeln & Bedingungen
|