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

Rebase #196

Merged
merged 11 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/smoke-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:
needs: build-test-app-and-frameworks
if: ${{ github.event_name != 'push' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.CI_BOT_GITHUB_TOKEN }} # to open a PR
GITHUB_PR_NUM: ${{ github.event.number }}
steps:
- uses: actions/[email protected]
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### 🔄 Changed

# [0.4.1](https://github.com/GetStream/stream-video-swift/releases/tag/0.4.1)
_October 16, 2023_

### 🐞 Fixed
- Video tracks remain disabled when they become visible [#191](https://github.com/GetStream/stream-video-swift/pull/191)

# [0.4.0](https://github.com/GetStream/stream-video-swift/releases/tag/0.4.0)
_October 11, 2023_

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ import Foundation

extension SystemEnvironment {
/// A Stream Video version.
public static let version: String = "0.4.0"
public static let version: String = "0.4.1"
}
2 changes: 1 addition & 1 deletion Sources/StreamVideo/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>0.4.0</string>
<string>0.4.1</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,12 @@ public struct ParticipantsSpotlightLayout<Factory: ViewFactory>: View {
self.onChangeTrackVisibility = onChangeTrackVisibility
}


public var body: some View {
VStack {
viewFactory.makeVideoParticipantView(
participant: participant,
id: "\(participant.id)-spotlight",
availableFrame: .init(origin: .zero, size: .init(width: thumbnailSize, height: thumbnailSize)),
availableFrame: topParticipantFrame,
contentMode: .scaleAspectFill,
customData: [:],
call: call
Expand All @@ -48,51 +47,76 @@ public struct ParticipantsSpotlightLayout<Factory: ViewFactory>: View {
viewFactory.makeVideoCallParticipantModifier(
participant: participant,
call: call,
availableFrame: availableFrame,
ratio: ratio,
availableFrame: topParticipantFrame,
ratio: topParticipantRatio,
showAllInfo: true
)
)
.modifier(ParticipantChangeModifier(
participant: participant,
onChangeTrackVisibility: onChangeTrackVisibility)
)

.visibilityObservation(in: topParticipantFrame) {
onChangeTrackVisibility(participant, $0)
}

ScrollView(.horizontal) {
HorizontalContainer {
ForEach(participants) { participant in
viewFactory.makeVideoParticipantView(
participant: participant,
id: participant.id,
availableFrame: .init(origin: .zero, size: .init(width: thumbnailSize, height: thumbnailSize)),
availableFrame: participantStripItemFrame,
contentMode: .scaleAspectFill,
customData: [:],
call: call
)
.visibilityObservation(in: availableFrame) { onChangeTrackVisibility(participant, $0) }
.adjustVideoFrame(to: thumbnailSize, ratio: 1)
.modifier(
viewFactory.makeVideoCallParticipantModifier(
participant: participant,
call: call,
availableFrame: participantStripItemFrame,
ratio: participantsStripItemRatio,
showAllInfo: true
)
)
.visibilityObservation(in: participantsStripFrame) { onChangeTrackVisibility(participant, $0) }
.cornerRadius(8)
.accessibility(identifier: "spotlightParticipantView")
}
}
.frame(height: thumbnailSize)
.frame(height: participantStripItemFrame.height)
.cornerRadius(8)
}
.padding()
.padding(.bottom)
.accessibility(identifier: "spotlightScrollView")
}

}

private var availableFrame: CGRect {
private var topParticipantFrame: CGRect {
.init(
origin: frame.origin,
size: CGSize(width: frame.size.width, height: frame.size.height - thumbnailSize - 64)
)
}

private var participantsStripFrame: CGRect {
.init(
origin: .init(x: frame.origin.x, y: frame.maxY - thumbnailSize),
size: CGSize(width: frame.size.width, height: thumbnailSize)
)
}

private var topParticipantRatio: CGFloat {
topParticipantFrame.size.width / topParticipantFrame.size.height
}

private var ratio: CGFloat {
availableFrame.size.width / availableFrame.size.height
private var participantsStripItemRatio: CGFloat {
participantsStripFrame.size.width / participantsStripFrame.size.height
}

private var participantStripItemFrame: CGRect {
.init(origin: .zero, size: .init(width: participantsStripFrame.height, height: participantsStripFrame.height))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ struct VisibilityThresholdModifier: ViewModifier {
let requiredWidth = rect.size.width * threshold

/// Check if the content view is vertically within the parent's bounds.
let verticalVisible = (minY + requiredHeight < bounds.maxY && minY > bounds.minY) ||
(maxY - requiredHeight > bounds.minY && maxY < bounds.maxY)
let verticalVisible = (minY + requiredHeight <= bounds.maxY && minY >= bounds.minY) ||
(maxY - requiredHeight >= bounds.minY && maxY <= bounds.maxY)
/// Check if the content view is horizontally within the parent's bounds.
let horizontalVisible = (minX + requiredWidth < bounds.maxX && minX > bounds.minX) ||
(maxX - requiredWidth > bounds.minX && maxX < bounds.maxX)
let horizontalVisible = (minX + requiredWidth <= bounds.maxX && minX >= bounds.minX) ||
(maxX - requiredWidth >= bounds.minX && maxX <= bounds.maxX)

return (verticalVisible, horizontalVisible)
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/StreamVideoSwiftUI/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>0.4.0</string>
<string>0.4.1</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
Expand Down
2 changes: 1 addition & 1 deletion Sources/StreamVideoUIKit/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>0.4.0</string>
<string>0.4.1</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
Expand Down
2 changes: 1 addition & 1 deletion StreamVideo.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'StreamVideo'
spec.version = '0.4.0'
spec.version = '0.4.1'
spec.summary = 'StreamVideo iOS Video Client'
spec.description = 'StreamVideo is the official Swift client for Stream Video, a service for building video applications.'

Expand Down
2 changes: 1 addition & 1 deletion StreamVideoSwiftUI.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'StreamVideoSwiftUI'
spec.version = '0.4.0'
spec.version = '0.4.1'
spec.summary = 'StreamVideo SwiftUI Video Components'
spec.description = 'StreamVideoSwiftUI SDK offers flexible SwiftUI components able to display data provided by StreamVideo SDK.'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ final class VisibilityThresholdModifier_Tests: XCTestCase {
in: bounds,
threshold: 0.5,
viewRect: CGRect(x: -10, y: 0, width: 60, height: 100),
expected: (false, true)
expected: (true, true)
)
}

Expand All @@ -76,7 +76,7 @@ final class VisibilityThresholdModifier_Tests: XCTestCase {
in: bounds,
threshold: 0.5,
viewRect: CGRect(x: 0, y: 110, width: 100, height: 60),
expected: (false, false)
expected: (false, true)
)
}

Expand All @@ -85,7 +85,7 @@ final class VisibilityThresholdModifier_Tests: XCTestCase {
in: bounds,
threshold: 0.5,
viewRect: CGRect(x: 110, y: 0, width: 60, height: 100),
expected: (false, false)
expected: (true, false)
)
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion StreamVideoUIKit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'StreamVideoUIKit'
spec.version = '0.4.0'
spec.version = '0.4.1'
spec.summary = 'StreamVideo UIKit Video Components'
spec.description = 'StreamVideoUIKit SDK offers flexible UIKit components able to display data provided by StreamVideo SDK.'

Expand Down
6 changes: 3 additions & 3 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,14 @@ private_lane :test_ui do |options|

title = "[CI] #{options[:scheme]} Snapshots"
base = current_branch
head = "#{base}/snapshots"
head = "#{base}-snapshots"
sh("git checkout -b #{head}")
sh('git add -A')
sh("git commit -m '#{title}'")
push_to_git_remote(tags: false)
create_pull_request(
api_token: params[:github_token],
repo: params[:github_repo],
api_token: ENV.fetch('GITHUB_TOKEN', nil),
repo: github_repo,
title: title,
head: head,
base: base,
Expand Down