You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: hisplayer-api.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -119,6 +119,21 @@ The following public APIs are provided by **HISPlayerManager**:
119
119
***public struct HISPlayerCaptionElement**: The information of the triggered event turns into caption’s format.
120
120
***public int playerIndex**: The index of the player where the event is triggered.
121
121
***public string caption**: The next generated caption text.
122
+
123
+
***public struct HTTPHeader**: Information for a custom HTTP header:
124
+
***public string key**: Key of the HTTP header.
125
+
***public string value**: Value of the HTTP header.
126
+
127
+
***public class HTTPHeaderList**: Wrapper class for a list of custom HTTP headers.
128
+
***public List \<HTTPHeader\> headers**: List of HTTP headers.
129
+
***public int Count (Read-only)**: Number of HTTP headers.
130
+
***public void Add(string key, string value)**: Adds a new HTTP header given a **key** and a **value**.
131
+
***public void Add(HTTPHeader header)**: Adds an existing **HTTPHeader**.
132
+
***public bool Remove(string key)**: Removes the first header matching the given **key**. Returns true if a header was removed.
133
+
***public bool Remove(HTTPHeader header)**: Removes a specific **HTTPHeader**. Returns true if the header was removed.
134
+
***public void Clear()**: Removes all HTTP headers.
135
+
***public bool Contains(string key)**: Returns true if a header with the given **key** exists.
136
+
***public string Get(string key)**: Returns the value of the header matching the given **key**, or null if it does not exist.
122
137
123
138
## Functions
124
139
The following functions are provided by **HISPlayerManager**. They are not public so it’s necessary to create a custom script which inherits from **HISPlayerManager**.
@@ -396,6 +411,9 @@ Add new content to a certain player. If the **enableDRM** variable is true, a vi
Add new content to a certain player and its respective key server uri and tokens if needed (tokenKey and tokenValue are optional parameters). The **enableDRM** variable must be true for using this function. The **playerIndex** is associated with the index of the element of **Multi Stream Properties**, e.g. the index 0 is the element 0 in the list. The **url** is the link to the new video. The **keyServerUri** is the license key associated with the URL. Please, make sure the string is correct. This function supports local file paths. The **mimeType** parameter is optional and indicates which MIME type will be used for the new url.
Add new content to a certain player including custom HTTP headers. The **playerIndex** is associated with the index of the element of **Multi Stream Properties**, e.g. the index 0 is the element 0 in the list. The **url** is the link to the new video. Please, make sure the string is correct. This function supports local file paths. The **httpHeaderList** contains the custom HTTP headers that will be attached to the requests for this content. The parameter **mimeType** is optional and indicates which MIME type will be used for the new url.
416
+
399
417
#### void ChangeVideoContent(int playerIndex, int urlIndex)
400
418
Change the video’s URL of a certain player. The next playback will start paused if **autoPlay** is disabled. The **playerIndex** is associated with the index of the element of **Multi Stream Properties**, e.g. the index 0 is the element 0 in the list. The **urlIndex** is associated with the index of the element in the list of URLs.
401
419
@@ -408,6 +426,9 @@ Change the video’s URL of a certain player given a new URL. The next playback
Change the video’s URL of a certain player given a new URL with DRM protection (tokenKey and tokenValue are optional parameters). The next playback will start paused if **autoPlay** is disabled. The **playerIndex** is associated with the index of the element of **Multi Stream Properties**, e.g. the index 0 is the element 0 in the list. The parameter **url** is the link to the new video. The **keyServerUri** is the license key associated with the URL. Please, make sure the parameters are correctly written. This function supports local file paths. This function will replace the Playlist with the new element. The **mimeType** parameter is optional and indicates which MIME type will be used for the new url.
Change the video's URL of a certain player given a new URL including custom HTTP headers. The next playback will start paused if **autoPlay** is disabled. The **playerIndex** is associated with the index of the element of **Multi Stream Properties**, e.g. the index 0 is the element 0 in the list. The parameter **url** is the link to the new video. Please, make sure the new URL is correctly written. This function supports local file paths. This function will replace the Playlist with the new URL. The **httpHeaderList** contains the custom HTTP headers that will be attached to the requests for this content.
431
+
411
432
#### void RemoveVideoContent(int playerIndex, int urlIndex)
412
433
Remove content from a certain player. The **playerIndex** is associated with the index of the element of **Multi Stream Properties**, e.g. the index 0 is the element 0 in the list. The **urlIndex** is associated with the index of the element in the list of URLs.
0 commit comments