-
-
Notifications
You must be signed in to change notification settings - Fork 811
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App Javascript refactor #56
Conversation
…h temp logo image
…e videoJS tech options
@gabek Can you give this branch a test run and see how it works for overall? I have 2 checkbox items left, which I think I will create separate tasks for them outside of this MR. I'd like to get this thing merged sooner so we can do other things with it. Thanks! |
Lots of changes! This is awesome! Here's some initial things, but I may very well be testing it incorrectly, have incorrect opinions, or I'm misunderstanding things so don't take my comments too seriously :) Chat stuff
Player stuff
For this last item here's how I'm testing it:
|
Responses! Oh wait, some explanations first!.. which may help with what you're seeing.
Ah this is a bug! I'll fix! 😳
Bug, I'll fix!
Oh good point. I'll update.
🤔 If you get to the page and online=false, yes you should see the poster - the poster of the user's logo. (that's what we want right?). Not sure about audio, where it's coming from. I can't repro that.
Hm yeah I've wondered about caching. I can try the video.src() trick, maybe with a randomizer on the url, like src="video.url?random()" |
…ly change classnames from non-vue sources
Oh ok, I've repro'd . Not sure what the intended display should be? Can we flip to "online=false" after the ending animation video instead?
|
The problem is the server doesn't know when the client has consumed all the video, so the server can't wait to flip the |
…setting on pause to main app to keep player obj cleaner; use opacity to hide video element on offline as sometimes control bars may still linger with vis:hidden
Oh I meant
It's another example of just because online is |
…t's easier to start playign without looking for the unmute button
* master: Fix missing default video bitrate if none is supplied
@graywolf336 Heads up, lots of changes here 🎊 |
Bumps [date-fns](https://github.com/date-fns/date-fns) from 2.16.1 to 2.19.0. - [Release notes](https://github.com/date-fns/date-fns/releases) - [Changelog](https://github.com/date-fns/date-fns/blob/master/CHANGELOG.md) - [Commits](https://github.com/date-fns/date-fns/commits) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…hatApiEndpoint Ruffy/document new chat api endpoint
JS App refactor
Instead of having various JS files creating global variables and timers scattered across the app, I wanted a single object as a source for entire app management.
app.js
"Owncast App" object, which gets created in a closure during page load. We also have a "OwncastPlayer" class (player.js
) which handles mostly VideoJS functionalities of the video.status.js
,config.js
,airplay.js
have been removed. Airplay function has been moved intoplayer.js
, since it's videojs player related..player.js
has been moved out of/player
dir.utils.js
, including urls, file names, timer values.The main
app.js
flow:video.js
./config
data, then updates Vue UI with resultsmessage.js
), which basically sets up all the DOM events and interactions needed for the Chat section.Player.js flow:
After the Vue app has mounted, from (1) above
videojs()
on the<video>
element in the DOM (with options defined inutils.js
).This will lead Videojs's
ready()
state, so from there the App can start fetching Stream Status.Current implemented Video playing logic:
When the app first loads, everything should be in an offline state. A logo will be in the video background. The Stream Status will poll every 5s.
When Stream status flips to
online: true
, we'll tell videojs player to play() the stream.As long as the status is
online
the video player's poster will update with the stream's current thumbnail.When the Stream status flips to
online: false
, we'll set the App back to the offline state with the logo in the background.When the video's
ended
event fires, we'll also set the app back to the offline state.If the status ever comes back online, right now videojs will just play() again. Not sure if any resets of sort are necessary.
TODO: