Controlling Player Buffer and Video Encoder For Adaptive Video Streaming