amp-story video playback improvements (#13245)
amp-story video playback improvements (#13245)

* Return play promise from playFn to ensure media playback is not interrupted.

* Refactor playFn to always return a promise.  Improve documentation.

* Use closure so the proper context is set on the distance function.

* Add debug messages

* Remove muted property change, since this is in a separate PR

* Fix merge

ampproject/amphtml,lannka/amphtml,Gregable/amphtml,jpettitt/amphtml,mhc-gh/amphtml,honeybadgerdontcare/amphtml,yieldmo/amphtml,widespace-os/amphtml,powdercloud/amphtml,cory-work/amphtml,yieldbot/amphtml,luciancrasovan/amphtml,taboola/amphtml,clawr/amphtml,donttrustthisbot/amphtml,techhtml/amphtml,danielrozenberg/amphtml,cvializ/amphtml,honeybadgerdontcare/amphtml,bpaduch/amphtml,yieldmo/amphtml,ampproject/amphtml,laterpay/amphtml,yieldmo/amphtml,yandex-pcode/amphtml,techhtml/amphtml,sriramkrish85/amphtml,lannka/amphtml,aghassemi/amphtml,yieldmo/amphtml,kamtschatka/amphtml,ampproject/amphtml,jpettitt/amphtml,koshka/amphtml,alanorozco/amphtml,chaveznvg/amphtml,powdercloud/amphtml,bpaduch/amphtml,zhouyx/amphtml,sharethrough/amphtml,cory-work/amphtml,cory-work/amphtml,media-net/amphtml,dotandads/amphtml,voyagegroup/amphtml,prateekbh/amphtml,BenDz/amphtml,alanorozco/amphtml,danielrozenberg/amphtml,prateekbh/amphtml,sharethrough/amphtml,donttrustthisbot/amphtml,media-net/amphtml,voyagegroup/amphtml,src-code/amphtml,tlong2/amphtml,sharethrough/amphtml,engtat/amphtml,clawr/amphtml,alanorozco/amphtml,mhc-gh/amphtml,smartadserver/amphtml,zhouyx/amphtml,camelburrito/amphtml,danielrozenberg/amphtml,taboola/amphtml,prateekbh/amphtml,cvializ/amphtml,yieldmo/amphtml,smartadserver/amphtml,jpettitt/amphtml,yandex-pcode/amphtml,zhouyx/amphtml,koshka/amphtml,laterpay/amphtml,rsimha-amp/amphtml,chaveznvg/amphtml,taboola/amphtml,src-code/amphtml,engtat/amphtml,taboola/amphtml,luciancrasovan/amphtml,danielrozenberg/amphtml,widespace-os/amphtml,bpaduch/amphtml,camelburrito/amphtml,yandex-pcode/amphtml,pedjoni8/amphtml,mhc-gh/amphtml,honeybadgerdontcare/amphtml,dotandads/amphtml,sebastianbenz/amphtml,jpettitt/amphtml,jridgewell/amphtml,donttrustthisbot/amphtml,erwinmombay/amphtml,luciancrasovan/amphtml,jridgewell/amphtml,luciancrasovan/amphtml,jridgewell/amphtml,clawr/amphtml,jmadler/amphtml,techhtml/amphtml,zhangsu/amphtml,media-net/amphtml,yieldbot/amphtml,donttrustthisbot/amphtml,zhouyx/amphtml,Gregable/amphtml,jmadler/amphtml,kamtschatka/amphtml,sebastianbenz/amphtml,bpaduch/amphtml,chaveznvg/amphtml,laterpay/amphtml,yieldbot/amphtml,BenDz/amphtml,jridgewell/amphtml,BenDz/amphtml,sriramkrish85/amphtml,alanorozco/amphtml,jridgewell/amphtml,prateekbh/amphtml,dotandads/amphtml,rsimha-amp/amphtml,koshka/amphtml,jpettitt/amphtml,danielrozenberg/amphtml,danielrozenberg/amphtml,techhtml/amphtml,voyagegroup/amphtml,ampproject/amphtml,honeybadgerdontcare/amphtml,powdercloud/amphtml,sriramkrish85/amphtml,ampproject/amphtml,adup-tech/amphtml,luciancrasovan/amphtml,jmadler/amphtml,danielrozenberg/amphtml,BenDz/amphtml,prateekbh/amphtml,yieldbot/amphtml,powdercloud/amphtml,tlong2/amphtml,cvializ/amphtml,nexxtv/amphtml,aghassemi/amphtml,kamtschatka/amphtml,alanorozco/amphtml,pedjoni8/amphtml,ampproject/amphtml,pedjoni8/amphtml,nexxtv/amphtml,smartadserver/amphtml,clawr/amphtml,prateekbh/amphtml,widespace-os/amphtml,koshka/amphtml,src-code/amphtml,Gregable/amphtml,kamtschatka/amphtml,BenDz/amphtml,tlong2/amphtml,mhc-gh/amphtml,media-net/amphtml,Gregable/amphtml,camelburrito/amphtml,tlong2/amphtml,cory-work/amphtml,sriramkrish85/amphtml,yieldbot/amphtml,donttrustthisbot/amphtml,widespace-os/amphtml,alanorozco/amphtml,powdercloud/amphtml,lannka/amphtml,adup-tech/amphtml,nexxtv/amphtml,aghassemi/amphtml,voyagegroup/amphtml,zhouyx/amphtml,jpettitt/amphtml,media-net/amphtml,nexxtv/amphtml,clawr/amphtml,sebastianbenz/amphtml,adup-tech/amphtml,koshka/amphtml,zhouyx/amphtml,engtat/amphtml,BenDz/amphtml,taboola/amphtml,voyagegroup/amphtml,laterpay/amphtml,smartadserver/amphtml,chaveznvg/amphtml,sriramkrish85/amphtml,src-code/amphtml,yieldmo/amphtml,lannka/amphtml,rsimha-amp/amphtml,widespace-os/amphtml,jpettitt/amphtml,smartadserver/amphtml,cory-work/amphtml,bpaduch/amphtml,prateekbh/amphtml,alanorozco/amphtml,cory-work/amphtml,erwinmombay/amphtml,ampproject/amphtml,honeybadgerdontcare/amphtml,chaveznvg/amphtml,koshka/amphtml,dotandads/amphtml,camelburrito/amphtml,aghassemi/amphtml,luciancrasovan/amphtml,yandex-pcode/amphtml,camelburrito/amphtml,jpettitt/amphtml,cvializ/amphtml,engtat/amphtml,clawr/amphtml,bpaduch/amphtml,kamtschatka/amphtml,mhc-gh/amphtml,dotandads/amphtml,yandex-pcode/amphtml,clawr/amphtml,techhtml/amphtml,powdercloud/amphtml,pedjoni8/amphtml,camelburrito/amphtml,sebastianbenz/amphtml,laterpay/amphtml,zhangsu/amphtml,pedjoni8/amphtml,rsimha-amp/amphtml,engtat/amphtml,yieldmo/amphtml,kamtschatka/amphtml,honeybadgerdontcare/amphtml,tlong2/amphtml,jmadler/amphtml,media-net/amphtml,pedjoni8/amphtml,chaveznvg/amphtml,voyagegroup/amphtml,smartadserver/amphtml,Gregable/amphtml,Gregable/amphtml,rsimha-amp/amphtml,zhouyx/amphtml,yandex-pcode/amphtml,lannka/amphtml,adup-tech/amphtml,jridgewell/amphtml,Gregable/amphtml,sriramkrish85/amphtml,erwinmombay/amphtml,rsimha-amp/amphtml,lannka/amphtml,zhangsu/amphtml,donttrustthisbot/amphtml,erwinmombay/amphtml,dotandads/amphtml,adup-tech/amphtml,erwinmombay/amphtml,taboola/amphtml,sebastianbenz/amphtml,sebastianbenz/amphtml,cory-work/amphtml,nexxtv/amphtml,powdercloud/amphtml,danielrozenberg/amphtml,lannka/amphtml,mhc-gh/amphtml,bpaduch/amphtml,jmadler/amphtml,camelburrito/amphtml,zhangsu/amphtml,sharethrough/amphtml,yandex-pcode/amphtml,jridgewell/amphtml,media-net/amphtml,media-net/amphtml,donttrustthisbot/amphtml,tlong2/amphtml,mhc-gh/amphtml,sharethrough/amphtml,ampproject/amphtml,aghassemi/amphtml,sharethrough/amphtml,zhangsu/amphtml,honeybadgerdontcare/amphtml,erwinmombay/amphtml,luciancrasovan/amphtml,engtat/amphtml,src-code/amphtml,laterpay/amphtml,nexxtv/amphtml,adup-tech/amphtml,alanorozco/amphtml,widespace-os/amphtml,zhangsu/amphtml,techhtml/amphtml,aghassemi/amphtml,nexxtv/amphtml,engtat/amphtml,jmadler/amphtml,taboola/amphtml,yieldbot/amphtml,cvializ/amphtml,rsimha-amp/amphtml,voyagegroup/amphtml,src-code/amphtml,mhc-gh/amphtml,Gregable/amphtml,cvializ/amphtml