-
Notifications
You must be signed in to change notification settings - Fork 2
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
MultiChannels for tvOS player #217
Conversation
} | ||
} | ||
.id(source.id) | ||
.id(channel.source.id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the second id
view modifier is redundant?
import SwiftUI | ||
|
||
@MainActor | ||
final class ChannelGridViewModel: ObservableObject { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if no mutations it does not need to be ObservableObject and can be a struct?
guard let self, | ||
let channels else { return } | ||
|
||
for channel in channels { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: Do you think some of subscriptions(iterations) can be setup concurrently ?
func updateChannelWithSources(channel: Channel, sources: [StreamSource]) { | ||
guard !sourcedChannels.contains(where: { $0.id == channel.id }), | ||
sources.count > 0 else { return } | ||
let sourcedChannel = SourcedChannel.build(from: channel, source: sources[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if we should use zeroth index or source which is main
? the latter is what the tvOS app currently does and an easy use case to handle.
We also need to handle removal when the source goes inactive in this case will be removed from the list of sources?
import os | ||
import RTSCore | ||
|
||
final actor VideoTracksManager { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not quite sure, my gut feel is this track manager may not be required for this use case, in interactive player we have scenarios where multiple views will try to play the same video (in a detail view vs grid/list layout). Currently our SDK has a limitation where only one renderer can be active and attached to a track at a given time.
So every time the user navigate back from the detail view the previous renderer is used reenable the track.
In this multichannel app - all we need will be a layer observation and enable track(with a newly selected layer) ? What's your thoughts?
case(.quality, .auto): | ||
false | ||
case let (.quality(lhsQuality), .quality(rhsQuality)): | ||
lhsQuality == rhsQuality |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we use this operator ? lhsQuality == rhsQuality
can be a false comparison for less than ?
Adding more features & will resubmit |
This is a basic implementation of Multi-Channels for tvOS. There are various features such as labels, sound management & persistence, that need to by firmed up in a later ticket.
LandingView
2 Channels
3 Channels
4 Channels