UF-CEN5035-2022SpringProject / GatorStore

0 stars 0 forks source link

Webpage receive livesteam key from youtube, and show iframe html of live #54

Closed chouhy closed 2 years ago

chouhy commented 2 years ago

There was change on response parameter. Document

Success:

{
    "status": 0,
    "result": {
          'id': "113024", // livestream id
          'title': "YiMing Chang", // livestream title
          'streamKey': "1324-5678-8974-1230",
          'streamUrl': "some url",
          'createTime': "2006-01-02T15:04:05Z07:00"
          'updateTime': "2006-01-02T15:04:05Z07:00"
          'embedHTML': "some iframe html" <<<<< New parameter
    }
}
llerenabarruetos commented 2 years ago

Final Sprint 2 Front-end Functionality:

User is now able to create a livestream via YouTube from a seller's store page (/store-page). After clicking on "Start Livestream", they will be prompted to give it a title, after which they will be asked to select the products they will advertise on the livestream (this information is currently appropriately collected in the front-end but is not yet being sent or user in the back-end).

Through a POST request, this stream information is sent to the back-end, which creates a livestream in the user's YouTube account. The request returns a key and a url for the user to feed into a streaming software such as OBS Studio. Once the livestream has been actually started in OBS Studio, the user can click "Go Live" to return to the store page, which will have changed its front-end state of "not-live" to "live", which displays an iframe (given by YouTube) with the stream. A (currently) dummy chat and viewer count is also display besides the iframe.

The user can click on "End Livestream" to return to the front-end state of "not-live". In the future, the respective back-end API will change also close the stream on YouTube after this button is pressed.