Skip to main content
EmbyTok includes a native iOS application built with UIKit and AVFoundation, providing native video playback with direct Emby and Folder Server integration.

Overview

The iOS app (EmbyTokNative) is located in the ios-native/ directory and includes:
  • Native iOS/iPadOS app with UIKit interface
  • AVPlayer-based video playback for smooth MP4 streaming
  • Native watchOS app (minimum watchOS 10.6) with disk cache
  • Direct MP4 stream support for Emby and Folder servers
  • Preloading and buffering for seamless playback
The iOS native app currently supports MP4 direct links. HLS and other formats can be added in future updates.

System Requirements

Development Mac

macOS with Xcode 15 or later

Target Devices

iOS 16+ / iPadOS 16+ devices

Apple ID

Free or paid Apple Developer account

watchOS (optional)

watchOS 10.6+ for Apple Watch app

Installation Steps

1

Open Xcode project

Navigate to the iOS project directory and open in Xcode:
cd ios-native
open EmbyTokNative.xcodeproj
Or from Finder, double-click EmbyTokNative.xcodeproj.
2

Configure code signing

In Xcode:
  1. Select the EmbyTokNative project in the navigator
  2. Select the EmbyTokNative target
  3. Go to Signing & Capabilities tab
  4. Select your Team from the dropdown
  5. Xcode will automatically manage provisioning profiles
If you see “Bundle Identifier conflicts”, change the Bundle Identifier to a unique value (e.g., com.yourname.embytok).
3

Select target device

In the Xcode toolbar:
  1. Click the device selector (next to the Run button)
  2. Choose your connected iPhone/iPad
  3. Or select a simulator for testing
For best performance testing, use a real device rather than simulator.
4

Build and run

Click the Run button (▶) or press Cmd+R.Xcode will:
  1. Build the application
  2. Install on your device
  3. Launch EmbyTok automatically
5

Trust developer certificate (first time)

On your iOS device:
  1. Go to Settings > General > VPN & Device Management
  2. Find your developer certificate
  3. Tap Trust to allow the app to run

Building watchOS App (Optional)

The project includes a native Apple Watch companion app:
1

Install watchOS components

If not already installed:
  1. Open Xcode
  2. Go to Xcode > Settings > Components
  3. Download watchOS platform components
2

Select watch target

In Xcode:
  1. Change scheme to EmbyTokWatch
  2. Select your Apple Watch as target device
3

Build and run

Click Run to install on your Apple Watch.Features:
  • Server connection
  • Pure mode toggle
  • Mute control
  • Disk cache prefetch for smooth playback

Network Configuration

App Transport Security

The app allows HTTP connections for local servers via NSAppTransportSecurity settings. In Info.plist:
<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>
HTTP is allowed for development and local network access. For production apps connecting to remote servers, use HTTPS or add specific domain exceptions.

Connecting to Servers

EmbyTok iOS supports:
  1. Emby servers (MP4 direct stream)
  2. Folder Server (LAN file server mode)
Ensure your iOS device can reach the server on your local network.

Using the iOS App

1

Launch EmbyTok

Open the app on your iOS device.
2

Select connection type

Choose between:
  • Emby: Connect to Emby media server
  • Folder: Connect to EmbyTok folder server
3

Enter server details

For Emby:
  • Server URL: http://192.168.1.100:8096
  • Username and password
For Folder Server:
  • Server URL: http://192.168.1.100:5176
  • Service name or ID in password field
4

Start browsing

Swipe vertically to browse videos in TikTok-style interface.

Video Playback Features

The native iOS app includes:

AVPlayer Integration

  • Native AVFoundation video playback
  • Hardware-accelerated decoding
  • Smooth seeking and scrubbing
  • Picture-in-picture support (if enabled)

Preloading and Buffering

// Example configuration
AVPlayerItem.preferredForwardBufferDuration = 10.0
  • Preloads next 2 videos for seamless browsing
  • Configurable buffer duration
  • Efficient memory management

Cache Management (watchOS)

watchOS app includes disk cache:
  • Location: Caches/EmbyTokWatchCache
  • Prefetches current and next videos
  • Automatic cache cleanup

Xcode Project Structure

