{"id":19411459,"url":"https://github.com/volcengine/bdlivedemo_ios","last_synced_at":"2025-04-24T10:33:32.344Z","repository":{"id":103369914,"uuid":"515022410","full_name":"volcengine/BDLiveDemo_iOS","owner":"volcengine","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-25T02:55:47.000Z","size":2338,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-26T16:28:15.853Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/volcengine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-18T03:29:03.000Z","updated_at":"2024-10-25T02:55:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"325dee69-b172-418c-a2e3-7261fe563b43","html_url":"https://github.com/volcengine/BDLiveDemo_iOS","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/volcengine%2FBDLiveDemo_iOS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/volcengine%2FBDLiveDemo_iOS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/volcengine%2FBDLiveDemo_iOS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/volcengine%2FBDLiveDemo_iOS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/volcengine","download_url":"https://codeload.github.com/volcengine/BDLiveDemo_iOS/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223950261,"owners_count":17230444,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T12:21:29.245Z","updated_at":"2024-11-10T12:21:29.726Z","avatar_url":"https://github.com/volcengine.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BDLiveDemo_iOS\n\n企业直播在 GitHub 上提供开源示例项目 BDLiveDemo_iOS 用于演示如何集成和使用企业直播 aPaaS SDK。该项目包含以下 Demo：\n\n- `SimpleViewer`: 演示了如何通过少量代码接入完整直播间。\n- `Player`: 演示了如何接入播放器组件和连麦组件。\n- `PlayerHD`: 演示了在 iPad 上接入播放器组件的多种布局方式。\n- `FloatingPlayer`: 演示了如何接入支持画中画功能的播放器组件。在这个 Demo 中，观众可以不进入直播间页面就查看画中画效果。\n- `HybridViewer`: 演示了如何使用观播 SDK 配合您的业务 UI，搭建定制化的直播间。\n- `LiveStreaming`: 演示了如何通过少量代码接入开播 SDK。\n- `LiveStreamingAndViewer`: 演示了如何通过少量代码同时接入观播 SDK 和开播 SDK。\n- `BasePlayer`: 演示了如何接入独立播放器，并在此基础上实现视频的控制界面。\n- `TwoBasePlayer`: 演示了如何接入 2 个独立播放器，并分别控制单个播放器播放视频。在该 Demo 中，您可以通过点击播放器下的播放按钮播放视频，但每次只能播放一个播放器的视频。\n\n\u003e 独立播放器不包含控制界面，即播放器内无播放按钮等互动按钮。\n\n本文以 SimpleViewer 为例，介绍如何快速编译并运行 Demo。\n\n# 前提条件\n\n- iOS 9.0 及以上版本的真机或模拟器。\n- CPU 架构：armv7、arm64、x86_64。\n- 安装 Xcode，建议使用最新版本。\n- 安装 CocoaPods，建议使用 1.11.0 或更高版本。可参考 [Getting Started with CocoaPods](https://guides.cocoapods.org/using/getting-started.html#getting-started)。\n- 联系企业直播技术支持获取 TTSDK License 文件和 AppID。License 是使用 TTSDK 对应模块的鉴权凭证。\n\n# 操作步骤\n\n1. 在终端中运行以下命令，将 BDLiveDemo_iOS 仓库克隆至本地：\n\n```\ngit clone https://github.com/volcengine/BDLiveDemo_iOS.git\n```\n\n2. 进入 BDLiveDemo_iOS/SimpleViewer 文件夹后，安装所需的依赖库。\n\n```\ncd BDLiveDemo_iOS/SimpleViewer\npod install\n```\n\n\u003e 安装成功后，终端会显示 Pod installation complete!，此时 BDLiveDemo_iOS/SimpleViewer 文件夹下会生成一个 SimpleViewer.xcworkspace 文件。\n\n3. 双击 SimpleViewer.xcworkspace 文件，即可在 Xcode 中打开 SimpleViewer 项目。\n4. 在项目 TARGETS 下的 Signing \u0026 Capabilities 界面勾选 Automatically manage signing，配置您的 Team 和 Bundle Identifier。\n5. 将您获取到的 TTSDK License 文件拷贝至 BDLiveDemo_iOS/SimpleViewer/SimpleViewer 文件夹中。假设 License 文件名为 licenseFilePath.lic，文件结构如下：\n\n```\n└── BDLiveDemo_iOS\n    ├── SimpleViewer\n    │   ├── SimpleViewer\n    │   │   ├── licenseFilePath.lic\n```\n\n6. 在 SimpleViewer/info.plist 文件中将 SSAppID 的值设为您申请 TTSDK License 文件时使用的 AppID。\n\n![simpleviewer_info.png](./images/simpleviewer_info.png)\n\n7. 在 SimpleViewer/AppDelegate.m 文件中，修改 -initTTSDK 方法的 BundleID、AppID、LicenseFilePath 参数值。\n\n\u003e 💡 注意  \n\u003e 您需要确保以下事项，否则会出现鉴权失败的问题：\n\u003e - TTSDK License 文件对应的 BundleID 和 AppID 与初始化 TTSDK SDK 时传入的 BundleID 和 AppID 一致。\n\u003e - 初始化 TTSDK 时传入的 BundleID 和项目配置的 Bundle Identifier 一致。\n\n![simpleviewer_xcode.png](./images/simpleviewer_xcode.png)\n\n8. 连接上 iOS 设备后，在 iOS 设备下拉框中选中您的 iOS 设备。\n9. 单击 Build 图标开始编译项目。编译成功后，您的 iOS 设备上会出现一个名为 SimpleViewer 的应用。\n10. 在 iOS 系统设置中将该应用设为信任开发者后，您才能打开应用。打开应用后，您可以看到以下界面。此处预填了企业直播官方 Demo 直播间的 Activity ID 和 token。点击 Join 即可进入直播间。\n\n![simpleviewer_screenshot.png](./images/simpleviewer_screenshot.png)\n\n# 更多文档\n\n[产品动态](https://www.volcengine.com/docs/6669/101243)  \n[集成 SDK](https://www.volcengine.com/docs/6669/101259)  \n[接口说明](https://www.volcengine.com/docs/6669/122548)  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvolcengine%2Fbdlivedemo_ios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvolcengine%2Fbdlivedemo_ios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvolcengine%2Fbdlivedemo_ios/lists"}