-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
265 lines (171 loc) · 11.9 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>BCOVSidecarSubtitles Reference</title>
<link rel="stylesheet" href="css/style.css">
<meta name="viewport" content="initial-scale=1, maximum-scale=1.4">
<meta name="generator" content="appledoc 2.2.1 (build 1334)">
</head>
<body class="appledoc">
<header>
<div class="container" class="hide-in-xcode">
<h1 id="library-title">
<a href="index.html">BCOVSidecarSubtitles </a>
</h1>
<p id="developer-home">
<a href="index.html">Brightcove</a>
</p>
</div>
</header>
<aside>
<div class="container">
<nav>
<ul id="header-buttons" role="toolbar">
<li><a href="hierarchy.html">Hierarchy</a></li>
</ul>
</nav>
</div>
</aside>
<article>
<div id="overview-contents" class="container">
<div id="content">
<main role="main">
<h1 class="title">BCOVSidecarSubtitles Reference</h1>
<div class="section section-overview index-overview">
<h1>Sidecar Subtitles Plugin for Brightcove Player SDK for iOS and tvOS, version 2.1.3.112</h1>
<h1>Supported Platforms</h1>
<p>iOS 8.0 and above.</p>
<p>tvOS 9.0 and above.</p>
<h1>Installation</h1>
<p>The Sidecar Subtitles plugin for Brightcove Player SDK provides two installation packages for iOS; a static library framework and a dynamic framework. For tvOS, the Sidecar Subtitles plugin provides a dynamic framework only.</p>
<h2>CocoaPods</h2>
<p>You can use <a href="http://cocoapods.org">CocoaPods</a> to add the Sidecar Subtitles Plugin for Brightcove Player SDK to your project. You can find the latest <code>Brightcove-Player-SDK-SidecarSubtitles</code> podspec <a href="https://github.com/CocoaPods/Specs/tree/master/Specs/9/5/e/Brightcove-Player-SDK-SidecarSubtitles">here</a>.</p>
<p>Specifying the default pod <code>Brightcove-Player-SDK-SidecarSubtitles</code> will install the static library framework. To install the dynamic framework, declare the pod with the <code>dynamic</code> subspec: <code>Brightcove-Player-SDK-SidecarSubtitles/dynamic</code></p>
<p>Static Framework example:</p>
<pre><code>pod 'Brightcove-Player-SDK-SidecarSubtitles'
</code></pre>
<p>Dynamic Framework example:</p>
<pre><code>pod 'Brightcove-Player-SDK-SidecarSubtitles/dynamic'
</code></pre>
<p>Maintaining an up-to-date master podspec repo is necessary to ensure that you are always using the latest versions of Brightcove software. As of CocoaPods 1.0.0, podspec repo updates are no longer an automatic feature, so to update your master repo, run the following on the command line:</p>
<pre><code>pod repo update
</code></pre>
<h2>Manual</h2>
<p>To add the Sidecar Subtitles Plugin for Brightcove Player SDK to your project manually:</p>
<ol>
<li>Install the latest version of the <a href="https://github.com/brightcove/brightcove-player-sdk-ios">Brightcove Player SDK</a>.</li>
<li>Download the latest zipped release of the BrightcoveSidecarSubtitles plugin from our <a href="https://github.com/brightcove/brightcove-player-sdk-ios-sidecarsubtitles/releases">release page</a>.</li>
<li>Add <code>BrightcoveSidecarSubtitles.framework</code> to your project.</li>
<li>On the “Build Settings” tab of your application target, ensure that the “Framework Search Paths” include the path to the framework. This should have been done automatically unless the framework is stored under a different root directory than your project.</li>
<li>(Dynamic Framework only) On the “General” tab of your application target, add ‘BrightcoveSidecarSubtitles.framework’ to the “Embedded Binaries” section.</li>
<li>(Dynamic Framework only) On the “Build Phases” tab, add a “Run Script” phase with the command <code>bash ${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/BrightcoveSidecarSubtitles.framework/strip-frameworks.sh</code>. Check “Run script only when installing”. This will remove unneeded architectures from the build, which is important for App Store submission.</li>
<li>(Static Framework only) On the “Build Settings” tab of your application target, add <code>-ObjC</code> to the “Other Linker Flags” build setting.</li>
</ol>
<h2>Imports</h2>
<p>The Brightcove Player SDK for iOS can be imported into code a few different ways:</p>
<ul>
<li><code>@import BrightcoveSidecarSubtitles;</code></li>
<li><code>#import <BrightcoveSidecarSubtitles/BrightcoveSidecarSubtitles.h></code></li>
<li><code>#import <BrightcoveSidecarSubtitles/[specific class].h></code>.</li>
</ul>
<h1>Quick Start</h1>
<pre><code> NSString *policyKey = <your-policy-key>;
NSString *accountId = <your-account-id>;
NSString *videoID = <your-video-id>;
BCOVPlayerSDKManager *manager = [BCOVPlayerSDKManager sharedManager];
[1] id<BCOVPlaybackController> controller = [playbackManager createSidecarSubtitlesPlaybackControllerWithViewStrategy:nil];
[self.view addSubview:controller.view];
BCOVPlaybackService *playbackService = [[BCOVPlaybackService alloc] initWithAccountId:accoundId
policyKey:policyKey];
[2] [playbackService findVideoWithVideoID:videoID
parameters:nil
completion:^(BCOVVideo *video,
NSDictionary *jsonResponse,
NSError *error) {
[controller setVideos:@[ video ]];
[controller play];
}];
</code></pre>
<p>BCOVSidecarSubtitles adds some category methods to BCOVPlaybackManager. The first of these is <code>-createSidecarSubtitlesPlaybackControllerWithViewStrategy:</code>. Use this method to create your playback controller. Alternately (if you are using more than one session provider), you can create a BCOVSSSessionProvider and pass that to the manager method that creates a playback controller with upstream session providers.* If you are developing for tvOS, the ViewStrategy passed to createSidecarSubtitlesPlaybackControllerWithViewStrategy must be nil.</p>
<p>* Note that <code>BCOVSSSessionProvider</code> should come before any session providers in the chain passed to the manager when constructing the playback controller. This plugin is <strong>not compatible</strong> with the Widevine plugin.</p>
<p>If you have questions or need help, visit the support forum for Brightcove Native Player SDKs at <a href="https://groups.google.com/forum/">https://groups.google.com/forum/</a>#!forum/brightcove-native-player-sdks .</p>
<h2>Using the Built-In PlayerUI Controls</h2>
<p>The code snippet above presents a video player without any controls. You can add playback controls to your code like this.</p>
<p>Add a property to keep track of the <code>BCOVPUIPlayerView</code>:</p>
<pre><code>// PlayerUI's Player View
@property (nonatomic) BCOVPUIPlayerView *playerView;
</code></pre>
<p>Create the <code>BCOVPUIBasicControlView</code>, and then the <code>BCOVPUIPlayerView</code>. This is where we associate the Playback Controller (and thus all the videos it plays) with the controls. Set the player view to match the video container from your layout (<code>yourVideoView</code>) when it resizes.</p>
<pre><code>BCOVPUIBasicControlView *controlView = [BCOVPUIBasicControlView basicControlViewWithVODLayout];
self.playerView = [[BCOVPUIPlayerView alloc] initWithPlaybackController:controller options:nil controlsView:controlView];
// Match parent view size
self.playerView.frame = self.yourVideoView.bounds;
self.playerView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
// Add BCOVPUIPlayerView to your video view.
[self.yourVideoView addSubview:self.playerView];
</code></pre>
<p>If you use the BCOVPUIPlayerView, you also need to remove one line above:</p>
<pre><code>[self.view addSubview:controller.view]; // no longer needed when using PlayerUI
</code></pre>
<p>If you want to reuse the player with with another playback controller, you can simply make a new assignment:</p>
<pre><code>self.playerView.playbackController = anotherPlaybackController;
</code></pre>
<p>The player view will automatically add the playback controller’s view to its own view hierarchy.</p>
<p>Please see the Brightcove Native Player SDK’s README for more information about adding and cumstomizing PlayerUI controls in your app.</p>
<p>If you have questions or need help, visit the <a href="https://groups.google.com/forum/#!forum/brightcove-native-player-sdks">Brightcove Native Player SDK support forum</a>.</p>
<h1>Manually populating subtitle data</h1>
<p>The BCOVSidecarSubtitle plugin will look for the presence of an array of subtitle metadata in the <code>BCOVVideo</code> object properties, keyed by kBCOVSSVideoPropertiesKeyTextTracks. If you are using <code>BCOVPlaybackService</code> to retrieve videos and those videos have text tracks associated with them, this will be populated automatically.</p>
<p>If you are a providing your own videos or are a Perform customer, you will need to structure the data as shown below:</p>
<pre><code> NSArray *subtitles = @[
@{
kBCOVSSTextTracksKeySource: ..., // required
kBCOVSSTextTracksKeySourceLanguage: ..., // required
kBCOVSSTextTracksKeyLabel: ..., // required
kBCOVSSTextTracksKeyDuration: ..., // required/optional [1]
kBCOVSSTextTracksKeyKind: kBCOVSSTextTracksKindSubtitles or kBCOVSSTextTracksKindCaptions, // required
kBCOVSSTextTracksKeyDefault: ..., // optional
kBCOVSSTextTracksKeyMIMEType: ..., // optional
}
@{...}, // second text track dictionary
@{...}, // third text track dictionary
];
BCOVVideo *video = [BCOVVideo alloc] initWithSource:<source>
cuePoints:<cuepoints>
properties:@{ kBCOVSSVideoPropertiesKeyTextTracks:subtitles }];
</code></pre>
<h1>Notes</h1>
<ul>
<li>kBCOVSSTextTracksKeyDuration is a required key if you are using caption files with a .vtt extension. kBCOVSSTextTracksKeyDuration is an optional key if you are using using caption files with a .m3u8 extension.</li>
</ul>
<p>Please refer to the code documentation in the BCOVSSComponent.h header file for more information on usage of these keys.</p>
<h1>Known Issues</h1>
<ul>
<li><p>Subtitles will not be displayed when viewing 360 degree videos.</p></li>
<li><p>This plugin currently does not support integrating with the Widevine Plugin for Brightcove Brightcove Player SDK for iOS.</p></li>
<li><p>When retrieving your videos from the Brightcove Playback API, your renditions must include a master M3U8 playlist. The Sidecar Subtitle plugin does not work with single rendition M3U8 playlists.</p></li>
<li><p>If you are providing a subtitle playlist to the plugin, and that subtitle playlist includes links to web vtt files that respond as 404, playback will fail. This is a bug in Apple’s AVPlayer.</p></li>
</ul>
</div>
<div class="index-container">
<div class="index-column">
<h2 class="index-title">Category References</h2>
<ul>
<li><a href="Categories/BCOVPlayerSDKManager+BCOVSSAdditions.html">BCOVPlayerSDKManager(BCOVSSAdditions)</a></li>
<li><a href="Categories/BCOVPlayerSDKManager+BCOVSSAdditionsDepricated.html">BCOVPlayerSDKManager(BCOVSSAdditionsDepricated)</a></li>
</ul>
</div>
</div>
<footer>
<div class="footer-copyright">
<p class="copyright">Copyright © 2016 Brightcove. All rights reserved. Updated: 2016-12-16</p>
<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
</div>
</footer>
</main>
</div>
</div>
</article>
<script src="js/script.js"></script>
</body>
</html>