Package 

Class Cast

  • All Implemented Interfaces:
    tv.mycujoo.mcls.cast.ICast

    
    public final class Cast
     implements ICast
                        

    Integration with Google Cast

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      ISessionManagerListener initialize(Context context, ICastListener castListener) Initialize integration by
      • Creating CastContext

      • Setting current session to newly created CastContext

      • Return SessionManagerListener

      Unit loadRemoteMedia(CasterLoadRemoteMediaParams params) Load given parameters into remote device
      Unit play() Play content on remote client
      Unit pause() Pause content on remote client
      Unit seekTo(Long position) Seek to given position on remote client
      Unit fastForward(Long amount) Fast forward by given amount
      Unit rewind(Long amount) Rewind by given amount
      Long currentPosition() Return current position, if remote media client is setup
      Unit onResume() Add cast session listener in onResume event of host component Must be called in onResume of host Activity/Fragment
      Unit onPause() Remove cast session listener in onPause event of host component Must be called in onPause of host Activity/Fragment
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Cast

        Cast(ViewStub miniControllerViewStub, MediaRouteButton mediaRouteButton, String receiverAppId)
        Parameters:
        miniControllerViewStub - view-stub which mini controller will inflate at
    • Method Detail

      • initialize

         ISessionManagerListener initialize(Context context, ICastListener castListener)

        Initialize integration by

        • Creating CastContext

        • Setting current session to newly created CastContext

        • Return SessionManagerListener

        Parameters:
        context - context to create CastContext from
        castListener - listener for cast session events
      • loadRemoteMedia

         Unit loadRemoteMedia(CasterLoadRemoteMediaParams params)

        Load given parameters into remote device

      • play

         Unit play()

        Play content on remote client

      • pause

         Unit pause()

        Pause content on remote client

      • seekTo

         Unit seekTo(Long position)

        Seek to given position on remote client

        Parameters:
        position - position at which player must seek to
      • currentPosition

         Long currentPosition()

        Return current position, if remote media client is setup

      • onResume

         Unit onResume()

        Add cast session listener in onResume event of host component Must be called in onResume of host Activity/Fragment

      • onPause

         Unit onPause()

        Remove cast session listener in onPause event of host component Must be called in onPause of host Activity/Fragment