11 Replies Latest reply on Jul 2, 2013 5:34 AM by venkey-vavni

    imagetrait not being displayed in Safari

    funkysoul Level 4

      Anyone has experienced any issues with an imagetrait on Safari? I have a serial element with an image, swf and a video.

      The latter are working fine but the image doesn't display at all and it shoots me the error:


      ArgumentError: Invalid parameter passed to method
          at org.osmf.traits::LoadTrait/setBytesLoaded()
          at org.osmf.elements.loaderClasses::LoaderLoadTrait/loadStateChangeStart()
          at org.osmf.traits::LoadTrait/setLoadState()
          at org.osmf.traits::LoadTrait/onLoadStateChange()
          at flash.events::EventDispatcher/dispatchEventFunction()
          at flash.events::EventDispatcher/dispatchEvent()
          at org.osmf.traits::LoaderBase/updateLoadTrait()
          at Function/<anonymous>()



      Any ideas what could be wrong with it?

        • 1. Re: imagetrait not being displayed in Safari

          I think this has nothing to do with the browser, do you use the 1.0 sources?


          I just updated my SWC from 0.95 to 1.0 and I have the same problem with ImageElements (loaded as DurationElements). It looks like they get loaded correctly but they are not being displayed. I think the OSMF team did some changes with some classes in the new version. Let's wait for their response...

          • 2. Re: imagetrait not being displayed in Safari
            bringrags Level 4

            Could you post some source (and/or an image URL) that we can use to reproduce?  The error you're getting seems to be the result of Loader.contentLoaderInfo's bytesLoaded value being out of range (negative, greater than bytesTotal, or NaN).

            1 person found this helpful
            • 3. Re: imagetrait not being displayed in Safari
              funkysoul Level 4

              kkonrad, nope I'm using Sprint 10 (0.93), funny though that it works on all other browsers (IE, FF, Chrome) it's only not working with Safari, doesn't matter if Windows or Mac version.


              I could always put a try/catch so the error doesn't appear, but that still doesn't solve the problem as the image is really not being displayed.

              • 4. Re: imagetrait not being displayed in Safari
                funkysoul Level 4

                Brian, thanks for the reply.


                Below is the specific code portion that creates the serial element, everything is being created there and passed on to my mediaplayer class as a serialelement.


                private function buildSerialElements():void
                            var i:int = 0;
                            for each ( var video:XML in _xml..video )
                                var serialElement:SerialElement = new SerialElement();
                                var imgElement:DurationElement = new DurationElement( video.stillImage.@duration, new ImageElement( new URLResource( video.stillImage ), new ImageLoader() ) );
                                serialElement.addChild( imgElement );
                                if ( video.preRoll.@active == "true" )
                                    if ( video.preRoll.@type == "swf" )
                                        var swfEl:DurationElement = new DurationElement( video.preRoll.@duration, new SWFElement( new URLResource( video.preRoll ) ) );
                                        serialElement.addChild( swfEl );
                                        var vidEl:VideoElement = new VideoElement( new URLResource( video.preRoll ), new NetLoader() ) ;
                                        serialElement.addChild( vidEl );
                                var movie:VideoElement    = new VideoElement( new URLResource( video.videoURL ), new NetLoader() );
                                serialElement.addChild( movie );
                                _compositeVec[ i ] = serialElement;
                            _played = true;
                            dispatchEvent( new Event ( Event.COMPLETE ) );


                Below the URL to the sample player,



                Thanks for your help

                • 5. Re: imagetrait not being displayed in Safari
                  bringrags Level 4

                  So far we've been unable to reproduce this (using OSMF 1.0, Safari on Mac or Win, with Flash 10.1 from labs.adobe.com).  If/when you upgrade to OSMF 1.0, please let us know if you're still seeing the issue.

                  • 6. Re: imagetrait not being displayed in Safari
                    funkysoul Level 4

                    Yep, you are absolutely right, with OSMF 1.0 the imageElement is being displayed again no errors, everything working like a charm,

                    thanks again for an outstanding cool framework.

                    • 7. Re: imagetrait not being displayed in Safari
                      kkonrad Level 1

                      For me it still doesn't work. ImageElements are not being displayed using OSMF 1.0. Switching back to 0.95 makes everything works fine.


                      What I'am doing:


                      Creating a DurationElement with a Image Element:

                      imageElement1 = new DurationElement(3, new ImageElement(new URLResource(imagePath1)));


                      Adding it to the Container:



                      Calling a method to start the playback:




                      Starting the plaback with:

                      private function startSerialParallelPlayback():void
                           serialElement = new SerialElement();
                           serialElement.addChild(introElementP); // ParellelElement - is being displayed in 1.0 and 0.95
                           serialElement.addChild(imageElement1); // DurationElement - is not being in 1.0 but in 0.95    
                           serialElement.addChild(imageElement2); // ...
                           serialElement.addChild(imageElement3); // ... 
                           serialElement.addChild(outroElementP); // ParallelElement - is being display like above
                           mediaPlayer.media = serialElement; 


                      I'm using Flex 3.5 / FP WIN 10,1,51,95 and the OSMF.SWC lib

                      • 8. Re: imagetrait not being displayed in Safari
                        kkonrad Level 1

                        And I found another procedure which doesn't work in 1.0 but in 0.95:


                        When called:


                        private function onTraitAdd(event:MediaElementEvent):void

                             if (mediaContainer.containsMediaElement(imageElement1))
                             }else ...



                        - in 0.95 - the ImageElement gets removed from stage

                        - in 1.00 - I get a Error: Invalid parameter passed to method

                        • 9. Re: imagetrait not being displayed in Safari
                          bringrags Level 4

                          @kkonrad: Can you post a small, complete, runnable example with source (and image URLs) that shows the problem?  Thanks!

                          • 10. Re: imagetrait not being displayed in Safari
                            kkonrad Level 1

                            please check your PM

                            • 11. Re: imagetrait not being displayed in Safari

                              I am also getting the same error with OSMF.swf 2.0 with safari and chrome. It's working fine in IE anf FF.  Does any one of you got the solution for this issue