[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 696
  • Last Modified:

Having a few issues with H.264 player...

Hello, I'm have few issues with my player... it needs to play and loop over and over again and stretch with the stage... it does all that... but the  few issue are this... sometimes the video does play of the bat until you refresh the browser.. and the other is that it there seems to be like a frame of black... I double checked the video it's self... the mp4 doesn't have it..

does anyone know how to fix these issues... or have a line on a really stable basic no anything but play and loop player?  something that plays in play v.8 would be the best... thanks for the help...

Jeremy
Stage.align = "TL";
// *** Stop the stage from scaling with the browser window.
Stage.scaleMode = "noScale";
Stage.showMenu = false;
import mx.transitions.Tween;
import mx.transitions.easing.*;
 
var mcLoader2:MovieClipLoader = new MovieClipLoader();
var container:MovieClip = createEmptyMovieClip("container", getNextHighestDepth());
mcLoader2.addListener(this);
mcLoader2.loadClip("http://www.hellscanyonsportfishing.com/images/testhead.png", container);
 
var v = Math.random() * 6 - 3;
var xScaleT0:Tween = new mx.transitions.Tween(container, "_x", Regular.easeOut, 5, 2 * v, 2, true);
var xScaleT1:Tween = new mx.transitions.Tween(container, "_y", Regular.easeOut, 5, 2 * v, 2, true);
 
 
xScaleT0.onMotionFinished = function() {
    this.yoyo();
};
xScaleT1.onMotionFinished = function() {
    this.yoyo();
};
 
// ---------------------- Load XML -----------------------//
 
dify=(Stage.height-Stage.width);
difx=(Stage.width-Stage.height);
if(Stage.height>Stage.width) {
my_video._width = Stage.width;	
my_video._height = (my_video._width + dify);
} else if(Stage.width>Stage.height){
my_video._height = Stage.height;
my_video._width = (my_video._height + difx);
}
my_video._y = (-(my_video._height))+Stage.height;
// end initial position setting
 
 
//create a listner that checks to see if the browser window is resized
sizeListener = new Object();
sizeListener.onResize = function() {
	// change movieclip properties when the window is resized.
dify=(Stage.height-Stage.width);
difx=(Stage.width-Stage.height);
if(Stage.height>Stage.width) {
my_video._width = Stage.width;	
my_video._height = (my_video._width + dify);
} else if(Stage.width>Stage.height){
my_video._height = Stage.height;
my_video._width = (my_video._height + difx);
}
my_video._y = (-(my_video._height))+Stage.height;
};
Stage.addListener(sizeListener);
//
//TO RUN THIS WITH THE INCLUDED EXTRA EFFECTS YOU NEED TO HAVE MC_TWEEN2 LIBRARY
//GET THIS LIBRARY AT: http://hosted.zeh.com.br/mctween/
//INSTALL THE EXTENSION AND WHEN YOU PUBLISH IT WILL BE AUTOMATICALLY INCLUDED
//#include "mc_tween2.as"
/////////////////////////////////////////////////////
// USER CONFIGURABLE VARIABLES
/////////////////////////////////////////////////////
//IF STREAMING OR NOT
var streaming:Boolean = false;
//VIDEO TO BE PLAYED PATH
//Type the directory of the video to be played
var videoDirectory:String = "";
//Type the filename of the video file that you want to be played
var videoFileName:String = "http://www.hellscanyonsportfishing.com/Scripts/flash/water 2.flv.mp4";
 
//Width of the Progress Bar
//var barWidth:Number = new Number(progressBar._width);
//Set This Variable To True If You Want The Video To Trace 
//Its Current Time and Total Time Consistently
var traceTime:Boolean = false;
//
//Set This Variable To However Many Miliseconds You Want The Video Controls
//FastForward and Rewind To Skip By
//var skipTime:Number = 4;
//
//Set The Initial Volume of Video
//Note: Set this volume as a percentage
var initialVolumeLevel:Number = 50;
 
//VIDEO SMOOTHING
my_video.smoothing = true;
//
//SETS INITIAL VIDEO SIZE
setVideoSize();
////////////////////////////////////////
// FUNCTIONS
////////////////////////////////////////
//Loads Whatever FLV Video File You Send It
function playVideo(_videoFile:String) {
	if (videoDirectory == "") {
		stream_ns.play(_videoFile);
	} else {
		stream_ns.play(videoDirectory + _videoFile);
	}
	//playBtn._visible = false;
	//pauseBtn._visible = true;
}
////////////////////////////////////////
// VIDEO ACTIONS
////////////////////////////////////////
//
////////////////////////////////////////
// VARIABLES
////////////////////////////////////////
//progressBar._xscale = 0;
//bufferBar._xscale = 0;
//Define Connection
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
//Progressive download.
var stream_ns:NetStream = new NetStream(connection_nc);
//Preloader
//preloaderBar();
//Attach NetStream To Video Holder
my_video.attachVideo(stream_ns);
//This prevents the movie from playing right away, while it still preloads
stream_ns.setBufferTime(15);
stream_ns.seek(2);
stream_ns.pause();
 
stream_ns.onStatus = function(infoObject:Object) {
	trace("NETSTREAM STATUS: " + infoObject.code);
	switch (infoObject.code) {
		case "NetStream.Play.Stop" :
playVideo(videoFileName);
			break;
		case "NetStream.Buffer.Full" :
		bufferClip._visible = false;
			break;
		case "NetStream.Buffer.Empty" :
		bufferClip._visible = true;
			break;
		case "NetStream.Buffer.Flush" :
			break;
		case "NetStream.Play.Start" :
			break;
		case "NetStream.Seek.InvalidTime" :
			trace("INVALID TIME");
			break;
		case "NetStream.Seek.Notify" :
			break;
	}
};
 
stop();
playVideo(videoFileName);

Open in new window

0
jeremyBass26
Asked:
jeremyBass26
  • 14
  • 5
1 Solution
 
wal_toorCommented:
Hello jeremy,

You need to change one line to get this seamless loop. In line 131 (playVideo(videoFileName)) you reload the movie, it is cached but flash needs a little time to reset the flv. Change this line to:  stream_ns.seek(0); The playbackhead in the flv file will turn to playtime zero and will continue playing.

Hope this works for you.

greetz,
walter

p.s. i have attached the code
Stage.align = "TL";
// *** Stop the stage from scaling with the browser window.
Stage.scaleMode = "noScale";
Stage.showMenu = false;
import mx.transitions.Tween;
import mx.transitions.easing.*;
 
var mcLoader2:MovieClipLoader = new MovieClipLoader();
var container:MovieClip = createEmptyMovieClip("container", getNextHighestDepth());
mcLoader2.addListener(this);
mcLoader2.loadClip("http://www.hellscanyonsportfishing.com/images/testhead.png", container);
 
var v = Math.random() * 6 - 3;
var xScaleT0:Tween = new mx.transitions.Tween(container, "_x", Regular.easeOut, 5, 2 * v, 2, true);
var xScaleT1:Tween = new mx.transitions.Tween(container, "_y", Regular.easeOut, 5, 2 * v, 2, true);
 
 
xScaleT0.onMotionFinished = function() {
    this.yoyo();
};
xScaleT1.onMotionFinished = function() {
    this.yoyo();
};
 
// ---------------------- Load XML -----------------------//
 
dify=(Stage.height-Stage.width);
difx=(Stage.width-Stage.height);
if(Stage.height>Stage.width) {
my_video._width = Stage.width;  
my_video._height = (my_video._width + dify);
} else if(Stage.width>Stage.height){
my_video._height = Stage.height;
my_video._width = (my_video._height + difx);
}
my_video._y = (-(my_video._height))+Stage.height;
// end initial position setting
 
 
//create a listner that checks to see if the browser window is resized
sizeListener = new Object();
sizeListener.onResize = function() {
        // change movieclip properties when the window is resized.
dify=(Stage.height-Stage.width);
difx=(Stage.width-Stage.height);
if(Stage.height>Stage.width) {
my_video._width = Stage.width;  
my_video._height = (my_video._width + dify);
} else if(Stage.width>Stage.height){
my_video._height = Stage.height;
my_video._width = (my_video._height + difx);
}
my_video._y = (-(my_video._height))+Stage.height;
};
Stage.addListener(sizeListener);
//
//TO RUN THIS WITH THE INCLUDED EXTRA EFFECTS YOU NEED TO HAVE MC_TWEEN2 LIBRARY
//GET THIS LIBRARY AT: http://hosted.zeh.com.br/mctween/
//INSTALL THE EXTENSION AND WHEN YOU PUBLISH IT WILL BE AUTOMATICALLY INCLUDED
//#include "mc_tween2.as"
/////////////////////////////////////////////////////
// USER CONFIGURABLE VARIABLES
/////////////////////////////////////////////////////
//IF STREAMING OR NOT
var streaming:Boolean = false;
//VIDEO TO BE PLAYED PATH
//Type the directory of the video to be played
var videoDirectory:String = "";
//Type the filename of the video file that you want to be played
var videoFileName:String = "http://www.hellscanyonsportfishing.com/Scripts/flash/water 2.flv.mp4";
 
//Width of the Progress Bar
//var barWidth:Number = new Number(progressBar._width);
//Set This Variable To True If You Want The Video To Trace 
//Its Current Time and Total Time Consistently
var traceTime:Boolean = false;
//
//Set This Variable To However Many Miliseconds You Want The Video Controls
//FastForward and Rewind To Skip By
//var skipTime:Number = 4;
//
//Set The Initial Volume of Video
//Note: Set this volume as a percentage
var initialVolumeLevel:Number = 50;
 
//VIDEO SMOOTHING
my_video.smoothing = true;
//
//SETS INITIAL VIDEO SIZE
setVideoSize();
////////////////////////////////////////
// FUNCTIONS
////////////////////////////////////////
//Loads Whatever FLV Video File You Send It
function playVideo(_videoFile:String) {
        if (videoDirectory == "") {
                stream_ns.play(_videoFile);
        } else {
                stream_ns.play(videoDirectory + _videoFile);
        }
        //playBtn._visible = false;
        //pauseBtn._visible = true;
}
////////////////////////////////////////
// VIDEO ACTIONS
////////////////////////////////////////
//
////////////////////////////////////////
// VARIABLES
////////////////////////////////////////
//progressBar._xscale = 0;
//bufferBar._xscale = 0;
//Define Connection
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
//Progressive download.
var stream_ns:NetStream = new NetStream(connection_nc);
//Preloader
//preloaderBar();
//Attach NetStream To Video Holder
my_video.attachVideo(stream_ns);
//This prevents the movie from playing right away, while it still preloads
stream_ns.setBufferTime(15);
stream_ns.seek(2);
stream_ns.pause();
 
stream_ns.onStatus = function(infoObject:Object) {
        trace("NETSTREAM STATUS: " + infoObject.code);
        switch (infoObject.code) {
                case "NetStream.Play.Stop" :
		//playVideo(videoFileName);
		// reposition the playbackhead in the flv movie
		stream_ns.seek(0);
                        break;
                case "NetStream.Buffer.Full" :
                bufferClip._visible = false;
                        break;
                case "NetStream.Buffer.Empty" :
                bufferClip._visible = true;
                        break;
                case "NetStream.Buffer.Flush" :
                        break;
                case "NetStream.Play.Start" :
                        break;
                case "NetStream.Seek.InvalidTime" :
                        trace("INVALID TIME");
                        break;
                case "NetStream.Seek.Notify" :
                        break;
        }
};
 
stop();
playVideo(videoFileName);

Open in new window

0
 
jeremyBass26Author Commented:
thats not a bad idea... I'll give that a try and get back... also one other cause here i think in the some times not playing realem is due to the moov atom being located in the rear...

i'll be back a little later this morning... thanks for the help
jeremy
0
 
jeremyBass26Author Commented:
Crap... both what you suggested and moving the  moov atom had no effect... any other ideas?

know of another player setup?  

thanks for the help...
jeremy
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
wal_toorCommented:
Strange, the code seemed to work for me. Did you try using the playback components that are in the component library?
0
 
jeremyBass26Author Commented:
well it works if I use the file that was converted from an flv to the mp4 h.264 via super c... well the black  flash goes away... the playback components were big... were this file is 4kb...

if you could try with this file
http://www.hellscanyonsportfishing.com/Scripts/flash/Copy of ~water 2.flv_qtp.mp4

that is the smaller correct file that should work fine... it has the moov atom fix for progressive download.... outputed from premeire...

but both versions of the mp4 do the same thing... when you get to the page the logo that is in the file shows up and moves... meaning the file loaded and is playing... but the video doesn't show up... but if you refresh...  then it's all good... (- the flash of black for the "correct pure mp4") but then go to another page and samething... file loads but movies doesn't play... and so on and so on...

this is happening in both FF and IE... the vidoe always shows up when I  ctrl-enter...

totaly lost lol...
0
 
wal_toorCommented:
Hello jeremy,

I have rebuild the player, and tried it on my server. As long as the mp4 file loads reletively it works even in firefox.

check: http://www.zoetebroodjes.nl/downloads/flvplayer/

download: http://www.zoetebroodjes.nl/downloads/flvplayer/flv_player.zip

Hope this works for you.

greetz,
walter
0
 
jeremyBass26Author Commented:
Hello, sorry for the delay... I have had a issue come up.. I'll be on this tommorow.. I just didn't want you to think I was not greatful for the help...

Have a great day...
Jeremy
0
 
jeremyBass26Author Commented:
Ok So almost all is well... Sorry for the delay... as it truns out part of the problem is flash player 10... this works on every other player and browser combo but ones with player 10...

Any ideas on that last part?

thanks for the help...

Jeremy
0
 
jeremyBass26Author Commented:
Oh Oh... ok I don't know what this means but the loader was going backwarks in crazly high ingative numbers... :-) it's wried but it's something to go off... hopeful either you know why  in play 10 (this is with the Moov Atom fix...)

it's up on the site as it works for most but player 10 combos...
http://www.hellscanyonsportfishing.com

just not sure... thanks again
0
 
jeremyBass26Author Commented:
Found a new error when playing previwing in flash... sometimes i get

NETSTREAM STATUS: NetStream.Play.FileStructureInvalid

I call it MOOVatomTEST1~water 2.flv.mp4
and it's located in the same spot as the rest ....
http://www.hellscanyonsportfishing.com/Scripts/flash/MOOVatomTEST1~water 2.flv.mp4

thats with the file with the moov atom moved... problem is that is what fixes for the mass of the issues along with the changes to the script it's self...

Ideas :-/

thanks again...
0
 
jeremyBass26Author Commented:
Ok and I noticed one more thing... in flash if I place

http://www.hellscanyonsportfishing.com/Scripts/flash/~water 2.flv.mp4

and preview it works... but it doesn't have the moov atom fix so it has the same issues in the start with FF  and IE not playing it till the page is refreshed...

but if I then place

http://www.hellscanyonsportfishing.com/Scripts/flash/MOOVatomTEST1~water 2.flv.mp4

back in the flash file and preview
I this time don't get the
NETSTREAM STATUS: NetStream.Play.FileStructureInvalid

all looks well...

now if I close it then open it thats when I get the error in flash...

man oh man it's odd... reproducible from end to end but odd and confusing...
0
 
jeremyBass26Author Commented:
if you'd like to see it going backwards... the loading.. you can view it here...

http://www.hellscanyonsportfishing.com/testing

tested with both:
http://www.hellscanyonsportfishing.com/Scripts/flash/MOOVatomTEST1~water 2.flv.mp4
and
http://www.hellscanyonsportfishing.com/Scripts/flash/Copy of ~water 2.flv_qtp.mp4

also relative and full address... :) fun stuff lol

