NMPAVPlayer is the Nagra extension of iOS system AVPlayer class to support AES-128 scrambled Http Adaptive Streaming protocol stream with hybrid integration with Nagra CPAK library.
More...
#import <NMPAVPlayer.h>
|
UIView * | videoView |
| Property to set video renderView, and it also used as subtitle parent view. More...
|
|
int | maxBandwidth |
| Property to set and get max bandwidth in unit of bit per second. More...
|
|
CGSize | maxResolution |
| Property to set and get max resolution in pixels; For http adaptive streaming any stream with greater resolution than this value will be ignored. More...
|
|
NMPAVPlayer is the Nagra extension of iOS system AVPlayer class to support AES-128 scrambled Http Adaptive Streaming protocol stream with hybrid integration with Nagra CPAK library.
To learn more about AVPlayer, please refer to Apple online document: https://developer.apple.com/library/prerelease/ios/documentation/AVFoundation/Reference/AVPlayer_Class/index.html
Definition at line 33 of file NMPAVPlayer.h.
◆ addSubtitleWithContent:MIMEType:Language:()
- (BOOL) addSubtitleWithContent: |
|
(const NSData *) |
xContent |
MIMEType: |
|
(NSString *) |
xMIMEType |
Language: |
|
(NSString *) |
xLanguage |
|
|
| |
Add an external subtitle content through payload.
- Parameters
-
[in] | xContent | The subtitle content data. |
[in] | xMIMEType | The MIMEType of the subtitle. |
[in] | xLanguage | The language code of the subtitle. |
- Returns
- YES when the subtitle is added correctly. NO when there is something wrong in the parameters.
- Note
- Only SRT subtitles are supported currently.
- For SRT subtitles, MIMEType must be set as value "application/x-subrip".
◆ addSubtitleWithUrl:MIMEType:Language:()
- (BOOL) addSubtitleWithUrl: |
|
(const NSString *) |
xUrl |
MIMEType: |
|
(NSString *) |
xMIMEType |
Language: |
|
(NSString *) |
xLanguage |
|
|
| |
Add an external subtitle content through URL.
- Parameters
-
[in] | xUrl | The URL of the subtitle. |
[in] | xMIMEType | The MIMEType of the subtitle. |
[in] | xLanguage | The language code of the subtitle. |
- Returns
- YES when the subtitle is added correctly. NO when there is something wrong in the parameters.
- Note
- Only SRT subtitles are supported currently.
- For SRT subtitles, MIMEType must be set as value "application/x-subrip".
◆ deselectTrack:()
- (void) deselectTrack: |
|
(unsigned int) |
xIndex |
|
Select the specific subtitle track to deselect and remove from display.
- Parameters
-
[in] | xIndex | The index of the track to be deselected. The valid range of the index is 0 ... total number of tracks - 1. The total number of the tracks as well as the type of each individual track can be found by calling getTrackInfo method. |
◆ getTrackInfo()
- (NSArray*) getTrackInfo |
|
|
|
◆ initWithPlayerItem:()
- (instancetype) initWithPlayerItem: |
|
(AVPlayerItem *) |
NS_DESIGNATED_INITIALIZER |
|
Returns an instance of NMPAVPlayer that plays a single AES-128 encrypted audiovisual resource referenced by the AVPlayerItem.
- Parameters
-
[in] | item | Instance of AVPlayerItem |
- Returns
- An instance of NMPAVPlayer
- Note
- To play AES-128 encrypted HLS stream AVPlayerItem must be instantiated as NMPAVPlayerItem type.
◆ initWithURL:()
- (instancetype) initWithURL: |
|
(NSURL *) |
URL |
|
Returns an instance of NMPAVPlayer that plays a single AES-128 encrypted audiovisual resource referenced by URL.
- Parameters
-
[in] | URL | Instance of NSURL that references a media resource |
- Returns
- An instance of NMPAVPlayer
◆ playerWithPlayerItem:()
+ (id) playerWithPlayerItem: |
|
(AVPlayerItem *) |
item |
|
Returns an instance of NMPAVPlayer that plays a single AES-128 encrypted audiovisual resource referenced by the the AVPlayerItem.
- Parameters
-
[in] | item | Instance of AVPlayerItem |
- Returns
- An instance of NMPAVPlayer
- Note
- To play AES-128 encrypted HLS stream AVPlayerItem must be instanined as NMPAVPlayerItem type.
◆ playerWithURL:()
+ (id) playerWithURL: |
|
(NSURL *) |
URL |
|
Returns an instance of NMPAVPlayer that plays a single AES-128 encrypted audiovisual resource referenced by URL.
- Parameters
-
[in] | URL | Instance of NSURL that references a media resource |
- Returns
- An instance of NMPAVPlayer
◆ registerTagListener:forTags:()
- (void) registerTagListener: |
|
(id< INMPTagListener >) |
xListener |
forTags: |
|
(NSArray< NSString * > *) |
xTags |
|
|
| |
Register the INMPTagListener to get the specified tags parsed from media playlists.
The strings in the tags array do not need to be prefixed with a # to match, but can be.
Note that this function will be called immediately with tags from the last media playlist downloaded by the SDK (if any) for the current content.
- Parameters
-
[in] | xListener | INMPTagListener implementation instance to register. |
[in] | xTags | Array of HLS tags to call the listener with. |
◆ registerTrackChangedListener:()
◆ replaceCurrentItemWithPlayerItem:()
- (void) replaceCurrentItemWithPlayerItem: |
|
(AVPlayerItem *) |
item |
|
Replaces the player's current item with the specified player item.
- Parameters
-
[in] | item | The AVPlayerItem that will become the player's current item. |
- Note
- To play AES-128 encrypted HLS stream AVPlayerItem must be instantiated as NMPAVPlayerItem type.
◆ selectTrack:()
- (void) selectTrack: |
|
(unsigned int) |
xIndex |
|
Select the specific subtitle track to decode and display.
- Parameters
-
[in] | xIndex | The index of the track to be selected. The valid range of the index is 0 ... total number of tracks - 1. The total number of the tracks as well as the type of each individual track can be found by calling getTrackInfo method. |
◆ unregisterAllTagListeners()
- (void) unregisterAllTagListeners |
|
|
|
Unregister all INMPTagListeners.
◆ unregisterTagListener:()
Unregister the INMPTagListener.
This will unregister the listener for all tags it's been added for.
- Parameters
-
◆ unregisterTrackChangedListener:()
◆ maxBandwidth
Property to set and get max bandwidth in unit of bit per second.
For http adaptive streaming any stream with bit rate higher than this value will be ignored.
- Note
- This property should be set before stream playback.
Definition at line 104 of file NMPAVPlayer.h.
◆ maxResolution
Property to set and get max resolution in pixels; For http adaptive streaming any stream with greater resolution than this value will be ignored.
- Note
- This property should be set before stream playback.
Definition at line 114 of file NMPAVPlayer.h.
◆ videoView
Property to set video renderView, and it also used as subtitle parent view.
- Note
- This property should be set for subtitle render
Definition at line 94 of file NMPAVPlayer.h.