Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.

Conversation

@mustang-sally
Copy link
Contributor

Hello!

I've been using this player I made in favor of the default one and I'm really digging it. So I decided to share it with you, and maybe see if you're interested in merging. Don't feel pressured though, I made it mostly for me, because I wanted some sort of video rotation support and most importantly, when I changed my volume levels, I wanted it to be persistent the next time I watched some other stream or replay. 😆

Anyway, here are the changes:

  • I'm using Plyr for the UI. Well, mostly because it's pretty, lightweight, and customizable and I suck at CSS.
  • I'm using flv.js (to reproduce live streams only). I've always had insane stuttering on LiveMe with HLS live streams. And that was before I found out the official app actually uses the FLV stream, that's why is doesn't stutter there. However, their website still use HLS so if I watch there, it still lags like crap for me.
  • I tried to keep the watching experience simple and effective, just like the native player.
  • Keyboard shortcuts: A bunch of them! My favorite, like I mentioned before, is the video rotation one. It'd be ideal if it rotated automatically by detecting landscape mode, but I'm not sure if even the official app does that. Perhaps I could try implementing that in the future... Anyway, if you hit Alt + , the player window will rotate 90 degrees forward and also adjust the window based on the video dimensions. Same thing for Alt + , but this one does 90 degrees backwards. You can even watch a video upside-down now if you want! A feature much requested by the australians.

However, two shortcuts had to be replaced (K and L), because one of them (K) was already being used by Plyr, and unfortunately there is no way to disable it. So instead of K and L to seek backward/forward by 10 seconds, it's now A and D, respectively. Here's a screenshot of all shortcuts:

keyboard-shortcuts

And... I think that's pretty much it. If you need more details of a specific change was made, you can try to check the commit's description, or you can just ask me and I'll try to answer you asap.

Let me know what you think! Thanks.

I decided to add flv.js to replace the HLS.js when we're reproducing
live streams. The FLV stream is way smoother than the HLS one. This will
not affect downloads, as they are still downloaded using the HLS stream.
Plyr is a simple, lightweight, accessible and customizable HTML5 media
player.

Website: https://plyr.io/
Otherwise we get this annoying invisible block of pixels in the home
page
The other value was fine too, but I think 360p is more sane.
This change is necessary to implement video rotation without having to
deal with black bars.
This is one of the features I was missing the most: persistent player
configuration (such as volume and mute state). It was really frustrating
having your volume set to 100% every time you'd watch a stream. Not
anymore!

For now it only saves the volume and mute states, but there is nothing
preventing other customizations from being added in the future.
I've a parameter called preferLiveFlv, so when it's set to true,
pickProperSource() will try to return the URL of the FLV stream, instead
of the HLS one. This allow us for smoother playback when dealing with
live streams.

This options is off by default, and as of now it only affects live streams
in the internal video player.
Current features:

* Faster loading: The previous player wasn't using IPC, so whenever
  a video was request to be played, two API requests were made to
  getVideoInfo(). Now it's just one.
* Switching between streams / replays is responsive and glitch-free.
* Stutter-free playback on live streams by using flv.js (but it falls back to
the HLS stream if the FLV one is not available)
* Manual video rotation support
* Change playback speed
* A lot of new keyboard shortcuts
Useful for the keyboard shortcuts panel in the home page
@bem13
Copy link
Contributor

bem13 commented Apr 14, 2019

Do you think it would be possible to implement the idea in #73 in this? :)

@mustang-sally
Copy link
Contributor Author

I think it is feasible since it doesn't rely on the native player anymore. Perhaps by adding some markers in the progress bar wherever there is a comment, or something like that.

@bem13
Copy link
Contributor

bem13 commented Apr 16, 2019

I think that would be neat, provided it's configurable so people who don't want it aren't annoyed by it.

@thecoder75 thecoder75 self-assigned this Apr 16, 2019
@thecoder75 thecoder75 self-requested a review April 16, 2019 14:37
@thecoder75 thecoder75 added the feature New function or feature request. label Apr 16, 2019
@thecoder75 thecoder75 merged commit 77f329c into thecoder75:master Apr 16, 2019
@thecoder75
Copy link
Owner

I checked out the homepage for plyr.io and really like how the player looks. Approving because the UI alone of the player is what I've always wanted to have in the app and also cause it finally solves one of the longest/oldest requests for video rotation.

@mustang-sally mustang-sally deleted the new-internal-player branch April 16, 2019 22:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

feature New function or feature request.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants