private void initializeAttributes() {
        if (attrs != null) {
            TypedArray a = getContext().obtainStyledAttributes(attrs,
                    R.styleable.YouTubeOverlay, 0, 0);

            // PlayerView => see onAttachToWindow
            playerViewRef = a.getResourceId(R.styleable.YouTubeOverlay_yt_playerView, -1);

            // Durations
            setAnimationDuration((long)a.getInt(
                    R.styleable.YouTubeOverlay_yt_animationDuration, 650));

            seekSeconds = a.getInt(
                    R.styleable.YouTubeOverlay_yt_seekSeconds, 10);

            setIconAnimationDuration((long)a.getInt(
                    R.styleable.YouTubeOverlay_yt_iconAnimationDuration, 750));

            // Arc size
            setArcSize((float)a.getDimensionPixelSize(
                    R.styleable.YouTubeOverlay_yt_arcSize,
                    getContext().getResources().getDimensionPixelSize(R.dimen.dtpv_yt_arc_size))
            );

            // Colors
            setTapCircleColor(a.getColor(
                    R.styleable.YouTubeOverlay_yt_tapCircleColor,
                    ContextCompat.getColor(getContext(), R.color.dtpv_yt_tap_circle_color))
            );

            setCircleBackgroundColor(a.getColor(
                    R.styleable.YouTubeOverlay_yt_backgroundCircleColor,
                    ContextCompat.getColor(getContext(), R.color.dtpv_yt_background_circle_color))
            );

            // Seconds TextAppearance
            setTextAppearance(a.getResourceId(
                    R.styleable.YouTubeOverlay_yt_textAppearance,
                    R.style.YTOSecondsTextAppearance)
            );

            this.setIcon(a.getResourceId(
                    R.styleable.YouTubeOverlay_yt_icon,
                    R.drawable.ic_play_triangle)
            );

            a.recycle();
        } else {
            // Set defaults
            setArcSize((float)getContext().getResources().getDimensionPixelSize(R.dimen.dtpv_yt_arc_size));
            setTapCircleColor(ContextCompat.getColor(getContext(), R.color.dtpv_yt_tap_circle_color));
            setCircleBackgroundColor(ContextCompat.getColor(getContext(), R.color.dtpv_yt_background_circle_color));
            setAnimationDuration(650L);
            setIconAnimationDuration(750L);
            seekSeconds = 10;
            setTextAppearance(R.style.YTOSecondsTextAppearance);
        }
    }
Sets all optional XML attributes and defaults
app/src/main/java/com/brouken/player/dtpv/youtube/YouTubeOverlay.java