Skip to content
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

Closed
wants to merge 5 commits into from
Closed

Conversation

sheiladoherty-dolby
Copy link
Contributor

@sheiladoherty-dolby sheiladoherty-dolby commented Sep 23, 2024

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.

  • TabView for using single play vs multichannel
  • ChannelView can take up to 4 inputs
  • for ease of testing, the 4 streams are currently pre-populated
  • if the textfields are empty, they will just be skipped, up to 4 players

LandingView
Simulator Screenshot - Apple TV 4K (3rd generation) - 2024-09-23 at 13 57 42

2 Channels
Simulator Screenshot - Apple TV 4K (3rd generation) - 2024-09-23 at 13 57 21

3 Channels
Simulator Screenshot - Apple TV 4K (3rd generation) - 2024-09-23 at 13 57 51

4 Channels
Simulator Screenshot - Apple TV 4K (3rd generation) - 2024-09-19 at 13 58 26

@sheiladoherty-dolby sheiladoherty-dolby changed the title Feature/channels tv os MultiChannels for tvOS player Sep 23, 2024
}
}
.id(source.id)
.id(channel.source.id)
Copy link
Contributor

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 {
Copy link
Contributor

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 {
Copy link
Contributor

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])
Copy link
Contributor

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 {
Copy link
Contributor

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
Copy link
Contributor

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 ?

@sheiladoherty-dolby
Copy link
Contributor Author

Adding more features & will resubmit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants