shaka-project / shaka-player-embedded

Shaka Player in a C++ Framework
Apache License 2.0
238 stars 63 forks source link

fix: Return `Promise` instead of `void` #86

Closed Korilakkuma closed 2 years ago

Korilakkuma commented 4 years ago

This PR will ...

This PR will fix return type as Promise.

Why is this Pull Request needed ?

This PR needed to the latest specification.

TheModMaker commented 4 years ago

This is the real spec that specifies it should return a Promise. But the Promise should only resolve once the play action is completed and should be rejected if it is interrupted or has an error.

Since you don't implement these behaviors, I don't see why we should also return a Promise. I think it's better to return void until the correct resolve/reject behavior is implemented. You can still use an await with a void method, so this will only cause a problem if someone does video.play().then(...).