ios-native/
├── EmbyTokNative.xcodeproj/     # Xcode project
├── EmbyTokNative/               # iOS app source
│   ├── ContentView.swift        # Main UI
│   ├── VideoPlayer.swift        # AVPlayer wrapper
│   ├── Models/                  # Data models
│   └── Info.plist              # App configuration
├── EmbyTokWatch/                # watchOS app (optional)
└── README.md                    # iOS-specific docs

Development Workflow

Making Code Changes

1

Edit Swift files

Modify source files in Xcode editor.
2

Build the project

Press Cmd+B to build without running.
3

Run on device

Press Cmd+R to build and run on selected device/simulator.

Debugging

  • Console: View print() and NSLog() output in Xcode console
  • Breakpoints: Click line numbers to add breakpoints
  • View hierarchy: Use Debug View Hierarchy tool
  • Network: Use Network Link Conditioner for testing slow connections

Testing on Simulator

Run in iOS Simulator for quick testing:
  1. Select simulator from device menu
  2. Click Run
  3. Simulator launches automatically
Simulators are useful for UI testing, but use real devices for accurate video playback performance testing.

Building for Distribution

Archive for TestFlight/App Store

1

Select Generic iOS Device

In device selector, choose Any iOS Device (arm64).
2

Create archive

Select Product > Archive from menu.Wait for build to complete.
3

Distribute archive

In Organizer window:
  1. Select your archive
  2. Click Distribute App
  3. Choose distribution method:
    • TestFlight & App Store for beta/release
    • Ad Hoc for limited device distribution
    • Enterprise for internal apps
  4. Follow prompts to upload or export

Export IPA File

For manual distribution:
  1. Archive the project (steps above)
  2. Select Export instead of upload
  3. Choose Development or Ad Hoc
  4. Select signing certificate
  5. Export IPA file
Install IPA using:
  • Xcode: Window > Devices and Simulators
  • Third-party tools like Apple Configurator

Troubleshooting

Solutions:
  1. Verify you’re signed in to Xcode with your Apple ID:
    • Xcode > Settings > Accounts
  2. Change Bundle Identifier to unique value
  3. Select correct team in Signing & Capabilities
  4. For free accounts, use automatic signing for development
Solutions:
  1. Unlock your iOS device
  2. Trust the computer when prompted
  3. Reconnect USB cable
  4. Open Window > Devices and Simulators to troubleshoot
Debugging steps:
  1. Check Xcode console for crash logs
  2. Verify server URL is reachable from device
  3. Check Info.plist for correct permissions
  4. Ensure iOS version meets minimum requirement (iOS 16+)
Check:
  1. Network connectivity between device and server
  2. Server is serving MP4 files (not transcoding to HLS)
  3. HTTP access is allowed (check App Transport Security)
  4. Test server URL in Safari on device first
Solution: Verify with test URL:
// Test in Safari
http://your-server:5176/api/folder/ping
Solutions:
  1. Install watchOS platform: Xcode > Settings > Components
  2. Ensure Apple Watch is paired with iPhone
  3. Update watchOS to 10.6 or later
  4. Check signing for both iOS and watchOS targets
Solution: Update Info.plist to allow your server domain:
<key>NSAppTransportSecurity</key>
<dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key>your-server.local</key>
        <dict>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
        </dict>
    </dict>
</dict>

Performance Optimization

Video Preloading

The app preloads upcoming videos:
// Preload configuration
let preloadCount = 2  // Number of videos to preload
let bufferDuration = 10.0  // Seconds of buffer
Adjust these values in the source code for your use case.

Memory Management

  • Automatic cleanup of unused AVPlayerItem instances
  • Cache limits for watchOS app
  • Efficient thumbnail loading

Network Optimization

  • Range request support for seeking
  • HEAD request optimization
  • Persistent connections

Publishing to App Store

To submit EmbyTok to the App Store:
1

Enroll in Apple Developer Program

Required for App Store distribution ($99/year).
2

Create App Store listing

In App Store Connect:
  1. Create new app
  2. Fill in app information
  3. Add screenshots and descriptions
  4. Set pricing and availability
3

Archive and upload

Follow “Building for Distribution” steps above to upload build.
4

Submit for review

Complete all required information and submit for Apple review.
Ensure your app complies with App Store Review Guidelines, especially regarding content and server connections.

Next Steps

Android App

Build Android version with Capacitor

Configuration

Configure Emby/Folder servers

iOS Development

Extend iOS app features

Folder Server

Set up folder server for iOS app

Build docs developers (and LLMs) love