"Load 100% and then play" isn't working for me!
I tried the suggestions I found here:
http://getsatisfaction.com/schillmani...
but had the following problems.
---------------------------------------------------------
autoLoad=true, autoPlay=false, stream=false
---------------------------------------------------------
In this case, loading starts upon creatVideo() (which is what I want), but the video starts playing before loading is complete.
Here's my code:
----------------------
stream=false only
----------------------
Loading doesn't start until play() is invoked. I want to "pre-load" the video.
http://getsatisfaction.com/schillmani...
but had the following problems.
---------------------------------------------------------
autoLoad=true, autoPlay=false, stream=false
---------------------------------------------------------
In this case, loading starts upon creatVideo() (which is what I want), but the video starts playing before loading is complete.
Here's my code:
myVideo = soundManager.createVideo({
id:'video',
url:fn,
onfinish:NextItem,
stream: false,
whileloading:
function() {
writeMessage(this.sID+' loading, '+this.bytesLoaded+' of '+this.bytesTotal,regular);
},
onload:
function() {
ShowStartButton();
}
});
----------------------
stream=false only
----------------------
Loading doesn't start until play() is invoked. I want to "pre-load" the video.
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
The company marked this question as answered.
The best answer from the company
-
Ah-ha; it appears you have found a bug with video loading and automatically playing when autoLoad:true is set. The issue was that autoPlay was not being checked when autoLoad kicked in, and thus the movie was not prevented from playing.
I was mistaken in my prior thinking/code examples as the video wasn't being shown, though in fact it was playing the video - I just couldn't see it as the SWF was hidden from view. ;) The video demo page confirmed the undesired auto-play behaviour.
I've identified and (I think) fixed the bug, and can provide a temporary update for the .SWF involved before the next release.
You will need to upgrade to the latest version of SM2 first (at time of writing, version 2.95a.20090707).
Download and extract the latest, and then grab soundmanager2_flash9-20090717-video-autoload-fix.zip with the updated SWF, replacing the previous SWF with this one. You can then move these updated soundmanager2.js and SWF files into your project, and (fingers crossed), things should work fine.
I will include this fix in the next release of SM2. Thanks for the helpful test cases, and your patience in helping debug! :)
I’m d'oh!
The company says
this answers the question
Create a customer community for your own organization
Plans starting at $19/month
-
Inappropriate?When you wish to "pre-load", setting autoLoad:true should do the correct thing when creating a video.
For example:
soundManager.createVideo({
id:'myVideo',
url:'http://freshly-ground.com/data/video/xmaslights-iphone.m4v',
autoLoad:true,
onload:function(){
alert('loaded!')
}
});
This will fire the alert when the video has loaded; the load process begins as soon as the video is created.
When 'stream' is false, I had thought perhaps the movie wouldn't load - but, it does:
var v2 = soundManager.createVideo({
id:'myVideo2',
url:'http://freshly-ground.com/data/video/xmaslights-iphone.m4v',
autoLoad:true,
stream:false,
onload:function(){
alert('loaded!')
}
});
Interestingly, this seems to work OK with autoPlay:false..
var v3 = soundManager.createVideo({
id:'myVideo3',
url:'http://freshly-ground.com/data/video/xmaslights-iphone.m4v',
autoLoad:true,
stream:false,
autoPlay:false,
onload:function(){
alert('loaded!')
}
});
Tracking whileloading with this case seems to be OK:
var v4 = soundManager.createVideo({
id:'myVideo4',
url:'http://freshly-ground.com/data/video/xmaslights-iphone.m4v',
autoLoad:true,
stream:false,
autoPlay:false,
onload:function(){
alert('loaded!')
},
whileloading: function() {
console.log('loaded '+this.bytesLoaded+' of '+this.bytesTotal+' bytes');
}
});
.. Although there does look to be a minor bug with loading where both bytesLoaded and bytesTotal are 0 immediately before load, then followed by the correct end values? Hrm. I'll have to look at that. ;)
autoLoad:true should be OK, try the above examples for reference.. If you are seeing different behaviour, do let me know.
This assumes of course you have the following:
soundManager.flashVersion = 9;
soundManager.useMovieStar = true; // enable video (mp4/m4v, etc.)
I’m confident
-
Inappropriate?I've prepared several test files.
In all cases, video starts to play as soon as enough data has been downloaded.
(1) http://tell.fll.purdue.edu/SA-D/test1...
autoLoad: true + whileloading
(2) http://tell.fll.purdue.edu/SA-D/test1...
autoLoad: true w/o whileloading
(3) http://tell.fll.purdue.edu/SA-D/test2...
autoLoad: true, stream: false + whileloading
(4) http://tell.fll.purdue.edu/SA-D/test2...
autoLoad: true, stream: false w/o whileloading
(5) http://tell.fll.purdue.edu/SA-D/test3...
autoLoad: true, stream: false, autoPlay: false, w/o whileloading
BTW, I'm using V2.95a.20090501.
I’m stumped...
-
Inappropriate?Ah-ha; it appears you have found a bug with video loading and automatically playing when autoLoad:true is set. The issue was that autoPlay was not being checked when autoLoad kicked in, and thus the movie was not prevented from playing.
I was mistaken in my prior thinking/code examples as the video wasn't being shown, though in fact it was playing the video - I just couldn't see it as the SWF was hidden from view. ;) The video demo page confirmed the undesired auto-play behaviour.
I've identified and (I think) fixed the bug, and can provide a temporary update for the .SWF involved before the next release.
You will need to upgrade to the latest version of SM2 first (at time of writing, version 2.95a.20090707).
Download and extract the latest, and then grab soundmanager2_flash9-20090717-video-autoload-fix.zip with the updated SWF, replacing the previous SWF with this one. You can then move these updated soundmanager2.js and SWF files into your project, and (fingers crossed), things should work fine.
I will include this fix in the next release of SM2. Thanks for the helpful test cases, and your patience in helping debug! :)
I’m d'oh!
The company says
this answers the question
-
Inappropriate?Oh, wow! Thank you very much for providing an update so quickly!
I'll try it out very soon.
I’m *very* thankful!!!
-
Inappropriate?Interesting, I think this relates to a problem I had under IE8 where I was doing a loop using events to play a sound file and use onfinish to prompt a timer delay followed by loading the next sound file. The sound files were little one second mp3s of saying numbers which I wanted to play cleanly and I was more concerned with getting them played cleanly than the gap between the files - a delay waiting for a slow connection to catch up was less important than a broken up announcement.
On IE8, after a few plays, it would die, and using debugging statements, when it died it had triggered onload (which contained the play command) immediately (with no error) before the next javascript statement but did not trigger an onfinish, whereas a working statement did not have this behaviour.
However, in a moment of inspired fiddling, changing the soundManager.flashVersion from 8 to 9 (and I have 10 installed), cured the effect.
Anyhow, I am trying the fix and will see whether it is stable. -
Hmm! It may be there was a bug with the Flash 8 version related to playing and re-using a sequence of sounds via onfinish as described, etc. Good to know that flashVersion = 9 seems to have fixed it - Flash 9+ do handle loading and re-loading sound URLs better than 8.
Loading Profile...



EMPLOYEE