dsv-su / play

Dev repository for Play
0 stars 1 forks source link

Download resolution 1080p #81

Closed orkit closed 2 years ago

orkit commented 2 years ago

Downloading a presentation in the higher resolution(1080) only downloads a set of media files in the higher resolution. The player starts in the initial mode at the lower resolution (720) and this causes the playback not to start. Of course, it is possible to switch to the higher (1080) with the resolution switcher in the player to start playback, but it can be confusing for a user.

Therefore, the simplest solution should be that if a user downloads a presentation in the higher resolution, all sets of media files should be downloaded. The download button should also be changed to 720/1080 to make it clear that both resolutions are being downloaded.

booski commented 2 years ago

I'd say this is a bug in how the json data included in the download is created, combined with a bit of sloppy coding on my part in the player.

If the user downloads the 1080p stream, the json included in the package should only include "1080" keys in its "video" elements. The player should then automatically pick up on the fact that 720 isn't an available resolution and pick the available one.

I'll update the player to no longer hard-code 720 as default resolution.

orkit commented 2 years ago

Excellent, then perhaps no action is needed in the platform.

booski commented 2 years ago

Does the platform already strip the json of unavailable resolutions when downloading?

orkit commented 2 years ago

Yes.

booski commented 2 years ago

The player has been updated to use the first resolution listed in the first video stream as the default resolution:

{
  "id": "d4dc8702-fe1c-4925-adb2-17b78f2651b8",
  "thumb": "thumb.jpg",
  "sources": [
    {
      "video": { //first stream
        "720": "b5520a7a-126e-4a8e-90bc-9846324fa0fd-720-fast-26.mp4", //first resolution - this will be the default
        "1080": "b5520a7a-126e-4a8e-90bc-9846324fa0fd-1080-fast-26.mp4"
      },
      "poster": "b5520a7a-126e-4a8e-90bc-9846324fa0fd.jpg",
      "playAudio": true
    },
    {
      "video": {
        "720": "0fc6d4eb-f0fc-406c-8118-a97dbfc803ff-720-fast-26.mp4",
        "1080": "0fc6d4eb-f0fc-406c-8118-a97dbfc803ff-1080-fast-26.mp4"
      },
      "poster": "0fc6d4eb-f0fc-406c-8118-a97dbfc803ff.jpg",
      "playAudio": false
    }
  ]
}

As long as the platform makes sure that only available resolutions are listed in the json on download, the correct resolution should play automatically now.

orkit commented 2 years ago

Excellent! Thanks!

orkit commented 2 years ago

I have now updated the json package which incorrectly did not cut the correct resolution. I've also added a new script to automate the multiplayer update and integration in the platform. The script runs at each jenkin's update.

Manual: php artisan update:multiplayer

which will perform a git pull from the multiplayer repo and update the platform with the changes only if there is an update in the multiplayer.