Exemple #1
0
        public void SetSkin(JwSkinPackage pkg)
        {
            pkg.BindAndResize(BackgroundIcon, componentName, "background");
            pkg.BindHoverButton(PlayIcon, componentName, "playIcon", "playIconOver");
            pkg.BindHoverButton(MuteIcon, componentName, "muteIcon", "muteIconOver");
            pkg.BindAndResize(BufferIcon, componentName, "bufferIcon");

            var interval = pkg.GetSettingValue(componentName, "bufferinterval") ?? "100";
            var rotation = pkg.GetSettingValue(componentName, "bufferrotation") ?? "15";

            spinAnimation = new RotationAnimation(BufferIcon, TimeSpan.FromMilliseconds(double.Parse(interval)), double.Parse(rotation));

            PlayIcon.Clicked += PlayIconClicked;
        }
Exemple #2
0
        public void SetSkin(JwSkinPackage pkg)
        {
            skinPackage = pkg;

            pkg.BindHoverButton(CaptionsButton, "dock", "button", "buttonOver");
            CaptionsButton.BadgeImage   = pkg.GetNamedElement("captions", "dockIcon");
            CaptionsButton.CaptionText  = "Subtitles\r\nOn";
            CaptionsButton.CaptionColor = (pkg.GetSettingValue("dock", "fontcolor") ?? "0xffffff").HexToColor();
        }
Exemple #3
0
        ImageHoverButton BindButton(ControlBarElement element, JwSkinPackage pkg)
        {
            var btn = new ImageHoverButton();

            pkg.BindHoverButton(btn, ControlBarComponent, element.ElementName(), element.ElementName() + "Over");
            btn.Clicked += GetBinding(element.Name);

            if (element.Name == "play")
            {
                playButton = btn;
            }
            if (element.Name == "pause")
            {
                pauseButton = btn;
            }

            if (element.Name == "fullscreen")
            {
                fullScreenButton = btn;
            }
            if (element.Name == "normalscreen")
            {
                normalScreenButton = btn;
            }

            if (element.Name == "mute")
            {
                muteButton = btn;
            }
            if (element.Name == "unmute")
            {
                unmuteButton = btn;
            }

            if (element.Name == "prev")
            {
                prevButton = btn;
            }
            if (element.Name == "next")
            {
                nextButton = btn;
            }

            return(btn);
        }
Exemple #4
0
        public void SetCustomButton(string id, Action callback, string outGraphic, string overGraphic)
        {
            if (string.IsNullOrEmpty(outGraphic))
            {
                return;
            }
            if (!customButtons.ContainsKey(id))
            {
                customButtons.Add(id, new ImageHoverButton());
                LayoutRoot.Children.Add(customButtons[id]);
            }
            var button = customButtons[id];

            button.ClearEvents();
            button.Clicked += (s, e) => callback();
            skinPackage.BindHoverButton(button, "dock", "button", "buttonOver");
            button.BadgeImage = new BitmapImage(new Uri(outGraphic, UriKind.RelativeOrAbsolute).ForceAbsoluteByPage());
            if (!string.IsNullOrEmpty(overGraphic))
            {
                button.BadgeImageOver = new BitmapImage(new Uri(overGraphic, UriKind.RelativeOrAbsolute).ForceAbsoluteByPage());
            }
        }