Skip to content

Add SwiftUI player example app - #4

Open
rohit-fastpix wants to merge 1 commit into
mainfrom
example/swiftui-player-app
Open

Add SwiftUI player example app#4
rohit-fastpix wants to merge 1 commit into
mainfrom
example/swiftui-player-app

Conversation

@rohit-fastpix

Copy link
Copy Markdown
Collaborator

FastPix iOS Player SDK - SwiftUI Example App PR

Changes

What Changed

  • New documentation added — in-repo SwiftUI example app + README
  • Existing documentation updated
  • Documentation errors fixed
  • Code examples updated — runnable example (not just snippets)
  • Links and references updated

Files Modified

  • README.md
  • docs/ files
  • USAGE.md
  • CONTRIBUTING.md
  • Other: Examples/SwiftUI/ (example app + README), root .gitignore

Summary

Brief description of changes:

Adds a minimal, self-contained SwiftUI example app under Examples/SwiftUI/,
so the repo demonstrates the FastPix iOS Player without depending on an external
demo project. The app references FastPixPlayerSDK via a local package
reference (../..), owns the AVPlayerViewController in an ObservableObject
(surviving SwiftUI re-renders), attaches the FastPix Data SDK via
enableAnalytics(...) before prepare(...), and tears down on .onDisappear.
The workspace key is a placeholder; the playback ID defaults to a public demo
asset so it runs unchanged. Also adds a root .gitignore for Swift/Xcode
build artifacts.

Code Examples

import SwiftUI
import AVKit
import FastPixPlayerSDK

final class PlayerModel: ObservableObject {
    let controller = AVPlayerViewController()

    init() {
        controller.enableAnalytics(metadata: [
            "workspace_id": "WORKSPACE_KEY",
            "video_stream_type": "on-demand",
        ])
        controller.prepare(
            playbackID: "7c8d5087-edf7-462f-a1b3-e2fbd30747fa",
            playbackOptions: PlaybackOptions(streamType: "on-demand")
        )
    }
}

Testing

  • All code examples tested on iOS — built and launched on iPhone 17 Pro simulator (iOS 26), video plays
  • Links verified
  • Grammar checked
  • Formatting consistent

Review Checklist

  • Content is accurate
  • Code examples work as expected
  • Links are working
  • Grammar is correct
  • Formatting is consistent

Ready for review!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant