public static string GetVideoUrlByTab(int tab)
        {
            string taburl = "";

            taburl = CommonFrag.GetFragmentById(-1, null, tab)?.Wv.OriginalUrl;
            return(taburl);
        }
Example #2
0
        public static void LoadVideoFromUrl(Intent i = null, int tab = -1, string url = null)
        {
            string u = "";

            if (i != null)
            {
                try { u = i.GetStringExtra("URL"); }
                catch { }
                if (u == null || u == "")
                {
                    return;
                }
                else
                {
                    url = u;
                }
            }
            if (!PlaystateManagement.MediaPlayerIsStreaming)
            {
                if (tab == -1)
                {
                    tab = MainActivity.ViewPager.CurrentItem;
                }
                CommonFrag.GetFragmentById(-1, null, tab).Wv.LoadUrl(url);
            }
            else
            {
            }
        }
 public static async void SetReload(int tab = -1)
 {
     if (tab == -1)
     {
         tab = MainActivity.ViewPager.CurrentItem;
     }
     CommonFrag.GetFragmentById(-1, null, tab).SetReload();
 }
 public override bool OnKeyDown(Android.Views.Keycode keyCode, KeyEvent e)
 {
     if (e.KeyCode == Android.Views.Keycode.Back)
     {
         CommonFrag.GetFragmentById(-1, null, ViewPager.CurrentItem).WebViewGoBack();
     }
     return(false);
 }
        protected override void OnPause()
        {
            VerifyInBackground(WindowFocusChangedToBackground);

            if (UserRequestedStickyBackground)
            {
                StartStickyAfterDelay(0, UserRequestedStickyBackground, CommonFrag.GetFragmentById(-1, null, ViewPager.CurrentItem).Wv.Id);
                UserRequestedStickyBackground = false;
            }

            base.OnPause();
        }
