theonion/videojs-vast-plugin

Choose best resolution ad file based on player size

Opened this issue · 0 comments

If the VAST file specifies multiple files of the same type but in different resolutions, then whatever video is listed first seems to be picked. It would seem to be better to pick based on the resolution of the ad video and then looking at the size of the video player to pick the best fitting ad video.

My thoughts would be to pick the video resolution that is equal to or exceeds the dimensions of the video player in either the height or width direction. So the lowest resolution video whose height or width >= player height or width.

Example:

  • VAST provides 160 x 120 px and 640 x 480 px
  • Player is 320 x 240 px

So the 640 x 480 rendering would be chosen so that no scaling up is done.