Xiaomi ties up with Amagi to manage its video and ad offerings on phones, TVs