This is easy using playerctl
# media player bindsym XF86AudioPlay exec playerctl play-pause bindsym XF86AudioNext exec playerctl next bindsym XF86AudioPrev exec playerctl previous
bindsym $mod+XF86AudioNext exec playerctl position 20+ bindsym $mod+XF86AudioPrev exec playerctl position 10-
bindsym $mod+XF86AudioRaiseVolume exec playerctl volume 0.05+ bindsym $mod+XF86AudioLowerVolume exec playerctl volume 0.05-