7 Replies Latest reply on Aug 27, 2010 6:21 AM by ScreenName1710b

    OSMF and High Availability Streams

    ScreenName1710b

      Currently we are working on a High Availablility Stream fail-over for our FMS systems.


      We are working with two simultaneous streams from different servers, and using our FMS system to switch over between the two; however, I noticed an command with OSMF that is causing us an issue.

       

      According to the NetStreamTimeTrait class when the player receives a NetStream.Play.UnpublishNotify - it fires a signalComplete() - which in turn switches the player to stop.

       

      Unfortunately, the Unpublish subscribe comes straight from the "root" ingest point of the stream, and it appears that it cannot be intercepted before it gets to the client player.  Our FMS/Ops doesn't want to set up a dummystream to each player as that would claim more resources/overhead were the number of streams/clients to get large.  I've tested this switchover with a standard OVP player, and this issue does not occur (the stream continues playing after the stream has switched over.) -and I believe it's because it doesn't do any actions associated with the Unpublish event.

       

      Currently we are looking at extending our current plug-in to subclass/rewrite the NetStreamTimeTrait class (and all classes that touch it), but it's not my first choice.

       

      Does anyone know another option?

      Thanks in advance.

       

      -Will

        • 1. Re: OSMF and High Availability Streams
          weizhangstrobe Level 2

          Hi Will,

           

          Before making any recommendation, I would like to understand the situation correctly here.

           

          When one stream has unpublished, you want to switch to another stream since the unpublish could be fault of various parties instead of content reaches its end, right? And OSMF thinks the stream has reached the end once it receives unpublish.

           

           

          -Wei Zhang

          Senior Computer Scientist

          Adobe Systems, Inc.

          weizhang@adobe.com

          • 2. Re: OSMF and High Availability Streams
            ScreenName1710b Level 1

            We have two ingest servers taking in the same video stream.

            When one fails (client disconnection at source, online disconnection to source, or source failure) then the edge server switches over to the non-failed stream. However, when the first fail "unPublish" is sent, OSMF stops the player because it believes the stream is completed. On the servers, we are using a modified version of the Livecast, as our first attempt with that code didn't seem to work.

             

            I've gone ahead and re-written our plug-in to include all of those classes (NetStreamTimeTrait, AudioElement, Lightweightvideoelement) and now it does work; it determines if it's an HA stream, and then ignores the singleComplete if it is.  I did want to avoid having a bunch custom classes in our plug-in (with very little modifications) that have a high probability of changing in core OSMF in the future.

            Thanks.

             

            -Will

            • 3. Re: OSMF and High Availability Streams
              weizhangstrobe Level 2

              As an alternative, you can write a proxy element to surrogate the video element. Then the proxy can decide when (under the context of unpublish) to ignore the complete signal and go along with switching to the other stream.

               

               

              -Wei Zhang

              Senior Computer Scientist

              Adobe Systems, Inc.

              weizhang@adobe.com

              1 person found this helpful
              • 4. Re: OSMF and High Availability Streams
                ScreenName1710b Level 1

                Seems that my QoS plugin has also now gone on the fritz because it doesn't see the VideoElement anymore (I'd have to customize it for the new connection plugin probably - which would exclude its functionality when not using that plugin).

                 

                I'd like to implement a Proxied VideoElement, but I'm unclear how I would override that NetStreamTimeTrait, as both the VideoElement and LightweightVideoElement don't listen for the TimeEvent.COMPLETE - something else is.

                 

                So my guess is that I would have to pull the NetStreamTime trait in the Proxy and replace it when the VideoElement is loaded?

                 

                I'll look over the proxy plug-in implementation and let you know if I run into issues.

                Thanks.

                -Will

                • 5. Re: OSMF and High Availability Streams
                  ScreenName1710b Level 1

                  Might need a little advice on how to get that working with a Proxy; as I like the idea of having to rewrite as few classes as possible for a plugin. (A proxy would be 1 class, and the other method is 4+ classes)

                   

                  It doesn't appear that I can just remove the old NetstreamTimeTrait and replace the trait with a new custom trait that doesn't have that completeSignal; since all of the add/remove traits functions are protected for a video or media element. If I just pull the NetstreamTimeTrait how can I adjust either the internal netstreamevent response or the signal complete response given that both are private functions? Will I have to still write a custom VideoElement to modify the traits? and doesn't that basically eliminate the advantage of a Proxy?

                   

                  FYI, this is only a problem with the OSMF, I've tested our HA streaming on OVP, flowplayer, and other players and the switchover occurred without incident.

                   

                  Thanks in advance.

                  -Will

                  • 6. Re: OSMF and High Availability Streams
                    bringrags Level 4

                    One other possibility would be to try to suppress the Unpublish.Notify event.  You could do this by accessing the NetStream (I'm fairly sure how to do so is described in a dozen other threads), adding an event listener with a high priority, checking to see if the received event is an Unpublish.Notify event, and if so calling event.stopImmediatePropagation() so that the NetStreamTimeTrait never receives it.

                     

                    The proxy approach that Wei mentions would work as follows:  You would create a ProxyElement subclass that proxies the VideoElement.  The ProxyElement subclass would gain access to the NetStream, and override the TimeTrait with a custom TimeTrait.  For most operations, it would simply pass the values from the proxied TimeTrait up (i.e. you would add listeners to the proxied TimeTrait, and then update the overriding TimeTrait accordingly).  However, if it receives a "complete" event, and that event is in response to an Unpublish.Notify (which you would determine by listening for the event on the NetStream), then it would not propagate that same event up to the overriding TimeTrait.  Hopefully that makes sense -- if not, I can provide more specifics.

                    1 person found this helpful
                    • 7. Re: OSMF and High Availability Streams
                      ScreenName1710b Level 1

                      My fault for not looking at the ProxyElement class a little closer; thank you both for your insight.

                      Since I already have a General Streaming Plugin (that provides custom netconnection/stream), I've folded some aspects of what we need with the HA and Buffering into the same solution. Currently, I'm subclassing the VideoElement that replaces the TimeTrait with a custom one and monitors the buffering.

                       

                      However, I think your idea of stopping the event propagation is a better method, since I'm already listening to NetStatus events and I wouldn't have to create a custom NetStreamTimeTrait, so I will look at implementing that.

                      Thanks again to both of you for your help.

                       

                      -Will