internal PlayerControl(string source, Window window, IUIUpdate loadingUpdater = null, bool usePlayready = false)
        {
            uriSource   = source;
            this.window = window;
            player      = new Tizen.TV.Multimedia.Player();
            player.SetSource(new MediaUriSource(uriSource));

            player.Display            = new Display(window);
            player.PlaybackCompleted += (s, _) =>
            {
                player.Stop();
                Unprepare();
            };
            player.PlaybackInterrupted += (s, _) =>
            {
                Tizen.Log.Info("KEY", "Interrupted");
                interruptedPosition = player.GetPlayPosition();
                Unprepare();
            };
            player.ErrorOccurred += (s, e) =>
            {
                Tizen.Log.Info("KEY", e.ToString());
            };

            if (loadingUpdater != null)
            {
                this.loadingUpdater              = loadingUpdater;
                player.BufferingProgressChanged += BufferingHandler;
            }
            if (usePlayready)
            {
                try
                {
                    drm = DRMManager.CreateDRMManager(DRMType.Playready);
                    drm.AddProperty("LicenseServer", licenseServer);
                    drm.AddProperty("DeleteLicenseAfterUse", true);
                    drm.AddProperty("GetChallenge", true);
                }
                catch (ArgumentException e)
                {
                    if (drm != null)
                    {
                        drm.Dispose();
                    }
                    MessageBox.New(e.ToString());
                }
                catch (PlatformNotSupportedException e)
                {
                    MessageBox.New(e.ToString());
                }
            }
        }