Support media enumerable API from upstream 30

sync with upstream c129874dc579801d403c521fe0ebe38fbc1cf2f2
Fix #632