also did with and with out the moov atom fix... but I have to have the atom fix for the every other but player 10 to work right...

:) man it should be like this lol... thanks again for the help...
jeremy
0
 
jeremyBass26Author Commented:
ok... just to make sure... I update a 9.0.124.0 to player 10... :) that is it... but... the counting backwrads is not specfic to player 10... it showed up in 9.0.124.0 as well

side note thou... with play 9 it thinks (IE) that there is 5 items (the flash boxes) still downlloading but doesn't show up like that in player 10... which solve a long standing issue...

I'm having so much fun the wall is red lol...
0
 
wal_toorCommented:
Hellow jeremy,

I can get back to you about this issue after the weekend. Just one questiong though, is there a specific reason to use H.264 encode files and not using flashvideo files?

greetz,
walter
0
 
jeremyBass26Author Commented:
yes.. there is a ~45% difference in the CUP processes during testes... and a ~30% saving in file size... plus it looks much better in quality..

thanks again for the help... that wall I've been hitting just don't give lol...
0
 
wal_toorCommented:
Hellow jeremy,

Hmm i cannot seem to find out what is going wrong. Unfortunately i cannot test with flashplayer 10. I am working on an office laptop and i don't have admin privileges, so i cannot updat the flash player.

Seems that i am stuck.

Sorry.
0
 
jeremyBass26Author Commented:

It's ok I appreciate your help... let me requests attention and see what we can get finished... have a great t-day...
jeremy
0
 
jeremyBass26Author Commented:
To the admins... I'm requesting attention as this is a long standing heavily work issue that both of us have ran into a brick wall... thou wal_toor was helpful the issue is not fully solved that was why the request, he is not able to continue as he is not able to test with flash player 10... I just need to fix it with flash player 10  now to be done and I'm not fiding any solutions out there or here yet... why I'm requesting attention ... Thank you
Jeremy
0
 
jeremyBass26Author Commented:
It was all most there... Thanks for all your help...
Jeremy
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 14
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now