All the pitfalls I met in the first month

Pitfalls I met.

The first pitfall is regarding the environment. I have vagrant box (Homestead) installed on my Mac. However, the box crashes every one hour. I have no idea what went wrong. It is perhaps the God likes me that I fixed this environment issue the next day. I update my Mac to the newest version which solved this problem..  - -'

Twitch
I need an extra scope (channel_read) in order to view users stream key. Here is where things get tricky. Our website solely relies on third-party login. When user logins from Twitch again we lost the `view stream key` permission from the user.

Here is what we did to solve this problem. Firstly, I successfully convinced my team that we need to add `channel_read` scope in the config file so that we will always have this channel_read permission. However, things go south. Because this is an extra scope, every user of our website needs to re-login and re-auth in order to give us the permission. Our users pissed off, so we reverted this change in order to show how we care about our user.

Since this change has been reverted. Each time user logins, we lost the permission to view user's stream key. Thus, when the user is loading multistream page I will have to check whether we have the correct permission. If not, I will pop up a callout saying: "we don't have the permission to get your stream key, please click HERE to give us the permission".

Youtube
For this one, we need to get $broadcastsResponse->items[0]->contentDetails->boundStreamId first. And then use boundStreamId to get streamName inside ingestionInfo. We also need to consider the edge case that users live channel is not set up yet.

Mixer
For this one, - -'. We got the correct permissions we need by adding channel:streamKey:self in the config file. However, the stream key mixer returns is not really the stream key we find in mixer's admin panel. The real stream key is userid concatenate streamkey with a hyphen in the middle. - -'

Facebook
Based on my knowledge, the maximum length of a live video in Facebook is 5 hours. What if the streamer wants to stay live for 6 hours. This is an issue that needs to be solved. I don't know how I come across the policy of Facebook. But thanks to the policy(19.1 https://developers.facebook.com/policy/#liveAPI). I don't need to get the stream key from Facebook. This is because the policy says "Don’t build apps that enable publishers to simultaneously stream to Facebook and other online streaming services."

Something wired about getting stream key from Youtube.
I cannot get $broadcastsResponse->items[0]->`contentDetails` for M's account.  May be relogin to Youtube(Youtube updates M's info. ) solves this problem.
Anyway, I will throw an Exception when I cannot get `contentDetails`
``` throw new Exception('You might need to relogin to Youtube');```

One last issue
One needs to link youtube(third-party) account with our website so that I can get his stream key. When the youtube account is not linked, I need to redirect the user to account settings page to get it linked. But when a user finished linking the account, he will stay on account settings page. He will not be redirected back to multistream page.

Based on above, we need to make a streamlined user experience. When user clicks add youtube channel, I need to merge youtube account to our website's account first and add channel afterward. I have to do it for three platforms which we currently support.

Comments

Popular posts from this blog