Esempio n. 1
0
 public JWEventHandler(JWPlayerView jwPlayerView, TextView output)
 {
     mOutput = output;
     jwPlayerView.AddOnSetupErrorListener(this);
     jwPlayerView.AddOnPlaylistListener(this);
     jwPlayerView.AddOnPlaylistItemListener(this);
     jwPlayerView.AddOnPlayListener(this);
     jwPlayerView.AddOnPauseListener(this);
     jwPlayerView.AddOnBufferListener(this);
     jwPlayerView.AddOnIdleListener(this);
     jwPlayerView.AddOnErrorListener(this);
     jwPlayerView.AddOnSeekListener(this);
     jwPlayerView.AddOnTimeListener(this);
     jwPlayerView.AddOnFullscreenListener(this);
     jwPlayerView.AddOnQualityLevelsListener(this);
     jwPlayerView.AddOnQualityChangeListener(this);
     jwPlayerView.AddOnCaptionsListListener(this);
     jwPlayerView.AddOnCaptionsChangeListener(this);
     jwPlayerView.AddOnAdClickListener(this);
     jwPlayerView.AddOnAdCompleteListener(this);
     jwPlayerView.AddOnAdSkippedListener(this);
     jwPlayerView.AddOnAdErrorListener(this);
     jwPlayerView.AddOnAdImpressionListener(this);
     jwPlayerView.AddOnAdTimeListener(this);
     jwPlayerView.AddOnAdPauseListener(this);
     jwPlayerView.AddOnAdPlayListener(this);
     jwPlayerView.AddOnMetaListener(this);
     jwPlayerView.AddOnPlaylistCompleteListener(this);
     jwPlayerView.AddOnCompleteListener(this);
     jwPlayerView.AddOnBeforePlayListener(this);
     jwPlayerView.AddOnBeforeCompleteListener(this);
 }
Esempio n. 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            mPlayerView = FindViewById <JWPlayerView>(Resource.Id.jwplayer);
            TextView outputTextView = FindViewById <TextView>(Resource.Id.output);

            toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            // Handle hiding/showing of ActionBar
            SetSupportActionBar(toolbar);
            mPlayerView.AddOnFullscreenListener(this);

            // Instantiate the JW Player event handler class
            mEventHandler = new JWEventHandler(mPlayerView, outputTextView);

            // Load a media source
            PlaylistItem pi = new PlaylistItem("http://playertest.longtailvideo.com/adaptive/bipbop/gear4/prog_index.m3u8");

            mPlayerView.Load(pi);
            mCastManager = CastManager.Instance;
            mCastManager.AddDeviceListener(new DeviceListener());
            mCastManager.AddPlayerListener(new PlayerListener());
            mCastManager.AddApplicationListener(new ApplicationListener());
            mCastManager.AddConnectionListener(new ConnectionListener());
            mCastManager.AddErrorListener(new ErrorListener());
        }