示例#1
0
 public static void SkipToPrev(int id = -1)
 {
     if (PlaystateManagement.MediaPlayerIsStreaming || PlaystateManagement.PlayerTypeQueued() == PlayerType.NativeMediaPlayer)
     {
     }
     if (!PlaystateManagement.MediaPlayerIsStreaming || PlaystateManagement.WebViewPlayerIsStreaming ||
         PlaystateManagement.PlayerTypeQueued() == PlaystateManagement.PlayerType.WebViewPlayer)
     {
         try {
             if (id == -1)
             {
                 if (PlaystateManagement.GetWebViewPlayerById().CanGoBack())
                 {
                     PlaystateManagement.GetWebViewPlayerById().GoBack();
                 }
             }
             else
             {
                 if (PlaystateManagement.GetWebViewPlayerById(id).CanGoBack())
                 {
                     PlaystateManagement.GetWebViewPlayerById(id).GoBack();
                 }
             }
         }catch { }
     }
     else
     {
     }
 }
        public async void StartAwaitCallbackValueLoop(ExtWebValueCallbackListener listener)
        {
            bool loopStarted = false;

            while (((listener.ResultObject?.ToString() == "null" || listener.ResultObject?.ToString() == "true" ||
                     listener.ResultObject?.ToString() == "false") || listener.ResultObject == null) || loopStarted == false)
            {
                loopStarted = true;
                await Task.Delay(100);

                if (listener.ResultObject != null && ((ObjectType)listener.ResultObject) != ObjectType.None)
                {
                    listener.ResultObjectJava = (Java.Lang.Object)listener.ResultObject;
                    var cast = listener.ResultObject.ToString();
                    if (cast == "true")
                    {
                        _serviceWebViewPlayingList.Add(PlaystateManagement.GetWebViewPlayerById(listener.RequestObjectId, -1));
                        return;
                    }
                }

                if (listener.ResultObject != null)
                {
                    if ((ObjectType)listener.ResultObject == ObjectType.None)
                    {
                        _nullObjectCount++;
                        return;
                    }
                }
            }
        }
 public static void OnPlaystateChanged(PlaystateEventArgs e)
 {
     if (e.WebViewPlayerIdConfirmedInBackgroundIsPlaying != -1 && e.WebViewPlayerConfirmedInBackgroundIsPlaying)
     {
         PlaystateManagement.GetWebViewPlayerById(e.WebViewPlayerIdConfirmedInBackgroundIsPlaying).PlaybackShouldResumeOnMinimize = true;
         _playerIdPlayingCallbackResponseList
         .Add(new Tuple <int, bool>(e.WebViewPlayerIdConfirmedInBackgroundIsPlaying, e.WebViewPlayerConfirmedInBackgroundIsPlaying));
     }
 }
示例#4
0
 /// <summary>
 /// skips to the next video on a WebView tab
 /// </summary>
 /// <param name="tab"></param>
 public static void SendWebViewNextVideoCommand(int id = -1)
 {
     if (id == -1)
     {
         id = PlaystateManagement.WebViewPlayerNumberIsStreaming;
     }
     if (id != -1)
     {
         PlaystateManagement.GetWebViewPlayerById(id).LoadUrl(JavascriptCommands._jsNextVideoByASpa);
     }
 }
示例#5
0
        protected void OnNewIntent(Intent intent)
        {
            string url = "";

            if (intent != null)
            {
                try { url = intent.Extras.GetString("URL"); }
                catch {   }
            }
            if (url == "" || url == null)
            {
                return;
            }
            try
            {
                PlaystateManagement.GetWebViewPlayerById(-1, MainActivity.ViewPager.CurrentItem).LoadUrl(url);
            }
            catch {   }
        }