Exemplo n.º 1
0
        //private readonly DefaultBandwidthMeter BandwidthMeter = new DefaultBandwidthMeter();
        //private IDataSourceFactory DefaultDataMediaFactory;


        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            RequestWindowFeature(WindowFeatures.NoTitle);
            Window.SetFlags(WindowManagerFlags.Fullscreen,
                            WindowManagerFlags.Fullscreen);

            SetContentView(Resource.Layout.MediaPlayerLayout);
            SimpleExoPlayerView = FindViewById <PlayerView>(Resource.Id.exo_media_player_view);
            SimpleExoPlayerView.SetShutterBackgroundColor(Color.Transparent);
            Instance = this;

            imgAudio           = FindViewById <ImageView>(Resource.Id.imgAudio);
            progressBar        = FindViewById <ProgressBar>(Resource.Id.progressBar);
            frameLayout        = FindViewById <FrameLayout>(Resource.Id.frameLayout);
            mediaList          = JsonConvert.DeserializeObject <List <RvDatum> >(Intent.GetStringExtra("mediaList"));
            selectedMedia      = JsonConvert.DeserializeObject <RvDatum>(Intent.GetStringExtra("selectedMedia"));
            videoId            = Intent.GetStringExtra("videoId");
            imgProfile         = FindViewById <ImageView>(Resource.Id.imgProfile);
            imgProfile.Click  += UserProfile_Click;
            txtUserName        = FindViewById <TextView>(Resource.Id.txtUserName);
            txtUserName.Click += UserProfile_Click;
            txtDescription     = FindViewById <TextView>(Resource.Id.txtDescription);
            txtdays            = FindViewById <TextView>(Resource.Id.txtdays);
            btnLike            = FindViewById <ImageView>(Resource.Id.btnLike);
            btnLike.Click     += btnLike_Click;
            btnLike.Tag        = "0";
            txtLikeNumber      = FindViewById <TextView>(Resource.Id.txtLikeNumber);
            btnComment         = FindViewById <ImageView>(Resource.Id.btnComment);
            btnComment.Click  += btnComment_Click;
            txtCommentNumber   = FindViewById <TextView>(Resource.Id.txtCommentNumber);
            btnShare           = FindViewById <ImageView>(Resource.Id.btnShare);
            btnShare.Click    += btnShare_Click;
            txtShareNumber     = FindViewById <TextView>(Resource.Id.txtShareNumber);

            CommentsLayout = FindViewById <FrameLayout>(Resource.Id.ResponseCommentsLayout);
            CommentsLayout.LayoutParameters.Height = (int)(Resources.DisplayMetrics.HeightPixels / 2);
            //txtHideComment = FindViewById<TextView>(Resource.Id.txtHideResponseComments);
            //txtHideComment.Click += txtHideComment_Click;
            CommentsFragment = new ResponseComments.ResponseCommentsFragment();
            FragmentTransaction ftvideo = SupportFragmentManager.BeginTransaction();

            ftvideo.SetCustomAnimations(Resource.Animation.slide_up, Resource.Animation.slide_down);
            ftvideo.AddToBackStack(null);
            ftvideo.Add(CommentsLayout.Id, CommentsFragment, null).Hide(CommentsFragment).Commit();

            swipListener = new OnSwipeTouchListener(this);
            //DefaultDataMediaFactory = new DefaultDataSourceFactory(this, Util.GetUserAgent(this, AppSettings.ApplicationName), BandwidthMeter);
            TabbedMainActivity.GetInstance().VideoActionsController.ReleaseVideo();
            PlayAsync();
        }
Exemplo n.º 2
0
 public PlayerListener(MediaPlayerActivity mediaPlayerActivity)
 {
     this.mediaPlayerActivity = mediaPlayerActivity;
     LoadingProgressBar       = mediaPlayerActivity.FindViewById <ProgressBar>(Resource.Id.progressBar);
 }