Jump to content
Search Community

failure13

Members
  • Posts

    183
  • Joined

  • Last visited

Everything posted by failure13

  1. It's pretty hard to replicate, since it's only on server, and sometimes it doesn't happen at all...And if it happens - only once, after browser restart, but when you refresh page then everything is as usual. I use .mp4 15 second long video.. I think i found error, i was using this in my error function. The purpose of error function is: 1. If it used inside flash, firstly try original url string 2. If original url gives error AND if video player wasn't loaded from html. which have parameter GetVideoURL - than throw an error message, and turn player 'off' 3. If foriginal url gives an error AND video player was loaded from html...etc - than try video.url = videoURL; and load / play video again. 4. If it videoURL is not valid also - throw an error and turn "off" player. Here's how i was doing it before, i was creating a loop with playError, but probably it wasn't stable and fast enough: function errorCatch(e:LoaderEvent):void { // try to switch url for html videoURL parameter if (!playError && loaderParams.hasOwnProperty("GetVideoURL")) { // reset first play flag var playError:Boolean = true; // reload video video.url = videoURL; video.load(); video.playVideo(); } else { // remove listeners stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyClick); video.content.removeEventListener(MouseEvent.CLICK, playPauseSwitch); videoControls.btnStop.removeEventListener(MouseEvent.CLICK, stopClicked); videoControls.btnPlay.removeEventListener(MouseEvent.CLICK, playClicked); videoControls.btnPause.removeEventListener(MouseEvent.CLICK, pauseClicked); // show display and write error message TweenMax.to([logo.playSign, logo.pauseSign], 0.7,{alpha: 0, overwrite: true}); TweenMax.to([videoControls.lblTimeDuration, logo.cleverLine], 0.7,{alpha: 1, overwrite: true}); videoControls.lblTimeDuration.text = " URL ERROR"; } } Now i do the whole thing like this, check error catch function. It seem to be impossible now to get such a result of double play, right? // video first play flag var firstPlay:Boolean = false; var video:VideoLoader = new VideoLoader(VIDpath, { name: "video", autoPlay: false, container: this, alpha: 0, bgColor: backgroundsColor, bgAlpha: bgAlphaVideo, width: vW, height: vH, centerRegistration: true, scaleMode: "proportionalInside", onComplete: initVideo, onError: errorCatch, onProgress: updateDownloadProgress }); // set up video function initVideo(e:LoaderEvent):void { // listener for video complete video.addEventListener(VideoLoader.VIDEO_COMPLETE, stopVideoPlayer); // progress listener video.addEventListener(VideoLoader.PLAY_PROGRESS, updatePlayProgress); // set time to begin from 00:00 video.gotoVideoTime(0, false); // get duration videoDurationTime(); // check if mute activated if (videoControls.volumeFill.scaleX == 0) { // reset volume video.volume = 0; } else { // set volume video.volume = volumeValue; } // appear video & time display TweenMax.to([video.content, video.rawContent, videoControls.lblTimeDuration], 0.7,{alpha: 1}); } function playClicked(e:MouseEvent = null):void { if (!firstPlay) { // set first play flag firstPlay = true; // load video video.load(); } if (video.playProgress == 0) { // add controls hide listeners controlsHideListeners(); // hide controls after a while controlsRollOver(); // disappear logo & play sign TweenMax.to([logo.cleverLine, logo.playSign], logoSwitchTime + 0.5,{alpha: 0, delay: logoSwitchDelay, overwrite: "all"}); } // set video playing flag videoPlaying = true; // play video video.playVideo(); // switch play / pause visibility videoControls.btnPause.visible = true; videoControls.btnPlay.visible = false; } function errorCatch(e:LoaderEvent):void { // try to switch url for html videoURL parameter if (firstPlay && loaderParams.hasOwnProperty("GetVideoURL")) { // reset first play flag firstPlay = false; // reload video video.url = videoURL; video.load(); video.playVideo(); } else { // remove listeners stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyClick); video.content.removeEventListener(MouseEvent.CLICK, playPauseSwitch); videoControls.btnStop.removeEventListener(MouseEvent.CLICK, stopClicked); videoControls.btnPlay.removeEventListener(MouseEvent.CLICK, playClicked); videoControls.btnPause.removeEventListener(MouseEvent.CLICK, pauseClicked); // show display and write error message TweenMax.to([logo.playSign, logo.pauseSign], 0.7,{alpha: 0, overwrite: true}); TweenMax.to([videoControls.lblTimeDuration, logo.cleverLine], 0.7,{alpha: 1, overwrite: true}); videoControls.lblTimeDuration.text = " URL ERROR"; } } Since i started to use such code, i wasn't able to replicate such behaviour yet, so i suppose that was the thing...
  2. Oh, i didn't knew that you haven't understood the question, sorry.. Here's how i'm doing it now: // create video loader var video:VideoLoader = new VideoLoader(VIDpath, { name: "video", autoPlay: false, container: this, alpha: 0, bgColor: backgroundsColor, bgAlpha: bgAlphaVideo, width: vW, height: vH, centerRegistration: true, scaleMode: "proportionalInside", onComplete: initVideo, onError: errorCatch, onProgress: updateDownloadProgress }); // custom rmb menu var customContextVideoMenu:ContextMenu = new ContextMenu(); // menu rmb web link var videoMenuItem1:ContextMenuItem = new ContextMenuItem("Link"); var videoMenuItem2:ContextMenuItem = new ContextMenuItem("Video v1.23"); // hide unnecessary rmb stuff customContextVideoMenu.hideBuiltInItems(); // add custom content videoMenuItem2.separatorBefore = true; customContextVideoMenu.customItems.push(videoMenuItem1, videoMenuItem2); video.content.contextMenu = customContextVideoMenu; videoControls.contextMenu = customContextVideoMenu; // hyperlink function function goVideoClever(event:ContextMenuEvent):void { navigateToURL(new URLRequest("http://www.google.com"),"_blank"); }
  3. Strange thing, locally - everything is ok, but when i upload to server, first time i load video - i hear only sound for few seconds, and then video start, and sound starts over from 0 with it... Probably this is some kind of buffering trouble (i'm not really familiar with that), can someone please shread a light? Here's loader and some of the relevant functions from my code: var video:VideoLoader = new VideoLoader(VIDpath, { name: "video", autoPlay: false, container: this, alpha: 0, bgColor: backgroundsColor, bgAlpha: bgAlphaVideo, width: vW, height: vH, centerRegistration: true, scaleMode: "proportionalInside", onComplete: initVideo, onError: errorCatch, onProgress: updateDownloadProgress }); // set up video function initVideo(e:LoaderEvent):void { // listener for video complete video.addEventListener(VideoLoader.VIDEO_COMPLETE, stopVideoPlayer); // progress listener video.addEventListener(VideoLoader.PLAY_PROGRESS, updatePlayProgress); // set time to begin from 00:00 video.gotoVideoTime(0, false); // get duration videoDurationTime(); // check if mute activated if (videoControls.volumeFill.scaleX == 0) { // reset volume video.volume = 0; } else { // set volume video.volume = volumeValue; } // appear video & time display TweenMax.to([video.content, video.rawContent, videoControls.lblTimeDuration], 0.7,{alpha: 1}); } function playClicked(e:MouseEvent = null):void { if (!firstPlay) { // set first play flag firstPlay = true; // load video video.load(); } if (video.playProgress == 0) { // add controls hide listeners controlsHideListeners(); // hide controls after a while controlsRollOver(); // disappear logo & play sign TweenMax.to([logo.cleverLine, logo.playSign], logoSwitchTime + 0.5,{alpha: 0, delay: logoSwitchDelay, overwrite: "all"}); } // set video playing flag videoPlaying = true; // play video video.playVideo(); // switch play / pause visibility videoControls.btnPause.visible = true; videoControls.btnPlay.visible = false; }
  4. Yeah, thank you for the answer! I have tested it out with 1 child, it works, even unloading it from the memory... Have inserted a frame around the VideoLoader, which center set to loader's center, and this seem to hep a lot, because resize functions works a bit faster than, when you have to caluclate also x/y value for the frame... And when i call dispose, it's get unloaded fully from memory, and of course from display list! The benifit of such aproach is basicly making resize a bit faster...And seem that autosizing works well! Probably will stick with this for a while and test it more!
  5. Hi! For example i got VideoLoader, named video, and i add child inside it, this way: video.content.addChild(vFrame); I wanted to ask: 1. Is this normal practice, won't such thing prevent normal work of loader and it's properties and goodness of .content / .rawContent or something else? 2. If it is normal, than i can tehnically add any number of children this way? 3. After calling video.dispose(true); will such children be removed from stage, and unloaded from RAM?
  6. Sure, just want to make it as universal as possible For current projects i don't have urgency, so it would be cool if it will be possible someday in the future! Thanks for your creations
  7. Works cool, but is there any way of making this file collected with BinaryLoader, get played with all the cool features of MP3Loader? I mean like .playSound(); .pauseSound();, getting duration, monitoring progress, etc... It would be extremely cool and flexible! For .flac i suppose it's much more harder, coz you need some sort of decoder like with mp3...
  8. So i got my VideoLoader, and i've build custom right mouse button menu with some link... Strangely enough, it works if you click rmb and then clcik on the link somewhere on the content, but if you click on this link on video itself (.rawContent) - nothing happens :\ Probably some security issues, any thoughts?
  9. I have waiting for more than a minute, well, there is nothing perfect i know, worth trying though )) But the whole concept will be huge overload if there is like more than 2 players on one page...So i guess i have to drop the idea.
  10. // create video loader var video:VideoLoader = new VideoLoader(VIDpath, { name: "video", container: this, alpha: 0, bgColor: backgroundsColor, width: vW, height: vH, centerRegistration: true, scaleMode: "proportionalInside", alternateURL: videoURL, onComplete: initVideo, onError: errorCatch, onProgress: updateDownloadProgress }); video.load(); video.addEventListener(VideoLoader.VIDEO_BUFFER_FULL, swapBitmap); function swapBitmap(event:LoaderEvent):void { var bd:BitmapData = new BitmapData(video.content.width, video.content.height, false, 0x000000); bd.draw(video.content); var bitmap:Bitmap = new Bitmap(bd); bitmap.transform.matrix = video.content.transform.matrix; video.content.parent.addChildAt(bitmap, video.content.parent.getChildIndex(video.content)); video.content.parent.removeChild(video.content); video.unload(); // reset video playing flag videoPlaying = false; // pause video video.pauseVideo(); // switch play / pause visibility videoControls.btnPause.visible = false; videoControls.btnPlay.visible = true; } Nope, but now i had, so it gives same result ~204mb, which doesn't seem like unloading
  11. haha, haven't noticed, sorry Well, it works...But whole thing seem to be kind of pointless, coz with my test HD video which is 239 mb size, memory load reports exactly same, so it still loads whole video... Or could i miss something else? Well, anyway it's interesting to know, thx
  12. GreenSock hmm...this gives me Ideas? ' carl schooff yeah, i already have made something similar to this example, but problem is that i have dynamic resize, so i have to .clear and .drawRect with all of those calculations...pretty much intensive process. But seem that there are no options, and i'm very disappointed that in flash it is impossible to have alpha < 1 rectangle with glow / shadow instead border, it woule make our life sooo much easier!
  13. .wav is definately possible, check this out: http://active.tutsplus.com/tutorials/media/quick-tip-play-external-wav-files-in-as3/ But the problem is, that except they have loaded it as binary - i can't understand anything Hopefully you will
  14. Is there a way to make MP3Loader play .wav and .flac?
  15. carl schooff haha, i've just noticed that i forgot about some sneaky tween addresing for content, not for rawContent, that's why i have problems with background remained unseen GreenSock Hell, that's indeed sounds pretty hard and not so stable... I'm also not sure how to actually implement this with BUFFER_FULL, can you give me any short example? P.S. Do you guys know a cool and fast a way to draw a few pixel border around container, or make a glow (or shadow effect), that wouldn't change it's own color, when alpha or color of container have been changed? I was trying to use glow, but if alpha of container is not 1, than glow apply it's own color to the background...which is totally not cool
  16. // create video loader var video:VideoLoader = new VideoLoader(VIDpath, { name: "video", container: this, alpha: 0, bgColor: backgroundsColor, width: vW, height: vH, scaleMode: "proportionalInside", centerRegistration: true, alternateURL: videoURL, onComplete: initVideo, onError: errorCatch, onProgress: updateDownloadProgress }); For example i got code like this, and i want the black background to be seen and be 'ready' before i call video.load(); to actually load video...(coz i simply don't want to unnecessary load whole video into ram, before it actually used, but i want background to be seen) Or it woulb be cool if there are any way to preload just small portion of video, like first frame only, without loading whole video, so you would get black background + preview for the first frame, is it possible, and if it is - how to do it?
  17. jamiejefferson Hey, thank you! That makes sense, pity that no dynamic variables allowed... That's a great idea about null, and i also have an idea about just writing in VideoLoader alternateURL: VIDpath And it works also, pretty clean! carl schooff Works like charm, thank you again!
  18. Wow, Carl, thank you a lot! I missunderstood one thing at first, that those can be divided on Object and String, that totally makes sense now: So when i put videoURL directly in VideoLoader, now it works perfectly, but... http://www.sendspace.com/file/xpe1ga Take a look here, what i have problem with... If you will do it like this: function addVideo(VIDpath:String = videoURL):VideoLoader { .... } This will immideately give you an error: But i totally don't understand why, and got no one to ask except you (i know that this is not directly GS question, but still...) What i want is videoURL to be the default path for addVideo function, if there are no other String specified... Take a look at simple example, i'm sure you can understand what i'm doing wrong, it seem like some kind of flash bug (or my as syntax dyslexia)... About progress - everything is fine now, you was right...I just wonder that simulate download doesn't react as with flash native written player i used before But anyway on server it shows progress perfectly reasonable! thx a lot! Oh yeah, and i am trying to understand how to make "click on progress line to move on the specific place in video where it was clicked", http://active.tutsplus.com/tutorials/actionscript/smart-as3-video-loading-with-greensock-loadermax-free-active-premium/ like here you can click anywhere you want and go there, but there are nothing i can see in the tutorial about how to make it... P.S. I meant not scrubbing with scrubber, exactly click-to-go-to-mouse is what i need
  19. Well, i managed to get progress work, but it's like...Even when i test it in flash with modem speed it's immidiately show whole progress as loaded (that's why i thought it's not working)...How could it load that fast, that it's even impossible to notice difference between scaleX = 0 and scaleX = 1? Probably i still do something wrong or missing something? Well yeah, in my case it actually is a string, just a video URL... But it still act as an object for the var, and VideoLoader can't read it and thtow IO error back... How would you normally retrieve URL from html page using GS VideoLoader?
  20. Yep, doesn't work also...But hell, i still don't understand something about flash syntax probably... Please take a look, maybe you'll understand what's wrong: import com.greensock.*; import com.greensock.easing.*; import com.greensock.events.LoaderEvent; import com.greensock.loading.*; import com.greensock.loading.display.*; stage.align = "TL"; stage.scaleMode = "noScale"; // create new gallery instance var video1:VideoLoader = addVideo( "Videos/REHA720x576.mp4", ); /////////////////////////////////////////// VIDEO PLAYER ////////////////////////////////////////// function addVideo(VIDpath:Object = LoaderInfo(this.root.loaderInfo).parameters.GetVideoURL):VideoLoader { // url of video file var VIDpath:String; // create video loader var video:VideoLoader = new VideoLoader(VIDpath, { name: "video", autoPlay: false, container: this, alpha: 0, bgColor: backgroundsColor, scaleMode: "proportionalInside", centerRegistration: true, onComplete: initVideo, onError: errorCatch }); } What i want, is that function addVideo had it's default path value from html flashvar, like this VIDpath:Object = LoaderInfo(this.root.loaderInfo).parameters.GetVideoURL (i used to have it in past, and it was type of Object, working..), but also i would like to pass parameters of new URL, for this function (if needed), like this: var video1:VideoLoader = addVideo( "Videos/REHA720x576.mp4", ); And this is String type... So i don't know what to do, VideoLoader use only String or URLRequest, as you said, but i need to pass either String or Object (i believe)... Maybe there are some other way to retrieve URL from html's FlashVars and write it as String or URLRequest? Probably you missunderstood me about progress...I already got progress bar associated with time and mouse scrubber, what i need is download bar to monitor how much of video have been downloaded already...What you have showed seem to be same that i've done to monitor progress of video playback. I was watching those tutorials very precies already, but i feel that there are something i do wrong still in some scenarios...sorry for that
  21. Previously, when i wanted to get flashvars from .html page (using default flash loader), i was making it this way: But when i pass such thing to VideoLoader i got error How would i need to call for an URL from html now? P.S. And also i'm not sure how to monitor video download progress, like on youtube for example, if i got rectangle named downloadProgress, what should i do with videoLoader?
  22. I became really interested, and try...If i use Event.COMPLETE instead ProgressEvent.PROGRESS - it works fine, reliable (memory is nice too), but what about ProgressEvent.PROGRESS? Please, check if i have understood you right (if you don't want to waste your time on non gs related questions - i'll understand): var stream:URLStream; var request:URLRequest; // function that loads next URL until it fails to find valid combination function loadImagesURL():void { // load next URL index currentNum++; // current URL path, that replaces ## in IMGpath for a numbers currentURL = IMGpath.replace("##", currentNum); request = new URLRequest(currentURL); stream = new URLStream(); // pass new URL to loader stream.load(request); stream.addEventListener(ProgressEvent.PROGRESS, onNextComplete); stream.addEventListener(IOErrorEvent.IO_ERROR, onNextError); } // function that adds URL inside an array function onNextComplete():void { // add current URL inside an array imagesURL.push(currentURL); // for first written URL if (currentNum == 1) { // name & add controls on stage galleryControls.name = "galleryControls"; addChild(galleryControls); // create an XML text textXML(); // slowly change alpha of controls to let it appear TweenMax.to(galleryControls, loadAnimTime,{alpha: 1, delay: 0.14, onStart: function() {galleryControls.alpha = 0} }); } // load next URL loadImagesURL(); } // function that stop searching for images when there are no URL availible function onNextError():void { trace(imagesURL); stream.removeEventListener(ProgressEvent.PROGRESS, onNextComplete); stream.removeEventListener(IOErrorEvent.IO_ERROR, onNextError); // start listen for keys stage.addEventListener(KeyboardEvent.KEY_DOWN, reactToArrowKeys); // set up buttons array for (var i:int = 0; i < galleryButtonsArray.length; i++) { // add listeners for previous / next click galleryButtonsArray[i].addEventListener(MouseEvent.CLICK, imageButtonsActions); } } This way when i trace(imagesURL); last written url is usually something like system/gallery/patr/picture1217.jpg, but actually in my folder there are 11 files...So if use ProgressEvent, it can't stop in time, when IOError happens, right? P.S. and also, do i need to unload stream somehow, after it have been (or when i dispose whole gallery) done or it's automatically?
  23. Well...That's a good question actually, but it's also hard one for my understanding also... I mean, for example, if dataLoader after doing his job have loaded memory THAT hard (and i still have to dispose of it, after it's finished to unload his part from memory), than how much ImageLoader will eat...Well, probably i just miss your question concept, could you provide fast example piece of what you mean? As i understood, in this way, i'll have to check all the urls with image loader, than dispose it (just to unload all the memory that was full-filled with fast url check, which equal almost whole folder weight), and then load it with single needed url, did i get it right? Well, technically it's just the same i guess... But, is there a way to check urls availibility without loader? My goal in the first place is just to make an array of urls, with this automated method, but as you can see it's not really perfect...
  24. I meant, is it correct to loaderImages.unload(); to just unload picture from loader and do nothing more? Ok...What i wanted in this part, with my previous code, is just to ensure that after you press button, you will unload previous image, and load new only if something is already inside loader, but i believe you said somewhere, that if you just load image with ImageLoader, you don't have to call for unload first, it will automatically unload everything for you (even if it's not fully loaded also?), is it right? It's easy what i'am doing, just not so many people do it... I pass URL string like this "system/gallery/patr/picture##.jpg", and then DataLoader changes ## for numbers and write each valid url inside an URL array (which i use to switch between pitctures), until it fails... I know you thought that this is kinda crazy and probably slow, but why not, since it's projector standalone .exe project?) I think it's kinda cool way to just rename your pictures, and don't even waste your time editing xml.. So, to shorten it out, basicly what DataLoader doing in my case, is simply checking if file name really exists...Is there any better / faster way to do this without actual loading something in ram? What i need is just to check if URL really exists, and if not do something, but now it's loading content of url of course
×
×
  • Create New...