Example #6
0
 public static void SendVideoCardListToFeedRecycler(List <VideoCard> vcl, Android.Support.V7.Widget.RecyclerView recyclerView, int id = -1)
 {
     if (GetFeedRecyclerViewAdapter == null)
     {
         GetFeedRecyclerViewAdapter            = new FeedRecyclerViewAdapter(vcl);
         GetFeedRecyclerViewAdapter.ItemClick += CommonFrag.GetFragmentById(id).RootVideoAdapter_ItemClick;
         recyclerView.SetAdapter(GetFeedRecyclerViewAdapter);
     }
     else
     {
         GetFeedRecyclerViewAdapter.UpdateDataSet(vcl, true);
     }
 }
        public static async void StartStickyAfterDelay(int d = 3000, bool userRequestedStickyBackground = false, int idOverride = -1)
        {
            if (idOverride != -1)
            {
            }
            else
            {
                idOverride = CommonFrag.GetFragmentById(-1, null, ViewPager.CurrentItem).Wv.Id;
            }
            if (userRequestedStickyBackground)
            {
                MainPlaybackSticky.StartVideoInBkgrd(idOverride);
                CommonFrag.GetFragmentById(-1, null, ViewPager.CurrentItem).Wv.StickyBackgroundRequested = true;
            }
            await Task.Delay(d);

            if (MainPlaybackSticky.IsInBkGrd() && PlaystateManagement.WebViewPlayerIsStreaming && AppSettings.AutoPlayOnMinimized != "off")
            {
                if (AppState.ForeNote == null)
                {
                    MainPlaybackSticky.StartForeground(BitChute.ExtNotifications.BuildPlayControlNotification(), true, true);
                }
            }
        }
 public override void OnConfigurationChanged(Configuration newConfig)
 {
     base.OnConfigurationChanged(newConfig);
     if (newConfig.Orientation == Orientation.Landscape)
     {
         NavigationView.Visibility = ViewStates.Gone;
         try {
             if (CommonFrag.GetFragmentById(-1, null, ViewPager.CurrentItem).Wv.Url.StartsWith(@"https://www.bitchute.com/video/") &&
                 CommonFrag.GetFragmentById(-1, null, ViewPager.CurrentItem).Wv.RootUrl != Https.URLs._settings &&
                 CommonFrag.GetFragmentById(-1, null, ViewPager.CurrentItem).Wv.RootUrl != Https.URLs._myChannel)
             {
                 CommonFrag.GetFragmentById(-1, null, ViewPager.CurrentItem)
                 .Wv.LoadUrl(JavascriptCommands.GetInjectable(JavascriptCommands.JsHideTitle +
                                                              JavascriptCommands.JsHideWatchTab + JavascriptCommands.JsHideTooltips + JavascriptCommands.JsHidePageBar));
             }
             else if (CommonFrag.GetFragmentById(-1, null, ViewPager.CurrentItem).Wv.Url.StartsWith(@"https://www.bitchute.com/channel/") ||
                      CommonFrag.GetFragmentById(-1, null, ViewPager.CurrentItem).Wv.RootUrl == Https.URLs._myChannel ||
                      CommonFrag.GetFragmentById(-1, null, ViewPager.CurrentItem).Wv.RootUrl == Https.URLs._settings ||
                      CommonFrag.GetFragmentById(-1, null, ViewPager.CurrentItem).Wv.Url == Https.URLs._homepage)
             {
                 CommonFrag.GetFragmentById(-1, null, ViewPager.CurrentItem)
                 .Wv.LoadUrl(JavascriptCommands.GetInjectable(
                                 JavascriptCommands.JsHideTitle + JavascriptCommands.JsHideTooltips));
             }
             else
             {
                 CommonFrag.GetFragmentById(-1, null, ViewPager.CurrentItem)
                 .Wv.LoadUrl(JavascriptCommands.GetInjectable(
                                 JavascriptCommands.JsShowTitle + JavascriptCommands.JsHideTooltips + JavascriptCommands.JsHidePageBar));
             }
             AppState.Display.Horizontal = true;
             _window.ClearFlags(_winflagnotfullscreen);
             _window.AddFlags(_winflagfullscreen);
         } catch { }
     }
     else if (newConfig.Orientation == Orientation.Portrait)
     {
         if (CommonFrag.GetFragmentById(-1, null, ViewPager.CurrentItem).Wv.Url.Contains(@"https://www.bitchute.com/video/") &&
             CommonFrag.GetFragmentById(-1, null, ViewPager.CurrentItem).Wv.RootUrl != Https.URLs._settings &&
             CommonFrag.GetFragmentById(-1, null, ViewPager.CurrentItem).Wv.RootUrl != Https.URLs._myChannel)
         {
             CommonFrag.GetFragmentById(-1, null, ViewPager.CurrentItem)
             .Wv.LoadUrl(JavascriptCommands.GetInjectable(JavascriptCommands.JsShowTitle + JavascriptCommands.JsHideTooltips));
         }
         else if (CommonFrag.GetFragmentById(-1, null, ViewPager.CurrentItem).Wv.Url.StartsWith(@"https://www.bitchute.com/channel/") ||
                  CommonFrag.GetFragmentById(-1, null, ViewPager.CurrentItem).Wv.Url.StartsWith(@"https://www.bitchute.com/profile/") ||
                  CommonFrag.GetFragmentById(-1, null, ViewPager.CurrentItem).Wv.RootUrl == Https.URLs._myChannel ||
                  CommonFrag.GetFragmentById(-1, null, ViewPager.CurrentItem).Wv.RootUrl == Https.URLs._settings ||
                  CommonFrag.GetFragmentById(-1, null, ViewPager.CurrentItem).Wv.Url == Https.URLs._homepage)
         {
             CommonFrag.GetFragmentById(-1, null, ViewPager.CurrentItem)
             .Wv.LoadUrl(JavascriptCommands.GetInjectable(
                             JavascriptCommands.JsShowTitle + JavascriptCommands.JsShowWatchTab + JavascriptCommands.JsHideTooltips));
         }
         else
         {
             CommonFrag.GetFragmentById(-1, null, ViewPager.CurrentItem)
             .Wv.LoadUrl(JavascriptCommands.GetInjectable(
                             JavascriptCommands.JsShowTitle + JavascriptCommands.JsHideTooltips));
         }
         AppState.Display.Horizontal = false;
         _window.ClearFlags(_winflagfullscreen);
         _window.AddFlags(_winflagnotfullscreen);
         CustomOnTouch();
     }
     if (!AppSettings.HideHorizontalNavBar || newConfig.Orientation == Orientation.Portrait)
     {
         NavTimeout = false;
     }
 }
 void NavigationView_NavigationItemReSelected(object sender, BottomNavigationView.NavigationItemReselectedEventArgs e)
 {
     CommonFrag.GetFragmentById(-1, null, e.Item.Order).Pop2Root();
 }
        public static async void DelayedScrollToTop(int tab)
        {
            await System.Threading.Tasks.Task.Delay(AppSettings.ScrollToTopDelay);

            CommonFrag.GetFragmentById(-1, null, MainActivity.ViewPager.CurrentItem).Wv.ScrollTo(0, 0);
        }