0% found this document useful (0 votes)
258 views229 pages

OSMP+ User Guide

Uploaded by

jaguar45455
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
258 views229 pages

OSMP+ User Guide

Uploaded by

jaguar45455
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 229

User Guide

OnStream MediaPlayer+ User Guide

VisualOn, Inc.

June, 2016

20160630

VisualOn
Copyright/Confidentiality Notice
© 2016 VisualOn, Inc. All rights reserved.

VisualOn Trademarks

Trademarks and service marks of VisualOn, Inc. (VisualOn) contained in this


document are attributed to VisualOn with the appropriate symbol. For queries
regarding VisualOn’s trademarks, contact the corporate legal department from
VisualOn website.

VisualOn® OnStream®

All other trademarks are the property of their respective holders.

Proprietary and Confidential Information Notice


The information contained herein is the proprietary and/or confidential information,
including trade secrets, of VisualOn or its licensors, and such information may not be
used without prior written permission of VisualOn. Without limiting the foregoing, no
part of this publication may be reproduced in whole or in part by any means
(including photocopying or storage in an information storage/retrieval system) or
transmitted in any form or by any means. By receiving and using the information in
this document, the recipient agrees to maintain the confidentiality of the information
contained herein, and to be liable for any damages resulting from the breach of
confidentiality obligations. If the recipient is unauthorized to receive this document,
please return it or destroy it immediately.

Information in this document is subject to change without notice and does not
represent a commitment on the part of VisualOn. Except as may be explicitly set
forth in an agreement between VisualOn and its customer, VisualOn does not: (a)
make, and expressly disclaims, any representations or warranties as to the
completeness, accuracy or usefulness of the information contained in this
document; (b) warrant that use of such information will not infringe any third party
rights; (c) assume any liability for damages or costs of any kind that may result from
use of such information.

RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure by the Government is


subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical
Data and Computer Software clause at DFARS 252.227-7013.

UNPUBLISHED This document contains unpublished confidential information and is not


to be disclosed or used except as authorized by prior, written permission of VisualOn.

2 OnStream MediaPlayer+ User Guide


VisualOn
Contents

Contents

Chapter 1 Introduction 11
1.1 OSMP+ overview.............................................................................................12
1.1.1 OSMP+ benefits ..................................................................................13
1.1.2 OSMP+ SDK ..............................................................................................13
1.2 Supported operating system and web browser ........................................14
1.3 Terminology .....................................................................................................15
1.4 Features and codecs.....................................................................................16
1.4.2 Streaming .................................................................................................16
1.4.2 Adaptive streaming ...............................................................................19
1.4.3 Local parsers ...........................................................................................24
1.4.4 Codec ......................................................................................................26
1.4.5 Hardware acceleration .........................................................................31
1.4.6 Multiple audio tracks ..............................................................................37
1.4.7 Closed Captions .....................................................................................37
1.4.8 Subtitles ....................................................................................................39
1.4.9 FCC compliance ....................................................................................41
1.4.10 Zoom modes .........................................................................................44
1.4.11 Download Manager ............................................................................48
1.4.12 DRM ........................................................................................................49
1.4.13 Output Control with VCAS...................................................................49
1.4.14 AirPlay on iOS ........................................................................................50
1.4.15 360 video decoding .............................................................................51
1.4.16 3D playback of 360 video decoding.................................................53
1.4.17 IPv6-only network support ...................................................................53
1.4.18 Render options on Android .................................................................54

Chapter 2 Sample Player 56


2.1 Android ............................................................................................................57
2.1.1 Installation ................................................................................................57
2.1.2 Sample player usage .............................................................................60
2.2 iOS .....................................................................................................................81
2.2.1 Installation ................................................................................................81
2.2.2 Sample Player usage .............................................................................84

OnStream MediaPlayer+ User Guide 3


VisualOn
Contents

2.3 Plug-ins ...........................................................................................................103


2.3.1 Installation and uninstallation .............................................................103
2.3.2 Sample player usage (Windows) .......................................................107
2.3.3 Sample player usage (Mac OS) .........................................................120
2.4 Windows Phone ............................................................................................132
2.4.1 Installation and uninstallation .............................................................132
2.4.2 Opening media source .......................................................................133
2.4.3 Selecting/Playing media source ........................................................133
2.4.4 Playback options ..................................................................................134
2.4.5 Switching Asset properties ...................................................................138
2.4.6 Capturing log ........................................................................................138

Chapter 3 OSMP+ Integration 139


3.1 Integration on Android ................................................................................140
3.1.1 Preparing SDK files ................................................................................140
3.1.2 Initializing SDK instance ........................................................................141
3.1.3 Opening media source .......................................................................142
3.1.4 Handling SDK events ............................................................................142
3.1.5 Starting playback .................................................................................143
3.1.6 Stopping playback ...............................................................................143
3.1.7 Seeking ...................................................................................................143
3.1.8 Selecting tracks .....................................................................................144
3.1.9 Subtitle rendering (Optional) ..............................................................144
3.1.10 Download Manager (Optional) .......................................................145
3.1.11 Hardware acceleration (Optional) ..................................................146
3.1.12 Playback speed (Optional)...............................................................146
3.1.13 Zoom .....................................................................................................146
3.1.14 RTSP settings (Optional) .....................................................................147
3.1.15 Enabling DRM ......................................................................................148
3.2 Integration on iOS.........................................................................................148
3.2.1 Preparing SDK files ................................................................................148
3.2.2 Initializing SDK instance ........................................................................150
3.2.3 Opening media source .......................................................................151
3.2.4 Handling SDK event ..............................................................................151
3.2.5 Starting playback .................................................................................152
3.2.6 Stopping playback ...............................................................................152
3.2.7 Seeking ...................................................................................................152
3.2.8 Selecting tracks .....................................................................................152

4 OnStream MediaPlayer+ User Guide


VisualOn
Contents

3.2.9 Subtitle rendering (Optional) ..............................................................153


3.2.10 Download Manager (Optional) .......................................................154
3.2.11 Hardware acceleration (Optional) ..................................................156
3.2.12 Playback speed (Optional)...............................................................156
3.2.13 Zoom .....................................................................................................156
3.2.14 RTSP settings (Optional) .....................................................................156
3.2.15 Enabling DRM ......................................................................................157
3.3 Integration on Windows and Mac OS .......................................................158
3.3.1 Creating a plug-in object ....................................................................158
3.3.2 Initializing OSMP+ ..................................................................................158
3.3.3 Enabling DRM ........................................................................................159
3.4 Integration on Windows Phone ..................................................................159
3.4.1 Preparing SDK files ................................................................................160
3.4.2 Initializing SDK instance ........................................................................160
3.4.3 Opening media source .......................................................................161
3.4.4 Handling SDK event ..............................................................................162
3.4.5 Supported APIs and push buffer usage.............................................162
3.4.6 Enabling DRM ........................................................................................163
3.5 Best practices................................................................................................164

Chapter 4 Logging System 167


4.1 Overview........................................................................................................168
4.2 Printing level of log file .................................................................................169
4.3 Customization of volog.cfg .........................................................................169
4.4 Capturing log ................................................................................................170
4.4.1 Capturing log on Android ...................................................................170
4.4.2 Capturing log on iOS............................................................................171
4.4.3 Capturing log on Windows NPAPI plug-in .........................................172
4.4.4 Capturing log on Mac NPAPI plug-in ................................................173
4.4.5 Capturing log on Windows Phone .....................................................173
4.5 Verimatrix Log File Location ........................................................................174
4.6 Logging Messages........................................................................................175
4.6.1 Bitrate Adaptation logs ........................................................................175
4.6.2 Buffer logs ..............................................................................................175
4.6.3 Content logs ..........................................................................................176
4.6.4 Controller logs .......................................................................................176
4.6.5 DRM logs ................................................................................................177
4.6.6 Hardware Codec logs .........................................................................177

OnStream MediaPlayer+ User Guide 5


VisualOn
Contents

4.6.7 License logs ...........................................................................................178


4.6.8 Local File logs ........................................................................................178
4.6.9 KPI logs ...................................................................................................178
4.6.10 OS Source logs ....................................................................................179
4.6.11 Output Control logs ............................................................................179
4.6.12 RTSP logs ...............................................................................................180
4.6.13 Streaming logs.....................................................................................182
4.6.14 SourceIO logs ......................................................................................182
4.6.15 Subtitle logs ..........................................................................................183
4.6.16 VOME2 engine logs ............................................................................183

Chapter 5 License 185


5.1 Evaluation license.........................................................................................186
5.2 Production license ........................................................................................186
5.2.1 Android ..................................................................................................186
5.2.2 iOS ...........................................................................................................186
5.2.3 Windows plug-in....................................................................................186
5.2.4 Mac OS plug-in .....................................................................................187
5.2.5 Chrome PPAPI plug-in ..........................................................................187
5.2.6 Windows Phone ....................................................................................187

Chapter 6 Frequently Asked Questions 189


6.1 Frequently Asked Questions ........................................................................190

Appendix A Programming reference 197


API reference ......................................................................................................198
Events ...................................................................................................................198
Error codes ......................................................................................................198
VO_OSMP_CB_EVENT_ID ...............................................................................203
VO_OSMP_CB_SYNC_EVENT_ID ...................................................................213
VO_OSMP_SRC_CUSTOMERTAGID ..............................................................214
VO_OSMP_SRC_ADAPTIVE_STREAMING_INFO_EVENT...............................214
VO_OSMP_SRC_ADAPTIVE_STREAMING_ERROR_EVENT ........................... 216
VO_OSMP_SRC_ADAPTIVE_STREAMING_WARNING_EVENT ..................... 217
VO_OSMP_AVAILABLE_TRACK_TYPE ............................................................218
VO_OSMP_SRC_RTSP_ERROR .......................................................................218
VO_OSMP_CB_STREAMING_DOWNLOADER_EVENT_ID ............................ 220

Appendix B Configuration Files 224


Cap file.................................................................................................................225

6 OnStream MediaPlayer+ User Guide


VisualOn
Contents

White List ..............................................................................................................226

Appendix C Reference Documentation 227


VisualOn Documentation ..................................................................................228
Links.......................................................................................................................228

Figures
Figure 1. Supported protocols, formats, CPUs, and platforms .................. 12
Figure 2. Progressive Download in OSMP+...................................................17
Figure 3. Progressive Download roles ...........................................................17
Figure 4. Example of white list ........................................................................33
Figure 5. Sample 1: letterbox .........................................................................44
Figure 6. Sample 2: Letterbox ........................................................................45
Figure 7. Sample 1: Pan & Scan ....................................................................45
Figure 8. Sample 2: Pan & Scan ....................................................................46
Figure 9. Example of Fit to Window ...............................................................46
Figure 10. Example of Original Size .................................................................47
Figure 11. Example of Zoom In.........................................................................48
Figure 12. DRM workflow ..................................................................................49
Figure 13. Eclipse IDE Import Dialog ................................................................57
Figure 14. Select the SamplePlayer project ...................................................58
Figure 15. Eclipse IDE Package Explorer.........................................................58
Figure 16. Context Menu for SamplePlayer Project in Eclipse IDE .............. 59
Figure 17. Select Video Render Type ..............................................................62
Figure 18. Set duration for push PD .................................................................62
Figure 19. Select an external subtitle ..............................................................64
Figure 20. Set maximum buffer time ...............................................................64
Figure 21. Available RTSP connection types ..................................................66
Figure 22. Define the port .................................................................................66
Figure 23. Set the entry level ............................................................................67
Figure 24. Set the retry times ............................................................................67
Figure 25. Enable HTTP Verification Information ............................................67
Figure 26. Set the user name and password .................................................68
Figure 27. Set retry times ...................................................................................68
Figure 28. Set the value of Initial Bitrate .........................................................71
Figure 29. Set the lower and upper bound value .........................................72
Figure 30. Enable or disable settings of audio and subtitle ......................... 72
Figure 31. Sample Player with Closed Captions ...........................................77

OnStream MediaPlayer+ User Guide 7


VisualOn
Contents

Figure 32. Sample Player Asset menu .............................................................78


Figure 33. Screen brightness ............................................................................78
Figure 34. Update the media source..............................................................79
Figure 35. Set the aspect ratio .........................................................................79
Figure 36. Enable multiple instances...............................................................81
Figure 37. Sample Player Project in Finder .....................................................82
Figure 38. Xcode IDE with Imported SamplePlayer Project ......................... 82
Figure 39. Xcode IDE with Imported Sample Player Project........................ 83
Figure 40. iTunes Apps View with SamplePlayer Documents ...................... 85
Figure 41. Initial View of the Sample Player ...................................................85
Figure 42. Select an external subtitle ..............................................................88
Figure 43. Available RTSP Connection Types .................................................89
Figure 44. Define the port .................................................................................90
Figure 45. Set the entry level ............................................................................90
Figure 46. Set the retry times ............................................................................91
Figure 47. Set the user name and password .................................................91
Figure 48. Set retry times ...................................................................................91
Figure 49. Set the value of Initial Bitrate .........................................................94
Figure 50. Set the lower and upper boundary value ...................................95
Figure 51. Enable or disable settings of audio and subtitle ......................... 95
Figure 52. Playback Controls when Media is Playing ...................................99
Figure 53. Control audio speed .....................................................................100
Figure 54. Sample Player with Closed Captions Display ............................ 100
Figure 55. Sample Player Asset Selection Menu..........................................101
Figure 56. Screen brightness ..........................................................................101
Figure 57. Update the media source............................................................102
Figure 58. Enable multiple instances.............................................................103
Figure 59. Installation wizard on Windows ....................................................104
Figure 60. Installation wizard on Mac OS .....................................................105
Figure 61. Initial view of the Sample Player..................................................108
Figure 62. Set the aspect ratio .......................................................................110
Figure 63. Example of configurable UI..........................................................110
Figure 64. Playback control buttons .............................................................111
Figure 65. View full screen button .................................................................112
Figure 66. Property switches buttons ............................................................113
Figure 67. Switch the video ............................................................................113
Figure 68. Example of Closed Captions .......................................................115

8 OnStream MediaPlayer+ User Guide


VisualOn
Contents

Figure 69. Update the media source............................................................116


Figure 70. UTC time ..........................................................................................117
Figure 71. Enable Enter NTS ............................................................................118
Figure 72. Playback control buttons .............................................................123
Figure 73. View full screen button .................................................................124
Figure 74. Sound control buttons...................................................................124
Figure 75. Property switches buttons ............................................................125
Figure 76. Update the media source............................................................128
Figure 77. UTC time ..........................................................................................128
Figure 78. Enable Enter NTS ............................................................................130
Figure 79. Windows Phone Developer Registration ....................................132

Tables
Table 1. Supported web browser .................................................................14
Table 2. Supported web browser version....................................................15
Table 3. Terminology ......................................................................................15
Table 4. Supported profiles ...........................................................................27
Table 5. MPEG4 audio object details ..........................................................28
Table 6. Supported MPEG audio layer ........................................................30
Table 7. Output control flags ........................................................................50
Table 8. Subtitle attributes and related APIs ...............................................69
Table 9. Subtitle attributes and related APIs ...............................................92
Table 10. Subtitle attributes and related APIs .............................................135
Table 11. Java libraries ..................................................................................141
Table 12. Header files dependency ............................................................148
Table 13. Header files dependency ............................................................160
Table 14. Bitrate Adaptation related logs ...................................................175
Table 15. Buffer related logs .........................................................................176
Table 16. Content related logs .....................................................................176
Table 17. Controller related logs ..................................................................176
Table 18. DRM related logs ...........................................................................177
Table 19. Hardware codec related logs .....................................................177
Table 20. License related logs ......................................................................178
Table 21. Local file related logs ....................................................................178
Table 22. KPI related logs ..............................................................................179
Table 23. OS source related logs..................................................................179
Table 24. Output control related logs .........................................................179

OnStream MediaPlayer+ User Guide 9


VisualOn
Contents

Table 25. RTSP related logs ............................................................................180


Table 26. Streaming related logs ..................................................................182
Table 27. SourceIO related logs ...................................................................182
Table 28. Subtitle related logs .......................................................................183
Table 29. VOME2 engine related logs .........................................................183
Table 30. List of supported language codes ..............................................191

10 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 1: Introduction

Chapter 1 Introduction

This chapter presents the following topics:

1.1 OSMP+ overview.............................................................................................12

1.2 Supported operating system and web browser ........................................14

1.3 Terminology .....................................................................................................15

1.4 Features and codecs.....................................................................................16

OnStream MediaPlayer+ User Guide 11


VisualOn
Chapter 1: Introduction

1.1 OSMP+ overview


OnStream MediaPlayer+ (referred hereafter to as OSMP+) is a multimedia
player development kit enabling cross-platform content delivery and
playback on connected devices including mobile handsets, tablets,
desktops, set-top boxes, and smart TVs. OSMP+ enables the development
of both enterprise and consumer grade applications to meet the latest
trends in high-quality video/audio delivery and playback. Figure 1
demonstrates the video formats, audio formats, platforms, CPUs, and
protocols supported by OSMP+.

Figure 1. Supported protocols, formats, CPUs, and platforms

OSMP+ is based on a modular architecture that delivers maximum


portability and scalability. Its common application programming interface
(API) enables re-use and scalable deployment across multiple platforms.
The modular architecture also accelerates feature-rich development. With
OSMP+, integration into content delivery applications, with third party DRM
modules, or with custom protocols is fast and easy. Video and audio post-
processing support enables features such as closed captions and subtitles
rendering, and advanced audio processing.

The OSMP+ toolkit supports a set of highly optimized software multimedia


codecs for the most popular formats, as well as support for multiple

12 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 1: Introduction

streaming protocols across a wide range of media servers. OSMP+ builds


upon market-proven technology that currently powers over 200 million
mobile devices.

1.1.1 OSMP+ OSMP+ offers the following benefits when deploying a content delivery
benefits solution:
• Modular and flexible architecture enables easy integration into
content delivery applications and addition of new or custom
protocols.
• Enables development of multimedia players with no
device/OS/protocol dependencies
• Enables delivery of uniform and compelling viewer experiences
across multiple platforms
• Enables the efficient implementation, small memory footprint, and
runtime memory usage
• Enables scalable deployment and single software codebase
• Enables unprecedented performance and reliability across all
targeted devices
• Enables accelerated time to market and lower cost of deployment
and support

1.1.2 OSMP+ SDK The OSMP+ Software Development Kit (SDK) is a development kit to create
a media player on supported devices and supports the following functions:
• Playback of multiple video formats and audio formats to devices with
or without native support
• Playback of live or video on demand (VoD) streaming, progressive
download, and local media sources
• Easy integration with Digital Rights Management (DRM) decryption
engines
• Audio post-processing for third party audio effect plug-ins and
equalizers
• Video post-processing for Closed Captions and subtitles rendering

OnStream MediaPlayer+ User Guide 13


VisualOn
Chapter 1: Introduction

1.2 Supported operating system and web browser


The following is the operating system (OS) supported by OSMP+:
• Windows 7, Windows 8, Windows 8.1 with (ActiveX, NPAPI, PPAPI)
plug-in using Windowed mode, and Windows 10 with (NPAPI, PPAPI)
plug-in using Windowed mode
• Mac OS 10.6, Mac OS 10.8, Mac OS 10.9, and Mac OS 10.10 with
(NPAPI, PPAPI) plug-in using Windowless mode
• Android 2.3.x, Android 3.x, Android 4.0.x, Android 4.1.x, Android 4.2.x,
Android 4.3.x, Android 4.4.x, Android 5.0, and Android 6.0
• iOS6, iOS 7, iOS8, and iOS9
• Windows Phone 8.1

Table 1 lists the web browser supported by OSMP+:

Table 1. Supported web browser

Browser
Platform OS FireFox IE1 Chrome
Safari 1 Edge
(NPAPI) (ActiveX) (PPAPI)

32-bit Mac Yes No 2 N/A No (default N/A


is 64bit)

64-bit Mac 32-bit No N/A Yes N/A


mode: Yes
64-bit
mode: No

32-bit Windows N/A Yes Yes Yes No

64-bit Windows N/A No Yes 3 Yes No

1 Safari 64-bit and IE 64-bit support 32-bit plug-ins, but Chrome 64-bit and FireFox

64-bit do not support 32-bit plug-ins.


2Firefox will add a warning message when running NPAPI and will be terminating
support for NPAPI by the end of 2016.
3 IE10/11 64-bit default mode is 64-bit. VisualOn 32-bit plug-in can run on IE10/11

64-bit.

14 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 1: Introduction

Table 2 lists the web browser version supported by OSMP+:

Table 2. Supported web browser version

OS Browser Supported browser version

Window 7, Windows 8, Windows 8.1 with Internet Explorer (ActiveX) 10+


(ActiveX, NPAPI) plug-in using
Windowed mode, and Window 10 with Google Chrome (PPAPI) 46+
(NPAPI, PPAPI) plug-in using Windowed
mode Mozilla Firefox (NPAPI) 19+

Mac OS 10.6, Mac OS 10.8, Mac OS Apple Safari (NPAPI) 8+


10.9, and Mac OS 10.10 with (NPAPI,
PPAPI) using Windowless mode Google Chrome (PPAPI) 46+

1.3 Terminology
Table 3 describes the terminology used in this guide.

Table 3. Terminology

Term Definition

Adaptive Playback or Adaptive Streaming refers to streaming technologies


such as HTTP Live Streaming, Microsoft Smooth Streaming, and MPEG-DASH.
Adaptive These technologies enable seamless playback of video content over the air
Playback as client devices change their behavior according to external factors such as
bandwidth. Refer to Multimedia section on Android 4.4 APIs for more
information.

Bitrate Adaptation is used in adaptive streaming standards, which includes


HTTP Live Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (DASH).
Bitrate Smooth Bitrate Adaptation requires two decoding pipelines, but using two
Adaptation SurfaceView has limitations when two hardware decoders are required. We
recommend using one TextureView class and one SurfaceView class for two
video pipelines.

Closed Caption CC is the processes of displaying text on a television, video screen, or other
(CC) visual display to provide additional or interpretive information.

Hypertext HTTP is an application protocol for distributed, collaborative, hypermedia


Transfer information systems, as well as the foundation of data communication for the
Protocol (HTTP) World Wide Web.

API for accessing hardware decoders on Android devices. IOMX is for Android
IOMX
devices with version 4.0 and 4.1.

API for accessing hardware decoders on Android devices. MediaCodec is for


MediaCodec
Android devices with version 4.2 and later.

Progressive Progressive Download is the transfer of digital media files from a server to a

OnStream MediaPlayer+ User Guide 15


VisualOn
Chapter 1: Introduction

Term Definition
Download (PD) client, typically using the HTTP protocol when being initiated from a computer
or other mobile devices.

Real-time
RTP, sometime referred to as RTTP, defines a standardized packet format for
Transport
delivering audio and video over IP networks.
Protocol (RTP)

Default View class for displaying video contents on Android devices.


SurfaceView
Refer to SurfaceView for more information.

TCP is one of the core protocols of the Internet protocol (IP) suite. TCP
Transmission
provides reliable, ordered, and error-checked delivery of a stream of octets
Control
between programs running on computers connected to a local area
Protocol (TCP)
network, intranet, or the public Internet. TCP resides at the transport layer.

UDP uses a simple connectionless transmission model with a minimum of


protocol mechanism. It has no handshaking dialogues, thus exposes any
User Datagram unreliability of the underlying network protocol to the user's program. There is
Protocol (UDP) no guarantee of delivery, ordering, or duplicate protection. UDP provides
checksums for data integrity, and port numbers for addressing different
functions at the source and destination of the datagram.

General View class for displaying video contents on Android devices.


Comparing with SurfaceView, TextureView offers better capabilities for
TextureView
animation, scaling, and transformation. Refer to TextureView for more
information.

1.4 Features and codecs


Combined with VisualOn’s implementation of standard streaming
protocols, OSMP+ enables seamless content delivery and playback across
multiple platforms, including iOS, Android, Windows, Mac OS, and more.
OSMP+ uses the most advanced video and audio decoding technologies.

This section describes the OSMP+ features, feature specifications, and


codecs supported by OSMP+.

1.4.2 Streaming Streaming is multimedia that is constantly received by and presented to


an end user while being delivered by a provider. This section describes the
following topics:
• Progressive Download
• Real Time Streaming Protocol (RTSP)
• Windows Media Hypertext Transfer Protocol (WMHTTP)

16 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 1: Introduction

1.4.1.1 Progressive Download


Progressive Download is the transfer of digital media files from a server to a
client, typically using the HTTP protocol when being initiated from a
computer. End user may start playback of the media before the
download is complete.

OSMP+ downloads the media data from http server to local buffer, like
local memory or files, manages the limited buffer efficiently, and then
offers the required data to file parser as needed, as shown in Figure 2.

Figure 2. Progressive Download in OSMP+

To run Progressive Download, user needs to download at least 40 MB of the


media file being played to the device’s memory. If the required media
data is not in the buffer, OSMP+ downloads data from the HTTP server. If
the required media data is in the buffer, OSMP+ reads from local buffer
and returns the data. Figure 3 demonstrates the roles of Progressive
Download.

Figure 3. Progressive Download roles

1.4.1.2 Real Time Streaming Protocol


Real Time Streaming Protocol (RTSP) is a network control protocol designed
for use in entertainment and communications systems to control streaming
media servers. The protocol is used for establishing and controlling media
sessions between end points. Clients of media servers issue VCR-style
commands, such as play and pause, to facilitate realtime control of
playback of media files from the server. The transmission of streaming data
itself is not a task of the RTSP protocol. Most RTSP servers use the Real-time
Transport Protocol (RTP) in conjunction with Real-time Control Protocol
(RTCP) for media stream delivery. However some vendors implement
proprietary transport protocols. The RTSP server software from
RealNetworks, for example, also used RealNetworks' proprietary Real Data
Transport (RDT).

OnStream MediaPlayer+ User Guide 17


VisualOn
Chapter 1: Introduction

The OSMP+ player supports the following audio and video codecs:
• Audio
 MPEG4-GENERIC
 MPEG4-LATM
 AMR-WB+
 AMR-WB
 AMR-NB
 QCELP
 WMA
• Video
 H.264
 MPEG4
 H.263
 WMV

RTSP supports the following protocols:


• RFC 2326: Real Time Streaming Protocol (RTSP)
• RFC 2327: SDP: Session Description Protocol
• RFC 3550: RTP: A Transport Protocol for Real-Time Applications

The following is the supported RTP profile:


• RFC 3551: RTP Profile for Audio and Video Conferences with Minimal
Control
The following is the supported RTP Payload types:
• RFC 3984: RTP Payload Format for H.264 Video
• RFC 3016: RTP Payload Format for MPEG-4 Audio/Visual Streams
• RFC 4629: RTP Payload Format for ITU-T Rec.H.263 Video
• RFC 3267: Real-Time Transport Protocol (RTP) Payload Format and File
Storage Format for the Adaptive Multi-Rate (AMR) and Adaptive
Multi-Rate Wideband (ARM-WB) Audio Codecs
• RFC 4352: RTP Payload Format for the Extended Adaptive Multi-Rate
Wideband (AMR-WB+) Audio Codec
• RFC 2658: RTP Payload Format for PureVoice (tm) Audio
• MS-RTSP: RTP Payload Format for ASF Streams

18 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 1: Introduction

1.4.1.3 Windows Media HTTP


The Windows Media HTTP (WMHTTP) Streaming Protocol is a client/server–
based protocol used to stream realtime data between a client (the
receiver of streaming data) and a server (the sender of streaming data).
OSMP+ supports the following WMHTTP features:
• Supports both Non-Pipelined mode and Pipelined mode.
 Non-Pipelined mode: Mode of operation in which requests from
the client must be sent on a TCP connection separate from the
one being used by the server for streamingcontent to the client.
 Pipelined mode: Mode of operation in which requests from the
client can be sent on the same TCP connection being used by
the server for streamingcontent to the client.
• Supports both Single File streaming and live streaming.
 Single File streaming: See Single File Streaming for more
information.
 Live streaming: Content that is streamed while it is still being
encoded by an encoder.
• Specifies a transmission rate.
• Specifies the amount of multimedia data in milliseconds, which the
client requests the server to speed up
• KeepAlive request prevents the server from timing out.
• Submits statistics about the streamed content to the server.

See [MS-WMSP]: Windows Media HTTP Streaming Protocol for the detailed
information about WMHTTP.

1.4.2 Adaptive Adaptive streaming is a technique used in streaming multimedia over


streaming computer networks, which works by detecting a user's bandwidth and CPU
capacity in real time and adjusting the quality of a video stream
accordingly. It requires the use of an encoder which can encode a single
source video at multiple bitrates. The player switches between streaming
the different encodings depending on available resources. Adaptive
streaming includes the following three types:
• HTTP Live Streaming (HLS)
• Microsoft Smooth Streaming
• Dynamic Adaptive Streaming over HTTP (DASH)

1.4.2.1 HTTP Live Streaming


HTTP Live Streaming, namely HLS, is an HTTP-based media streaming
communications protocol implemented by Apple Inc. as part of their
QuickTime, Safari, OS X, and iOS software.

OnStream MediaPlayer+ User Guide 19


VisualOn
Chapter 1: Introduction

HLS works by breaking the overall stream into a sequence of small HTTP-
based file downloads. Each download loads one short chunk of an overall
potentially unbounded transport stream. As the stream is played, the client
may select from a number of different alternative streams containing the
same material encoded at a variety of data rates, allowing the streaming
session to adapt to the available data rate.

The following is the tags supported by the OSMP+ SDK. Refer to HTTP Live
Streaming for detailed definitions about HLS tags.
• EXT-X-TARGETDURATION
• EXT-X-MEDIA-SEQUENCE
• EXT-X-KEY(URI)
• EXT-X-ENDLIST
• EXT-X-STREAM-INF
• EXT-X-KEY(IV)
• EXT-X-DISCONTINUITY
• EXT-X-VERSION
• EXT-X-PLAYLIST-TYPE
• EXT-X-BYTERANGE
• EXT-X-MEDIA
• EXT-X-I-FRAME-STREAM-INF
• EXT-X-STREAM-INF(AUDIO/VIDEO)
• EXT-X-MEDIA(SUBTITLED/FORCED/CHARACTERISTICS)
• EXT-X-STREAM-INF(SUBTITLES)
• EXT-X-MAP

OSMP+ supports the following media formats:


• MPEG2-TS
• MPEG-ES/AAC
• MPEG-ES/MP3
• ID3(MPEG-ES)
• ID3(MPEG2-TS)
• WebVTT

1.4.2.2 Microsoft Smooth Streaming


The Microsoft Smooth Streaming protocol provides a means of delivering
media from servers to clients in a way that can be cached by standard
HTTP cache proxies in the communication chain. Allowing standard HTTP

20 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 1: Introduction

cache proxies to respond to requests on behalf of the server increases the


number of clients that can be served by a single server.

The following is the codec supported by Microsoft Smooth Streaming on


the OSMP+ player:
• Video codec
 H.264
 WMV/VC1
• Audio codec
 AAC
 WMA
Microsoft Smooth Streaming supported features include:
• Request and response through HTTP
• XML parser used for the manifest file
• Audio and video fragment process mechanism
• MP4 fragment parser callback
• Playback of multi-period VoD content
• Playback of indexed content
• Playback of live content
• Playback of VoD subtitle

1.4.2.3 Dynamic Adaptive Streaming over HTTP


Dynamic Adaptive Streaming over HTTP (DASH), also known as MPEG-
DASH, is an adaptive bitrate streaming technique that enables high quality
streaming of media content over the Internet delivered from conventional
HTTP web servers. Similar to Apple's HTTP Live Streaming (HLS) solution,
MPEG-DASH works by breaking the content into a sequence of small HTTP-
based file segments, each segment containing a short interval of playback
time of a content that is potentially many hours in duration, such as a
movie or the live broadcast of a sports event.
The content is made available at a variety of bitrates, for example,
alternative segments encoded at different bit rates covering aligned short
intervals of play back time are made available.
As the content is played back by an MPEG-DASH client, the client
automatically selects from the alternatives the next segment to download
and play based on current network conditions. The client selects the
segment with the highest bitrate possible that can be downloaded in time
for playback without causing stalls or re-buffering events. Therefore an
MPEG-DASH client can seamlessly adapt to changing network conditions,
and provide high quality playback without stalls or re-buffering events.

OnStream MediaPlayer+ User Guide 21


VisualOn
Chapter 1: Introduction

DASH supports the following video and audio codecs:


• Video codec
 H.264
 WMV/VC1
 H.265
• Audio codec
 AAC
 WMA

DASH supported features include:


• Request and response through HTTP
• XML parser used for Media Presentation Description (MPD) file
• Audio and video fragment process mechanism
• MP4 fragment parser callback
• TS fragment parser callback
• Playback of multi-period VoD content
• Playback of indexed content
• Playback of PD content (one file)
• Playback of live content
• Playback of VoD TTML or SMPTE subtitle

DASH uses the ISO, IEC, and 23009 tags. The Media Presentation
Description (MPD) document contains metadata required by a DASH
client to construct appropriate HTTP URLs to access segments and to
provide the streaming service to the user.

A Media Presentation consists of one or more Periods. Multi_Period is used


for advertisement insertion.
• AdaptationSet: Each Period consists of one or more AdaptationSets.
In general the AdaptionSet is divided into three types of stream:
Video, Audio, and Subtitle.
• ContentComponent: Each AdaptationSet contains one or more
media ContentComponents. The properties of each media
ContentComponent are described by a ContentComponent
element or may be described directly on the AdaptationSet element
if only one media ContentComponent is present in Adaptation Set.

22 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 1: Introduction

A Representation is one of the alternative choices of the complete set or


subset of media content components comprising the media content
during the defined Period.
• The Segment template is defined by the SegmentTemplate element.
In this case, specific identifiers that are substituted by dynamic values
assigned to Segments, to create a list of Segments.
• The SegmentTimeline element expresses the earliest presentation time
and presentation duration (in units based on the @timescale
attribute) for each Segment in the Representation.

1.4.2.4 Bitrate Adaptation


Bitrate Adaptation is a process to effectively deliver streaming contents to
achieve the best possible playback quality under various environmental
conditions. OSMP+ supports Bitrate Adaptation for HTTP-based adaptive
streaming protocols, namely HLS, Smooth Streaming, and DASH. OSMP+
takes network congestion, device capability, device loading, and several
other factors into consideration to determine an optimal video bitrate to
be played. Adaption allows seamless transitions among different video
qualities without interrupting the playback. The OSMP+ SDK complies with
the following rules to perform the Bitrate Adaptation operation:
• HLS: The OSMP+ SDK selects the default video/audio track.
• SS/DASH: The OSMP+ SDK selects the first video/audio track defined in
the manifest file.

Note: If the first track defined in the DASH manifest file is pure audio, the
OSMP+ SDK will automatically select the first track with both video and
audio defined in the manifest file.

In additional to automatic Bitrate Adaptation, OSMP+ supports many


configuration options to perfect adaption behaviors. These configuration
options include:
• Initial (starting) bitrate
• Start buffering time
• Playback re-buffering time
• Maximum buffering time
• Minimum bitrate
• Maximum bitrate
• CPU based adaption
• Device capability configuration

Combining these options with the automatic Bitrate Adaptation


technology provides a flexible solution to fit a wide range of requirements.

OnStream MediaPlayer+ User Guide 23


VisualOn
Chapter 1: Introduction

1.4.3 Local OSMP+ supports the following local parsers:


parsers
• Audio parser
• MP4 parser
• AVI parser
• FLV parser

1.4.3.1 Audio parser


Audio parser supports the following audio codecs:
• MP3
• AAC
• AC3
• AMR
• APE
• AU
• DTS-HD
• FLAC
• QCP
• WAV

1.4.3.2 MP4 parser


MP4 parser has no limitation on the maximum file size and supports the
following specifications:
• ISO/IEC 14496-12
• ISO/IEC 14496-14
• ISO+IEC+23001-7-2012(cenc)

MP4 parser supports the following audio and video codecs:


• Audio
 AAC
 QCELP
 MP3
 AMR (NB, WB, and WB+)
 EVRC
 AC3
 eAC3
 ALAC

24 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 1: Introduction

 DTS-HD
 MP4A
 PCM
 MULAW
 ALAW
 WMA
 QCELP
• Video
 H.264/AVC
 H.263
 MPEG4
 H.265/HEVC

1.4.3.3 AVI parser


The maximum file size of AVI parser is 2G bytes. AVI parser supports
OpenDML AVI File Format Extensions (version 1.02).

AVI parser supports the following audio and video codecs:


• Audio
 AAC
 QCELP
 MP3
 AMR (NB, WB, and WB+)
 EVRC
 AC3
 eAC3
 WMA
• Video
 H.264/AVC
 H.263
 MPEG4
 Motion JPEG
 Xvid
 DivX
 WMV

OnStream MediaPlayer+ User Guide 25


VisualOn
Chapter 1: Introduction

1.4.3.4 FLV parser


FLV parser has no limitation on the maximum file size and supports the
following audio and video codecs:
• Audio
 AAC
 FLV
• Video
 AVC
 Sorenson H.263
 VP6

1.4.4 Codec 1.4.4.1 Video codec


OSMP+ supports the following video codecs:
• HEVC/H.265 (software codec)
• H.264 (software codec)

1.4.4.1.1 HEVC/H.265
The input format of this video codec is ISO/IEC23008-2 compliant raw video
data, and the output format is YUV420 planar. The maximum supported
video size for HEVC is 1080p.
HEVC/H.265 supports the following profiles:
• I,P,B frame
• CU size: 8x8 to 64x84
• PU partition: Symmetric
• TU partition: RQT
• TU size: DCT 4x4 to 32x32, DST 4x4
• Intra Prediction mode: all size of DC, Planner, 33 directions mode
• Quarter pixed motion compensation and weighted prediction
• Parallel processing tools deblocking, SAO
• Entropy coding: context-adaptive binary arithmetic coding (CABAC)

1.4.4.1.2 H.264
For H.264 codec, the output format is YUV420. The input formats include:
• 14496-10 AnnexB format
• 14496-15 AVC format

26 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 1: Introduction

The maximum supported video size for H.264 codec is 1080p. Table 4 lists
the profiles supported by H.264 codec.
Table 4. Supported profiles

Constraine Baseli Exten Mai


High Hi10P Hi422P Hi444PP
d Baseline ne ded n

B slices No No Yes Yes Yes Yes Yes Yes

SI and SP
slices
No No Yes No No No No No

Flexible
macrobloc
No Yes Yes No No No No No
k ordering
(FMO)

Arbitrary
slice
No Yes Yes No No No No No
ordering
(ASO)

Redundant
No Yes Yes No No No No No
slices (RS)

Data
partitionin No No Yes No No No No No
g

Interlaced
coding
(PicAFF,
No No Yes Yes Yes Yes Yes Yes
MBAFF)

CABAC
entropy No No No Yes Yes Yes Yes Yes
coding

8×8 vs. 4×4


transform No No No No Yes Yes Yes Yes
adaptivity

Quantizati
on scaling No No No No Yes Yes Yes Yes
matrices

Separate
Cb and Cr No No No No Yes Yes Yes Yes
QP control

Monochro
me (4:0:0)
No No No No Yes Yes Yes Yes

Chroma 4:2: 4:2:0/4: 4:2:0/4:2:2


formats
4:2:0 4:2:0 4:2:0 4:2:0 4:2:0
0 2:2 /4:4:4

Sample
8 to
depths 8 8 8 8 8 8 to 10 8 to 14
(bits) 10

OnStream MediaPlayer+ User Guide 27


VisualOn
Chapter 1: Introduction

Constraine Baseli Exten Mai


High Hi10P Hi422P Hi444PP
d Baseline ne ded n

Separate
color
No No No No No No No Yes
plane
coding

Predictive
lossless No No No No No No No Yes
coding

1.4.4.2 Audio codec


OSMP+ supports the following audio codecs:
• AAC
• AAC+
• eAAC+
• MP3

Note: Windows Phone supports AAC audio codec only.

1.4.4.2.1 AAC, AAC+, and eAAC+


This audio codec supports the following object types:
• AAC-LC
• AACLT
• HEAAC (SBR)
• EAAC+ (HE_PS)
• BSAC (ER_BSAC)

For this audio codec, the bitrate mode includes variable bitrate (VBR) and
constant bitrate (CBR), and the output format is 16 bit PCM data. The input
formats include:

• RAW data AAC


• ADTS AAC
• ADIF AAC
• LATM AAC

Table 5 lists the MEPG4 audio object details.

Table 5. MPEG4 audio object details

Object Type Object ID Description Support (Yes or No)

NULL 0 NULL Object Yes

28 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 1: Introduction

Object Type Object ID Description Support (Yes or No)

AAC Main 1 AAC Main Object No

AAC LC 2 AAC Low Complexity(LC) Object No

AAC SSR 3 AAC Scalable Sampling Rate(SSR) Yes


Object

AAC LTP 4 AAC Long Term Predictor(LTP) No


Object

AAC SBR 5 AAC SBR object(HE_AAC) No

AAC SCAL 6 AAC Scalable Object Yes

TWIN VQ 7 TwinVQ Object Yes

CELP 8 CELP Object Yes

HVXC 9 HVXC Object Yes

RSVD 10 10 reserved Yes

RSVD 11 11 reserved Yes

TTSI 12 TTSI Object Yes

MAIN SYNTH 13 Main Synthetic Object Yes

WAV TAB 14 Wavetable Synthesis Yes


SYNTH

GEN MIDI 15 General MIDI Object Yes

ALG SYNTH 16 Algorithmic Synthesis and Audio Yes


AUD_FX FX Object

ER AAC LC 17 Error Resilient(ER) AAC Low Yes


Complexity(LC) Object

RSVD 18 18 reserved Yes

ER AAC LTP 19 Error Resilient(ER) AAC Long Term Yes


Predictor(LTP) Object

ER AAC 20 Error Resilient(ER) AAC Scalable Yes


SCAL Object

ER TWIN VQ 21 Error Resilient(ER) TwinVQ Object Yes

ER BSAC 22 Error Resilient(ER) BSAC Object No

OnStream MediaPlayer+ User Guide 29


VisualOn
Chapter 1: Introduction

Object Type Object ID Description Support (Yes or No)

ER AAC LD 23 Error Resilient(ER) AAC LD Object Yes

ER CELP 24 Error Resilient(ER) CELP Object Yes

ER HVXC 25 Error Resilient(ER) HVXC Object Yes

ER HILN 26 Error Resilient(ER) HILN Object Yes

ER PARA 27 Error Resilient(ER) Parametric Yes


Object

SSC 28 SSC Object Yes

HE PS 29 AAC High Efficiency with No


Parametric Stereo coding (HE-
AAC v2, EAAC+)

RSVD 30 30 reserved Yes

RSVD 31 31 reserved Yes

Layer 1 32 MPEG Layer 1 Object No

Layer 2 33 MPEG Layer 2 Object No

Layer 3 34 MPEG Layer 3 Object No

DST 35 DST Object Yes

1.4.4.2.2 MP3
Table 6 lists the supported MPEG audio layer.

Table 6. Supported MPEG audio layer

Decoder Layer type

• MPEG1 Layer1
• MPEG1 Layer2
• MPEG1 Layer3
• MPEG2 Layer1
MPEG audio • MPEG2 Layer2
• MPEG2 Layer3
• MPEG2.5 Layer1
• MPEG2.5 Layer2
• MPEG2.5 Layer3

30 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 1: Introduction

1.4.4.2.3 DSAPlus decoder


OSMP+ uses DSAPlus decoder to decode and post-process the Dolby
Digital Plus contents, as well as supporting the sample rates, bitrates, and
output modes for each of the audio formats. For detailed information
about DSAPlus decoder, visit Dolby’s official website.

1.4.4.2.4 Audio speed decoder


The following is the output of Audio speed decoder:
• Support Mono and two channels output
• 16 bits, PCM
• -3x to +3x audio speed adjustment

1.4.5 Hardware 1.4.5.1 Hardware acceleration for Android


acceleration This section describes the hardware integration implemented in OSMP+ on
the Android platform.

1.4.5.1.1 Hardware acceleration introduction


1.4.5.1.1.1 APIs for accessing hardware decoders
The Android operating system provides the following two types of API to
access hardware decoders:
• MediaCodec: MediaCodec is the official Android API. This API was
initially released for Android version 4.1.2 and is supported on most
Android devices with version 4.2 and later.
• IOMX: IOMX is not an official Android API. This API was initially
released for Android version 2.1. This API needs device tools to
compile the supported libraries, and is commonly used to access the
hardware decoders on Android devices with version 4.0 and version
4.1.

1.4.5.1.1.2 OSMP+ codec options


The following are the available video decoder types that can be set by
the application by using the setDecoderType() method:
• Software
• IOMX
• MediaCodec
• AutoHW

For AutoHW, OSMP+ selects the API based on the following default rules.
OSMP+ will automatically fall back on other options if the selected option is
not working.
• MediaCodec for Android devices with version 4.2 and later.

OnStream MediaPlayer+ User Guide 31


VisualOn
Chapter 1: Introduction

• IOMX for Android devices with version 4.0 and 4.1.


• Software for Android devices with version older than 4.0.

OSMP+ provides a white list file that overrides the decoder type selection
for specific devices when the IOMX, MediaCodec, or AutoHW types are
set. See 1.4.5.1.2 White List for more information.

1.4.5.1.1.3 Smooth Bitrate Adaptation


A consequence of Bitrate Adaptation is to dynamically switch between
streams having different bitrates depending on network conditions.
Sometimes the streams also have different resolutions.

Many hardware video decoders do not handle bitrate switching or


resolution switching smoothly. Artifacts such as black frames or pause may
impact the viewer’s experience. Performance of Bitrate Adaptation
switching varies depending on device configurations.

To enhance viewing experience, OSMP+ supports Smooth Bitrate


Adaptation. OSMP+ Smooth Bitrate Adaptation minimizes switching
artifacts by using several resources such as a second view, TextureView.
Smooth Bitrate Adaptation is enabled by using
enableVOAdaptivePlayback(true).

The behavior of Smooth Bitrate Adaptation can be fine-tuned for specific


devices configurations. See 1.4.5.1.2 White List for more information.

1.4.5.1.2 White List


OSMP+ offers the option to change the default audio and video hardware
decoding settings for specific device configurations. The list of device
configurations (also known as the white list) is saved in the device.xml file
under the assets directory of your Android project. The device.xml file
supports the following fields:

Note: Use the Android adb command, adb shell getprop, to get the information
about Model, Release, and Platform.

• Model: product model information


• Release: Android version
• Platform: platform name
• CodecSolution: IOMX, MediaCodec, or None
• TextureView: No is the only interpreted value, other values are
ignored.
Figure 4 shows an example of a white listed device configuration. For more
information about the white list, refer to the comment section of the
device.xml file shipped with the VisualOn OSMP+ SDK package. The
device.xml file can be found under Android > SamplePlayer > assets. You
can edit this xml file to add or remove device configurations.

32 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 1: Introduction

Figure 4. Example of white list

OSMP+ SDK compares the values of the white list fields to the values of the
device on which it is running.
• If the running device values have a match in the white list, OSMP+
changes the hardware decoding settings according to the white list
settings.
• If the running device values do not match, OSMP+ uses the current
hardware decoding settings.
• The interpretation of the white list is affected by the values of
setDecoderType() and enableVOAdaptivePlayback(). For more
information about the white list mechanisms, refer to the comment
section of device.xml.

1.4.5.1.3 List of tested devices


The following lists the devices tested for hardware decoding with OSMP+
as of the document publication date, which might not be updated at this
time. Contact VisualOn sales for the latest list of tested devices for
hardware integration with OSMP+.
• Amazon
 Kindle HDX 7/4.3/800
 Kindle FireTV/4.2.2/MSM8960
• ASUS
 ASUS ME371/4.1/Intel Atom
• Samsung
 Galaxy S5/4.4.2/MSM8974
 Galaxy S3/4.0.4/MSM8960
 Galaxy Note/4.0.3/8660
 Galaxy S3/4.1.1/Exynos4
 Galaxy Tab 10.1/4.1.2/Exynos4
 Galaxy Tab3/4.1/ Exynos4
 Galaxy Note II/4.1.2/Exynos4
 Galaxy S4 (I9500)/4.2.2/Exynos5
 Galaxy S4 (I9500)/4.4/ Exynos5

OnStream MediaPlayer+ User Guide 33


VisualOn
Chapter 1: Introduction

 Galaxy Note 3/4.3/Exynos5


 Samsung Tab4/4.4.2/PXA869
• Google
 Nexus 4/4.4/APQ8064
 Nexus 5/4.4.3/MSM8974
 Nexus 5/Android L/MSM8974
 Nexus 5/Android L/ MSM8974
 Nexus 6/Android L/ MSM8974
 Nexus 7/4.3/Tegra3
 Nexus 7/4.4.2/Tegra3
 Nexus 7 gen2/4.4.2/S4Pro
 Nexus 7 gen2/Android L/MSM8960
 Nexus 9/Android L/Tegra K1
 Nexus 10/4.2.2/Exynos5
• HTC
 HTC ONE/4.4.2/APQ8064T
 HTC ONE X/4.0/Tegra3
• Huawei
 Huawei P6/4.4.2/Hi6620
• Lenovo
 Lenovo K900/4.2.2/Intel Atom
• LG
 LG G3/4.4/MSM8975
 LG G2/4.2.2/MSM8974
 LG-V500/4.2.2/APQ8064
• Moto
 Moto MB886/4.0.4/MSM8960
 Moto Droid Razr/4.4.2/MSM8960
• Nubia
 Nubia/4.2.2/MSM8974
• Nvidia
 SHIELD P2450/4.3/Tegra4
 SHIELD Android TV/5.0/Tegra X1
• Sony

34 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 1: Introduction

 Sony Z Ultra/4.2.2/MSM8974
 Sony Z1/4.4.4/MSM8974
 Sony Z1 compact/4.4.2/MSM8974
 Sony Tablet Z/4.4.2/APQ8064
• Teclast
 Teclast Tpad/4.1.1/Rockchip

1.4.5.1.4 UI limitation using TextureView


Dual decoders and dual surfaces are used to enable Smooth Bitrate
Adaptation when selecting video hardware decoding. Dual surfaces
include SurfaceView and TextureView.
When using TextureView surfaces, some UI designs might impact overall
performance. OSMP+ optimizes Google’s default widget, for example
TextView, to reduce the impact on UI performance and subtitle display.

See 1.4.5.1.5 UI optimization using TextureView for the detailed


recommendations with respect to suggested UI optimizations.

1.4.5.1.5 UI optimization using TextureView


The following are recommendations to optimize UI performance when
enabling Smooth Bitrate Adaptation through the use a TextureView.
• Avoid complicated layout background settings. For example, use
android:theme=“@android:style/Theme.Black.NoTitleBar.Fullscreen”
for full screen playback.
• Reduce the number of overlay on top of the video.
• OSMP+ optimizes Google’s default widget such as TextView to
improve UI performance and subtitle display. Select these optimized
UI widgets instead of the standard Android widgets. For example, use
com.visualon.widget.TextViewPlus instead of the default TextView to
show video duration and playback position.
• Use the adb shell dumpsys gfxinfo command to check video
rendering time and monitor performance.
Refer to the following websites for general recommendation on how to
optimize the UI layout:
• Analyzing Display and Performance
• Android Performance Case Study
• Improving Layout Performance
• Improving Your Code with lint
• Optimizing Your UI
• Using the Dev Tools App

OnStream MediaPlayer+ User Guide 35


VisualOn
Chapter 1: Introduction

1.4.5.1.6 Known limitations


The following are known issues identified by VisualOn when using video
hardware decoding with OSMP+.
• 1080p video contents cannot be played simultaneously on two
players for Nexus 7 and Nexus 7 Gen2 that have Android 4.4 or
Android 5.0 installed.

1.4.5.2 Hardware acceleration for iOS


To perform the hardware acceleration on the iOS platform, the source
must satisfy the following:

Note:
1. OSMP+ does not support PCM, as PCM is not supported in HLS native player.
2. OSMP+ supports the hardware acceleration via Video Toolbox mechanism on
iOS 8.0 and above. VisualOn recommends using AVPlayer for hardware
acceleration for iOS 6.0 to iOS 7.0.
3. Hardware acceleration via Toolbox mechanism supports H.264 video codec
only, while hardware acceleration using AVPlayer supports both H.264 and AAC.

• Regular sources meeting the spec of all kinds of streaming


• HTTP Live Streaming (H.264 and AAC)
• Smooth Streaming (H.264 and AAC)
• Local MP4 (H.264 and AAC)
• Progressive Download (H.264 and AAC)

• DASH (H.264 and AAC)

Hardware acceleration supports the following codec types:


• AAC (AVPlayer only)

• H.264 (Baseline, High Profile, and Main Profile)

Hardware acceleration using AVPlayer supports iOS 6.0 and later, and is
available on the following devices:
• iPhone 4, iPhone 4S, iPhone 5, and above
• iPad, iPad2, new iPad, iPad 4, and above
• iPod Touch 4th, iPod Touch 5th, and above

Hardware acceleration using video toolbox supports iOS 8.0 and later, and
is available on the following devices:
• iPhone 4S and above
• iPad 4 and above
• iPod Touch 5th and above

36 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 1: Introduction

The following are the modules related to hardware acceleration:


• TS muxer (libvoTsFW.a): Hardware acceleration using AVPlayer
• AVFoundation.framework
• CoreMedia.framework
• AudioToolbox.framework

• VideoToolbox.framework: Hardware accerleration using video


toolbox

1.4.6 Multiple In adaptive streaming, if multiple audio tracks are advertised in the
audio tracks manifest file, OSMP+ extracts the information and provides a mechanism
to select a specific audio track to be played. OSMP+ also provides APIs to
query a number of properties related to audio, such as number of
alternative audio available, codec type, sample rate, number of
channels, language, and so on.

OSMP+ supports the feature to dynamically change audio tracks during


playback. In case that audio tracks of multiple languages are available, to
simplify the content preparation for different geographic regions, preferred
languages can be specified so that the playback starts with the most
favorable language.

1.4.7 Closed OSMP+ supports the following Closed Caption formats (including two main
Captions styles: paint-on/roll up and pop-on/pop-up):
• CEA-608
• CEA-708
CEA608 was developed in the 1970s for carrying 960bps captioning data
and services in the VBI (Vertical Blanking Interval) of NTSC video, an
analogue composite video format. In latter day digital component version
of NTSC, this analogue waveform is digitally encoded and embedded in
Line 21 of the Video.

CEA-708 defines DTV Closed Captioning (DTVCC) and provides


specifications and guidelines for caption service providers, distributors of
television signals, decoder and encoder manufacturers, DTV receiver
manufacturers, and DTV signal processing equipment manufacturers.

OSMP+ supports the following Closed Captions features:


• Text
• Horizontal Justification (Left, Right, and Center)
• Vertical Justification (Top, Bottom, and Center)
• Print Direction (Left-Right, Right-Left, Top-Bottom, and Bottom-Top)
• Text Wrap

OnStream MediaPlayer+ User Guide 37


VisualOn
Chapter 1: Introduction

• Scroll Direction (Left-Right, Right-Left, Top-Bottom, and Bottom-Top)


• Rectangle Border (None, Raised, Depressed, Uniform, Shadow_Left,
and Shadow_Right)
• Rectangle Border Color
• Rectangle Border Fill Color
• Rectangle Display Effect (Snap, Fade, and Wipe)
• Rectangle Display Effect Direction (LR, RL, TB, and BT)
• Rectangle Display Effect Speed
• Font Size (Standard, Small, and Large)
• Font Color (RGBA, 32bit)

OSMP+ supports the following Closed Captions font styles:


• Default (undefined)
• Monospaced with serifs
• Proportionally spaced with serifs
• Monospaced without serifs
• Proportionally spaced without serifs
• Casual font type
• Cursive font type
• Small capitals

OSMP+ supports the following Closed Captions text tags:


• Dialog
• Source_speaker_ID
• Electronically_reproduced_voice
• Dialog_language_other_than_primary
• Dialog_Voiceover
• Dialog_Audible_Translation
• Dialog_Subtitle_Translation
• Dialog_Voice_quality_description
• Dialog_Song_Lyrics
• Dialog_Sound_effect_description
• Dialog_Musical_score_description
• Dialog_Expletive
• Dialog_Text_not_to_be_displayed

38 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 1: Introduction

OSMP+ provides APIs for the application to control attributes of Closed


Captions text, including:
• Text size
• Text color and opacity
• Text effects, for example, italic, underline, bold
• Background color and opacity
• Window color and opacity
• Font selection

1.4.8 Subtitles Refer to Timed Text Markup Language 1 (TTML1) for a description of text-
based subtitles.
OSMP+ supports the following subtitle formats:
• TTML
• SAMI
• SMPTE
• SRT
• DVB (exclude teletext)
• WEBVTT

OSMP+ supports the following encoding formats:


• EUC-KR
• windows-949
• GB2312
• UTF-8
• ISO-8859-1
• ISO-8859-2
• ISO-8859-3
• ISO-8859-4
• ISO-8859-5
• ISO-8859-6 (Android and iOS)
• ISO-8859-7 (Android and iOS)
• ISO-8859-8 (Android and iOS)
• ISO-8859-9
• ISO-8859-10 (Android, Windows, and Mac OS)
• ISO-8859-11 (Android)
• ISO-8859-13

OnStream MediaPlayer+ User Guide 39


VisualOn
Chapter 1: Introduction

• ISO-8859-14 (Windows and Mac OS)


• ISO-8859-15
• ISO-8859-16 (Windows and Mac OS)
• Shift_JIS
• Unicode

OSMP+ supports the following subtitles features:


• Text
• Horizontal Justification (Left, Right, and Center)
• Vertical Justification (Top, Bottom, and Center)
• Print Direction (Left-Right, Right-Left, Top-Bottom, and Bottom-Top)
• Text Wrap
• Scroll Direction (Left-Right, Right-Left, Top-Bottom, and Bottom-Top)
• Rectangle Border (None, Raised, Depressed, Uniform, Shadow_Left,
and Shadow_Right)
• Rectangle Border Color
• Rectangle Border Fill Color
• Rectangle Display Effect (Snap, Fade, and Wipe)
• Rectangle Display Effect Direction (LR, RL, TB, and BT)
• Rectangle Display Effect Speed
• Font Size (Standard, Small, and Large)
• Font Color (RGBA, 32bit)

OSMP+ supports the following subtitle font styles:


• Default (undefined)
• Monospaced with serifs
• Proportionally spaced with serifs
• Monospaced without serifs
• Proportionally spaced without serifs
• Casual font type
• Cursive font type
• Small capitals

OSMP+ provides APIs for the application to control attributes of subtitles


text, including:
• Text size
• Text color and opacity

40 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 1: Introduction

• Text effects, for example, italic, underline, bold


• Background color and opacity
• Window color and opacity
• Font selection

1.4.9 FCC FCC compliance supports Timed Text Markup Language (TTML) and
compliance WebVtt. Refer to Notice for the FCC requirements.

1.4.9.1 Presentation
All apparatus must implement captioning so that the caption text may
appear within one or separate caption windows, and supports the
following modes:
• Text that appears all at once (pop-up)
• Text that scrolls up as new text appears (rollup)
• Text where each new letter or word appears as it arrives (paint-on).

OSMP+ has no API to support the presentation mode; instead OSMP+ gets
this data from streaming based on specification CEA-608 and specification
CEA-708.

1.4.9.2 Character Size


All apparatus must implement captioning so that users are provided with
the ability to vary the size of captioned text and needs provide a range of
sizes from 50% of the default character size to 200% of the default
character size.

To set the FCC character size, use setSubtitleFontSizeScale API.

1.4.9.3 Character Color


All apparatus must implement captioning so that characters may appear
in the 64 colors defined in CEA–708, and users are provided with the ability
to override the authored color for characters and select from a palette of
at least 8 colors, including white, black, red, green, blue, yellow, magenta,
and cyan.

To set the FCC character color, use setSubtitleFontColor API.

1.4.9.4 Character Opacity


All apparatus must implement captioning so that users are provided with
the ability to vary the opacity of captioned text and select between
opaque and semitransparent opacities.

To set the FCC character opacity, use setSubtitleFontOpacity API.

OnStream MediaPlayer+ User Guide 41


VisualOn
Chapter 1: Introduction

1.4.9.5 Fonts
All apparatus must implement captioning so that fonts are available to
implement the eight fonts required by CEA–708.
Users must be provided with the ability to assign the fonts included on their
apparatus as the default font for each of the following eight styles on
Android and iOS:
• Default (undefined)
• Monospaced with serifs (similar to Courier)
• Proportionally spaced with serifs (similar to Times New Roman)
• Monospaced without serifs (similar to Helvetica Monospaced)
• Proportionally spaced without serifs (similar to Arial and Swiss)
• Casual font type (similar to Dom and Impress)
• Cursive font type (similar to Coronet and Marigold)
• Small capitals (similar to Engravers Gothic)

Users must be provided with the ability to assign the fonts included on their
apparatus as the default font for each of the following seven styles on
NPAPI/PPAPI plug-ins:
• Courier
• Times New Roman
• Helvetica
• Arial
• Dom
• Coronet
• Gothic
To set the FCC font, use setSubtitleFontName API.

1.4.9.6 Caption Background Color and Opacity


All apparatus must implement captioning so that the caption background
may appear in the 64 colors defined in CEA–708, and users are provided
with the ability to override the authored color for the caption background
and select from a palette of at least 8 colors, including white, black, red,
green, blue, yellow, magenta, and cyan.

To set the FCC caption background, use setSubtitleFontBackgroundColor


API.

All apparatus must implement captioning so that users are provided with
the ability to vary the opacity of the caption background and select within
opaque, semitransparent, and transparent background opacities.

42 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 1: Introduction

To set the FCC caption opacity, use setSubtitleFontBackgroundOpacity


API.

1.4.9.7 Character Edge Attributes


All apparatus must implement captioning so that character edge
attributes may appear, and users are provided the ability to select
character edge attributes that include:
• No edge attribute
• Raised edges
• Depressed edges
• Uniform edges
• Drop shadowed edges: left drop shadow/right drop shadow

To set the FCC character edge attributes, use setSubtitleFontEdgeType API.

1.4.9.8 Caption Window Color and Opacity


All apparatus must implement captioning so that the caption window
color may appear in the 64 colors defined in CEA–708, and users are
provided with the ability to override the authored color for the caption
window and select from a palette of at least 8 colors, including white,
black, red, green, blue, yellow, magenta, and cyan.

To set the FCC caption window color, use


setSubtitleWindowBackgroundColor API.

All apparatus must implement captioning so that users are provided with
the ability to vary the opacity of the caption window and select within
opaque, semi-transparent, and transparent background opacities.

To set the FCC caption window opacity, use


setSubtitleWindowBackgroundOpacity API.

1.4.9.9 Language
All apparatus must implement the ability to select between caption tracks
in additional languages when such tracks are presented and are provided
the ability for the user to select simplified or reduced captions when such
captions are available and identify such a caption track as ‘‘easy
reader.’’

To set the FCC language, use setSubtitlePath API.

1.4.9.10 Preview and Setting Retention


All apparatus must provide the ability for the user to preview default and
user selection of the caption features required by this section, and must
retain such settings as the default caption configuration until the caption
configuration is changed by the user.

OnStream MediaPlayer+ User Guide 43


VisualOn
Chapter 1: Introduction

To set the FCC preview and retention, use previewSubtitle API.

1.4.10 Zoom OSMP+ supports the following zoom modes to control rendering of video:
modes
• Letterbox
• Pan & Scan
• Fit to Window
• Original Size
• Zoom In

1.4.10.1 Letterbox mode


The letterbox mode matches the height or width of the video to the
display area while keeping its original aspect ratio depending on the
orientation and size of the display area. See Letterboxing (filming) for more
information about the letterbox mode.

Figure 5 shows an example where the height of a 4:3 video is changed to


match the height of a 16:9 display area thus resulting in black bar on the
left and right sides.

Figure 5. Sample 1: letterbox

Figure 6 shows an example where the width of the video is adjusted to


match a rotated 16:9 display area resulting in black bars above and below
the centered video content.

44 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 1: Introduction

Figure 6. Sample 2: Letterbox

1.4.10.2 Pan & Scan mode


The Pan & Scan mode matches the height or width of the video to the
display area while keeping its original aspect ratio depending on the
orientation and size of the display area. As opposed to the letterbox
mode, the Pan & Scan mode removes any black bar from the display area
thus effectively cutting part of the video content. See Pan and scan for
more information about the Pan & Scan mode.

A 4:3 video rendered on a 16:9 display area of matching orientation is


scaled so that its width matches the width of the display area while
keeping its aspect ratio. This leads to the video feeling the entire display
area and part of the video being cut at the top and bottom, as shown in
Figure 7.

Note: Pan & Scan mode is not supported on the Windows plug-in and Mac OS
plug-in.

Figure 7. Sample 1: Pan & Scan

OnStream MediaPlayer+ User Guide 45


VisualOn
Chapter 1: Introduction

Figure 8 shows and example of 4:3 video rendered in Pan & Scan mode in
a 16:9 display area of different orientation thus resulting in the height of the
video matching the height of the display area and video being cut on the
left and right sides.

Figure 8. Sample 2: Pan & Scan

1.4.10.3 Fit to Window mode


Regardless of its aspect ratio and size, the video is resized to fill the entire
display area, as shown in Figure 9.

Note: Fit to Window mode is not supported on the Windows plug-in and Mac OS
plug-in.

Figure 9. Example of Fit to Window

46 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 1: Introduction

1.4.10.4 Original Size mode


The Original Size mode renders the video with its original size and aspect
ratio regardless of the display area size and aspect ratio, as shown in
Figure 10.

Note: Original Size mode is not supported on the Windows plug-in and Mac OS
plug-in.

Figure 10. Example of Original Size

1.4.10.5 Zoom In mode


The Zoom In mode specifies a rectangle area within the video to fill the
display area while preserving the original video aspect ratio, as shown in
Figure 11. The specified rectangle boundaries cannot be outside the video
actual size.

Note: Zoom In mode is not supported on the Windows plug-in and Mac OS plug-
in.

OnStream MediaPlayer+ User Guide 47


VisualOn
Chapter 1: Introduction

Figure 11. Example of Zoom In

1.4.11 Download Download Manager is an OSMP+ feature that is used to download content
Manager for offline playback.

Note: Download Manager is only available on Android and iOS.

The Download Manager module supports the following features:


• Download content to local storage while playing with playback or
download only. If Download Manager is turned on, the Select Asset
dialog will prompt when starting the playback.
• Select video bitrate, audio track, and subtitle track to be
downloaded. If the Download Manager feature is turned on, you will
be prompted to select only one video bitrate, audio track, or subtitle
track for downloading in the Select Asset dialog.
• Check the DRM key expiration.
• Report and display download progress.
• Resume download from the last break point.
• Report errors due to connection failure or full device storage.
• Start, stop, pause, resume, and delete download from the
application.

Note: Pause and resume functions are only available on Android


platform.

The current OSMP+ Download Manager feature supports


HLS/DASH/Smooth Streaming VoD streaming in combination with DRMs. In
addition, only the Android and iOS platforms are currently supported. For
more information about Download Manager, refer to OnStream
MediaPlayer+.Download Manager Integration Guide for Android.pdf and

48 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 1: Introduction

OnStream MediaPlayer+.Download Manager Integration Guide for iOS.pdf


in your installation package.

1.4.12 DRM Digital Rights Management (DRM) is a class of technologies that are used
by hardware manufacturers, publishers, copyright holders, and individuals
with the intent to control the use of digital content (video, audio, and so
on) and devices after sale.

VisualOn’s OSMP+ is agnostic to any DRM technology and can integrate


with all commercial and proprietary DRM engines to enable playback of
protected content on mobile devices. The DRM component allows or
prevents playback of digital assets on mobile devices while OSMP+
handles the steps related to high-quality playback of those assets. DRM
engine is placed underneath the application, and DRM Adaptor is used to
translate the private DRM interface into a common interface to be used
by other engines, as shown in Figure 12.

Figure 12. DRM workflow

Aside from standard AES-128 decryption, a standard feature in OSMP+,


example of pre-integrated DRM workflow is:
• Verimatrix’s VCAS with ViewRight Web DRM on Android, iOS,
Windows, and Mac OS

1.4.13 Output OSMP+ supports secure output playback based on the settings configured
Control with in Verimatrix Video Content Authority System (VCAS™) version 3.7.
VCAS
1.4.13.1 Supported features
Table 7 defines the VCAS server-based flags that are used for output
control.

OnStream MediaPlayer+ User Guide 49


VisualOn
Chapter 1: Introduction

Table 7. Output control flags

Flag name Description Value

• On: OSMP+ decides the actions that can


be done to enforce the output control.
Uses this option to enable or But it is still acceptable if the command
Best Effort disable the enforcement of cannot be enforced.
the playback.
• Off: OSMP+ enforces the output control
without exceptions to allow the playback.

Uses this option to decide if


OSMP+ needs to downsize • On: If HDCP is not available, OSMP+ needs
the resolution for high- to downsize the resolution for HD contents.
CIT_DIGITAL definition (HD) contents • Off: If HDCP is not available, OSMP+ does
when High-Bandwidth Digital not need to downsize the resolution for HD
Content Protection (HDCP) is contents.
not available on the output.

ANTI_MIRROR Uses this option to enable or


disable the mirroring. This • On: Disable the mirroring on all output
option is available on types including wired- and wireless-
Android, iOS, Windows, and connection output.
Mac OS platforms for all • Off: Enable the mirroring on all output
output types including wired- types including wired- and wireless-
and wireless- connection connection output.
output.

HDCP Uses this option to enable or • On: Enable HDCP and make sure the
disable the highest HDCP highest HDCP version is available.
version. • Off: Disable HDCP.

1.4.13.2 Limitations
The following are the limitations of the output control feature:
• HDCP capability is disabled on the Android platform which version is
lower than version 4.2.
• HDCP capability depends on the Display.SECURE_FLAG flag on the
Android platform which version is version 4.2 or higher.
• HDCP capability is disabled on the iOS platform.
• HDCP capability is disabled on the Mac OS platform.

1.4.14 AirPlay on AirPlay is a proprietary protocol stack/suite that allows wireless streaming
iOS between devices of audio, video, device screens, and photos, together
with related metadata.

50 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 1: Introduction

With AirPlay enabled on iOS, you can play/stop, pause, suspend/resume,


and seek the content, as well as controlling the content volum through
buttons. The OSMP+ SDK supports the following two AirPlay modes on iOS
platform.
• AirPlay Mirroring: enables the output of the iOS device screen to an
external display. If Mirroring is detected to be in use on the iOS
device, the OSMP+ player shows the content on both iOS device
screen and the external display.
• AirPlay Streaming Export: allows content to be re-directed from iOS
playback and instead streamed directly to Apple TV devices.
The OSMP+ AirPlay Streaming Export on iOS is available with limitations:

Note: AirPlay Streaming Export is only available when using AVPlayer hardware
engine.

• Operating System (OS): iOS


• Platform: iOS 4.3 or later, iTunes 10.2 or later
• Streaming protocol: Live and VOD for HLS and Smooth Streaming
• DRM: PlayReady DRM, Verimatrix DRM
• Video decoder: H.264
• Audio decoder: AAC

1.4.15 360 video The playback support of video recorded by 360 degree cameras works on
decoding the following OS versions:
• Android 4.0 and later
• iOS 7.0 and later
The OSMP+ SDK enables the viewing/playback of the video recorded by
360 degree cameras through four steps.
• Decode rectangular YUV frame as a regular H.264/HEVC frame
• Reverse mapping from YUV frame to 360 sphere view: set viewing
parameters, including viewing scope and sphere size
• Select playback area from user viewing angles: detect user viewing
angle through device sensors, and then input the angle to device
OpenGL engine to select the corresponding viewing area.
• Start playback from different users’ angles

OnStream MediaPlayer+ User Guide 51


VisualOn
Chapter 1: Introduction

1.4.15.1 Android
VisualOn recommends calling setRenderType, enableSphericalVideo, and
setSphericalVideoView in turn on Android platform, to start playback of
the videos recorded by 360 degree cameras. The following is the detailed
introduction about these three functions and how they work inside the
OSMP+ SDK.
• setRenderType(VO_OSMP_RENDER_TYPE type): This function is used
to set the video render type.

Notes:
1. This API must be called before calling the start() method to set the video
render type.
2. To support the 360 video playback, make sure to set the video render type to
VO_OSMP_RENDER_TYPE_OPENGLES using the following sample code.
player.setRenderType(VO_OSMP_RENDER_TYPE_OPENGLES);

• enableSphericalVideo(boolean enable): This function is used to


enable or disable the playback of video recorded by 360 degree
cameras. The default value is “disable”.
• setSphericalVideoView(float heading, float pitch, float fov): This
function is used to set the playback area from user viewing angles.
 heading: [in] indicates the compass heading of the camera.
 pitch: [in] the default value is 0. This value specifies the up or
down angle. Positive value indicates the camera angle is up (90
degrees indicating straight up); negative value indicates the
camera angle is down (-90 indicating straight down).
 fov:[in] the default value is 90. This value determines the horizontal
field of view of the image. The field of view is express in degrees.
The degree should be greater than 0, and should be less than or
equal to 120.
The sample codes in VideoSensorManager.java, which is under
Android\SamplePlayer\src\com\visualon\AppPlayerCommonFeatures,
demonstrate how setSphericalVideoView works inside the OSMP+ SDK. You
may refer to this file for the detailed implementation of the
setSphericalVideoView function.

1.4.15.2 iOS
VisualOn recommends calling enableSphericalVideo and
setSphericalVideoView in turn on iOS platform, to start playback of the
videos recorded by 360 degree cameras. The following is the detailed
introduction about both functions and how they work inside the OSMP+
SDK.

Note: The setting of video render type is only available on Android platform.

1. enableSphericalVideo: (bool) enable

52 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 1: Introduction

This function is used to enable or disable the playback of video


recorded by 360 degree cameras. The default value is “disable”.
2. setSphericalVideoView: (float) heading
pitch: (float) pitch
fov: (float) fov
This function is used to set the playback area from user viewing
angles.
 heading: [in] indicates the compass heading of the camera.
 pitch: [in] the default value is 0. This value specifies the up or
down angle. Positive value indicates the camera angle is up (90
degrees indicating straight up); negative value indicates the
camera angle is down (-90 indicating straight down).
 fov:[in] the default value is 90. This value determines the horizontal
field of view of the image. The field of view is express in degrees.
The degree should be greater than 0, and should be less than or
equal to 120.
The startCMMotion and stopCMMotion classes in
APPBasePlayerViewController.m, which is under iOS/SamplePlayer/AppUI,
demonstrate how setSphericalVideoView works inside the OSMP+ SDK.

1.4.16 3D The OSMP+ SDK introduces a new option called ‘CardBoard Video’ to
playback of 360 allow users looking around to view the video in 360 degrees. If this option is
video decoding enabled, the video screen splits into two smaller screens and users can
view the video in 360 degrees. This option only takes effect when both
enableSphericalVideo and enableCardBoardVideo are enabled.

You can enable the 3D playback of video from Options/Option>


CardBoard Video on Android and iOS separately. For more information,
refer to the enableCardBoardVideo function in the API Reference Manual.

1.4.17 IPv6-only The IPv6-only network support is available on iOS and Mac OS.
network support
In addition to IPv4 or dual stack (IPv4/IPv6) networks support, Apple
requests to support for IPv6-only networks for all applications submitted to
the App Store.

The OSMP+ SDK is compatible with DNS64/NAT64 transition mechanism


starting with this release in order to accommodate the work flow when
client has only IPv6 connectivity and try to address content hosted on IPv4.

If user attempts to access a content hosted on IPv4 from IPv6-only network,


it requests to DNS64 to obtain IP address from URL domain name and
receive a synthetized IPv6 address representing IPv4 address in IPv6 space.
Using this synthetized address, user can then establish a connection to IPv4
host using NAT64 which connects the IPv6 network to the IPv4 network.

OnStream MediaPlayer+ User Guide 53


VisualOn
Chapter 1: Introduction

On the other hand, if user attempts to access a content hosted on IPv6


from IPv6-only network, it uses DNS64 to obtain IPV6 address of URL domain
and establish IPv6 connection to content using standard IPv6 routing
mechanism.

Note: As Apple suggested on Mac Developer Library, VisualOn strongly


recommends that you use the URL host address of IPv4 contents for the
DNS64/NAT64 transitional workflow.

This new feature is available on the following platforms for both clear and
encrypted contents:
• iOS 9.0+/OS X 10.11.4+: both URL host address and IP literal address of
IPv4 content are supported
• Versions lower than iOS 9.0 or OS X 10.11.4: only URL host address of
IPv4 content is supported
The following is the example of log message that helps you to
identify/verify this DNS64/NAT64 transition.
• If the IPv4 content is a URL host address, you may get the log in the
format of ‘15:08:38.319 @@@VOLOG, Info, ModuleID[xxxxxxxx],
ThreadID[xxxxxxxx], vo_http_stream.cpp, send_request,
Line#1731, [SourceIO] address:64:ff9b::a02:4407,
url:example.visualon.com’
• If the IPv4 content is an IP address, you may get the log in the format
of ‘13:23:58.252 @@@VOLOG, Info, ModuleID[xxxxxxxx],
ThreadID[xxxxxxxx], vo_socket.cpp, VO_IOS_DNSResolve,
Line#626, IP item: i=0, host=10.2.68.7, port=8082, is_ipv6=1,
addr=64:ff9b::a02:4407, dataLen=28, sa_len=28, fam=30’.

1.4.18 Render The OSMP+ SDK supports the following four rendering options (also known
options on as render type) on Android to achieve better playback performance
Android when needed:
• Native C: this option will be phased out since Android N
• Native windows: OSMP+ uses this option by default
• Open GL: this option must be selected when enableCardBoardVideo
or enableSphericalVideo is enabled
• Share memory with hardware codec: Android devices render the
video frames directly. In this case, render settings will be ignored
whatever user selects Auto HW, MediaCodec, or IOMX as the
decoder type.

Notes:
1. If video post-processing or video watermark is enabled on the device
where MediaCodec or software decoder is selected as decoder type,
users can select the render type as needed. Do not use share memory with
hardware codec if MediaCodec is selected as decoder type in this case.

54 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 1: Introduction

2. When Open GL is selected as the render type, the OSMP+ SDK will render
the video frame only when onDrawFrame callback is invoked. This
approach may result in the potential performance limitation, such as the
rendering or playback is not very smooth.

OnStream MediaPlayer+ User Guide 55


VisualOn
Chapter 2: Sample Player

Chapter 2 Sample Player

This chapter presents the following topics:

2.1 Android ............................................................................................................57

2.2 iOS .....................................................................................................................81

2.3 Plug-ins ...........................................................................................................103

2.4 Windows Phone ............................................................................................132

56 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

2.1 Android

2.1.1 Installation This section describes the installation of the Sample Player application
included with the SDK on Android.

We recommend that you install the Sample Player application with the
latest Eclipse, which has the ADT extension and JRE 1.6.0 or higher versions.
Refer to Installing the Eclipse Plugin for instructions about how to install ADT
extension in Eclipse. See 1.2 Supported operating system and web browser
for the Android versions supported by OSMP+.

2.1.1.1 Importing SamplePlayer project into Eclipse


To import the SamplePlayer project:
1. From Eclipse IDE, select File > Import…. The Import dialog appears,
as shown in Figure 13.

Figure 13. Eclipse IDE Import Dialog

2. In the Import dialog, select General, select Existing Projects into


Workspace, and then click Next.
3. Select Select root directory, and then type or browse to
<SDK_INSTALL_DIR>\Android\SamplePlayer. Under Projects, ensure
that <SamplePlayer project> is selected, and then click Finish, as
shown in Figure 14.

OnStream MediaPlayer+ User Guide 57


VisualOn
Chapter 2: Sample Player

Figure 14. Select the SamplePlayer project

4. An Android project named SamplePlayer is imported into Eclipse,


and appears in Package Explorer, as shown in Figure 15.

Figure 15. Eclipse IDE Package Explorer

58 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

If the imported project contains multiple errors and warnings marked in


red, adding the SDK JAR and so libraries to the project removes these
errors and warnings.

Note: Refer to the Add the SDK Libraries section of the OnStream MediaPlayer+
SDK Project Setup for Android document for details about how to add the SDK
libraries to a project.

2.1.1.2 Running the Sample Player on a device


When the SDK is added to the SamplePlayer project in Eclipse, you are
ready to run the application on an Android device.

To run the Sample Player on an Android device:


1. Connect the device to the Eclipse workstation with a USB cable.
2. In Eclipse, right click the SamplePlayer project in Project Explorer,
and then select Run as > Android Application, as shown in Figure 16.
Then the SamplePlayer application can be explored on the Android
device.

Figure 16. Context Menu for SamplePlayer Project in Eclipse IDE

OnStream MediaPlayer+ User Guide 59


VisualOn
Chapter 2: Sample Player

2.1.1.3 Registering VCAS server on a device


Specify the VCAS server information after installing the Sample Player on a
device:
1. Launch the Sample Player.
2. Type public-ott-nodrm.verimatrix.com in the VCAS Server IP field.
3. Type 80 in the VCAS Server Port field.

2.1.1.4 Uninstalling the Sample Player on a device


To uninstall the Sample Player on an Android device:
1. Tap Settings.
2. Tap Apps under DEVICE.
3. Tap Sample Player in the Apps list.
4. Tap Uninstall.
5. Tap OK to confirm the uninstallation.

2.1.2 Sample This section describes the usage of the Sample Player application included
player usage with the SDK. The Sample Player application implements a fully integrated
media player with the following features:
• Select the media source
• Select the subtitle source
• Select the option for opening the media source, including
Synchronous and Asynchronous
• Set the preferred audio and subtitle languages
• Control the playback through buttons
• Control the sound volume and mute/unmute the sound
• Support the Closed Captions and subtitle rendering
• Configure the asset properties

2.1.2.1.1 Opening media source


Media source can be opened in either Sync or Async mode. The Sample
Player uses Async mode by default. For sample code of opening media
source, refer to 3.1.3 Opening media source.
• Sync mode: Opening the media source in sync mode causes the
client application to block until the open method completes or
returns.
• Async mode: In Async mode, the API call returns immediately, and
the client application is not blocked waiting for the media source to
be opened. The client application can then wait for an event to
indicate that the media source was opened successfully before
starting the media playback.

60 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

To activate the asynchronous option:


1. In the initial view tap Options.
2. Select the checkbox next to Asynchronous/Synchronous Open.

2.1.2.1.2 Selecting/Playing the Media Source


The initial view allows you to select the media source (for example, H.264
file, MP4 file, or HTTP Live Streaming link) for playback. You can type the
media source path manually or select from a list of media source listed in a
text file.

To manually type a media file or link:


1. In the initial view, type the full URL starting with http:// or file path to
the media source in the Input streaming URL address or file path text
box.
2. Tap the play button.

Alternately, a list of media files and links can be supplied to the Sample
Player through a text file. The text list must be saved to /sdcard/url.txt, with
each link URL and file path separated by line. To select a media file or link
from url.txt:
1. In the initial view, tap the button next to the URL field to display the
media file list.
2. Select the required media source, and then tap OK.
3. Tap the play button.

Refer to 3.1.5 Starting playback for the sample code of starting playback.
For details about initializing the SDK player, opening the media source, and
starting playback, refer to section 3 (Basic Integration) in the OnStream
MediaPlayer+ Player SDK Integration Guide for Android Platforms.

2.1.2.2 Options
2.1.2.2.1 Selecting Video Render Type
Tap Video Render Type from Options, and then tap the required Video
Render Type for the Sample Player, as shown in Figure 17. Refer to
setRenderType(VO_OSMP_RENDER_TYPE type) for API related information.

• Native Window: The output format of rendering data is .rgp.


• Native C: The output format of rendering data is .yuv.

OnStream MediaPlayer+ User Guide 61


VisualOn
Chapter 2: Sample Player

Figure 17. Select Video Render Type

2.1.2.2.2 Enabling Push PD


Push PD enables to download the video to the viewer's computer or
device and stored in a temporary directory, when the video is played. The
video will begin to play when enough of the file has been downloaded to
the computer or device. Refer to open(String url, VO_OSMP_SRC_FLAG
flag, VO_OSMP_SRC_FORMAT type, VOOSMPOpenParam openParam) for
API related information. Modify the value of VO_OSMP_SRC_FORMAT type
in the above API to set the type of opening source.

To enable Push PD, tap the checkbox next to Enable Push PD from Options
to enable Push PD for the Sample Player.

To set the duration for Push PD:


1. Enable Push PD. Refer to 2.1.2.2.2 Enabling Push PD for details.
2. Tap Push PD Open Duration, and then type the number to set the
duration for push PD for the Sample Player, as shown in Figure 18.
The PD duration is measured in millisecond.
3. Tap OK.

Figure 18. Set duration for push PD

Refer to open(String url, VO_OSMP_SRC_FLAG flag,


VO_OSMP_SRC_FORMAT type, VOOSMPOpenParam openParam) and
openParam.setDuration(value) for API related information.

62 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

2.1.2.2.3 Selecting audio decoder/video decoder


The Sample Player allows you to select the decoder type manually. Refer
to 1.4.5.1 Hardware acceleration for Android for details on explanations
and settings of decoder types.

2.1.2.2.4 Render optimization for BA


The Sample Player allows you to optimize rendering when bitrate
adaptation is being applied by selecting Render Optimization for BA from
Options.

2.1.2.2.5 Dolby Surround Module


The Sample Player has a Dolby Surround Module to provide the better
audio effects. Tap Dolby Surround Module from Options to load the
module.

Refer to enableAudioEffect(boolean value) for API related information.


You can set
setAudioEffectEndpointType(VO_OSMP_AUDIO_EFFECT_ENDPOINT_TYPE.V
O_OSMP_AUDIO_EFFECT_ENDPOINT_HEADPHONE) to enhance the audio
effect.

2.1.2.2.6 Enabling/disabling deblock


Deblocking is a feature applied to decoded compressed video to improve
visual quality and prediction performance by smoothing the sharp edges
which can form between macroblocks when block coding techniques are
used.

Enabling deblock helps improve the playback quality, especially when the
video has mosaic. Tap Deblock from Options to enable the deblock
feature. Refer to enableDeblock(boolean enable) for API related
information.

2.1.2.2.7 Selecting Subtitle source


The Sample Player allows you to optionally select an external subtitle
source (for example, CEA 608, CEA 708, SRT, and SMI) for Closed Captions
or subtitles rendering. A list of subtitle files and links can be supplied to the
Sample Player through a text file. The text list must be saved to
/sdcard/subtitle.txt, with each link URL and file path separated by a line.
Refer to setSubtitlePath(String filePath) for API related information.

To select an external subtitle file or link from subtitle.txt:


1. Tap Subtitle URL.
2. Select a URL from the /documents/subtitle.txt list menu, as shown in
Figure 19.
3. Select the required subtitle source.

OnStream MediaPlayer+ User Guide 63


VisualOn
Chapter 2: Sample Player

Figure 19. Select an external subtitle

2.1.2.2.8 Setting buffering time


The OSMP+ player allows you to set the buffering time of the source to be
played.

2.1.2.2.8.1 Max Buffering Time


Refer to setMaxBufferingTime(int time) for API related information.

To set the maximum time of source buffer:


1. Tap Max Buffering Time from Options.
2. Type the number to set the maximum buffering time in milliseconds,
as shown in Figure 20.

Figure 20. Set maximum buffer time

3. Tap OK.

2.1.2.2.8.2 Initial Buffering Time


Turn on Initial Buffering Time option to set the buffering time of the source
in milliseconds before the playback starts. Refer to setInitialBufferingTime(int
time) for API related information.

To enable the initial buffering time of source buffer:


1. Tap Initial Buffering Time from Options.
2. Type the number to set the initial buffering time in milliseconds.

2.1.2.2.8.3 Playback Buffering Time


When re-buffering is needed during playback, the player enables you to
set the buffering time with the Playback Buffering Time option. Refer to
setPlaybackBuferingTime(int time) for API related information.

64 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

To set the re-buffering time:


1. Tap Playback Buffering Time from Options.
2. Type the number to set the time in milliseconds.

2.1.2.2.9 Enabling Download Manager


The video files can be downloaded locally while playing if the Download
Manager is enabled. This feature is only for VoD and Smooth Streaming.

To enable Download Manager, tap the checkbox next to Download from


Options. For sample code of Download Manager related features, refer to
3.1.10 Download Manager (Optional). For details about how to integrate
Download Manager on Android, refer to the OnStream
MediaPlayer+.Download Manager Integration Guide for Android.pdf
document in your installation package.

If Download Manager is turned on, the Select Asset dialog prompts when
starting the playback. Specify the Video, Audio, and Subtitle tracks to be
downloaded, and then tap OK to download the source to be played. If
you do not want to keep the downloaded files on your device, tap Delete
Downloader File from Options, tap Delete All to remove all downloaded
files, or select the file to be removed and then tap Delete.

2.1.2.2.10 Enabling CPU Adaptation


The Bitrate Adaptation of Sample Player subjects to setting that is
hardcoded in the player if CPU Adaptation is enabled.

To enable CPU Adaptation, tap the checkbox next to CPU Adaptation


from Options. Refer to enableCPUAdaptation(boolean value) for API
related information.

2.1.2.2.11 RTSP Settings


For the sample code regarding RTSP settings, refer to 3.1.14 RTSP settings
(Optional).

2.1.2.2.11.1 Setting RTSP Connection Type


Refer to setRTSPConnectionType(VO_OSMP_RTSP_CONNECTION_TYPE
type) for API related information.

To set RTSP Connection Type:


1. Tap RTSP Connection Type from Options.
2. Three connection types, Automatic(UDP is priority), TCP, and UDP
are available for selection, as shown in Figure 21.
 Automatic (UDP is priority): The player selects the connection
types automatically.
 TCP: refer to1.3 Terminology for TCP definition.
 UDP: refer to 1.3 Terminology for UDP definition.

OnStream MediaPlayer+ User Guide 65


VisualOn
Chapter 2: Sample Player

Figure 21. Available RTSP connection types

3. Select the connection type as needed.

2.1.2.2.11.2 Enabling RTSP HTTP Port


Refer to enableRTSPOverHTTP(boolean enable) and
setRTSPOverHTTPConnectionPort(int portNum) for API related information.

Tap Options, and then tap Enable RTSP HTTP Port to enable RTSP HTTP port
function. Tap RTSP HTTP Port, and then type a value to define the Port to
access the RTSP media source, and then tap OK, as shown in Figure 22.

Figure 22. Define the port

2.1.2.2.11.3 Enabling Low Latency Video


The Low Latency Video feature allows you to easily build a high quality
and low latency HD video transmission system.

Tap Enable Low Latency Video to set a value as the acceptable level for
RTSP Camera video latency.

Refer to enableLowLatencyVideo(boolean value) for API related


information.

2.1.2.2.11.4 Enabling RTSP Max Socket Error Count


Refer to setRTSPMaxSocketErrorCount(int count) for API related
information.

66 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

The player allows setting the maximum number of socket error. To set the
RTSP Max Socket Error Count:
1. Tap Enable RTSP Max Socket Error Count from Options to enable it.
2. Tap RTSP Max Socket Error Count.
3. Type a value to set the entry level for RTSP Socket error handling,
and then tap OK, as shown in Figure 23.

Figure 23. Set the entry level

2.1.2.2.11.5 Enabling RTSP Connection Timeout


Refer to setRTSPConnectionTimeout (int count) for API related information.

To set the RTSP Connection Timeout:


1. Tap Enable RTSP Connection Timeout from Options to enable it.
2. Tap RTSP Connection Timeout.
3. Type a number to set a value that is the players’ retry times when
server has no response, and then tap OK, as shown in Figure 24.

Figure 24. Set the retry times

2.1.2.2.12 HTTP Settings


2.1.2.2.12.1 Enabling HTTP Verification Information
To set the HTPP Verification Information:
1. Tap Enable HTTP Verification Information from Options to access the
Username and Password, as shown in Figure 25.

Figure 25. Enable HTTP Verification Information

OnStream MediaPlayer+ User Guide 67


VisualOn
Chapter 2: Sample Player

2. Tap Username or Password.


3. Type the user name and password to authorize the RTSP media
source access, and then tap OK, as shown in Figure 26.

Figure 26. Set the user name and password

See the following sample code for reference.


VOOSMPVerificationInfo verif = new VOOSMPVerificationInfo(); str
= userName+":"+password;
verif.setVerificationString(str);
verif.setDataFlag(1);
m_sdkPlayer.setHTTPVerificationInfo(verif);

2.1.2.2.12.2 Enabling HTTP Retry Timeout


Refer to setHTTPRetryTimeout(int time) for API related information.

To set the HTPP Retry Timeout:


1. Tap Enable HTTP Retry Timeout from Options to enable the retry
timeout function.
2. Tap HTTP Retry Timeout.
3. Type a number to set the player retry times when server has no
response, and then tap OK, as shown in Figure 27.

Figure 27. Set retry times

68 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

2.1.2.2.12.3 Enabling HTTP Gzip Request


HTTP data is compressed before it is sent from the server: compliant
browsers will announce what methods are supported to the server before
downloading the correct format; browsers that do not support compliant
compression method will download uncompressed data. Gzip is one of
the most common compression schemes. Refer to
enableHTTPGzipRequest(boolean enable) for API related information.

Tap Enable HTTP Gzip Request from Options to enable or disable the
support of the GZIP format.

2.1.2.2.12.4 Setting token for HTTP Request


The sample player enables to set a token/string for HTTP requests. Refer to
setURLQueryString() for API related information.

Tap URL Query String from Options to enable or disable the token support
for HTTP requests. After enabling this option, tap Enable URL Query String,
and then type the Query String in the prompted dialog.

Note: The query string should be in the format of ‘key1=value&key2=value’.

2.1.2.2.13 Playback Looping


If the playback looping feature is on and you’re playing your timeline, the
playhead cycles back to the start of the sequence when you reach the
end. If it’s off, your playhead simply stops at the end of the sequence.

Tap Playback Looping from Options to enable or disable the Playback


looping.

This feature will be implemented when the player receives the


VO_OSMP_CB_PLAY_COMPLETE event. Set setPosition(0) to playback
again.

2.1.2.2.14Subtitle Settings
Tap Subtitle Settings from Options to enable or disable the Subtitle Settings.
For sample code of subtitle settings, refer to 3.1.9 Subtitle rendering
(Optional).

Table 8 lists the available subtitle attributes that can be set in the OSMP+
player and their related API s.
Table 8. Subtitle attributes and related APIs

Attribute Definition API

Enable/disable subtitles display.


Enable Subtitle enableSubtitle(Boolean value)
Disabled is set by default.

OnStream MediaPlayer+ User Guide 69


VisualOn
Chapter 2: Sample Player

Attribute Definition API

Use the subtitle settings from


Enable Default Settings
source stream

Reset all parameters to the


Reset Subtitle Settings default values that are resetSubtitleParameter()
specified in source stream.

Enable Subtitle
Bounding Box
• Set Top Percent Set the subtitle bounding box, setSubtitleBoundingBox(int topPercent, int
• Set Left Percent which will overwrite the subtitle leftPercent, int bottomPercent, int
settings from parser. rightPercent)
• Set Bottom
Percent
• Set Right Percent

Enable Subtitle Gravity


• Set Horizontal setSubtitleGravity(VO_OSMP_HORIZONTAL
Set the gravity of the bounding
Position horizontal, VO_OSMP_VERTICAL vertical)
box.
• Set Vertical
Position

Set the set of characters to be


Enable Subtitle Trim trimmed from the beginning or setSubtitleTrim(String trimChars)
end of subtitle.

Enable/Disable the automatic


Enable Subtitle Auto adjustment for subtitle enableSubtitleAutoAdjustment(boolean
Adjustment position/font size. Disabled is value)
set by default.

Enable Font size Set subtitle font size scale. setSubtitleFontSizeScale(int scale)

Enable Font Color Set subtitle font color opacity


setSubtitleFontOpacity(int alpha)
Opacity rate.

Enable Font Color List Set subtitle font color. setSubtitleFontColor(int color)

Enable Background Set subtitle font background setSubtitleFontBackgroundOpacity(int


Color Opacity color opacity rate. alpha)

Enable Background Set subtitle font background setSubtitleFontBackgroundColor(int color)


Color List color.

Enable Edge Color Set subtitle font edge color setSubtitleFontEdgeOpacity(int alpha)
Opacity opacity rate.

Enable Edge Color List Set subtitle font edge color.


setSubtitleFontEdgeColor(int color)

70 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

Attribute Definition API

Enable Edge Type List Set subtitle font edge type. setSubtitleFontEdgeType(int type)

Enable Font List Set subtitle font name. setSubtitleFontName(String name)

Enable Window Set window background color setSubtitleWindowBackgroundOpacity(int


Background Color opacity rate. alpha)
Opacity

Enable Window setSubtitleWindowBackgroundColor(int


Set window background color.
Background Color List color)

Enable Underline Font Enable or disable the underline setSubtitleFontUnderline(Boolean enable)


font for subtitle.

Enable Bold Font Enable or disable the bold font


setSubtitleFontBold(Boolean enable)
for subtitle.

Enable Italic Font Enable or disable the italic font setSubtitleFontItalic(Boolean enable)
for subtitle.

2.1.2.2.15 Enabling Initial Bitrate


The OSMP+ player enables to select a suitable initial bitrate, which can
utilize the TCP throughput to achieve a higher-than-lowest bitrate if
possible. By providing a better picture quality, the quality of experience
can be improved. Refer to setInitialBitrate(int bitrate) for API related
information.

To set the initial bitrate:


1. Tap Enable Initial Bitrate from Options to enable or disable the Initial
Bitrate setting.
2. Tap Initial Bitrate, type a value for the Initial Bitrate, and then Tap
OK, as shown in Figure 28.

Figure 28. Set the value of Initial Bitrate

2.1.2.2.16 Setting Bitrate Range


Refer to setBitrateThreshold(int upper, int lower) for API related information.

OnStream MediaPlayer+ User Guide 71


VisualOn
Chapter 2: Sample Player

To set the bitrate range:


1. Tap Set Bitrate Range from Options to enable or disable the Bitrate
Range Settings.
2. Tap Lower Bound Bitrate Range or Upper Bound Bitrate Range, type
the boundary value for lower and upper bound, and then Tap OK,
as shown in Figure 29.

Figure 29. Set the lower and upper bound value

2.1.2.2.17 Default Audio and Subtitle


Refer to setPreferredAudioLanguage(String[] languageList) and
setPreferredSubtitleLanguage(String[] languageList) for API related
information. See Question 8 in 6.1 Frequently Asked Questions for the
supported language code for setPreferredAudioLanguage.

Tap Default Audio or Default Subtitle from Options to enable or disable the
Default Audio and Subtitle settings, as shown in Figure 30.

Figure 30. Enable or disable settings of audio and subtitle

2.1.2.2.18 Anti Mirror


The OSMP+ player allows user to enable or disable the anti-mirroring mode
on iOS devices. Slide to enable Anti Mirror from Option. Refer to
enableAntiMirror() for API related information.

2.1.2.2.19 Preference settings


The OSMP+ player allows user to set the preference of playback. Select Set
preferences from Options to enable the following options. Refer to
setPreference() for API related information.

2.1.2.2.19.1 Keeping Last Frame


During the transition from live channel to NTS media, the OSMP+ player
keeps the last frame of the live channel being played until the first frame of
NTS media is played, when the Keeping Last Frame option is turned on. In
the meantime, the OSMP+ player keeps the screen black when stopping
or closing any playback.

72 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

2.1.2.2.19.2 Seek Precise


The OSMP+ player provides a new option, Seek Precise, for smooth
streaming to allow user setting the offset to the live point, so that user can
seek to the play point based on this offset value precisely.

2.1.2.2.19.3 Select Audio Switch Immediately


When the Select Audio Switch Immediately options is turned off, the
OSMP+ player continues playing the previous content and then switches
to the selected audio track when the previous playback is complete. This
option is turned on by default.

2.1.2.2.19.4 Use IPV4 as prior


When the Use IPV4 as prior option is selected, the OSMP+ SDK will use IPV4
as the preferred connection type at first then switch to IPV6 if IPV4 does
not work, and vice versa. To access this option, select Set Preference > Use
IPV4 as prior from Options menu.
Refer to the following functions in API Reference Manual for more
information. VO_OSMP_PREF_CONNECTION_IPV6_PRIOR is the default
value.
• VO_OSMP_PREF_CONNECTION_IPV4_PRIOR
• VO_OSMP_PREF_CONNECTION_IPV6_PRIOR

2.1.2.2.20 Set presentation delay time


The OSMP+ player provides the Set presentation delay time option for HLS
and Smooth Streaming, for enabling user to download chunks with some
seconds of delay that is defined by this option. Refer to
setPresentationDelay() for API related information.

2.1.2.2.21 Enter NTS


The OSMP+ player provides the Enter Network Time Shifting (NTS) feature to
test resuming playback from the pause point, rather than the live point.

The Enter NTS feature requires the collaboration within the streaming server,
application, and OSMP+ SDK. Streaming server should create the NTS
stream once the user pause live stream playback, and notify the
application of the new URL of NTS stream.

The application should call OSMP+ SDK API to switch to NTS stream once
the user resumes playback (after perform the pause operation for a while).
Also the application should call OSMP+ SDK API to switch back to Live
stream once the user catches up with the Live content (typically after a
seek operation).

The requirements to use this features are:


• The streams support #EXT-X-PROGRAM-DATE-TIME HLS

OnStream MediaPlayer+ User Guide 73


VisualOn
Chapter 2: Sample Player

• The playlist of the live stream at the time of pause and the playlist of
the NTS stream at the time of resume should have the same #EXT-X-
PROGRAM-DATE-TIME HLS value

In other words, there are two streams, a live stream that is paused and a
NTS stream that is resumed. Both streams share the same content.

The Enter NTS feature enables playback of the NTS stream instead of the
live stream when resuming playback. To use this feature, enter the value of
the PROGRAM-DATE-TIME HLS tag (when the live stream was paused) in
the Min pos box. Min Pos needs to be converted into millisecond.

Note: To make the Enter NTS feature work, ensure that the value of
enableLiveStreamingDVRPosition() is set to false.

After clicking EnterNTS, the player starts playback at the HLS Live paused
position using the NTS stream. To verify that the resume operation is
successful, one can check that the UTC time display should not change
more than one second when playback resumes.

To enable the Enter NTS playback:


1. Select Enter NTS from Options.
2. In the NTS URL box, type the URL address of the NTS stream that
shares the same content with the live stream being played.
3. Convert the UTC time to unix timestamp, and then type this
converted unix timestamp in the NTS min position box. The unit of
Min pos is millisecond.

2.1.2.2.22 Enabling HW decoder max resolution


The OSMP+ player supports to specify both maximum height and
maximum width to enable adaptive plahyback for a video decoder. To
enable it, tap Enable HW Decoder Max Resolution from Options. For more
information, refer to setHWDecoderMaxResolution() in the API Reference
Manual.

2.1.2.2.23 Previous seek to


The OSMP+ player supports to play the content from a specified position.
To enable the previous seek to feature, tap Previous seek to from Options,
and then specify a position in the unit of ms in the Seek To Value dialog.

2.1.2.2.24 DRM offline mode


The OSMP+ player provides a switch for Verimatrix DRM to enable playing
the downloaded content with the local key even if the device is not
connected to the internet. Refer to the enableDRMOfflineMode() function
for API related information.

74 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

When DRM Offline Mode is enabled regardless of whether the device is


connected to the internet or not:
• If the DRM key is stored on the server, the DRM link cannot be played
back.
• If the DRM key is downloaded to the local storage, the downloaded
content can be played only when the content/key downloading is
fully completed; otherwise the downloaded content cannot be
played back.
When DRM Offline Mode is disabled:
• If the DRM key is stored on the server, DRM contents can be played
only when the device is connected to the internet.
• If the DRM key is downloaded to the local storage, the downloaded
content can be played only when the key downloading is fully
completed.
To enable DRM offline mode, tap DRM Offline Mode from SpecialFeatures
during playback.

2.1.2.2.25 Spherical Video


The sample player supports the playback of the content that is recorded
by using the 360 degree camera. To enable the decoding of 360 degree
video, tap Spherical Video from Option. For more information, refer to
1.4.15 360 video decoding and the setSphericalVideoView function in the
API Reference Manual.

2.1.2.2.26 CardBoard Video


The sample player enables looking around to view the video in 360
degrees. If this option is enabled, the video screen splits into two smaller
screens and users can view the video in 360 degrees.

To enable the 3D playback of 360 video, tap CardBoard Video from


Option. For more information, refer to the enableCardBoardVideo function
in the API Reference Manual.

2.1.2.2.27 Enable Live Streaming DVR Position


The OSMP+ player supports defining position based on live streaming DVR
window. DVR window is also referred to as the duration of live streaming.
To enable defining the position, tap Live Streaming DVR Position from
Options.

When this option is enabled:


• Value of Play: this value is 00:00:00 when playing at the live head. If
the play point is not the live point, this value will be a negative value
to represent the offset between DVR window and live head.
• Value of Max: this value is always 00:00:00 that represents the live
head.

OnStream MediaPlayer+ User Guide 75


VisualOn
Chapter 2: Sample Player

• Value of Min: this value is (value of Max - DVR window size).


When this option is disabled:
• Value of Play: this value is the offset between the play head and the
beginning of the playback.
• Value of Max: this value is the offset between the live head and the
beginning of the playback.
• Value of Min: this value is (value of Max - DVR window size).
For more information, refer to enableLiveStreamingDVRPosition() in the API
Reference Manual.

2.1.2.2.28 Version
The Sample Player version information appears in Version of the Options
menu.

2.1.2.3 Playback controls


During playback, the Sample Player provides a set of basic controls,
including a shared Start/Pause button, Stop button, and a Seek bar.

Notes:

• Refer to Section 4 (Advanced Integration: Pause/Play Control) of the


OnStream MediaPlayer+ Player SDK Integration Guide for Android for
details about Pause/Play integration.
• Refer to Section 6 (Advanced Integration: Seekbar Control) of the
OnStream MediaPlayer+ Player SDK Integration Guide for Android for
details about Seekbar integration.

2.1.2.4 Channel switching


During playback, the SamplePlayer application supports channel
switching from the list of added media sources saved in /sdcard/url.txt.

The API calling sequence should start with stop(), and then close(), open()
should be last called. The player can set other configurations before
open().

To switch channels (sources):


1. Tap Prev or Next on the right side of the screen to switch to the
previous or next media source respectively.

Note: Refer to Section 7 (Advanced Integration: Channel Switching) of the


OnStream MediaPlayer+ Player SDK Integration Guide for Android for details
about Channel switching.

2.1.2.5 Controlling audio speed


During playback, the Sample Player allows to control the audio speed.

76 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

Tap + to speed up the audio playback or – to slow down the audio


playback.

Refer to setAudioPlaybackSpeed(float speed) for API related information.

2.1.2.6 Closed Captions


The Sample Player demonstrates the built-in SDK handling of CC and
subtitles rendering. If CC data exists, it appears as shown in Figure 31.

Figure 31. Sample Player with Closed Captions

When CC Show is selected (default), the SDK player automatically handles


CC display when data arrives. When CC output is selected, the
application manages CC data. Refer to enableSubtitle(boolean value) for
API related information.

2.1.2.7 Switching Asset properties


If the media source includes multiple video tracks (also known as bitrate),
audio tracks, or subtitles, the Sample Player application supports switching
properties during the playback. Refer to 3.1.8 Selecting tracks for details
about this feature.

To switch properties:
1. Tap Asset on the bottom of the video screen to display the Asset
menu.
2. Tap the required Video, Audio, and/or Subtitle track.
3. Tap Commit to confirm your selection. Playback continues with your
selection, as shown in Figure 32.

OnStream MediaPlayer+ User Guide 77


VisualOn
Chapter 2: Sample Player

Figure 32. Sample Player Asset menu

2.1.2.8 Special features


2.1.2.8.1 Screen Brightness
You can adjust the screen Brightness during the playback by dragging the
Screen Brightness bar in SpecialFeatures, as shown in Figure 33. Refer to
setScreenBrightness(int brightness) for API related information.

Figure 33. Screen brightness

2.1.2.8.2 Playback Volume


You have several options for controlling volume in the Sample Player,
including adjusting the volume level, muting, or unmuting. Refer to
setVolume(float volume), mute(), and unmute()for API related information.

To adjust the volume level, drag the playback volume bar and click Mute
to mute the volume. To restore the audio, click UnMute.

2.1.2.8.3 Stereo Channel


The Sample Player application allows you to set the stereo channel as
needed. Specify the need number for the left/right channel, and then tap
SetStereo.

78 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

2.1.2.8.4 Updating the media source


During playback, use the update source URL function to balance the
workload within media servers. This feature is specific for the optimization
for content delivery network (CDN) delivery. Refer to
updateSourceURL(String url) for API related information.

Note: The previous URL will be expired a few seconds after the new URL is
activated. Master manifest, sub-manifest, and TS chunks of new URL must be
exactly same with the previous media file.

1. Tap SpecialFeatures.
2. Type the required media URL address into the Update URL box, and
then tap Update, as shown in Figure 34.

Figure 34. Update the media source

2.1.2.8.5 Setting Zoom mode


The Sample Player application allows you to select the zoom mode as
needed. To set the zoom mode:
1. Tap SpecialFeatures.
2. Tap Zoom, select the required mode from the following list:
a. FullWindow
b. ZoomIn
c. LetterBox
d. Original
e. PanScan

Refer to 1.4.10 Zoom modes for more information about zoom modes.

2.1.2.8.6 Setting the aspect ratio


The Sample Player application allows you to set the aspect ratio as
needed. Refer to setVideoAspectRatio(VO_OSMP_ASPECT_RATIO ar)for API
related information.

To set the aspect ratio:


1. Tap SpecialFeatures.
2. Tap Auto to select the required aspect ratio, as shown in Figure 35.

Figure 35. Set the aspect ratio

OnStream MediaPlayer+ User Guide 79


VisualOn
Chapter 2: Sample Player

3. Tap Done.

2.1.2.8.7 SEI
During playback, tap the checkbox next to SEI to enable the SEI setting to
collect the SEI data from the media source.

See the following for the sample code of starting SEI.


m_sdkPlayer.enableSEI(VO_OSMP_SEI_INFO_FLAG.VO_OSMP_SEI_INFO_PIC_T
IMING);
m_sdkPlayer.startSEINotification(5000);

See the following for the sample code of stopping SEI.


m_sdkPlayer.stopSEINotification();

2.1.2.8.8 RTSP Statistics


During playback, tap the checkbox next to RTSP Statistics to collect the
RTSP information from the media source.

The player uses a timer to get RTSP statistics by using getRTSPStatistics().

2.1.2.8.9 Download Status


During playback, tap the checkbox next to Download Status to track the
HTML5 download information from the media source.

The player uses a timer to get the download status during playback. See
the following for the sample code of getting download status.
int validBufferDuation = m_sdkPlayer.getValidBufferDuration();
VO_OSMP_DOWNLOAD_STATUS audioDownloadStatus =
m_sdkPlayer.getDownloadStatus(VO_OSMP_SOURCE_STREAMTYPE.VO_OSMP_SS
_AUDIO);
VO_OSMP_DOWNLOAD_STATUS videoDownloadStatus =
m_sdkPlayer.getDownloadStatus(VO_OSMP_SOURCE_STREAMTYPE.VO_OSMP_SS
_VIDEO);
VO_OSMP_DOWNLOAD_STATUS subtitleDownloadStatus =
m_sdkPlayer.getDownloadStatus(VO_OSMP_SOURCE_STREAMTYPE.VO_OSMP_SS
_SUBTITLE);

2.1.2.8.10 Video/Audio decoding bitrate


During playback, you can get the video and audio decoding bitrate of
the streaming being played in the SpecialFeatures page.

2.1.2.8.11 Multiple Instances


During playback, tap Start next o Multi Instance to display a second
instance of the player on the top of the first player simultaneously (picture
in picture), as shown in Figure 36.

80 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

Figure 36. Enable multiple instances

2.1.2.9 Exiting the application


When the media playback is complete, the Sample Player returns to the
initial view and you can type or select a new media source. The API calling
sequence for exiting playback is stop(), close(), and then destroy().

If Home is used to leave the application during playback, the Sample


Player pauses the playback and keeps the media source open. Playback
resumes when user returns the application.

Refer to suspend(false) and resume(SurfaceView view)for API related


information.

Note: Refer to Section 3 (Basic Integration) of the OnStream MediaPlayer+ Player


SDK Integration Guide for Android for details about stopping playback.

2.2 iOS

2.2.1 Installation This section describes the installation of the Sample Player application
included with the SDK on iOS.

We recommend that you install the Sample Player application in the latest
Xcode version. See 1.2 Supported operating system and web browser for
the iOS versions supported by OSMP+.

2.2.1.1 Importing the SamplePlayer project into Xcode


To import the SamplePlayer project into Xcode:
1. In Finder, browse to the <SDK_INSTALL_DIR>/iOS/SamplePlayer
directory, as shown in Figure 37.

Note:
Application Transport Security blocks the cleartext HTTP on iOS 9. To ensure that
the content can be played back on iOS 9 devices, upgrade Xcode to version 7
and add the following code in the plist.info file.

OnStream MediaPlayer+ User Guide 81


VisualOn
Chapter 2: Sample Player

<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/></dict>

Figure 37. Sample Player Project in Finder

2. Double click SamplePlayer.xcodeproj to open the project in Xcode,


as shown in Figure 38.

Figure 38. Xcode IDE with Imported SamplePlayer Project

After importing the Sample Player project into Xcode, its files are visible in
the Navigator area. The SDK header and library files have been added to
the SamplePlayer project. You are ready to build the project and run the
application on an iOS device.

82 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

2.2.1.2 Running the Sample Player on a device


To run the Sample Player on an iOS device:

Note: You must ignore Xcode’s recommendation and select the target. Also,
change the default com.visualon.SamplePlayer to the name of your developer
certificate.

1. Connect the device to the Xcode workstation with a USB cable.


2. In Xcode, ensure that the Scheme is set to use the connected
device.
3. Click Run to build and run it on the iOS device, as shown in Figure
39. The Sample Player application can be explored on the iOS
device.

Figure 39. Xcode IDE with Imported Sample Player Project

2.2.1.3 Registering VCAS server on a device


Specify the VCAS server information after installing the Sample Player on a
device:
1. Launch the Sample Player.
2. Type public-ott-nodrm.verimatrix.com in the VCAS Server IP field.
3. Type 80 in the VCAS Server Port field.

OnStream MediaPlayer+ User Guide 83


VisualOn
Chapter 2: Sample Player

2.2.1.4 Uninstalling the Sample Player on a device


To uninstall the Sample Player on an iOS device:
1. Press and hold the Sample Player icon for a few seconds.
2. The icon starts to wobble gently, and a small cross appears on the
top right corner of the icon.
3. Tap the cross, and then tap Delete to confirm the uninstallation.

2.2.2 Sample This section describes the usage of the Sample Player application included
Player usage with the SDK. The Sample Player application implements a fully integrated
media player with the following features:
• Select the media source
• Select the subtitle source
• Select the option for opening the media source, including
Synchronous and Asynchronous
• Set the preferred audio and subtitle languages
• Control the playback through buttons
• Control the sound volume and mute/unmute the sound
• Support the Closed Captions and subtitle rendering
• Configure the asset properties

2.2.2.1 Media sources


The Sample Player application allows you to supply media files or text
(*.txt) lists of media URLs for playback. The text file lists each link URL
(including http://) separated by line.

To add media sources to the Sample Player application:


1. Connect the iOS device to the workstation with a USB cable.
2. Run iTunes and select the device under DEVICES.
3. Select Apps, and then select SamplePlayer to show a list of
documents to be synchronized.
4. Drag the media files and/or *.txt media source list files into the
SamplePlayer Documents list.
5. Click Sync to synchronize the file with the iOS device, as shown in
Figure 40. The media sources are available for selection when you
run the SamplePlayer application.

84 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

Figure 40. iTunes Apps View with SamplePlayer Documents

2.2.2.2 Initial view


The initial view of the Sample Player, as shown in Figure 41, provides the
user interface (UI) to select the media source.

Figure 41. Initial View of the Sample Player

2.2.2.1.1 Opening media source


Media source can be opened in either Sync or Async mode. The Sample
Player uses Async mode by default. For sample code of opening media
source, refer to 3.2.3 Opening media source.

OnStream MediaPlayer+ User Guide 85


VisualOn
Chapter 2: Sample Player

• Sync mode: Opening the media source in sync mode causes the
client application to block until the open method completes or
returns.
• Async mode: In Async mode, the API call returns immediately, and
the client application is not blocked waiting for the media source to
be opened. The client application can then wait for an event to
indicate that the media source was opened successfully before
starting the media playback.

To activate the asynchronous option:


6. In the initial view tap Option.
7. Slide the Asynchronous/Synchronous Open radio button to open
source asynchronously.

2.2.2.2.2 Selecting the Media Source


The initial view allows you to select the media source (for example, H.264,
MP4 file, or HTTP Live Streaming link and so on) for playback. The media
source path can be inputted manually or be selected from the list of
media source previously added to the application in the documents
folder.

To manually type a media file or link:


1. Tap Browser to enter the full URL starting with http:// in the text box.
2. Tap Start.
Alternately, a list of media files and links can be supplied to the Sample
Player through a text file. The text list must be saved to /documents/url.txt,
with each link URL and file path separated by line. To select a media file or
link from url.txt:
1. Tap Select to display the media source list and tap the required
source file or URL. Tap anywhere outside the source list to close the
list.
2. Tap Start.

2.2.2.2.3 Starting Playback


Tap Start to start playback. Sample code of starting playback is described
in 3.2.5 Starting playback. Refer to Section 3 (Basic Integration) in the
OnStream MediaPlayer+ Player SDK Integration Guide for iOS, for details
about initializing the SDK player, opening the media source, and beginning
playback.

2.2.2.2.4 Enabling AirPlay


Tap the AirPlay button in the initial view, select iPad/iPhone to display
the content on the iOS device screen. If you want to stream the content to

86 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

the external device screen, tap the AirPlay button , and then tap the
name of the device to which you want to stream content.

Note: AirPlay is only applicable when AVPlayer engine is enabled. Refer to


2.2.2.3.1 Engine type for details about how to turn on AVPlayer engine.

2.2.2.3 Options
2.2.2.3.1 Engine type
The Sample Player application includes an option to initialize the SDK by
using the AVPlayer engine or VisualOn VOME2 software engine (default).

Sample code of initializing the SDK is described in 3.2.2 Initializing SDK


instance.

To use the AVPlayer engine:


1. Tap Option, and then tap Engine Type.
2. Select AVPlayer from the Engine Type list, and then tap Done.

The OSMP+ SDK uses Video Toolbox to resolve the performance issue
caused by the AVPlayer decoder. To achieve the better rendering
performance, Video Toolbox decoder is recommended being selected on
iOS devices. Visit Apple Developer website for more information about
Video Toolbox.

To use the Video Toolbox decoder:


1. Tap Option, and then tap Video Decoder Type.
2. Select AutoHW from the Engine Type list, and then tap Done.

2.2.2.3.2 Dolby Surround Module


The Sample Player has a Dolby Surround Module to provide the better
audio effects. Tap Dolby Surround Module from Option to load the
module. Refer to enableAudioEffect for API related information.

2.2.2.3.3 Enabling/disabling deblock


Deblocking is a feature applied to decoded compressed video to improve
visual quality and prediction performance by smoothing the sharp edges
which can form between macroblocks when block coding techniques are
used.

Enabling the deblock function helps improve the playback quality,


especially when the video has mosaic. Tap Deblock from Option to enable
the deblock feature. Refer to enableDeblock for API related information.

2.2.2.3.4 Selecting the Subtitle Source


The Sample Player allows you to optionally select an external subtitle
source (for example, CEA 608, CEA 708, SRT, SMI, etc.) for Closed Captions
(CC) or subtitles rendering. A list of subtitle files and links can be supplied to

OnStream MediaPlayer+ User Guide 87


VisualOn
Chapter 2: Sample Player

the Sample Player through a text file. The text list must be saved to
/documents/subtitle.txt, with each link URL and file path separated by a
line. Refer to setSubtitlePath for API related information.

To select an external subtitle file or link from subtitle.txt:


1. Tap Option, and then tap Subtitle URL.
2. Select a URL on /documents/subtitle.txt list menu, as shown in Figure
42.

Figure 42. Select an external subtitle

3. Select the required subtitle source, and then tap Done.

2.2.2.3.5 Setting buffering time


The OSMP+ player allows you to set the buffering time of the source to be
played.

2.2.2.3.5.1 Initial Buffering Time


Turn on Initial Buffering Time option to set the buffering time of the source
in milliseconds before the playback starts. Refer to setInitialBufferingTime(int
time) for API related information.

To enable the initial buffering time of source buffer:


1. Tap Initial Buffering Time from Option.
2. Type the number to set the initial buffering time in milliseconds.

2.2.2.3.5.2 Setting Max Buffer Time


Refer to setMaxBufferingTime for API related information. To set the
maximum time of source buffer:
1. Type the number in the Max Buffer Time box from Option to set the
maximum buffer time in milliseconds.
2. Tap Done.

2.2.2.3.5.3 Playback Buffering Time


When re-buffering is needed during playback, the player enables you to
set the buffering time with the Playback Buffering Time option. Refer to
setPlaybackBuferingTime(int time) for API related information.

To set the re-buffering time:


1. Tap Playback Buffering Time from Option.

88 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

2. Type the number to set the time in milliseconds.

2.2.2.3.6 Enabling Download Manager


The video files can be downloaded locally while playing when the
Download manager is enabled. This feature is only for adaptive streaming.
Tap Option, and then tap Download to enable Download Manager. For
details about how to integrate Download Manager on Android, refer to
the OnStream MediaPlayer+.Download Manager Integration Guide for
Android.pdf document in your installation package.

If Download Manager is turned on, the Select Asset dialog prompts when
starting the playback. Specify the Video, Audio, and Subtitle tracks to be
downloaded, and then tap OK to download the source to be played. If
you do not want to keep the downloaded files on your device, tap Delete
Downloader File from Options, tap Delete All to remove all downloaded
files, or select the file to be removed and then tap Delete.

2.2.2.3.7 Enabling CPU Adaption


The Bitrate Adaption of Sample Player subjects to setting which is
hardcoded in the player when enabling CPU Adaption. Refer to
enableCPUAdaptation for API related information.

To enable CPU Adaption, tap Option, and then tap CPU Adaption.

2.2.2.3.8 RTSP Setting


For the sample code regarding RTSP settings, refer to 3.2.14 RTSP settings
(Optional).

2.2.2.3.8.1 Setting RTSP Connection Type


To set RTSP Connection Type:
1. Tap RTSP Connection Type from Option.
2. Three connection types, Automatic(UDP is priority), TCP, and UDP
are available for selection, as shown in Figure 43.
 Automatic (UDP is priority): The player selects the connection
types automatically.
 TCP: refer to 1.3 Terminology for TCP definition.
 UDP: refer to 1.3 Terminology for UDP definition.

Figure 43. Available RTSP Connection Types

OnStream MediaPlayer+ User Guide 89


VisualOn
Chapter 2: Sample Player

3. Select the required connection type, and then tap Done.

2.2.2.3.8.2 Enabling RTSP HTTP Port


Tap Option, and then tap Enable RTSP HTTP Port to enable it. Refer to
enableRTSPOverHTTP for API related information.

Tap Set to enable RTSP HTTP Port, and then type a value to define the Port
to access the RTSP media source, as shown in Figure 44. Refer to
setRTSPConnectionPort for API related information.

Figure 44. Define the port

2.2.2.3.8.3 Enabling Low Latency Video


The Low Latency Video feature allows you to easily build a high quality
and low latency HD video transmission system. Refer to
enableLowLatencyVideo for API related information.

Tap Option, and then tap Enable Low Latency Video to enable RTSP
Camera video latency.

2.2.2.3.8.4 Enabling RTSP Max Socket Error Count


Tap Option, and then tap Enable RTSP Max Socket Error Count to enable
RTSP Socket Error handling. Refer to setRTSPMaxSocketErrorCount for API
related information.

Tap Set RTSP max socket error count., and then type a value to set the
entry level for RTSP Socket error handling, as shown in Figure 45.

Figure 45. Set the entry level

2.2.2.3.8.5 Enable RTSP Connection Timeout


Tap Option, and then tap Enable RTSP Connection Timeout to enable the
connection timeout function. Refer to setRTSPConnectionTimeout for API
related information.

Tap Set RTSTP connection timeout., and then type a number to set a value
for the retry times when server has no response, as shown in Figure 46.

90 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

Figure 46. Set the retry times

2.2.2.3.9 HTTP Setting


2.2.3.9.1 Enabling HTTP Verification Information
Tap Option, and then tap Enable HTTP Verification Information. Refer to
setHTTPVerificationInfo for API related information.

Tap Set the HTTP verification information., and then type the user name
and password to authorize the RTSP media source access, as shown in
Figure 47.

Figure 47. Set the user name and password

2.2.3.9.2 Enabling HTTP Retry Timeout


Tap Option, and then tap Enable HTTP Retry Timeout to enable the retry
timeout function. Refer to setHTTPRetryTimeout for API related information.

Tap Enable HTTP connection retry timeout., and then type a number to set
the player retry times when server has no response, as shown in Figure 48.

Figure 48. Set retry times

2.2.3.9.3 Enabling HTTP Gzip Request


HTTP data is compressed before it is sent from the server: compliant
browsers will announce what methods are supported to the server before
downloading the correct format; browsers that do not support compliant
compression method will download uncompressed data. Gzip is one of

OnStream MediaPlayer+ User Guide 91


VisualOn
Chapter 2: Sample Player

the most common compression schemes. Refer to enableHTTPGzipRequest


for API related information.

Tap Option, and then tap Enable HTTP Gzip Request to enable or disable
the support of the GZIP format.

2.2.3.9.4 Setting token for HTTP Request


The sample player enables to set a token/string for HTTP requests. Refer to
setURLQueryString for API related information.

Tap URL Query String from Options to enable or disable the token support
for HTTP requests. After enabling this option, tap Enable URL Query String,
and then type the Query String in the prompted dialog.

Note: The query string should be in the format of ‘key1=value&key2=value’.

2.2.2.3.10 Playback Looping


If the playback looping feature is on and you’re playing your timeline, the
playhead cycles back to the start of the sequence when you reach the
end. If it’s off, your playhead simply stops at the end of the sequence.

Tap Option, and then tap Playback Looping to enable or disable the
Playback looping.

2.2.2.3.11 Subtitle Settings


Tap Option, and then tap Subtitle Settings to enable or disable the Subtitle
Settings. For API related information, refer to 3.2.9 Subtitle rendering
(Optional).

Table 9 lists the available subtitle attributes that can be set in the OSMP+
player and their related API s.
Table 9. Subtitle attributes and related APIs

Attribute Definition API

Enable/disable subtitles display.


Enable Subtitle enableSubtitle()
Disabled is set by default.

92 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

Attribute Definition API

Use the subtitle settings from


Enable Default Settings N/A
source stream

Reset all parameters to the


Reset Subtitle Settings default values that are specified resetSubtitleParameter()
in source stream.

Enable Subtitle Bounding


Box
• Set Top Percent Set the subtitle bounding box,
which will overwrite the subtitle setSubtitleBoundingBox()
• Set Left Percent settings from parser.
• Set Bottom Percent
• Set Right Percent

Enable Subtitle Gravity


• Set Horizontal Set the gravity of the bounding
setSubtitleGravity()
Position box.
• Set Vertical Position

Set the set of characters to be


Enable Subtitle Trim trimmed from the beginning or setSubtitleTrim()
end of subtitle.

Enable/Disable the automatic


Enable Subtitle Auto adjustment for subtitle
enableSubtitleAutoAdjustment()
Adjustment position/font size. Disabled is set
by default.

Enable Font size Set subtitle font size scale. setSubtitleFontSizeScale()

Enable Font Color Set subtitle font color opacity


setSubtitleFontOpacity()
Opacity rate.

Enable Font Color List Set subtitle font color. setSubtitleFontColor()

Enable Background Set subtitle font background


setSubtitleFontBackgroundOpacity()
Color Opacity color opacity rate.

Enable Background Set subtitle font background


setSubtitleFontBackgroundColor()
Color List color.

Enable Edge Color Set subtitle font edge color


setSubtitleFontEdgeOpacity()
Opacity opacity rate.

Enable Edge Color List Set subtitle font edge color.


setSubtitleFontEdgeColor()

Enable Edge Type List Set subtitle font edge type. setSubtitleFontEdgeType()

OnStream MediaPlayer+ User Guide 93


VisualOn
Chapter 2: Sample Player

Attribute Definition API

Enable Font List Set subtitle font name. setSubtitleFontName()

Enable Window Set window background color setSubtitleWindowBackgroundOpacity()


Background Color opacity rate.
Opacity

Enable Window setSubtitleWindowBackgroundColor()


Set window background color.
Background Color List

Enable Underline Font Enable or disable the underline


setSubtitleFontUnderline()
font for subtitle.

Enable Bold Font Enable or disable the bold font


setSubtitleFontBold()
for subtitle.

Enable Italic Font Enable or disable the italic font


setSubtitleFontItalic()
for subtitle.

2.2.2.3.12 Enabling Initial Bitrate


The OSMP+ player enables to select a suitable initial bitrate, which can
utilize the TCP throughput to achieve a higher-than-lowest bitrate if
possible. By providing a better picture quality, the quality of experience
can be improved. Tap Option, and then tap Enable Initial Bitrate to enable
or disable the Initial Bitrate setting. Refer to setInitialBitrate for API related
information.

Tap Set to enable initial bitrate, type a value for the Initial Bitrate, and then
Tap Done, as shown in Figure 49.

Figure 49. Set the value of Initial Bitrate

2.2.2.3.13 Setting Bitrate Range


Tap Option, and then tap Set Bitrate Range to enable or disable the Bitrate
Range Settings. Refer to setBitrateThreshold for API related information.

Tap Set bitrate range (kbps), type the number for lower and upper bound
bitrate range, and then tap Done, as shown in Figure 50.

94 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

Figure 50. Set the lower and upper boundary value

2.2.2.3.14 Default Audio and Subtitle


Tap Option, and then tap Default Audio/Default Subtitle to enable or
disable the Default Audio and Subtitle settings, as shown in Figure 51. Refer
to setPreferredAudioLanguage or setPreferredSubtitleLanguage for API
related information. See Question 8 in 6.1 Frequently Asked Questions for
the supported language code for setPreferredAudioLanguage.

Figure 51. Enable or disable settings of audio and subtitle

2.2.2.3.15 Anti Mirror


The OSMP+ player allows user to enable or disable the anti-mirroring mode
on iOS devices. Slide to enable Anti Mirror from Option. Refer to
enableAntiMirror() for API related information.

2.2.2.3.16 Preference settings


The OSMP+ player allows user to set the preference of playback. Select Set
preferences from Options to enable the following options. Refer to
setPreference() for API related information.

2.2.2.3.16.1 Keeping Last Frame


During the transition from live channel to NTS media, the OSMP+ player
keeps the last frame of the live channel being played until the first frame of
NTS media is played, when the Keeping Last Frame option is turned on. In
the meantime, the OSMP+ player keeps the screen black when stopping
or closing any playback.

OnStream MediaPlayer+ User Guide 95


VisualOn
Chapter 2: Sample Player

2.2.2.3.16.2 Seek Precise


The OSMP+ player provides a new option, Seek Precise, for smooth
streaming to allow user setting the offset to the live point, so that user can
seek to the play point based on this offset value precisely.

2.2.2.3.16.3 Select Audio Switch Immediately


The option, Select Audio Switch Immediately, is added into the OSMP+
player to continue play the previous content and then switch to the
selected audio track when the previous playback is complete, when this
option is turned off. This option is turned on by default.

2.2.2.3.16.4 Use IPV4 as prior


When the Use IPV4 as prior option is selected, the OSMP+ SDK will use IPV4
as the preferred connection type at first then switch to IPV6 if IPV4 does
not work, and vice versa. To access this option, select Set Preference > Use
IPV4 as prior from Option menu.
Refer to the following functions in API Reference Manual for more
information. VO_OSMP_PREF_CONNECTION_IPV6_PRIOR is the default
value.
• VO_OSMP_PREF_CONNECTION_IPV4_PRIOR
• VO_OSMP_PREF_CONNECTION_IPV6_PRIOR

2.2.2.3.17 Set presentation delay time


The OSMP+ player provides the Set presentation delay time option for HLS
and Smooth Streaming, to allow user downloading chunks with some
seconds of delay that is defined by this option. Refer to
setPresentationDelay() for API related information.

2.2.2.3.18 Enter NTS


The OSMP+ player provides the Enter Network Time Shifting (NTS) feature to
test resuming playback from the pause point, rather than the live point.

The Enter NTS feature requires the collaboration within the streaming server,
application, and OSMP+ SDK. Streaming server should create the NTS
stream once the user pause live stream playback, and notify the
application of the new URL of NTS stream.

The application should call OSMP+ SDK API to switch to NTS stream once
the user resumes playback (after perform the pause operation for a while).
Also the application should call OSMP+ SDK API to switch back to Live
stream once the user catches up with the Live content (typically after a
seek operation).

The requirements to use this features are:


• The streams support #EXT-X-PROGRAM-DATE-TIME HLS

96 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

• The playlist of the live stream at the time of pause and the playlist of
the NTS stream at the time of resume should have the same #EXT-X-
PROGRAM-DATE-TIME HLS value

In other words, there are two streams, a live stream that is paused and a
NTS stream that is resumed. Both streams share the same content.

The Enter NTS feature enables playback of the NTS stream instead of the
live stream when resuming playback. To use this feature, enter the value of
the PROGRAM-DATE-TIME HLS tag (when the live stream was paused) in
the Min pos box. Min Pos needs to be converted into millisecond.

After clicking EnterNTS, the player starts playback at the HLS Live paused
position using the NTS stream. To verify that the resume operation is
successful, one can check that the UTC time display should not change
more than one second when playback resumes.

To enable the Enter NTS playback:


1. Select Enter NTS from Option.
2. In the NTS URL box, type the URL address of the NTS stream that
shares the same content with the live stream being played.
3. Convert the UTC time to unix timestamp, and then type this
converted unix timestamp in the NTS min position box. The unit of
Min pos is millisecond.

2.2.2.3.19 Previous seek to


The OSMP+ player supports to play the content from a specified position.
To enable the previous seek to feature, tap Previous seek to from Option,
and then specify a position in the unit of ms in the Seek To Value dialog.

2.2.2.3.20 DRM offline mode


The OSMP+ player provides a switch for Verimatrix DRM to enable playing
the downloaded content with the local key even if the device is not
connected to the internet. Refer to the enableDRMOfflineMode() function
for API related information.

When DRM Offline Mode is enabled regardless of whether the device is


connected to the internet or not:
• If the DRM key is stored on the server, the DRM link cannot be played
back.
• If the DRM key is downloaded to the local storage, the downloaded
content can be played only when the content/key downloading is
fully completed; otherwise the downloaded content cannot be
played back.

OnStream MediaPlayer+ User Guide 97


VisualOn
Chapter 2: Sample Player

When DRM Offline Mode is disabled:


• If the DRM key is stored on the server, DRM contents can be played
only when the device is connected to the internet.
• If the DRM key is downloaded to the local storage, the downloaded
content can be played only when the key downloading is fully
completed.
To enable DRM offline mode, tap DRM Offline Mode from SpecialFeatures.

2.2.2.3.21 Spherical Video


The sample player supports the playback of the content that is recorded
by using the 360 degree camera. To enable the decoding of 360 degree
video, tap Spherical Video from Option. For more information, refer to
1.4.15 360 video decoding and the setSphericalVideoView function in the
API Reference Manual.

2.2.2.3.22 CardBoard Video


The sample player enables looking around to view the video in 360
degrees. If this option is enabled, the video screen splits into two smaller
screens and users can view the video in 360 degrees.

To enable the 3D playback of 360 video, tap CardBoard Video from


Options. For more information, refer to the enableCardBoardVideo
function in the API Reference Manual.

2.2.2.3.23 Enable Live Streaming DVR Position


The OSMP+ player supports defining position based on live streaming DVR
window. DVR window is also referred to as the duration of live streaming.
To enable defining the position, tap Live Streaming DVR Position from
Option.

When this option is enabled:


• Value of Play: this value is 00:00:00 when playing at the live head. If
the play point is not the live point, this value will be a negative value
to represent the offset between DVR window and live head.
• Value of Max: this value is always 00:00:00 that represents the live
head.
• Value of Min: this value is (value of Max - DVR window size).
When this option is disabled:
• Value of Play: this value is the offset between the play head and the
beginning of the playback.
• Value of Max: this value is the offset between the live head and the
beginning of the playback.
• Value of Min: this value is (value of Max - DVR window size).

98 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

For more information, refer to enableLiveStreamingDVRPosition() in the API


Reference Manual.

2.2.2.3.24 Version
Tap Version from Option to shown the Sample Player version information.

2.2.3.4 Playback controls


During playback, the Sample Player provides a set of basic controls,
including a shared Start/Pause button, Stop button, and a Seek bar, as
shown in Figure 52.

Figure 52. Playback Controls when Media is Playing

Notes:

• Refer to Section 4 (Advanced Integration: Pause/Play Control) of the


OnStream MediaPlayer+ Player SDK Integration Guide for iOS for
details about Pause/Play integration.
• Refer to Section 6 (Advanced Integration: Seekbar Control) of the
OnStream MediaPlayer+ Player SDK Integration Guide for iOS for
details about Seekbar integration.

2.2.3.5 Switching channel


During playback, the Sample Player supports channel switching from the
list of added media sources.

To switch channels (sources):


1. Tap Prev or Next on the right side of the screen to switch to the
previous or next media source respectively.

OnStream MediaPlayer+ User Guide 99


VisualOn
Chapter 2: Sample Player

Note: Refer to Section 7 (Advanced Integration: Channel Switching) of the


OnStream MediaPlayer+ Player SDK Integration Guide for iOS for details about
Channel switching.

2.2.3.6 Controlling audio speed


During playback, the Sample Player can control the audio speed. Refer to
setAudioPlaybackSpeed for API related information.

Tap + to speed up the audio playback or – to slow down the audio


playback, as shown in Figure 53.

Figure 53. Control audio speed

2.2.3.7 Closed Captions


The Sample Player demonstrates the built-in SDK handling of CC and
subtitles rendering. If CC data exists, it appears as shown in Figure 54.

Figure 54. Sample Player with Closed Captions Display

When CC Show is selected (default), the SDK player automatically handles


CC display when data arrives. When CC output is selected, the
application manages CC data. Enable or disable the subtitle display by
taping Sub on lower right corner.

2.2.3.8 Switching Asset properties


If the media source includes multiple video (bit rate/angle), audio, or
subtitle (language) tracks, the Sample Player supports property switching
during playback.

100 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

To switch properties:
1. Tap Asset on the bottom of the screen to display the Asset Selection
dialog.
2. Tap the required Video, Audio, and/or Subtitle track.
3. Tap Commit to confirm your selection. Playback continues with your
selection, as shown in Figure 55.

Figure 55. Sample Player Asset Selection Menu

2.2.3.9 Special features


2.2.3.9.1 Screen Brightness
You can adjust the screen Brightness during the playback by dragging the
Screen Brightness bar in Special Feature, as shown in Figure 56. Refer to
getScreenBrightness for API related information.

Figure 56. Screen brightness

2.2.3.9.2 Playback Volume


You have several options for controlling volume in the Sample Player,
including adjusting the volume level, muting, or unmuting. Refer to
setVolume for API related information.

To adjust the volume level, drag the playback volume bar and click Mute
to mute the volume. To restore the audio, click UnMute. Refer to mute or
unmute for API related information.

OnStream MediaPlayer+ User Guide 101


VisualOn
Chapter 2: Sample Player

2.2.3.9.3 Setting zoom mode


The Sample Player application allows you to select the zoom mode as
needed. To set the zoom mode:
1. Tap Special Feature.
2. Tap Zoom Model, select the required mode from the following list:
a. Full
b. ZoomIn
c. LetterBox
d. Original
e. Pan&Scan
Refer to 1.4.10 Zoom modes for more information about zoom modes.

2.2.3.9.4 Setting the aspect ratio


The Sample Player application allows you to set the aspect ratio as
needed. Refer to setVideoAspectRatio for API related information.
To set the aspect ratio:
1. Tap Special Feature.
2. Tap Aspect Ratio, select the required aspect ratio.

2.2.3.9.5 Updating the media source


During playback, use the update source URL function to balance the
workload within media servers. This feature is specific for the optimization
for content delivery network (CDN) delivery. Refer to updateSourceURL for
API related information.

Note: The previous URL will be expired a few seconds after the new URL is
activated. Master manifest, sub-manifest, and TS chunks of new URL must be
exactly same with the previous media file.

1. Tap Special Feature.


2. Type the required media URL address into the Update URL box, and
then tap Update, as shown in Figure 57.

Figure 57. Update the media source

2.2.3.9.6 SEI
During playback, tap the checkbox next to SEI to collect the SEI data from
the media source. Refer to startSEINotification or enableSEI for API related
information.

102 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

2.2.3.9.7 RTSP Statistics


During playback, tap the checkbox next to RTSP Statistics Setting to collect
the RTSP information from the media source. Refer to getRTSPStatistics for
API related information.

2.2.3.9.8 Download Status


During playback, tap the checkbox next to Download Status to track the
HTML5 download information from the media source. Refer to
getDownloadStatus for API related information.

2.2.3.9.9 Multiple Instances


During playback, enable Multi Instance to display a second player
instance on top of the first one simultaneously (picture in picture).

Disable the multiple instances by taping Stop, as shown in Figure 58.

Figure 58. Enable multiple instances

2.2.3.10 Exiting the application


When the media playback is complete, the Sample Player returns the
initial view and you can type or select a new media source.

If Home is used to leave the application during playback, the Sample


Player pauses the playback and keeps the media source open. When the
user returns to the application, playback resumes. Refer to suspend or
resume for API related information.

Note: Refer to Section 3 (Basic Integration) of the OnStream MediaPlayer+ Player


SDK Integration Guide for iOS for details about stopping playback.

2.3 Plug-ins

2.3.1 Installation This section describes how to install the player plug-ins and how to run the
and associated SDK Sample Player applications.
uninstallation
The operations for hosting the plug-ins, downloading the plug-ins, and
signing the plug-ins may vary depending on supported internet browser.
We recommend that you refer to the internet browser developer’s guide
or user manual or visit their official website for detailed information on

OnStream MediaPlayer+ User Guide 103


VisualOn
Chapter 2: Sample Player

these operations. See 1.2 Supported operating system and web browser
for the Windows version and Mac OS version supported by OSMP+.

2.3.1.1 Installing the player plug-ins


The plug-in package provides plug-ins sample installation files for Windows
and Mac OS.

2.3.1.1.1 Installing the Windows plug-in


Note: The evaluation plug-in files are copied to C:\ProgramData\VisualOn folder
during the installation.

1. Decompress the plug-in package.


2. In Windows Explorer, type or browse to the <SDK_INSTALL_DIR>
directory where the plug-in package is decompressed.

Note: Ensure that all web browsers are closed and are killed in Task Manager
before starting the installation.

3. Select Bin > Win32, and then double click the


VisualOnBrowserPlugin_release.msi file. The installation wizard
appears, as shown in Figure 59.

Figure 59. Installation wizard on Windows

4. Follow the onscreen prompts to complete the installation.

2.3.1.1.2 Installing the Mac OS plug-in


1. Decompress the plug-in package.
2. In Finder, browse to the <SDK_INSTALL_DIR> directory where the
plug-in package is decompressed.

Note: Ensure that all web browsers are closed and are killed in Activity Monitor
before starting the installation.

3. Select Bin > MacOS, decompress


VisualOnBrowserPluginInstaller_release.zip.

4. Double click VisualOnABrowserPluginInstaller.app. The installation


wizard appears, as shown in Figure 60.

104 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

Figure 60. Installation wizard on Mac OS

5. Follow the onscreen prompts to complete the installation.

2.3.1.2 Running Sample Player

2.3.1.2.1 Running on Windows platform


OSMP+ provides the Sample Player with configurable UI for Windows plug-
in. See 2.3.2.2 Configurable UI for more information.

Note: This configurable UI is only available for Windows plug-in.

To run the Sample Player application with the configurable UI on a


Windows device:
1. In Windows Explorer, type or browse to <SDK_INSTALL_DIR>> Sample
> SamplePlayer.
2. Double click the SamplePlayer.html file in Internet Explorer or
Chrome.

2.3.1.2.2 Running on Mac OS platform


To run the Sample Player application on a Mac OS device:
1. In Finder, browse to the <SDK_INSTALL_DIR> > Sample >
SamplePlayer.
2. Double click the SamplePlayer.html file in Safari.
When opening the Sample Player in the web browser, you may see a
message from the browser requesting the permission to run active content
or ActiveX content. The message may vary depending on your browser’s
configuration. Follow the prompts and accept to run ActiveX content.

To quickly verify that the Sample Player is functional, click the


http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8 link

OnStream MediaPlayer+ User Guide 105


VisualOn
Chapter 2: Sample Player

underneath the video screen. The video should be started after a few
seconds.

2.3.1.3 Registering VCAS server on a device


Specify the VCAS server information after installing the Sample Player on a
device for Windows and Mac OS plug-ins.

2.3.1.3.1 Windows
To specify the VCAS server information:
1. From the Windows desktop, press the Windows + R key to open the
Run dialog box.
2. Type regedit in the Open: field and click OK.
3. Select:
 64-bit Windows:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\VisualOn\Br
owserPlugin\DRMVerification\Verimatrix.
 32-bit Windows:
HKEY_LOCAL_MACHINE\SOFTWARE\VisualOn\BrowserPlugin\DRM
Verification\Verimatrix
4. Change the value of Server attribute to public-ott-
nodrm.verimatrix.com:80.

2.3.1.3.2 Mac OS
To specify the VCAS server information:
5. Click Go on the Finder menu bar.
6. Press Option on the keyboard to display the Library option.
7. Click Library to display the folders on your system.
8. Click Internet Plug-Ins.
9. Right click voBrowserPlugin.plugin, and then select Show Package
Contents.
10. Click Contents, and then open Info.plist.
11. Change the value of DRMVerificationInfoString in Info.plist to public-
ott-nodrm.verimatrix.com:80.
Or
1. Click Go on the Finder menu bar.
2. Select Terminal from Application > Utilities.
3. In Terminal, type the following command to install the plug-in.
open ~/Library/Internet\ Plug-
Ins/voBrowserPlugin.plugin/Contents/Info.plist

106 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

4. Change the value of DRMVerificationInfoString in Info.plist to public-


ott-nodrm.verimatrix.com:80.

2.3.1.4 Uninstalling the plug-ins


2.3.1.4.1 Uninstalling the Windows plug-in
1. Open Control Panel from the Start menu.
2. Select Programs and Features to show the Uninstall or change a
program page.

Note: Ensure that all web browsers are closed before starting the uninstallation.

3. Select voBrowserPlugin from the list, and then click Uninstall.

2.3.1.4.2 Uninstalling the Mac OS plug-in


1. Click Go on the Finder menu bar.
2. Press Option on the keyboard to display the Library option.
3. Click Library to display the folders on your system.
4. Click Internet Plug-Ins.
5. Select voBrowserPlugin.plugin, and then select Move to Trash.
Or
1. Click Go on the Finder menu bar.
2. Select Terminal from Application > Utilities.
3. In Terminal, type the following command to uninstall the plug-in.
rm -rf ~/Library/Internet\ Plug-Ins/voBrowserPlugin.plugin/

2.3.2 Sample This section describes the use of the Sample Player application integrated
player usage with the SDK. The Sample Player application implements a fully integrated
(Windows) media player with the following features:
• Select the media source
• Support the configurable UI for Windows
• Select the subtitle source
• Select the option for opening the media source, including
Synchronous and Asynchronous
• Set the preferred audio and subtitle languages
• Control the playback through buttons
• Control the sound volume and mute/unmute the sound
• Support the Closed Captions and subtitle rendering
• Configure the asset properties

OnStream MediaPlayer+ User Guide 107


VisualOn
Chapter 2: Sample Player

2.3.2.1 Initial view


The initial view of the Sample Player application provides users with an
interface to select media sources, subtitle sources, and asset properties, as
shown in Figure 61.

Figure 61. Initial view of the Sample Player

2.3.2.1.1 Selecting the media source


The Sample Player application allows you to select the media source,
including video sources and audio sources.

To select the media source:


1. In Tab-1, type the required URL address in the Play URL box.
 Type the URL address starting with http:// or rtsp:// to play
streaming resources on Internet
 Type the local directory path like C:\ to play local files
2. Click Play to start the playback.

Note: For details about how to initialize the SDK, open the media source, and
start the playback, refer to section 4 and section 5 in the OnStream
MediaPlayer+ Player SDK Integration Guide for Windows.

2.3.2.1.2 Selecting a license file


Setting a new license is optional. To set the license:
1. Click Tab-2.
2. Type the required license file in the License file box.

108 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

3. Click Set. The default license file path is


C:\ProgramData\VisualOn\BrowserPlugin\voVidDec.dat.
Renewing a license file or the use of additional features may require
additional license files.
4. The new license file takes effect from the next playback.

2.3.2.1.3 Setting the user agent


The Sample Player application allows you to set the user agent according
to your requirements.

To set the user agent:


1. Click Tab-2.
2. Select User agent settings.
3. Type the agent name in the Name box as needed. This value is set
to VisualOn OSMP+ Player(Windows) by default.
4. Type the required agent value in the Value box.
5. Click Set. The new user agent takes effect from the next playback.

2.3.2.1.4 Setting the proxy


The Sample Player application allows you to set the proxy according to
your requirements.

To set the proxy:


1. Click Tab-2.
2. Select Proxy settings.
3. Type the required agent name in the Host box.
4. Type the required agent value in the Port box.
5. Click Set. The new proxy settings take effect from the next
playback.

2.3.2.1.5 HTTP Gzip support


The Sample Player application allows you to enable or disable the support
of the GZIP format.

To enable or disable GZIP support:


1. Click Tab-2.
2. Select HTTP gzip request or not as needed.
The HTTP gzip support takes effect from the next playback.

2.3.2.1.6 Set the aspect ratio


The Sample Player application allows you to set the aspect ratio as
needed.

OnStream MediaPlayer+ User Guide 109


VisualOn
Chapter 2: Sample Player

To set the aspect ratio:


In Tab-1, select the required ratio from the Aspect ratio list, as shown in
Figure 62.

Figure 62. Set the aspect ratio

2.3.2.1.7 Opening media source


Media source can be opened in either Sync or Async mode.
• Sync mode: Opening the media source in sync mode causes the
client application to block until the open method completes or
returns.
• Async mode: In Async mode, the API call returns immediately, and
the client application is not blocked waiting for the media source to
be opened. The client application can then wait for an event to
indicate that the media source was opened successfully before
starting the media playback.
To activate the asynchronous option, select Async in Tab-1.

2.3.2.2 Configurable UI
When the mouse is over the video screen, the configurable UI appears.
The configurable UI includes a shared Start/Pause button, a seek bar, the
volume adjustment, and a FullScreen icon, as shown in Figure 63.

Figure 63. Example of configurable UI

110 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

For more information about configurable UI, refer to the OnStream


MediaPlayer+ Plugin UI-Control API Reference document in your
installation package.

2.3.2.3 Playback controls


During playback, the Sample Player application provides a set of basic
controls, including a Play button, a Pause button, and a Stop button, as
shown in Figure 64.

Figure 64. Playback control buttons

2.3.2.3.1 Starting the playback


After initializing the SDK and selecting the media source, click Play to start
the playback. See 2.3.2.1.1 Selecting the media source for details.

2.3.2.3.2 Pausing the playback


During playback, click Pause to stop playing the media temporarily. Click
Play to resume the playback.

2.3.2.3.3 Stopping the playback


During playback, click Stop to stop playing the media.

2.3.2.4 Display mode controls


Full-screen mode makes videos fill the entire screen when you play them.

To play the video full screen:


1. In Tab-1, click Full or the View full screen icon in the lower right
corner of the player, as shown in Figure 65.

Note: You might need to resize the window to expose the FullScreen button.

OnStream MediaPlayer+ User Guide 111


VisualOn
Chapter 2: Sample Player

Figure 65. View full screen button

2. To quit the full-screen mode, press Esc on the keyboard or the Exit
full screen icon in the lower right corner.
2.3.2.5 Sound control
You have several options for controlling volume in the Sample Player,
including adjusting the volume level, muting, or unmuting.

To adjust the volume level, in Tab-1, type the percent number in the
Volume box, and then click Set. The value should be any number from 0 to
100.

In Tab-1, click Mute to mute the volume. To restore the audio, click Mute
again.

2.3.2.6 Asset property selections


If the media source includes multiple video tracks (also known as bitrate),
audio tracks, or subtitles, the Sample Player application supports switching
within various tracks during the playback.

The Sample Player provides a set of buttons to support the property


switches, as shown in Figure 66.

112 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

Figure 66. Property switches buttons

2.3.2.6.1 Selecting audios


To select the audio,
1. In Tab-1, click Audio, and then select the required audio track from
the audio list menu.
2. Click Commit.

2.3.2.6.2 Setting the preferred audio language


Set your preferred language for the audio track.
1. In Tab-2, type your preference in the Preferred audio language box.

Note: Type the abbreviated language code that complies with the iso639-2
standard.

2. Click Set.

2.3.2.6.3 Selecting videos


To select the video,
1. In Tab-1, click Video, and then select the required video track from
the video list menu, as shown in Figure 67.

Figure 67. Switch the video

2. Click Commit.

2.3.2.6.4 Selecting subtitle tracks


To select the subtitle,
1. In Tab-1, click Subtitle, and then select the required subtitle from the
subtitle list menu.
2. Click Commit.

OnStream MediaPlayer+ User Guide 113


VisualOn
Chapter 2: Sample Player

2.3.2.6.5 Setting external subtitle path


The Sample Player allows you to optionally select an external subtitle
source (for example, CEA 608, CEA 708, SRT, and SMI) for Closed Captions
or subtitles rendering. You can set the directory for storing external subtitles.
Refer to setSubtitlePath(String filePath) for API related information.

To specify the directory for an external subtitle file:


1. In Tab-2, input the directory path in the Subtitle path: textbox.
2. Click Set.

2.3.2.6.6 Displaying subtitles


The OSMP+ player enables you to turn on or turn off the subtitle display
during the playback. To enable or disable the subtitle display, in FCC-1,
click Subtitle(Enable subtitle presentation).

The subtitle settings support the following attributes. Refer to Table 8 for the
attribute explanations and the corresponding API information.

Note: Some of subtitle attributes need to be configured in FCC-2 tab.

• Enable subtitle auto adjustment


• Enable default settings
• Reset subtitle settings
• Enable subtitle bounding box
 Set font top percent
 Set font left percent
 Set font bottom percent
 Set font right percent
• Enable subtitle gravity
• Enable font size
• Enable font color opacity
• Enable font color list
• Enable background color opacity
• Enable background color list
• Enable edge color opacity
• Enable edge color list
• Enable edge type list
• Enable font list
• Enable window background color opacity

114 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

• Enable window background color list


• Enable underline font
• Enable bold font
• Enable italic font

2.3.2.6.7 Setting the preferred subtitle language


Set your preferred language for the subtitle.
1. In Tab-2, type your preference in the Preferred subtitle language
box.

Note: Type the abbreviated language code that complies with the iso639-2
standard.

2. Click Set.
2.3.2.7 Displaying Closed Captions
The Sample Player application demonstrates the built-in SDK handling of
Closed Captions and subtitles rendering. CC data appears on the video
screen if it exists, as shown in Figure 68.

Figure 68. Example of Closed Captions

2.3.2.8 Getting DRM library version


The Sample Player allows you to get the DRM library version number.
1. In Tab-1, click Get next to the DRM library version box.
2.3.2.9 Getting the Device unique ID
The Sample Player allows you to get the unique ID.
1. In Tab-1, click Get next to the Device unique ID box.

OnStream MediaPlayer+ User Guide 115


VisualOn
Chapter 2: Sample Player

2.3.2.10 updating the media source


During playback, you can use the update source URL function to balance
the workload within media servers. This feature is specific for the
optimization for content delivery network (CDN) delivery.

Notes: The previous URL will be expired a few seconds after the new URL is
activated. Master manifest, sub-manifest, and TS chunks of new URL must be
exactly same with the previous media file.

To update the source URL address:


1. Click Tab-2.
2. Type the required media URL address into the Update source URL
box, as shown in Figure 69.

Figure 69. Update the media source

3. Select the required option.


 After open: Update the media source path after opening the
playback.
 Assets change: Update the media source path after changing
any of the asset proprieties.
 Seek: Update the media source path after performing the seek
operation.
 Before close: Update the media source path before closing the
playback.
 After pause: Update the media source path after performing the
pause operation.
 After BA: Update the media source path after the bitrate of the
current playback is changed automatically.
4. Click Update.

2.3.2.11 Current UTC time


This window displays the current UTC time as defined by the #EXT-X-
PROGRAM-DATE-TIME HLS tag, as shown in Figure 70.

116 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

Figure 70. UTC time

If #EXT-X-PROGRAM-DATE-TIME is not supported, the message


"getUTCPosition return -1" appears or the UTC time remains frozen in 1970.

2.3.2.12 Download status & valid buffer duration


The OSMP+ player enables to display the download status and valid buffer
in the Logs area. To display the status, click Tab-2, and then select
Download status & valid buffer duration.

2.3.2.13 Offset
The offset value defines the starting playback position for the next stream
playback. The OSMP+ player allows you to set the offset in milliseconds. For
example, if the offset is set to 10 seconds, the player plays the next stream
from the scene where the timestamp is 10 seconds.

Note: The offset feature only applies to the VoD links, other than the Live links.

To set the offset:


1. Click Tab-1.
2. Type the required offset value into the Offset box.
3. Click Set.

2.3.2.14 Enter NTS


The OSMP+ player provides the Enter Network Time Shifting (NTS) feature to
test resuming playback from the pause point, rather than the live point.

The Enter NTS feature requires the collaboration within the streaming server,
application, and OSMP+ SDK. Streaming server should create the NTS
stream once the user pause live stream playback, and notify the
application of the new URL of NTS stream.

The application should call OSMP+ SDK API to switch to NTS stream once
the user resumes playback (after perform the pause operation for a while).
Also the application should call OSMP+ SDK API to switch back to Live
stream once the user catches up with the Live content (typically after a
seek operation).

The requirements to use this features are:


• The streams support #EXT-X-PROGRAM-DATE-TIME HLS

OnStream MediaPlayer+ User Guide 117


VisualOn
Chapter 2: Sample Player

• The playlist of the live stream at the time of pause and the playlist of
the NTS stream at the time of resume should have the same #EXT-X-
PROGRAM-DATE-TIME HLS value

In other words, there are two streams, a live stream that is paused and a
NTS stream that is resumed. Both streams share the same content.

The Enter NTS feature enables playback of the NTS stream instead of the
live stream when resuming playback. To use this feature, enter the value of
the PROGRAM-DATE-TIME HLS tag (when the live stream was paused) in
the Min pos box. Min Pos needs to be converted into millisecond.

Note: To make the Enter NTS feature work, ensure that the value of
enableLiveStreamingDVRPosition() is set to false.

After clicking EnterNTS, the player starts playback at the HLS Live paused
position using the NTS stream. To verify that the resume operation is
successful, one can check that the UTC time display should not change
more than one second when playback resumes.

To enable the Enter NTS playback:


1. Click Tab-1.
2. In the NTS Stream box, type the URL address of the NTS stream that
shares the same content with the live stream being played.
3. Convert the UTC time to unix timestamp, and then type this
converted unix timestamp in the Min pos box, as shown in Figure 71.
The unit of Min pos is millisecond.
Refer to 2.3.2.11 Current UTC time for details about how to get the
UTC time.

Figure 71. Enable Enter NTS

4. Click EnterNTS.

2.3.2.15 Enabling log


During the playback, the OSMP+ player allows to you to enable the log.

Note: This feature only applies to the debug version, other than the release
version.

To enable the log:


1. Click Tab-1.

118 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

2. Select Enable logs.

2.3.2.16 Enabling time info


After the log display is enabled, the OSMP+ player allows you to display
the time information in the show log area.

To enable the time info:


1. Click Tab-1.
2. Select Enable logs to show the Time info option.
3. Select Time info.
2.3.2.17 Enabling audio stream
The OSMP+ player allows you to enable or disable the audio during the
playback, if the stream being played has both the audio and video
streams.

To enable the playback of audio stream:


1. Click Tab-2.
2. Select Enable audio stream.
2.3.2.18 Set preference
The OSMP+ player allows user to set the preference of playback. Select Set
preferences in Tab-3 to enable the following options. Refer to
setPreference() for API related information.

2.3.2.18.1 Stop keep last frame


During the transition from live channel to NTS media, the OSMP+ player
keeps the last frame of the live channel being played until the first frame of
NTS media is played, when the Stop keep last frame option is turned off. In
the meantime, the OSMP+ player keeps the screen black when stopping
or closing any playback.

2.3.2.18.2 Select Audio Switch Immediately


When the Select Audio Switch Immediately options is turned off, the
OSMP+ player continues playing the previous content and then switches
to the selected audio track when the previous playback is complete. This
option is turned on by default.

OnStream MediaPlayer+ User Guide 119


VisualOn
Chapter 2: Sample Player

2.3.2.2.18.3 Use IPV4 as prior


When the Use IPV4 as prioroption is selected, the OSMP+ SDK will use IPV6
as the preferred connection type at first then switch to IPV4 if IPV6 does
not work, and vice versa. To access this option, select Tab-3 > Use IPV4 as
prior.
Refer to the following functions in API Reference Manual for more
information. VO_OSMP_PREF_CONNECTION_IPV6_PRIOR is the default
value.
• VO_OSMP_PREF_CONNECTION_IPV4_PRIOR
• VO_OSMP_PREF_CONNECTION_IPV6_PRIOR
2.3.3.19 Cookies management
You can view or clear cookies in your sample player by modifying the
basePlayer.js file that is under \Sample\SamplePlayer\player-js\ of your
plug-ins package.

To set cookies, change the value of headerName in basePlayer.js to a


string. For example:
• For http links: the value should be cookie name=Test;
domain=visualon.com; path=/; expires=2147483647;
• For https links: the value should be cookie name=Test;
domain=visualon.com; path=/; expires=2147483647;
secure=false;
To clear cookies, set the value of headerName in basePlayer.js to void.

2.3.2.20 Retry times


In Tab-1, input a number to set the player retries times when server has no
response, and then clicks Set.

3.3.2.21 Exiting the application


When the media playback is complete, the Sample Player application
automatically stops the media pipeline. Use the Close icon of your Internet
Explorer to exit the Sample Player.

2.3.3 Sample This section describes the use of the Sample Player application integrated
player usage with the SDK. The Sample Player application implements a fully integrated
(Mac OS) media player with the following features:
• Select the media source
• Select the subtitle source
• Select the option of opening the media source, including
Synchronous and Asynchronous
• Set the preferred audio and subtitle languages
• Control the playback through buttons

120 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

• Control the sound volume and mute the sound


• Support the Closed Captions and subtitle rendering
• Configure the asset properties
2.3.3.1 Initial view
The initial view of the Sample Player application provides users with an
interface to select media sources, subtitle sources, and asset properties.

2.3.3.1.1 Selecting the media source


The Sample Player application allows you to select the media source,
including video sources and audio sources. For information about the
supported media formats, refer to 1.1 OSMP+ overview1.1 OSMP+
overview.

To select the media source:


1. In Tab-1, type the required URL address in the Play URL box.
 Type the URL address starting with http:// or rtsp:// to play
streaming resources on Internet
 Type the local directory path like C:\ to play local files
2. Click Play to start the playback.

Note: For details about how to initialize the SDK, open the media source, and
start the playback, refer to section 4 and section 5 in the OnStream
MediaPlayer+ Player SDK Integration Guide for iOS.

2.3.3.1.2 Selecting a license file


Setting a license is optional. To set the license:
1. Click Tab-2.
2. Type the required file path in the License file box.
3. Click Set. The default license file path is
C:\ProgramData\VisualOn\BrowserPlugin\voVidDec.dat.
Renewing a license file or the use of additional features may require
additional license files.

4. The new license file takes effect from the next playback.

2.3.3.1.3 Setting the user agent


The Sample Player application allows you to set the user agent according
to your requirements.

To set the user agent:


1. Click Tab-2.
2. Select User agent settings.

OnStream MediaPlayer+ User Guide 121


VisualOn
Chapter 2: Sample Player

3. Type the agent name in the Name box as needed. This value is set
to VisualOn OSMP+ Player(MacOS) by default.
4. Type the required agent value in the Value box.
5. Click Set. The new user agent takes effect from the next playback.

2.3.3.1.4 Setting the proxy


The Sample Player application allows you to set the proxy according to
your requirements.

To set the proxy:


1. Click Tab-2.
2. Select Proxy settings.
3. Type the required host name in the Host box.
4. Type the required port number in the Port box.
5. Click Set. The new proxy settings take effect from the next
playback.

2.3.3.1.5 HTTP gzip support


The Sample Player application allows you to enable or disable the support
of the GZIP format.

To enable or disable GZIP support:


1. Click Tab-2.
2. Select HTTP gip Request or not as needed.
The HTTP gzip support takes effect from the next playback.

2.3.3.1.6 Setting the aspect ratio

The Sample Player application allows you to set the aspect ratio as
needed.

To set the aspect ratio, in Tab-1, select the required ratio from the Aspect
ratio list menu.

2.3.3.1.7 Opening media source


Media source can be opened in either Sync or Async mode. Opening the
media source in sync mode causes the client application to block until the
open method completes or returns. In Async mode however, the API call
returns immediately, and the client application is not blocked waiting for
the media source to be opened. The client application can then wait for
an event to indicate that the media source was opened successfully
before starting the media playback.

To activate the asynchronous option, select Async in Tab-1.

122 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

2.3.3.2 Playback controls


During playback, the Sample Player application provides a set of basic
controls, including a Play button, a Pause button, and a Stop button, as
shown in Figure 72.

Figure 72. Playback control buttons

2.3.3.2.1 Starting the playback


After initializing the SDK and selecting the media source, click Play to start
the playback. See 2.3.3.1.1 Selecting the media source for details.

2.3.3.2.2 Pausing the playback


During playback, click Pause to stop playing the media temporarily. Click
Play to resume playback.

2.3.3.2.3 Stopping the playback


During playback, click Stop to stop playing the media.

2.3.3.3 Display mode controls


Full-screen mode makes videos fill the entire screen when you play them.
To play the video full screen:
1. Click Full on the video screen, as shown in Figure 73.

OnStream MediaPlayer+ User Guide 123


VisualOn
Chapter 2: Sample Player

Figure 73. View full screen button

2. To quit the full-screen mode, press Esc on the keyboard or click


Normal.
2.3.3.4 Sound control
You have several options for controlling the volume in the Sample Player,
including adjusting the volume level and muting the sound.

To adjust the volume level, type the percent number in the Volume box,
and then click Set. The value should be any number from 0 to 100.

Click Mute to mute the volume, as shown in Figure 74.

Figure 74. Sound control buttons

2.3.3.5 Asset property selections


If the media source includes multiple video tracks (also known as bitrate),
audio tracks, or subtitles, the Sample Player application supports switching
within various tracks during the playback.

The Sample Player provides a set of buttons to support the property


switches, as shown in Figure 75.

124 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

Figure 75. Property switches buttons

2.3.3.5.1 Selecting the audio


To select the audio,
1. In Tab-1, click Audio, and then select the required audio track from
the audio list menu.
2. Click Commit.

2.3.3.5.2 Setting the preferred audio language


Set your preferred language for the audio track.
1. In Tab-2, type your preference in the Preferred audio language box.

Note: Type the abbreviated language code that complies with the iso639-2
standard.

2. Click Set.

2.3.3.5.3 Selecting the video


To select the video,
1. In Tab-1, click Video, and then select the required video track from
the video list menu.
2. Click Commit.

2.3.3.5.4 Selecting the subtitle


To select the subtitle,
1. In Tab-1, click Subtitle, and then select the required subtitle from the
subtitle list menu.
2. Click Commit.

OnStream MediaPlayer+ User Guide 125


VisualOn
Chapter 2: Sample Player

2.3.3.5.5 Setting external subtitle path


The Sample Player allows you to optionally select an external subtitle
source (for example, CEA 608, CEA 708, SRT, and SMI) for Closed Captions
or subtitles rendering. You can set the directory for storing external subtitles.
Refer to setSubtitlePath(String filePath) for API related information.

To specify the directory for an external subtitle file:


1. In Tab-2, input the directory path in the Subtitle path: textbox.
2. Click Set.

2.3.3.5.6 Displaying the subtitle


The OSMP+ player enables to you turn on or turn off the subtitle display
during the playback. To enable the subtitle display, in FCC-1, click
Subtitle(Enable subtitle presentation).

The subtitle settings include the following attributes. Refer to Table 8 for the
attribute explanations and the corresponding API information.

Note: Some of subtitle attributes needs to be configured in FCC-2 tab.

• Enable subtitle auto adjustment


• Enable default settings
• Reset subtitle settings
• Enable subtitle bounding box
 Set font top percent
 Set font left percent
 Set font bottom percent
 Set font right percent
• Enable subtitle gravity
• Enable font size
• Enable font color opacity
• Enable font color list
• Enable background color opacity
• Enable background color list
• Enable edge color opacity
• Enable edge color list
• Enable edge type list
• Enable font list
• Enable window background color opacity

126 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

• Enable window background color list


• Enable underline font
• Enable bold font
• Enable italic font

2.3.3.5.6 Setting the preferred subtitle language


Set your preferred language for the subtitle.
1. In Tab-2, type your preference in the Preferred subtitle language
box.

Note: Type the abbreviated language code that complies with the iso639-2
standard.

2. Click Set.

2.3.3.6 Displaying Closed Captions


The Sample Player application demonstrates the built-in SDK handling of
Closed Captions and subtitles rendering. CC data appears on the video
screen if it exists.

2.3.3.7 Getting DRM library version


The Sample Player allows you to get the DRM library version number.
1. In Tab-1, click Get next to the DRM library version: box.
2.3.3.8 Getting the Device unique ID
The Sample Player allows you to get the Device unique ID.
1. In Tab-1, click Get next to the Device unique ID: box.
2.3.3.9 Updating the media source
During the playback, you can select the same media source from the
backup location by using the update source URL function. This feature is
specific for the optimization for content delivery network (CDN) delivery.

Note: The previous URL will be expired a few seconds after the new URL is
activated. Master manifest, sub-manifest, and TS chunks of new URL must be
exactly same with the previous media file.

To update the source URL address:


1. Click Tab-2.
2. Type the required media URL address into the Update source URL
box, as shown in Figure 76.

OnStream MediaPlayer+ User Guide 127


VisualOn
Chapter 2: Sample Player

Figure 76. Update the media source

3. Select the required option.


 After open: Update the media source path after opening the
playback.
 Assets change: Update the media source path after changing
any of the asset proprieties.
 Seek: Update the media source path after performing the seek
operation.
 Before close: Update the media source path before closing the
playback.
 After pause: Update the media source path after performing the
pause operation.
 After BA: Update the media source path after the bitrate of the
current playback is changed automatically.
4. Click Update.

2.3.3.10 Current UTC time


This window displays the Current UTC time as defined by the #EXT-X-
PROGRAM-DATE-TIME HLS tag, as shown in Figure 77.

Figure 77. UTC time

If #EXT-X-PROGRAM-DATE-TIME is not supported, the message


"getUTCPosition return -1" appears or the UTC time remains frozen in 1970.

2.3.3.11 Download status & valid buffer duration


The OSMP+ player enables to display the download status and valid buffer
in the show log area. To display the status, click Tab-2, and then select
Download status & valid buffer duration.

2.3.3.12 Offset
The offset value defines the starting playback position for the next stream
playback. The OSMP+ player allows you to set the offset in milliseconds. For

128 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

example, if the offset is set to 10 seconds, the player plays the next stream
from the scene where the timestamp is 10 seconds.

Note: The offset feature only applies to the VoD links, other than the Live links.

To set the offset:


1. Click Tab-1.
2. Type the required offset value into the Offset box.
3. Click Set.

2.3.3.13 Enter NTS


The OSMP+ player provides the Enter Network Time Shifting (NTS) feature to
test resuming playback from the pause point, rather than the live point.

The Enter NTS feature requires the collaboration within the streaming server,
application, and OSMP+ SDK. Streaming server should create the NTS
stream once the user pause live stream playback, and notify the
application of the new URL of NTS stream.

The application should call OSMP+ SDK API to switch to NTS stream once
the user resumes playback (after perform the pause operation for a while).
Also the application should call OSMP+ SDK API to switch back to Live
stream once the user catches up with the Live content (typically after a
seek operation).

The requirements to use this features are:


• The streams support #EXT-X-PROGRAM-DATE-TIME HLS
• The playlist of the live stream at the time of pause and the playlist of
the NTS stream at the time of resume should have the same #EXT-X-
PROGRAM-DATE-TIME HLS value

In other words, there are two streams, a live stream that is paused and a
NTS stream that is resumed. Both streams share the same content.

The Enter NTS feature enables playback of the NTS stream instead of the
live stream when resuming playback. To use this feature, enter the value of
the PROGRAM-DATE-TIME HLS tag (when the live stream was paused) in
the Min pos box. Min Pos needs to be converted into millisecond.

Note: To make the Enter NTS feature work, ensure that the value of
enableLiveStreamingDVRPosition() is set to false.

After clicking EnterNTS, the player starts playback at the HLS Live paused
position using the NTS stream. To verify that the resume operation is
successful, one can check that the UTC time display should not change
more than one second when playback resumes.

OnStream MediaPlayer+ User Guide 129


VisualOn
Chapter 2: Sample Player

To enable the Enter NTS playback:


1. Click Tab-1.
2. In the NTS Stream box, type the URL address of the NTS stream that
shares the same content with the live stream being played.
3. Convert the UTC time to unix timestamp, and then type this
converted unix timestamp in the Min pos box, as shown in Figure 78.
The unit of Min pos is millisecond.
Refer to 2.3.3.10 Current UTC time for details about how to get the
UTC time.

Figure 78. Enable Enter NTS

4. Click EnterNTS.

2.3.3.14 Enabling log


During the playback, the OSMP+ player allows to you to enable the log.

Note: This feature only applies to the debug version, other than the release
version.

To enable the log:


1. Click Tab-1.
2. Select Enable Logs.
2.3.3.15 Enabling time info
After the log display is enabled, the OSMP+ player allows you to display
the time information in the Logs area.

To enable the time info:


1. Click Tab-1.
2. Select Enable Logs to show the Time info option.
3. Select Time info.
2.3.3.16 Enabling audio stream
The OSMP+ player allows you to enable or disable the audio during the
playback, if the stream being played has both the audio and video
streams.

130 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

To enable the playback of audio stream:


1. Click Tab-2.
2. Select Enable audio stream.

2.3.3.17 Cookies management


You can view or clear cookies in your sample player by modifying the
basePlayer.js file that is under \Sample\SamplePlayer\player-js\ of your
plug-ins package.

To set cookies, change the value of headerName in basePlayer.js to a


string. For example:
• For http links: the value should be cookie name=Test;
domain=visualon.com; path=/; expires=2147483647;
• For https links: the value should be cookie name=Test;
domain=visualon.com; path=/; expires=2147483647;
secure=false;
To clear cookies, set the value of headerName in basePlayer.js to void.

2.3.2.18 Set preference


The OSMP+ player allows user to set the preference of playback. Select Set
preferences in Tab-3 to enable the following options. Refer to
setPreference() for API related information.

2.3.2.18.1 Stop keep last frame


During the transition from live channel to NTS media, the OSMP+ player
keeps the last frame of the live channel being played until the first frame of
NTS media is played, when the Stop keep last frame option is turned off. In
the meantime, the OSMP+ player keeps the screen black when stopping
or closing any playback.

2.3.2.18.2 Select Audio Switch Immediately


When the Select Audio Switch Immediately options is turned off, the
OSMP+ player continues playing the previous content and then switches
to the selected audio track when the previous playback is complete. This
option is turned on by default.

2.3.2.2.18.3 Use IPV4 as prior


When the Use IPV4 as prior option is selected, the OSMP+ SDK will use IPV6
as the preferred connection type at first then switch to IPV4 if IPV6 does
not work, and vice versa. To access this option, select Tab-3 > Use IPV4 as
prior.
Refer to the following functions in API Reference Manual for more
information. VO_OSMP_PREF_CONNECTION_IPV6_PRIOR is the default
value.
• VO_OSMP_PREF_CONNECTION_IPV4_PRIOR

OnStream MediaPlayer+ User Guide 131


VisualOn
Chapter 2: Sample Player

• VO_OSMP_PREF_CONNECTION_IPV6_PRIOR
2.3.2.19 Retry times
In Tab-1, input a number to set the player retries times when server has no
response, and then clicks Set.

2.3.3.20 Exiting the application


When the media playback is complete, the Sample Player application
automatically stops the media pipeline. Use the Close icon of your Internet
Explorer to exit the Sample Player.

2.4 Windows Phone

2.4.1 Installation To install the Sample Player on a Windows phone, ensure that you have
and registered the Windows phone by using the Windows Phone Developer
uninstallation Registration Tool. To register your Windows phone:
1. Turn on your phone and unlock the phone screen.

Note: Ensure that the date and time on your phone are correct.

2. Connect your phone to your computer with a USB cable that


comes with your phone.
3. In Microsoft Visual Studio 2013, select Tools > Windows Phone 8.1 >
Developer Unlock.
4. The Developer Phone Registration dialog appears, as shown in
Figure 79. Ensure that the Status message displays Identified
Windows Phone 8 device.
If your phone is already registered, the Status message indicates this
and you see a Unregister button.

Figure 79. Windows Phone Developer Registration

132 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

5. Click Register.
6. Type your Microsoft developer account and password in the Sign In
dialog, and then click Sign In.
After your phone is successfully registered, the Status message
displays Congratulations! You have successfully unlocked your
Windows Phone.

After registering the Windows phone, install the Sample Player on the
Windows phone:

Note: Ensure that you uninstall the Sample Player prior to the upgrade if you have
a sample player previously installed on your Windows phone.

1. Connect the device to the computer with a USB cable.


2. Open Microsoft Visual Studio 2013, select Tools > Windows Phone 8.1
> Application Deployment.
3. Browse to select VisualOnASamplePlayer_release.appx, and then
click Deploy.
4. The installation is automatically running in the background. Then the
Sample Player application can be explored under Applications on
the device.

To uninstall the Sample Player on a Windows phone, press and hold the
Sample Player application, and then select Uninstall from the context
menu.

2.4.2 Opening Media source can be opened in either Sync or Async mode. The Sample
media source Player uses Async mode by default. For sample code of opening media
source, refer to 3.4.3 Opening media source.
• Sync mode: Opening the media source in sync mode causes the
client application to block until the open method completes or
returns.
• Async mode: In Async mode, the API call returns immediately, and
the client application is not blocked waiting for the media source to
be opened. The client application can then wait for an event to
indicate that the media source was opened successfully before
starting the media playback.

2.4.3 The initial view allows you to select the media source for playback. You
Selecting/Playin can type the media source path manually or select from a list of media
g media source source listed in a text file.

OnStream MediaPlayer+ User Guide 133


VisualOn
Chapter 2: Sample Player

To manually type a media file or link:


1. In the initial view, type the full URL starting with http:// or file path to
the media source in the Input streaming URL address or file path text
box.
2. Tap Play.

Alternately, a list of media files and links can be supplied to the Sample
Player through a text file. The text list must be saved to /sdcard/url.txt, with
each link URL and file path separated by line. To supply the media text file
into a Windows phone:
1. Download and install IsoStoreSpy.
2. Open IsoStoreSpy, and then click WP Application.
3. In the Choose an application dialog, select Device from the <select
a device> list box.

4. In the Files section, click the upload button .


5. Browse to select the url.txt file, and then click OK. You can add the
playback url addresses in the url.txt file if needed.

To select a media file or link from url.txt in the Sample Player:


1. In the initial view, tap Select to display the media file list.
2. Select the required media source.
3. Tap Play.

2.4.4 Playback 3.4.4.1 Enabling/disabling deblock


options Deblocking is a feature applied to decoded compressed video to improve
visual quality and prediction performance by smoothing the sharp edges
which can form between macroblocks when block coding techniques are
used.

Enabling deblock helps improve the playback quality, especially when the
video has mosaic. Tap Set to enable deblock function from Options to
enable the deblock feature. Refer to enableDeblock() for API related
information.

2.4.4.2 Setting buffering time


The OSMP+ player allows you to set the buffering time of the source to be
played.

2.4.4.2.1 Max Buffering Time


Refer to setMaxBufferingTime() for API related information.

To set the maximum time of source buffer:


1. Tap Max Buffering Time from Options.

134 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

2. Type the number to set the maximum buffering time in milliseconds.


3. Tap OK.

2.4.4.2.2 Initial Buffering Time


Turn on Initial Buffering Time option to set the buffering time of the source
in milliseconds before the playback starts. Refer to setInitialBufferingTime()
for API related information.

To enable the initial buffering time of source buffer:


1. Tap Initial Buffering Time from Options.
2. Type the number to set the initial buffering time in milliseconds.
3. Tap OK.

2.4.4.2.3 Playback Buffering Time


When re-buffering is needed during playback, the player enables you to
set the buffering time with the Playback Buffering Time option. Refer to
setPlaybackBuferingTime() for API related information.

To set the re-buffering time:


1. Tap Playback Buffering Time from Options.
2. Type the number to set the time in milliseconds.
3. Tap OK.

2.4.4.3 Enabling CPU Adaptation


The Bitrate Adaptation of Sample Player subjects to setting that is
hardcoded in the player if CPU Adaptation is enabled.

To enable CPU Adaptation, tap Enable CPU adaptation from Options.


Refer to enableCPUAdaptation() for API related information.

2.4.4.4 Subtitle settings


Tap Options, and then tap Set to enable subtitle settings to enable or
disable subtitle settings.

Table 10 lists the available subtitle attributes that can be set in the OSMP+
player and their related API s.
Table 10. Subtitle attributes and related APIs

Attribute Definition API

Enable/disable subtitles display.


Enable Subtitle enableSubtitle()
Disabled is set by default.

OnStream MediaPlayer+ User Guide 135


VisualOn
Chapter 2: Sample Player

Attribute Definition API

Use the subtitle settings from


Enable Default Settings N/A
source stream

Reset all parameters to the


Reset Subtitle Settings default values that are specified resetSubtitleParameter()
in source stream.

Enable Font size Set subtitle font size scale. setSubtitleFontSizeScale()

Enable Font Color Set subtitle font color opacity


setSubtitleFontOpacity()
Opacity rate.

Enable Font Color List Set subtitle font color. setSubtitleFontColor()

Enable Background Set subtitle font background


setSubtitleFontBackgroundOpacity()
Color Opacity color opacity rate.

Enable Background Set subtitle font background


setSubtitleFontBackgroundColor()
Color List color.

Enable Edge Color Set subtitle font edge color


setSubtitleFontEdgeOpacity()
Opacity opacity rate.

Enable Edge Color List Set subtitle font edge color.


setSubtitleFontEdgeColor()

Enable Edge Type List Set subtitle font edge type. setSubtitleFontEdgeType()

Enable Font List Set subtitle font name. setSubtitleFontName()

Enable Window Set window background color setSubtitleWindowBackgroundOpacity()


Background Color opacity rate.
Opacity

Enable Window setSubtitleWindowBackgroundColor()


Set window background color.
Background Color List

Enable Underline Font Enable or disable the underline


setSubtitleFontUnderline()
font for subtitle.

Enable Bold Font Enable or disable the bold font


setSubtitleFontBold()
for subtitle.

Enable Italic Font Enable or disable the italic font


setSubtitleFontItalic()
for subtitle.

136 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 2: Sample Player

2.4.4.5 Setting bitrate range


Tap Options, and then tap Set bitrate range (kbps) to enable or disable
the bitrate range settings. Refer to setBitrateThreshold for API related
information. Refer to setBitrateThreshold() for API related information.

Tap Lower Bound Bitrate Range/Upper Bound Bitrate Range, type the
number for lower and upper bound bitrate range, and then tap OK.

2.4.4.6 Setting presentation delay time


The OSMP+ player provides the Presentation delay time option for HLS and
Smooth Streaming, to allow user downloading chunks with some seconds
of delay that is defined by this option. Refer to setPresentationDelay() for
API related information.

2.4.4.7 HTTP settings


2.4.4.7.1 Enabling HTTP Retry Timeout
Tap Options, and then tap Enable set HTTP connection retry timeout. to
enable the retry timeout function. Refer to setHTTPRetryTimeout() for API
related information.

Tap HTTP Retry Timeout, and then type a number to set the player retry
times when server has no response.

2.4.4.7.2 Enabling HTTP Gzip Request


HTTP data is compressed before it is sent from the server: compliant
browsers will announce what methods are supported to the server before
downloading the correct format; browsers that do not support compliant
compression method will download uncompressed data. Gzip is one of
the most common compression schemes. Refer to
enableHTTPGzipRequest() for API related information.

Tap Options, and then tap Enable or disable sending HTTP request with
gzip to enable or disable the support of the GZIP format.

2.4.4.7.3 Setting HTTP proxy


To set the HTTP proxy server:
1. Tap Options, and then tap Set the HTTP proxy.
2. Top HTTP Proxy Host, type the host sever, and then tap OK.
3. Tap HTTP Proxy Port, type the host sever, and then tap OK.

2.4.4.8 Setting default audio language


Tap Options, and then tap Default Audio to enable or disable the Default
Audio settings. Refer to setPreferredAudioLanguage for API related
information. See Question 8 in 6.1 Frequently Asked Questions for the
supported language code for setPreferredAudioLanguage.

OnStream MediaPlayer+ User Guide 137


VisualOn
Chapter 2: Sample Player

2.4.5 Switching If the media source includes multiple video tracks (also known as bitrate),
Asset properties audio tracks, or subtitles, the Sample Player application supports switching
properties during the playback.

To switch properties:
1. Tap Asset on the bottom of the video screen to display the Asset
menu.
2. Tap the required video, audio, and/or subtitle track.
3. Tap Commit to confirm your selection. Playback continues with your
selection.
2.4.6 Capturing Follow the instructions to obtain your log file on Windows Phone 8.1:
log
Note: The logging system is only enabled in the debug version. The difference
between debug and release versions, is that the debug version can output the
log information in different levels with various detailed information.

1. Open IsoStoreSpy.

2. Click the upload button , and then browse to select volog.cfg.


3. Logs are generated and save in the volog.log file located under the
same directory with volog.cfg.

138 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 3: OSMP+ Integration

Chapter 3 OSMP+ Integration

This chapter presents the following topics:

3.1 Integration on Android ................................................................................140

3.2 Integration on iOS.........................................................................................148

3.3 Integration on Windows and Mac OS .......................................................158

3.4 Integration on Windows Phone ..................................................................159

3.5 Best practices................................................................................................164

OnStream MediaPlayer+ User Guide 139


VisualOn
Chapter 3: OSMP+ Integration

3.1 Integration on Android


Follow the instructions below to complete the OSMP+ integration on the
Android platform.

The integration Labs, which are compressed into the labs.zip file under Doc
of your installation package, provide working examples to accompany
the OSMP+ Player SDK Integration Guide for Android Platforms. The
integration Labs focus on individual integration topics and require
installation of the SDK and license file. Start with README.txt compressed in
the labs.zip file to learn how to use Labs.

3.1.1 Preparing Decompress the Android package, and you see the following directory
SDK files structure under Android of your installation directory.
• Bin
• Doc
• Jar
• Libs
• Libs_x86
• License
• SamplePlayer

Follow these steps to complete the prerequisites for importing the SDK
libraries:
1. Create the libs directory under the SamplePlayer directory, if the
SamplePlayer directory does not include the libs directory already.
2. Copy all .jar files (Java SDK libraries) to libs.
If you want to use the debug version to import logs, copy all .jar files
under Jar\debug to libs and copy all .so files under Libs\debug to
the folder created in step 3.
3. Create a directory named armeabi under libs.
Or
If you use x86, create a directory named x86 under libs.
4. Copy all .so files (C/C++ shared libraries) to armeabi.
Or
Copy all .so files (C/C++ shared libraries) to x86.
5. Create a directory named assets under SamplePlayer, if it does not
exist already, and then copy the license file, voVidDec.dat to assets.
To use the OSMP+ SDK, add the following sample codes to import Java
SDK libraries.

140 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 3: OSMP+ Integration

import com.visualon.OSMPPlayer.*;
import com.visualon.OSMPPlayerImpl.*;

Table 11 describes the Java libraries used in OSMP+.

Table 11. Java libraries

Package Commonly used Interfaces and classes

• VOCommonPlayer
• VOCommonPlayerAssetSelection
• VOCommonPlayerConfiguration
• VOCommonPlayerControl
• VOCommonPlayerDeviceInfo
• VOCommonPlayerHDMI
• VOCommonPlayerHTTPConfiguration
com.visualon.OSMPPlayer • VOCommonPlayerListener
• VOCommonPlayerRTSPConfiguration
• VOCommonPlayerStatus
• VOCommonPlayerSubtitle
• VOOSMPChunkInfo
• VOOSMPInitParam
• VOOSMPType
• VOOSMPVerificationInfo

• VOCommonPlayerHDMIImpl
• VOCommonPlayerImpl
• VOOSMPAssetIndexImpl
com.visualon.OSMPPlayerImpl
• VOOSMPAssetPropertyImpl
• VOOSMPEnumUtils
• VOOSMPInitParamImpl

3.1.2 Initializing The SDK instance initialization includes the following:


SDK instance
• Create an instance
• Configure a view
• Define the view size
• Set the license
• Set the event callback

The following is the sample code for initializing an SDK instance.


m_sdkPlayer = new VOCommonPlayerImpl();
// Retrieve location of libraries
String apkPath = getUserPath(this) + "/lib/";
String cfgPath = getUserPath(this) + "/";

OnStream MediaPlayer+ User Guide 141


VisualOn
Chapter 3: OSMP+ Integration

// SDK player engine type


VO_OSMP_PLAYER_ENGINE eEngineType =
VO_OSMP_PLAYER_ENGINE.VO_OSMP_VOME2_PLAYER;
// Initialize SDK player
m_sdkPlayer.init(eEngineType, init);
// Set view
m_sdkPlayer.setView(m_svMain);
// Set surface view size
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
m_sdkPlayer.setViewSize(dm.widthPixels, dm.heightPixels);
// Register SDK event listener
m_sdkPlayer.setOnEventListener(m_listenerEvent);
// Set device capability file location
String capFile = cfgPath + "cap.xml";
m_sdkPlayer.setDeviceCapabilityByFile(capFile);
// Set license content
InputStream is = null;
byte[] b = new byte[32*1024];
try {
is = m_context.getAssets().open("voVidDec.dat");
is.read(b);
is.close();
} catch (IOException e) {
e.printStackTrace();
}
m_sdkPlayer.setLicenseContent(b);

3.1.3 Opening Use VOCommonPlayer.open() to open the media source. See the
media source following for sample codes.
// Auto-detect source format
VO_OSMP_SRC_FORMAT format =
VO_OSMP_SRC_FORMAT.VO_OSMP_SRC_AUTO_DETECT;
// Set source flag to asynchronous
VO_OSMP_SRC_FLAG eSourceFlag;
eSourceFlag = VO_OSMP_SRC_FLAG.VO_OSMP_FLAG_SRC_OPEN_ASYNC;
VOOSMPOpenParam openParam = new VOOSMPOpenParam();
openParam.setDecoderType(VO_OSMP_DECODER_TYPE.VP_OSMP_DEC_VIDEO_SW
.getValue() |
VO_OSMP_DECODER_TYPE.VO_OSMP_DEC_AUDIO_SW.getValue());
//Open media source
m_sdkPlayer.open(m_strVideoPath, eSourceFlag, format, openParam);

3.1.4 Handling Use VOCommonPlayerListener() to handle SDK events. See the following
SDK events for sample codes.
private VOCommonPlayerListener m_ListenerEvent = new
VOCommonPlayerListener(){
// SDK Event Handling
...
public VO_OSMP_RETURN_CODE onVOEvent(VO_OSMP_CB_EVENT_ID nID, int
nParam1, int nParam2, Object obj) {
switch(nID) {
...
Case VO_OSMP_CB_OPEN_FINISHED: {

142 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 3: OSMP+ Integration

if (nParam1 == VO_OSMP_RETURN_CODE.VO_OSMP_ERR_NONE.getValue())
{ // MediaPlayer is opened
VO_OSMP_RETURN_CODE nRet;
// Start (play) media pipeline
mRet = m_sdkPlayer.start();
...
} else {
onError(m_sdkPlayer, nParam1, 0);
}
break;
}
...
}
return VO_OSMP_RETURN_CODE.VO_OSMP_ERR_NONE; }

3.1.5 Starting The OSMP+ player can start the playback either in the Sync mode or in the
playback Async mode. See the following for the source code of opening the source
in Sync mode or in Async mode.

3.1.5.1 Sync
eSourceFlag = VO_OSMP_SRC_FLAG.VO_OSMP_FLAG_SRC_OPEN_SYNC;
m_sdkPlayer.open(...)
m_sdkPlayer.start();

3.1.5.2 Async
eSourceFlag = VO_OSMP_SRC_FLAG.VO_OSMP_FLAG_SRC_OPEN_ASYNC;

m_sdkPlayer.open(...);

The player uses VOCommonPlayer.start() to start playback after opening


the media source. See the following for sample codes.
Case VO_OSMP_CB_OPEN_FINISHED: {
if (nParam1 == VO_OSMP_RETURN_CODE.VO_OSMP_ERR_NONE.getValue())
{ // MediaPlayer is opened
VO_OSMP_RETURN_CODE nRet;
// Start (play) media pipeline
mRet = m_sdkPlayer.start();

3.1.6 Stopping Use VOCommonPlayer.stop() to stop playback. See the following for the
playback sample code for the whole stop function.
m_sdkPlayer.stop();
m_sdkPlayer.close();
m_sdkPlayer.destroy();
m_sdkPlayer = null;

3.1.7 Seeking Use VOCommonPlayer.setPosition() to perform the seeking operation. For


example, m_sdkPlayer.setPosition(60000),in this sample, the unit of time
is millisecond, and the player seeks the position which time is 00:01:00.

See the following for the sample code of the seeking operation.

OnStream MediaPlayer+ User Guide 143


VisualOn
Chapter 3: OSMP+ Integration

public void onStopTrackingTouch(SeekBar arg0)


{
// Calculate new position as percentage of total duration
int iCurrent = arg0.getProgress();
int iMax = arg0.getMax();
long m_nDuration = m_sdkPlayer.getDuration();
long lNewPosition;
if (m_nDuration > 0) {
lNewPosition = iCurrent * m_nDuration / iMax;
}
else {
long nMinPos = m_sdkPlayer.getMinPosition();
long nMaxPos = m_sdkPlayer.getMaxPosition();
int nDuration = (int) (nMaxPos - nMinPos);
lNewPosition = iCurrent * nDuration / iMax;
lNewPosition = lNewPosition + nMinPos;
}
if (m_sdkPlayer != null)
{
Log.v(TAG,"Seek To " + lNewPosition);
m_sdkPlayer.setPosition(lNewPosition); // Set new position
}
}

3.1.8 Selecting If the clip includes multiple tracks, use the


tracks VOCommonPlayer.selectVideo(), VOCommonPlayer.selectAudio(), or
VOCommonPlayer.selectSubtitle()function to select the required track.

Note: Call the VOCommonPlayer.commit() function after calling the selection


functions.

To select a track:
1. Get the number of video tracks by using int count =
m_sdkPlayer.getVideoCount();
2. Use m_sdkPlayer.selectVideo(index) and m_sdkPlayer.commit() to
select the corresponding index of track for playback.
 If the first track is selected, the index value is 0. Increase the index
value in the ascending order. For example, if the second track is
selected, the index value is 1.
 Set the index value to -1, which means to adjust the video track
automatically according to the network bandwidth.

Note: For audio and subtitle selection, the index value cannot be set to
-1. Refer to VOCommonPlayerAssetSelection for the all related functions.

3.1.9 Subtitle Use VOCommonPlayer.enableSubtitle() to enable the subtitle rendering,


rendering and use VOCommonPlayer.setSubtitlePath() to indicate an external file, for
(Optional) example:
m_sdkPlayer.enableSubtitle(true);

144 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 3: OSMP+ Integration

m_sdkPlayer.setSubtitlePath(strSubtitlePath);

Refer to the VOCommonPlayerSubtitle interface for the other subtitle


related functions.

3.1.10 Download OSMP+ supports to download streaming to local disks. Refer to the
Manager VOOSMPStreamingDownloader interface for details.
(Optional)
3.1.10.1 Initializing Download Manager
See the following for the sample code of initializing Download Manager.
m_downloader = new VOOSMPStreamingDownloaderImpl();
String apkPath = CommonFunc.getApkPath(m_context);
VOOSMPStreamingDownloaderInitParam init = new
VOOSMPStreamingDownloaderInitParam();
init.setContext(m_context);
init.setLibraryPath(apkPath);
m_downloader.init(this, init);

3.1.10.2 Download Manager (open media source)


See the following for the sample code for opening the media source in
Download Manager.
m_cDownloader.open( strVideoPath, 0, strLocalDownloadPath);

In the above sample, the strVideoPath is the link address that is to be


downloaded and strLocalDownloadPath is the path that is added into the
local files.

3.1.10.3 Download Manager event


See the following for the sample code of Downloader Manager event.
public VO_OSMP_RETURN_CODE onVOStreamingDownloaderEvent(
VO_OSMP_CB_STREAMING_DOWNLOADER_EVENT_ID event, int
arg1, int arg2,Object obj) {

switch(event){
case
VO_OSMP_CB_STREAMING_DOWNLOADER_SYNC_AUTHENTICATION_DRM_SERVER_INF
O:
// DRM download support
{
VOOSMPVerificationInfo info = new
VOOSMPVerificationInfo();
info.setDataFlag(1);
if(m_verificationString != null)
info.setVerificationString(m_verificationString);
m_downloader.setDRMVerificationInfo(info);
break;
}
case VO_OSMP_CB_STREAMING_DOWNLOADER_OPEN_COMPLETE:
//Select video/audio/subtitle track to download;
m_downloader.selectVideo(index);
m_downloader.commitSelection();

OnStream MediaPlayer+ User Guide 145


VisualOn
Chapter 3: OSMP+ Integration


m_downloader.start();
break;
case VO_OSMP_CB_STREAMING_DOWNLOADER_MANIFEST_OK:
//This is the download local path,it can be play throuth OSMP SDK
now
String localURL = String(obj);
m_sdkPlayer.open(localURL……);
break;

}
}

3.1.10.4 Stopping Download


Use the following functions to stop the download.
m_cDownloader.stop();
m_cDownloader.close();

3.1.11 Hardware Use VOCommonPlayer.open() to specify the hardware decoder type on


acceleration Android. Change the value of param openParam in api open() to use the
(Optional) hardware decoder.

See the following for the sample code for specifying the hardware
decoder type.
VOOSMPOpenParam openParam = new VOOSMPOpenParam();
//use SW
openParam.setDecoderType(VO_OSMP_DECODER_TYPE.VP_OSMP_DEC_VIDEO_SW
.getValue() |
VO_OSMP_DECODER_TYPE.VO_OSMP_DEC_AUDIO_SW.getValue());
//use IOMX
openParam.setDecoderType(VO_OSMP_DECODER_TYPE.VP_OSMP_DEC_VIDEO_IO
MX.getValue() |
VO_OSMP_DECODER_TYPE.VO_OSMP_DEC_AUDIO_IOMX.getValue());
//use MediaCodec
openParam.setDecoderType(VO_OSMP_DECODER_TYPE.VP_OSMP_DEC_VIDEO_ME
DIACODEC.getValue() |
VO_OSMP_DECODER_TYPE.VO_OSMP_DEC_AUDIO_MEDIACODEC.getValue());
//use AutoHW
openParam.setDecoderType(VO_OSMP_DECODER_TYPE.VP_OSMP_DEC_VIDEO_
HARDWARE_AUTO_SELECTED.getValue() |
VO_OSMP_DECODER_TYPE.VO_OSMP_DEC_AUDIO_SW.getValue());

3.1.12 Playback Use VOCommonPlayer.setAudioPlaybackSpeed() to set the speed of


speed audio playback. For example:
(Optional)
m_sdkPlayer.setAudioPlaybackSpeed(2.0);

The value is set to 1.0 by default.

3.1.13 Zoom OSMP+ provides VOCommonPlayer.setZoomMode() to set the zoom


mode, which includes PanScan, FitWindow, Original, LetterBox, and

146 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 3: OSMP+ Integration

ZoomIn. Use voSurfaceView instead of surfaceView to support the


hardware zoom feature in the application level. Refer to 1.4.10 Zoom for
details about the zoom feature.

See the following for the sample code for setting the zoom mode.

• PanScan:
m_sdkPlayer.setZoomMode(VO_OSMP_ZOOM_MODE.VO_OSMP_ZOO
M_PANSCAN, null);
• FitWindow:
m_sdkPlayer.setZoomMode(VO_OSMP_ZOOM_MODE.VO_OSMP_ZOO
M_FITWINDOW, null);
• Original:
m_sdkPlayer.setZoomMode(VO_OSMP_ZOOM_MODE.VO_OSMP_ZOO
M_ORIGINAL, null);
• LetterBox:
m_sdkPlayer.setZoomMode(VO_OSMP_ZOOM_MODE.VO_OSMP_ZOO
M_LETTERBOX,null);
• ZoomIn:
Rect rect = new Rect(videoWidth / 4, videoHeight / 4, videoWidth * 3
/ 4, videoHeight * 3 / 4);
m_sdkPlayer.setZoomMode(VO_OSMP_ZOOM_MODE.VO_OSMP_ZO
OM_ZOOMIN, rect);

3.1.14 RTSP Use the VOCommonPlayerRTSPConfiguration interface to change RTSP


settings settings.
(Optional)
3.1.14.1 RTSPOverHTTP
// Enable RTSP over HTTP tunneling.
m_sdkPlayer. enableRTSPOverHTTP(true);
// Set port number for RTSP over HTTP tunneling.
m_sdkPlayer. setRTSPOverHTTPConnectionPort(num);

3.1.14.2 RTSP HTTP verification information


VOOSMPVerificationInfo verif = new VOOSMPVerificationInfo();
verif.setVerificationString(str);
verif.setDataFlag(1);
// Set the verification information to start HTTP verification
m_sdkPlayer .setHTTPVerificationInfo(verif);

3.1.14.3 RTSP statistics


// Get the RTSP module status value
VOOSMPRTSPStatistics RTSPStatistics =
m_cSpecialPlayer.getRTSPStatistics();
String log ="RTSP Statistics - PacketReceived: %d,
PacketDuplicated: %d, PacketLost: %d, PacketSent: %d,
AverageJitter: %d, AverageLatency: %d.";

OnStream MediaPlayer+ User Guide 147


VisualOn
Chapter 3: OSMP+ Integration

log = String.format(log, RTSPStatistics.getPacketReceived(),


RTSPStatistics.getPacketDuplicated(),
RTSPStatistics.getPacketLost(),
RTSPStatistics.getPacketSent(),RTSPStatistics.getAverageJitter(),
RTSPStatistics.getAverageLatency());

3.1.14.4 Other RTSP interfaces


// Enable/Disable immediate video rendering with low latency.
enableLowLatencyVideo(boolean value)
//Set RTSP connection type,it can be auto/TCP/UDP
setRTSPConnectionType(VO_OSMP_RTSP_CONNECTION_TYPE type);

3.1.15 Enabling Use VOCommonPlayer.setDRMLibrary() to enable the DRM engine.


DRM
m_sdkPlayer.setDRMLibrary(“voDRM” “voGetDRMAPI”);

3.2 Integration on iOS


Follow the instructions below to complete the OSMP+ integration on the
iOS platform.

The integration Labs, which are compressed into the labs.zip file under Doc
of your installation package, provide working examples to accompany
the OSMP+ Player SDK Integration Guide for iOS Platforms. The integration
Labs focus on individual integration topics and require installation of the
SDK and license file. Start with README.txt compressed in the labs.zip file to
learn how to use Labs.

3.2.1 Preparing Import header files, libraries, and license file into the player project.
SDK files
3.2.1.1 Importing header files
Import the OSMP+ SDK header files that are relevant for your player
project. A basic SDK client requires the VOCommonPlayerImpl.h header
file. Table 12 lists the header files dependency.

Table 12. Header files dependency

Header file Header files included in header file Definition

VOCommonPla • VOCommonPlayer.h Common Player


yerImpl.h • VOCommonPlayerAssetSelection.h implementation,
including configuration,
• VOCommonPlayerConfiguration.h control, subtitles, asset
• VOCommonPlayerControl.h selection, and device
• VOCommonPlayerDelegate.h information

• VOCommonPlayerDeviceInfo.h
(optional)
• VOCommonPlayerHDMI.h (optional)
• VOCommonPlayerHTTPConfiguration.h

148 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 3: OSMP+ Integration

Header file Header files included in header file Definition


(optional)
• VOCommonPlayerImpl.h
• VOCommonPlayerRTSPConfiguration.h
(optional)
• VOOSMPRTSPPort.h (optional)
• VOOSMPRTSPStatistics.h (optional)
• VOCommonPlayerStatus.h
• VOCommonPlayerSubtitle.h (optional)
• VOOSMPHTTPDownloadFailure.h
(optional)
• VOOSMPHTTPProxy.h (optional)
• VOOSMPImageData.h (optional)
• VOOSMPInitParam.h
• VOOSMPOpenParam.h
• VOOSMPType.h
• VOOSMPVerificationInfo.h (optional)

VOCommonPla VOCommonPlayerHDMI.h HDMI connection


yerHDMIImpl.h

VOOSMPChunkI N/A Chunk information


nfo.h

VOOSMPBuffer. N/A
h

VOOSMPPCMB N/A
uffer.h

VOOSMPStrea VOOSMPStreamingDownloader.h Download Manager


mingDownload VOOSMPStreamingDownloaderType.h
erImpl.h

To import the VOCommonPlayer implementation header file, add the


following lines:
#import <VOCommonPlayerImpl.h>

3.2.1.2 Importing libraries


voLoadLibControl is used to import the libraries and get the module API.

See the following for sample code of importing libraries:


void* voGetModuleAdapterFunc(char *pszApiName)
{if (0 == strcmp(pszApiName, "voGetAudioReadAPI")) {
return (void
*)voGetAudioReadAPIAdapter;

OnStream MediaPlayer+ User Guide 149


VisualOn
Chapter 3: OSMP+ Integration

}
if (0 == strcmp(pszApiName, "voGetAudio2ReadAPI")) {
return (void
*)voGetAudio2ReadAPIAdapter;
}
}

3.2.1.3 Importing license file


Copy the voVidDec.dat file to the player project file.

3.2.1.4 Importing framework files


Ensure that the following .framework files and lib files are included in your
sample player project for iOS, to guarantee the successful compilation
environment.
• AudioToolbox.framework
• AVFoundation.framework
• CFNetwork.framework
• CoreAudio.framework
• CoreGraphics.framework
• CoreLocation.framework
• CoreMedia.framework
• CoreMotion.framework
• CoreText.framework
• CoreVideo.framework
• ExternalAccessory.framework
• Foundation.framework
• libresolv.dylib
• MediaPlayer.framework
• OpenGLES.framework
• QuartzCore.framework
• Security.framework
• SystemConfiguration.framework
• UIKit.framework
• VideoToolbox.framework

3.2.2 Initializing The SDK instance initialization includes the following:


SDK instance
• Creating an instance

150 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 3: OSMP+ Integration

• Configuring a view
• Defining the view size
• Setting the license
• Setting the event callback

See the following for the sample code for initializing an SDK instance.

3.2.2.1 Initializing a player instance


playEngineType [in] Refer to {@link VO_OSMP_PLAYER_ENGINE}.
initParam [in] Currently unused, should be set to nil.
VO_OSMP_PLAYER_ENGINE playEngineType = VO_OSMP_VOME2_PLAYER;
VOOSMPInitParam *parma = nil;
self.player = [[[VOCommonPlayerImpl alloc] init:
VO_OSMP_VOME2_PLAYER initParam:parma] autorelease];

3.2.2.2 Setting surface view for video playback


view [in] The UIView(iOS)
[self.player setView:view];

3.2.2.3 Notifying the player on view size change


[self.player notifyViewSizeChanged];

3.2.2.4 Setting license file path


path [in] Location of the license file.
[self.player setLicenseFilePath:path];
[self.player setPreAgreedLicense:agreedLicenseString];

3.2.2.5 Setting event callback


delegate [in] Event handler instance.
[self.player setOnEventDelegate:self];

3.2.3 Opening Use VOCommonPlayer.open() to open the media source.


media source
VOOSMPOpenParam * param = nil;
int sourceType = VO_OSMP_SRC_AUTO_DETECT;
[self.player open:url flag:VO_OSMP_FLAG_SRC_OPEN_ASYNC
sourceType:sourceType openParam:param];

3.2.4 Handling See the following for the sample code for handling the basic event.
SDK event
(VO_OSMP_RETURN_CODE) onVOEvent:(VO_OSMP_CB_EVENT_ID)nID
param1:(int)param1 param2:(int)param2 pObj:(void *)pObj
{
if (nID == VO_OSMP_CB_PLAY_COMPLETE) {
}
else if (nID == VO_OSMP_SRC_CB_OPEN_FINISHED)
{
}
return VO_OSMP_ERR_NONE;
}

OnStream MediaPlayer+ User Guide 151


VisualOn
Chapter 3: OSMP+ Integration

3.2.5 Starting Use VOCommonPlayer.start() to start playback after opening the media
playback source.
[self.player start];

3.2.6 Stopping Use VOCommonPlayer.stop() to stop playback.


playback
[self.player stop];
[self.player close];

3.2.7 Seeking Use VOCommonPlayer.setPosition() to perform the seeking operation.


[self.player setPosition:msec];

3.2.8 Selecting If the clip includes multiple tracks, use the


tracks VOCommonPlayer.selectVideo(), VOCommonPlayer.selectAudio(), or
VOCommonPlayer.selectSubtitle() function to select the required track.

3.2.8.1 Getting asset count


[self.player getVideoCount];
[self.player getAudioCount];
[self.player getSubtitleCount];

3.2.8.2 Getting asset property


id<VOOSMPAssetProperty> videoItem = [self.player
getVideoProperty:index];
id<VOOSMPAssetProperty> audioItem = [self.player
getAudioProperty:index];
id<VOOSMPAssetProperty> subtitleItem = [self.player
getSubtitleProperty:index];

3.2.8.3 Checking availability of the specified track


BOOL *videoAvailable = [self.player isVideoAvailable:index];
BOOL *audioAvailable = [self.player isAudioAvailable:index];
BOOL *subtitleAvailable = [self.player isSubtitleAvailable:index];

3.2.8.4 Getting the selected track


id<VOOSMPAssetIndex> index = [self.player getCurrentSelection];

3.2.8.5 Getting the actual index of track being played


id<VOOSMPAssetIndex> index = [self.player getPlayingAsset];

3.2.8.6 Selecting track by index


The value of index is valid from 0.
[self.player selectVideo:index];
[self.player selectAudio:index];
[self.player selectSubtitle:index];

152 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 3: OSMP+ Integration

3.2.8.7 Committing all asset selections


[self.player commitSelection];

3.2.8.8 Removing uncommitted selections


[self.player clearSelection];

3.2.9 Subtitle Use VOCommonPlayer.enableSubtitle() to enable the subtitle rendering,


rendering and use VOCommonPlayer.setSubtitlePath() to indicate an external file.
(Optional)
3.2.9.1 Setting file/URL path for external subtitles
[self.player setSubtitlePath:filePath];

3.2.9.2 Enabling/disabling subtitle display


This value is set to disabled by default.
[self.player enableSubtitle:value];

3.2.9.3 Setting subtitle font color


[self.player setSubtitleFontColor:color]; // color [in] Font color
(0x00RRGGBB) of subtitle text.

3.2.9.4 Setting subtitle font size


[self.player setSubtitleFontSizeScale:scale]; // scale [in] Font
size scale for subtitle text (percent).

3.2.9.5 Setting subtitle font background color


[self.player setSubtitleFontBackgroundColor:color]; // color [in]
Subtitle font background color (0x00RRGGBB).

3.2.9.6 Setting opacity of subtitle font background color


[self.player setSubtitleFontBackgroundOpacity:alpha]; // alpha
[in] Subtitle font background color opacity rate.

3.2.9.7 Setting window background color


[self.player setSubtitleWindowBackgroundColor:color]; // color
[in] Subtitle window background color (0x00RRGGBB).

3.2.9.8 Setting opacity of window background color


[self.player setSubtitleWindowBackgroundOpacity:alpha]; // alpha
[in] Subtitle window background color opacity rate.

3.2.9.9 Enabling/disabling subtitle font italics


[self.player setSubtitleFontItalic:enable]; // enable [in]
Enable/Disable

3.2.9.10 Enabling/disabling subtitle font bold


[self.player setSubtitleFontBold:enable]; // enable [in]
Enable/Disable

OnStream MediaPlayer+ User Guide 153


VisualOn
Chapter 3: OSMP+ Integration

3.2.9.11 Enabling/disabling subtitle font underlined


[self.player setSubtitleFontUnderline:enable]; // enable [in]
Enable/Disable

3.2.9.12 Setting subtitle font name


[self.player setSubtitleFontName:name]; // name [in] Font name for
subtitle text

3.2.9.13 Setting subtitle font edge type


[self.player setSubtitleFontEdgeType:type]; // type [in] Edge type
of subtitle font.

3.2.9.14 Setting subtitle font edge color


[self.player setSubtitleFontEdgeColor:color]; // color [in] Font
edge color (0x00RRGGBB) of subtitle text.

3.2.9.15 Setting opacity rate of subtitle font edge color


[self.player setSubtitleFontEdgeOpacity:alpha]; // alpha [in] Edge
color opacity rate of subtitle font.

3.2.9.16 Previewing subtitle by sending some sample text to be rendered


[self.player previewSubtitle:@"Sample" view:view]; // sampleText
[in] text for previewing current subtitle settings; view [in] view
to which the sample text is being rendered.

Use [self.player resetSubtitleParameter]; to reset all parameters to their


default values. Subtitles are presented as specified in the subtitle stream.

3.2.10 Download OSMP+ allows you to download streams to local disks.


Manager
(Optional) 3.2.10.1 Initializing a Download Manager instance
See the following for the sample code for initializing a Download Manager
instance.
@param self [in] Refer to {@link
VOOSMPStreamingDownloaderDelegate}
@param initParam [in] Refer to {@link
VOOSMPStreamingDownloaderInitParam}
VOOSMPStreamingDownloaderInitParam *initParam = NULL;
id<VOOSMPStreamingDownloader> downloader =
[[VOOSMPStreamingDownloaderImpl alloc] init:self
initParam:initParam];

3.2.10.2 Download Manager (Open media source)


See the following for the sample code for opening downloader media
source.
NSString *filePath =
[[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES) objectAtIndex:0]
stringByAppendingPathComponent:@”Downloader”];

154 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 3: OSMP+ Integration

VO_OSMP_RETURN_CODE ret = [self.downloader open:url flag:flag


localDir:filePath];

3.2.10.3 Creating the player and playback


After receiving the APP_DOWNLOADER_DOWNLOADER_MANIFEST_OK
event, set pObj for the URL of playback. See the following for the sample
code for reference.
-(VO_OSMP_RETURN_CODE)
handleDownloaderEvent:(APP_DOWNLOADER_EVENT_ID)nID
param1:(int)param1 param2:(int)param2 pObj:(void *)pObj
{
[self performSelectorOnMainThread:@selector(startPlayDownloader:)
withObject:(NSString *)pObj waitUntilDone:NO];
}
- (void)startPlayDownloader:(NSString *)pURL
{
// Create player and open with pURL.
}

3.2.10.4 Selecting a downloader track and starting playback


After receiving the APP_DOWNLOADER_OPEN_COMPLETE event, select a
track, and then start playback. See the following for the sample code for
reference.
- (VO_OSMP_RETURN_CODE)
handleDownloaderEvent:(APP_DOWNLOADER_EVENT_ID)nID
param1:(int)param1 param2:(int)param2 pObj:(void *)pObj
{
if (nID == APP_DOWNLOADER_OPEN_COMPLETE)
{
[self performSelectorOnMainThread:@selector(startDownloader)
withObject:nil waitUntilDone:NO];
}
}

- (void)startDownloader
{
// Select downloader track and start playback.
}

3.2.10.5 Starting download


See the following for the sample code for starting download.
[self.downloader startDownloader];

3.2.10.6 Stopping download


See the following for the sample code for stopping download.
[self.downloader stop];

3.2.10.7 Closing download


See the following for the sample code for closing download.

OnStream MediaPlayer+ User Guide 155


VisualOn
Chapter 3: OSMP+ Integration

[self.downloader close];

3.2.11 Hardware Use VOCommonPlayer.init() to set the engine type. VO_OSMP_AV_PLAYER


acceleration is used for iOS.
(Optional)
3.2.11.1 Initializing the player with VisualOn media framework engine
See the following for the sample code for initializing the player with
VisualOn media framework engine.
VOOSMPInitParam *parma = nil;
id<VOCommonPlayer> player = [[VOCommonPlayerImpl alloc] init:
VO_OSMP_VOME2_PLAYER initParam:parma];

3.2.11.2 Initializing the player with AVPlayer engine


This is for iOS platform only. AVPlayer supports H.264 video decoder and
AAC audio decoder. See the following for the sample code for initializing
the player with AVPlayer engine.
VOOSMPInitParam *parma = nil;
id<VOCommonPlayer> player = [[VOCommonPlayerImpl alloc] init:
VO_OSMP_AV_PLAYER initParam:parma];

3.2.12 Playback Use VOCommonPlayer.setAudioPlaybackSpeed() to set the audio


speed playback speed. See the following for the sample code for setting the
(Optional) playback speed.
speed [in] speed multiplier with respect to realtime playback.
Default is 1.0
[self.player setAudioPlaybackSpeed:speed];

3.2.13 Zoom Use VOCommonPlayer.setZoomMode() to set the zoom mode. See the
following for the sample code of the zoom mode.
mode [in] Zoom mode. Refer to {@link VO_OSMP_ZOOM_MODE}.

rect [in] The rectangular area of the video to be displayed. This


argument is only used when the zoom mode is {@link
VO_OSMP_ZOOM_ZOOMIN}.

VO_OSMP_ZOOM_MODE mode = VO_OSMP_ZOOM_LETTERBOX;

Rect rt;
memset(&rt, 0, sizeof(Rect));
[self.player setZoomMode:mode rect:rt];

3.2.14 RTSP Use the VOCommonPlayerConfiguration interface to change RTSP settings.


settings
(Optional) 3.2.14.1 Setting RTSP Connection Type
See the following for the sample code for setting the RTSP Connection
Type.

156 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 3: OSMP+ Integration

Type [in] Connection type. {@link VO_OSMP_RTSP_CONNECTION_TYPE}


[self.player setRTSPConnectionType:type];

3.2.14.2 Setting port number for RTSP connection


See the following for the sample code for setting port number for RTSP
connection.
port [in] port number
VOOSMPRTSPPort *port = [[VOOSMPRTSPPort alloc] init:6666
videoConnectionPort:8888];
VO_OSMP_RETURN_CODE ret = [self.player
setRTSPConnectionPort:port];
[port release];
port = nil;

3.2.14.3 Setting port number for RTSP over HTTP tunneling


See the following for the sample code for setting port number for RTSP over
HTTP tunneling.
portNum [in] port number
[self.player setRTSPOverHTTPConnectionPort:portNum];

3.2.14.4 Enabling RTSP over HTTP tunneling


See the following for the sample code for enabling RTSP over HTTP
tunneling.
enable [in] Enable/Disable;
[self.player enableRTSPOverHTTP:enable];

3.2.14.5 Setting maximum socket errors


See the following for the sample code for setting the maximum socket
errors.
[self.player setRTSPMaxSocketErrorCount:count];

3.2.14.6 Setting RTSP connection timeout


See the following for the sample code for setting RTSP connection timeout.
time [in] RTSP connection timeout (in seconds), default is 10
seconds
[self.player setRTSPConnectionTimeout:time];

3.2.14.7 Getting the RTSP module statistics


See the following for the sample code for getting the RTSP module
statistics.
id<VOOSMPRTSPStatistics> info = [self.player getRTSPStatistics];

3.2.15 Enabling See the following for the sample code for enabling the Verimatrix DRM.
DRM
- (VO_OSMP_RETURN_CODE) setVerifiacationInfo
{

OnStream MediaPlayer+ User Guide 157


VisualOn
Chapter 3: OSMP+ Integration

VO_OSMP_RETURN_CODE ret = VO_OSMP_ERR_IMPLEMENT;


if (self.player == nil || self.playerDrm == nil) {
return ret;
}

[self.player setDRMLibrary:@"voDRM_Verimatrix_AES128" libApiNam


e:@"voGetDRMAPI”];

NSString *serverAddress = [AppCommonActions


getOptionItemInfo:SERVER_ADDRESS];
if (serverAddress == nil) {
return VO_OSMP_ERR_IMPLEMENT;
}
ret = [self.player setVerifiacationInfo:serverAddress];

return ret;
}

3.3 Integration on Windows and Mac OS


Follow the instructions below to construct a VisualOn OSMP+ plug-in
instance on Windows or Mac OS. For the detailed API information, refer to
the API Reference Manual.zip file in your installation package.

3.3.1 Creating a To create a VisualOn OSMP+ plug-in object:


plug-in object
1. Use the following code to create an object element.
var pluginObj = document.createElement("object");

2. Specify the newly created object as a VisualOn OSMP+ plug-in


object. The method for specifying this object varies from the
browser and platform.
 For Windows IE, use classid to specify the plug-in object:
pluginObj.setAttribute("classid","clsid:********-****-****-
****-************");

Fill the * characters with the register key of VisualOn OSMP+ plug-
in object.
 For other browsers on Windows, use the object type to specify the
plug-in object:
pluginObj.setAttribute("type", "application/x-visualon-
osmp");

 For Safari on Mac OS, the video is plotted directly on the Safari
window.
pluginObj.setAttribute("wmode", "transparent");

3.3.2 Initializing
OSMP+

158 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 3: OSMP+ Integration

To create an OSMP+ instance, and then bind this instance to the plug-in
object created in 3.3.1 Creating a plug-in object:
1. Use the following code to create an OSMP+ instance, and then
bind it to the plug-in object:
voplayer = new VOCommonPlayer(OSMPPlayerPlugin);
voplayer.init(voOSMPType.VO_OSMP_PLAYER_ENGINE.VO_OSMP_VOME2
_PLAYER, '');

2. Use the following code to register a callback that is used to handle


the player event:
var callbackFunction = foo (nID, nParam1, nParam2, object)
{…;}*
voplayer.registerEventHandler(callbackFunction);

For more event handling information, refer to the OnStream MediaPlayer+


Plugin SDK Integration Guide for Windows. pdf or the OnStream
MediaPlayer+ Plugin SDK Integration Guide for Mac OS.pdf.

3.3.3 Enabling The OSMP+ SDK uses the AES-128 DRM by default. Refer to the following
DRM documents if you want to find the information to change the DRM server.
• Windows: Refer to DRM information in Table 3: Examples of Registry
location in OnStream MediaPlayer+ Plugin SDK Integration Guide for
Windows. pdf
• Mac: Refer to 7.6 Verimatrix in OnStream MediaPlayer+ Plugin SDK
Integration Guide for Mac OS.pdf.

3.4 Integration on Windows Phone


Follow the instructions below to complete the OSMP+ integration on the
Windows Phone 8.1 platform.

The following is the required software for interfacing with the OSMP+ SDK
on Windows Phone 8.1:
• 64-bit Windows 8 Pro or higher
• Windows Phone 8.x SDK
• Microsoft Visual Studio Ultimate 2013 or higher
• Register a Windows Phone 8.x device by signing up for a developer
account
• Enable Hyper-V for Windows Phone 8.x emulator
• IsoStoreSpy for file exploration

Note: Refer to Register your Windows Phone for instructions about how to register
a Windows Phone device.

OnStream MediaPlayer+ User Guide 159


VisualOn
Chapter 3: OSMP+ Integration

3.4.1 Preparing Import header files, libraries, and license file into the player project.
SDK files
Import the OSMP+ SDK header files that are relevant for your player
project. A basic SDK client requires the VOCommonplayer.h header file.
Table 13 lists the header files dependency.

Table 13. Header files dependency

Header file Header files included in header file Definition

VOCommonPla • VOCommonPlayer.h Common Player


yer.h • VOCommonPlayerAnalytics.h implementation,
including configuration,
• VOCommonPlayerAssetSelection.h control, subtitles, asset
• VOCommonPlayerConfiguration.h selection, and device
• VOCommonPlayerControl.h information

• VOCommonPlayerDeviceInfo.h
• VOCommonPlayerHTTPConfiguration.h
• VOCommonPlayerListener.h
• VOCommonPlayerRTSPConfiguration.h
• VOCommonPlayerStatus.h
• VOCommonPlayerSubtitle.h

To use VisualOn OSMP+ SDK on Windows Phone, include


VOCommonplayer.h in VS2013 project, and then set a proper additional
library path to include voOSMP.lib in the link phase. Also, import license file
in VS2013 project.

3.4.2 Initializing The SDK instance initialization includes the following:


SDK instance
• Creating an instance
• Configuring a view
• Setting the event callback

3.4.2.1 Initializing a player instance


See the following for the sample code for initializing a player instance.
m_commonPlayer = std::unique_ptr<VOCommonPlayer>(new
VOCommonPlayer());
VO_OSMP_PLAYER_ENGINE playEngineType = VO_OSMP_VOME2_PLAYER;
VOOSMPInitParam initParam;
char stra[2048];
{
memset(stra, 0, sizeof(stra));
WideCharToMultiByte(CP_ACP, 0, (TCHAR*)szPath, -1, stra, 1024,
NULL, NULL);
VOOSMPString pth(stra);
initParam.setLibraryPath(pth);
}

160 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 3: OSMP+ Integration

int nRC = m_commonPlayer->init(playEngineType, initParam);

3.4.2.2 Setting where the video is plotted by setView


On Windows Phone 8.1, OSMP+ SDK takes two arguments, including the
current window and a SwapChainPanel instance. For more information
about these two classes, see documents and examples of Windows Phone
DirectX with XAML project.
Windows::UI::Core::CoreWindow^ window =
CoreWindow::GetForCurrentThread();

void* viewParam[2] = {

reinterpret_cast<void *>(window),

reinterpret_cast<void *>(swapChainPanel)

};

m_commonPlayer->setView(reinterpret_cast<void *>(viewParam));

3.4.2.3 Setting event listener to handle OSMP+ events with callback


The following sample code demonstrates how to register a listener
VOEventListenerWP that is derived from VOCommonPlayerListener. In the
definition of VOEventListenerWP, user customizes the event-handling logic.
m_commonPlayerListener =
std::unique_ptr<VOCommonPlayerListener>((VOCommonPlayerListener*)(
new VOEventListenerWP(this)));
if (m_commonPlayer != nullptr) {
m_commonPlayer>setOnEventListener(*m_commonPlayerListener);
}
}

3.4.3 Opening Use VOCommonPlayer.openSource() to open the media source. The


media source following sample code demonstrates how to register a callback for
external source in push PD mode.

OnStream MediaPlayer+ User Guide 161


VisualOn
Chapter 3: OSMP+ Integration

VOOSMPSetPushBufferPrototype source = m_simulateDataSource-


>GetCallback();
if (source != NULL)
{
ret = m_commonPlayer->openSource(source,
VO_OSMP_FLAG_SRC_PUSH_BUFFER_FUNCTION);
if (ret != VO_OSMP_ERR_NONE)
{
auto msgDlg = ref new MessageDialog("Open Source
Failed!", "Error");
msgDlg->ShowAsync();
return ret;
}
}

3.4.4 Handling We 4 implement a simple listener wrapper to demonstrate how to bind


SDK event callbacks to handle OSMP+ events. The wrapper is implemented in the files
VOEventListenerWP.h and VOEventListenerWP.cpp.

With this wrapper, user can put the event handling logic in DirectXPage
and achieve the interaction between XAML UI and OSMP+ SDK.
For more information about DirectXPage, refer to DirectX and XAML
project template of VS2013. For more information about event handling
logic, refer to DirectXPage::initVOEventListener() function in the push-
mode OSMP+ sample.

3.4.5 Supported OSMP+ SDK for Windows Phone provides the following subset of APIs to
APIs and push retrieve the streaming data with push-mode. For more information about
buffer usage the following APIs, refer to API Reference Manual.zip under your installation
package.
• init
• destroy
• setView
• openSource
• close
• start
• pause
• stop
• setPosition
• setOnEventListener
• getPlayerStatus

4 In this guide, “we” refer to the VisualOn development engineering team that

develops the OSMP+ SDK.

162 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 3: OSMP+ Integration

• getPosition
• getMinPosition
• getMaxPosition
• getDuration
• getParameter
• setLicenseContent
• setLicenseFilePath

In addition to the APIs listed above, source with push-mode is transferred


by registering the following callbacks:
• VOOSMPGetInfoPrototype
• VOOSMPPushBufferPrototype
• VOOSMPSetPushBufferPrototype

For the definitions of the prototypes above, refer to VOOSMPPushBuffer.h.


For the example of setting callbacks to push-mode source, refer to 3.4.3
Opening media source and the sample player.

3.4.6 Enabling AES-128 DRM engine is loaded and enabled by default for the OSMP+
DRM sample player with Verimatrix on Windows Phone. Refer to the
DirectXPage.xaml file under \WinPhone\SameplePlayer for the DRM
configuration information.

To enable AES-128 DRM engine:


1. Open DirectXPage.xaml with an editor.
2. Set the value of ‘Text’ to null as follows:
<TextBox Name="DRMLibrary" HorizontalAlignment="Left" Text="
voDRM_Verimatrix_AES128" MinWidth="350"/>
<TextBox Name="DRMLibraryAPI" HorizontalAlignment="Left"
Text=" voGetDRMAPI" MinWidth="350"/>

To disable AES-128 DRM engine:


1. Open DirectXPage.xaml with an editor.
2. Set the value of ‘Text’ to null as follows:
<TextBox Name="DRMLibrary" HorizontalAlignment="Left"
Text="" MinWidth="350"/>
<TextBox Name="DRMLibraryAPI" HorizontalAlignment="Left"
Text="" MinWidth="350"/>

Or

1. Open DirectXPage.xaml.cpp with an editor.


2. Do not call the setDRMLibrary function that is under the initDRMInfo
function.

OnStream MediaPlayer+ User Guide 163


VisualOn
Chapter 3: OSMP+ Integration

m_commonPlayer->setDRMLibrary(strText.c_str(),
strText1.c_str());

3.5 Best practices


VisualOn considered the following key best practices in the OSMP+
integration to ensure the optimal performance:

• Strictly follow this sequence to complete a playback session: create a


player instance > init() > open() > open finish event > start() > stop() >
close() > destroy() > delete the player instance.
• Call two APIs, suspend() and resume(), on the main thread.
Moreover, follow this sequence when calling suspend() and resume()
on the main thread: create a player instance > init() > open() > open
finish event > start() > suspend() > resume() > stop() > close() >
destroy() > delete the player instance.
• Follow this sequence when performing the fast channel operation:
create a player instance > init() > open() > open finish event > start()
> stop () > close() > open() > open finish event > start() > stop() >
close() > destroy() > delete the player instance.
• When using Async mode to open the media source, call the start()
API after receiving a completed open event.
• Keep the video view active during the playback.
• Keep the VOCommonPlayerListener object or
VOCommonPlayerDelegate object on iOS active during the
playback.
• Ensure that no function is called when deleting the player object.
• Call setLicenseContent(), setLicenseFilePath(), and
setPreAgreedLicense() after completing the init() API.
• Do not support cloning the player object, which may result in the
incorrect player status.
• We recommend NOT changing the voSurfaceView or its Activity
during playback. If you have to change the voSurfaceView or its
Activity during playback, we suggest performing the following:
a. Call suspend() at first.
b. Change the voSurfaceView or its Activity. Ensure that the
change operation is completed before proceeding with step c.
c. Call resume() with the new voSurfaceView.

• Call setDRMLibrary() to enable DRM engine. If it is required to set the


verification information, ensure that you call setDRMVerificationInfo()
after calling setDRMLibrary().

164 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 3: OSMP+ Integration

Ensure that you use the following values for


setDRMLibrary(DRM_LIB_NAME, DRM_API_NAME) if you need to set up
the connection with the VCAS server.
 String DRM_LIB_NAME = "voDRM_Verimatrix_AES128";
 String DRM_API_NAME = "voGetVerimatrixDRMAPI";
• Follow the sequence below to set up DRM for Verimatrix:
a. setDRMLibrary
b. setDRMFilePath
c. Set DRM Server information
• OSMP+ SDK used to have an API setDRMUniqueIdentifier() to specify
unique identifier on Android device for Verimatrix DRM. For security
reason, Verimatrix requests to remove this setDRMUniqueIdentifier()
API from the OSMP+ SDK. Therefore, since release 3.17.10, the OSMP+
SDK has a new algorithm to generated UID on Android devices, and
the setDRMUniqueIdentifier() interface is deprecated and is no longer
available.

Note: We do not recommend using UID as the identification of application,


user, and device for account management, as the value of UID intends to
be changed.

The UID obtained by using getDRMUniqueIdentifier()will be changed:


 If the device is factory reset, this ID may be changed.
 If a user uninstalls the application on a device that has neither a
proper Android ID nor a Device ID, this ID may be changed after
reinstalling the application.
• Along with the new algorithm applied for generating UID, user can
get the UID by using getDRMUniqueIdentifier() for device provisioning
purpose starting with release 3.17.10. For the projects that have been
deployed with UID, this causes that a single device has two
difference IDs on the VCAS server. Contact Verimatrix support or your
VisualOn application engineer for detailed information to resolve
such case.
• In previous Chrome PPAPI plug-in releases obtaining the Verimatrix
client ID with getDRMUniqueIdentifier() can only be done after
initializing a player instance which requires loading the .pexe PNaCl
file. Loading of the PNaCl .pexe file by Chrome can take dozen of
seconds the first time. To avoid this long delay the Verimatrix client ID
generation process is also added at the Helper extension level. It is
now possible to get the Verimatrix ID with only the extension and the
BrowserPlugin Helper installed. The Helper extension introduces a new
interface named initDRMInfoByExtension() to initialize the Verimatrix
Client ID generation. When initDRMInfoByExtension() is called, the
Helper extension implements the setDRMLibrary() to get the

OnStream MediaPlayer+ User Guide 165


VisualOn
Chapter 3: OSMP+ Integration

Verimatrix Client ID and then presents it to the web page. Refer to the
baseplayer.js file in the Sample Player project for details.
The following is the corresponding sample code:
function initDRMInfoByExtension(){
if (!Bph.setDRMLibrary) return;
var temp = getElement('DRMLibrary');
if (temp != null && temp.value){ strDRMLibName = temp.value; }
temp = getElement('DRMAPI');
if (temp != null && temp.value){ strDRMApiName = temp.value; }
Bph.setDRMLibrary(strDRMLibName,strDRMApiName,function(duid){
log_output('setDRMLibrary through extension: DRM ID=
'+duid+'\n');
});
}
this.setDRMLibrary = function(libname,libapiname,cb){
var cmd = 'setDRMLibrary';
var data = {cmd: cmd, libName:libname, libApiName:libapiname
};
_connection.postMessage(data);
_cmd_callbacks[cmd] = cb;
}

166 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 4: Logging System

Chapter 4 Logging System

This chapter presents the following topics:

4.1 Overview........................................................................................................168

4.2 Printing level of log file .................................................................................169

4.3 Customization of volog.cfg .........................................................................169

4.4 Capturing log ................................................................................................170

4.5 Verimatrix Log File Location ........................................................................174

4.6 Logging Messages........................................................................................175

OnStream MediaPlayer+ User Guide 167


VisualOn
Chapter 4: Logging System

4.1 Overview

An effective logging strategy has long been recognized by system


administrators as a way to keep track of problems with components and
applications, provide quantifiable statistics for an application's history, help
in troubleshooting issues, as well as help in monitoring the overall health of
the systems that administrators are responsible for.

This section discusses how you, as a developer or support engineer, can


use the logging mechanism provided to make it easier to understand the
OSMP+ SDK, provide more in-depth information for debugging, and
communicate with field support engineers when a problem is
encountered or a threshold is reached.

The following log line is a typical log line, each field is described in detail
below:

Note: For security reasons, the logging system is only enabled when using the
VisualOn debug libraries. To capture log, make sure that the debug libraries are
used in your applications.

$time$
@@@VOLOG,$LevelName$,$ModuleID$,$ThreadID$,$FileName$,$FunctionNam
e$,$LineNumber$,$YOURSLOG$

• $time$: The current time, for example “12:23:56.789”


• $LevelName$: can be either one of” Error”, “Warning”, “Info”,
“Status”, “Run”, or “Function”
• $ModuleID$: The value of the module’s compiling tag
(_VOMODULEID)
• $ThreadID$: The thread id that calls the outputted log
• $FileName$: The file name that calls the outputted log
• $FunctionName$: The function name that calls the outputted log
• $LineNumber$: The line's number that calls the outputted log
• $YOURSLOG$: The log message

See the following for an example of log entry:


10:43:00.721 @@@VOLOG,Info,09020000,40047FFC,COSSourceBase.cpp,
Open,825,openned over!

168 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 4: Logging System

4.2 Printing level of log file


The OSMP+ SDK supports four levels of log output:

Notes:
1. The OSMP+ SDK will print the log messages with level 2 by default. If you want
to configure the log printing level yourself, modify the volog.cfg configuration file
as required and then copy the updated volog.cfg file to your local device. Refer
to 4.3 Customization of volog.cfg for more information.
2. Log level 3 and 4 should only be used exceptionally because the log file size
will quickly exceed the storage capability of your device.

• 0 (error): Indicates the printing level is 0 and the OSMP+ SDK will
output all error messages.
• 1(warning): Indicates the printing level is 1 and the OSMP+ SDK will
output all error and warning messages.
• 2 (info): Indicates the printing level is 2 and the OSMP+ SDK will output
all error, warning, and information messages.
• 3 (status): Indicates the printing level is 3 and the OSMP+ SDK will
output all error, warning, information, and status messages.
• 4 (running): Indicates the printing level is 4 and the OSMP+ SDK will
output all error, warning, information, status, and running messages.

4.3 Customization of volog.cfg


The volog.cfg file can be used to customize the output of log file.

The following volog.cfg example is used to describe how to tailor the


volog.cfg content to your need:
0x00000000,2
0xFFFFFFFF,/sdcard/,128000
0xFFFFFFFE,1

• 0x00000000: Identify which module will generate logs. The value


0x00000000 indicates that all modules will generate logs. In case of
specific inquiries, VisualOn may provide different value(s)
corresponding to one or several modules.
• 2: Log printing level. Refer to 4.2 Printing level of log file for details.
• 0xFFFFFFFF: Used to enable the local logging capability (logs are saved
locally).
• /sdcard/: path in which the logs will be saved.
• 128000: Maximum allowed log file size. The player will overwrite the file if
the log capture is greater than 128000 Mbytes.
• 0xFFFFFFFE,1:
In general, the log file is flushed from the cache to the local storage

OnStream MediaPlayer+ User Guide 169


VisualOn
Chapter 4: Logging System

after the workflow completes. However the player might crash during
playback and some of the log will be lost as some of the log
information is temporarily saved in the cache and is not flushed to local
storage. If you want to avoid losing the cached information in case of
crash, change ‘1’ to ‘0’. By setting ‘1’ to ‘0’, the log file is saved to the
directory defined as the second line directly and caching is not used.

Note: If caching is disabled, the write speed to the log file will be slower than
the normal usage.

4.4 Capturing log


This section introduces how to capture or configure the log output on
various platforms.

4.4.1 Capturing 4.4.1.1 Capturing log using an external PC


log on Android adb logcat can be used to capture logs:
1. The logging system is enabled by default as long as you use debug
libraries.
2. Run the ‘adb logcat –v time | grep –i volog’ command to verify
whether the logging system is functional or not. You should see log
messages with ‘VOLOG’ when you run your application.
3. Run ‘adb logcat –v time > sample.txt’ to save the logcat output to
your PC local directory.
4.4.1.2 Capturing log on local storage using the volog.cfg configuration file
Perform the following to capture the OSMP+ log on local storage on
Android:
1. Create/Open a volog.cfg file with a text editor.
2. Specify the following values in volog.cfg.
Refer to 4.3 Customization of volog.cfg for the detailed explanation
of the following tags/values.
 Module name: 0x00000000
 Log printing level: any of 0,1,2,3,4
 Local log enabling flag: 0xFFFFFFFF
 Path to save log file: /AA/BB/CC
 Max. log file size in Mbyte

 Flag for flushing logs in cache to local storage: 0xFFFFFFFE, <1/0>

3. Copy volog.cfg on local storage. Run the adb push


C:/mydirectory/volog.cfg /data/local/tmp/volog.cfg command to

170 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 4: Logging System

copy the volog.cfg file from your PC to the /data/local/tmp


directory of your mobile device.

Note: If the tmp directory does not exist on your mobile device, use the
‘adb shell’, ‘cd data/local’, and ‘mkdir tmp’ commands to create the
tmp directory.

4. Run the sample player. You can find the volog.log file under the
directory specified in step 2.

Note: On some Android devices you may have to create an empty


volog.log text file in the target directory to enable capture the first time.
Other Android devices require to “forced stop” the application in
Android settings before each new log capture.

4.4.2 Capturing 4.4.2.1 Capturing log without volog.cfg


log on iOS If you have installed the debug version, the log file will be automatically
saved to /Applications/Documents after running the sample player.

4.4.2.2 Configuring log output using volog.cfg


Perform the following to configure the OSMP+ log output on iOS:
1. On your Mac open a text editor, and ensure that volog.cfg includes
the following text.
Refer to 4.3 Customization of volog.cfg for the detailed explanation
of the following tags/values.

Note: You are not allowed to specify the path to save the log file on iOS.

0x00000000,2
0xFFFFFFFF,./,128000
0xFFFFFFFE,1

2. Copy the volog.cfg file to /Application/Documents after installing


an application that includes the debug version of the VisualOn
libraries.
3. Run the sample player. You can find the volog.log file under
/Applications/Documents.

4.4.2.3 Reduce iOS simulator debug messages


As the original debug/release libraries for i386 have been removed, use
the debug libraries under Libs/debug if you need to debug i386 simulator.
Under this condition, you always get the full debug messaging. To use the
i386 simulator with less messaging, perform the following in the Xcode
simulator:
1. On your Mac open a text editor, and ensure that volog.cfg includes
the following text.
Refer to 4.3 Customization of volog.cfg for the detailed explanation
of the following tags/values.

OnStream MediaPlayer+ User Guide 171


VisualOn
Chapter 4: Logging System

Note: You are not allowed to specify the path to save the log file on iOS.

0x00000000,2
0xFFFFFFFF,./,128000
0xFFFFFFFE,1

2. After installing an application that includes the debug version of the


VisualOn libraries, copy the volog.cfg file under the Documents
directory, for example
/Users/<autotest>/Library/Developer/CoreSimulator/Devices/<89B16
2C8-A29D-4235-9F05-
8CB856B400E9>/data/Containers/Data/Application/<FB318CBF-
257F-4ADA-83D0-12FE4573CD09>/Documents.

Note: Contents included in angle brackets <> will vary depending on the
device model that you are using.

4.4.3 Capturing 4.4.3.1 Capturing log without volog.cfg


log on Windows Perform the following to view the OSMP+ log on Windows NPAPI, if you do
NPAPI plug-in not have the volog.cfg file:
1. Download DebugView from TechNet.
2. Install and start DebugView.
3. Open a browser, and then run the plug-in sample player.
4. Interface with the browser, and then quit the browser when the
operations are completed.
5. Select File > Save as in DebugView to save VisualOn logs.

Note: DebugView requires a lot of CPU and will affect playback. VisualOn
recommends using the volog.cfg option instead (see 4.4.3.2
Capturing/Configuring log output using volog.cfg).

4.4.3.2 Capturing/Configuring log output using volog.cfg


Perform the following to capture the OSMP+ log on Windows NPAPI plug-
in:
1. Copy the volog.cfg file to your plug-in installation directory, for
example C:\ProgramData\VisualOn\BrowserPlugin.

Note: If you cannot find ProgramData under Disk C, select Tools > Folder
Options > View, select Show hidden files, folders, and drives, and then
click OK.

2. Open notepad, and ensure that volog.cfg includes the following


text.
Refer to 4.3 Customization of volog.cfg for the detailed explanation
of the following tags/values.

172 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 4: Logging System

0x00000000,2
0xFFFFFFFF,C:\ProgramData\VisualOn\BrowserPlugin,128000
0xFFFFFFFE,1

3. Run the sample player. You can find the volog.log file under
C:\ProgramData\VisualOn\BrowserPlugin.

4.4.4 Capturing In the case of the VisualOn sample plug-in, the volog.cfg file is located
log on Mac under /Users/<user_name>/Library/Internet Plug-
NPAPI plug-in Ins/voBrowserPlugin.plugin/Contents/dylib. After installing the debug
version, the log file will be automatically saved to ~/Users /<user_name>.

If you want to configure the log output, perform the following to capture
the OSMP+ log on Mac OS NPAPI plug-in:
1. Open the volog.cfg file under /Users/<user_name>/Library/Internet
Plug-Ins/voBrowserPlugin.plugin/Contents/dylib after installing the
debug version.
2. You will see the following text. Make changes to volog.cfg file as
needed.
Refer to 4.3 Customization of volog.cfg for the detailed explanation
of the following tags/values.
0x00000000,2
0xFFFFFFFF,./,1280000
0xFFFFFFFE,1

3. Run the sample player. You can find the volog.log file under ~/Users
/<user_name>.

Note: Make sure that the volog.cfg file values are compatible with the
name of your customized application.

4.4.5 Capturing Follow the instructions to obtain your log file on Windows Phone 8.1:
log on Windows
Phone 1. Go to http://isostorespy.codeplex.com/ and then download
IsoStoreSpy.
2. Install and open IsoStoreSpy.
3. Connect your Windows phone to your computer with a USB cable
that comes with your phone.

4. Click the upload button , and then browse to select volog.cfg.


The volog.cfg file is as follows.
Refer to 4.3 Customization of volog.cfg for the detailed explanation
of the following tags/values.
0x00000000,2
0xFFFFFFFF,./,1280000
0xFFFFFFFE,1

OnStream MediaPlayer+ User Guide 173


VisualOn
Chapter 4: Logging System

5. Logs are generated and saved in the volog.log file located under
the same directory as volog.cfg.
If you do not want to install IsoStoreSpy and have ISETool.exe already
installed on your computer, follow the instructions below to obtain your log
file:

Note: ISETool.exe should be located under ‘C:\Program Files (x86)\Microsoft


SDKs\Windows Phone\v8.1\Tools\IsolatedStorageExplorerTool’.

1. Connect your Windows phone to your computer with a USB cable


that comes with your phone.
2. Open cmd.exe on your computer.
3. Type the following command in the command line.

Note: the sample path ‘E:\apk\IsolatedStore’ is the directory where


volog.cfg is saved on your computer. Make changes to this file path as
needed.

ISETool.exe rs de 9731be5a-856a-45fb-b85a-4054a33bf837
"E:\apk\IsolatedStore
4. The log file will be generated and saved on your Windows Phone.
Type the following command in the command line to copy the log
file to your computer. You can change the file path as needed.
ISETool.exe ts de 9731be5a-856a-45fb-b85a-4054a33bf837
"E:\apk

4.5 Verimatrix Log File Location


• Android: Logs are generated and saved according to the VR_log.ini
configuration file that is stored under /sdcard/VR.
 If VR_log.ini exists under /sdcard/VR and this .ini file includes
VERIMATRIXLOG=1, logs are saved under /sdcard/VR.
 If VR_log.ini exists under /sdcard/VR but this .ini files does not
include VERIMATRIXLOG=1, the OSMP+ SDK cannot output the
Verimatrix log.
 If VR_log.ini does not exist, the OSMP+ SDK cannot output the
Verimatrix log.
• iOS: The Verimatrix logs are generated and saved under
/Applications/Documents
• Windows:
 NPAPI: The Verimatrix log can be found in
C:\Users\<user_name>\AppData\LocalLow\VisualOn\vrweb_cli
ent.log

174 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 4: Logging System

 PPAPI: The Verimatrix log can be found in


C:\Users\<USERNAME>\AppData\LocalLow\VisualOn\vrweb_cli
ent.log
• Mac OS:
 NPAPI: The Verimatrix log is saved in
~/Users/<user_name>/VisualOn/vrweb_client.log
 PPAPI: The Verimatrix log can be found in
~/User/VisualOn/vrweb_client.log
• Windows Phone: The Verimatrix logs are generated and saved in your
app’s local folder.

4.6 Logging Messages


The following sections describe the logging keywords that are defined in
the voLog.h header file. The sample output message through Table 14 to
Table 29 is $YOURSLOG$ of the above sample.

Note: Contents in Sample output message column demonstrate an example of


keyword’s output message. Characters/Strings/Numbers included in angle
brackets <> vary from your actual log message.

4.6.1 Bitrate Table 14 lists the keywords, keywords’ definitions, parameter types, and
Adaptation logs sample output messages for the Bitrate Adaptation related logs labeled
with LOGLEVEL=0.

Table 14. Bitrate Adaptation related logs

Parameter
Keyword Definition Sample output message
type
VOLOG_KEYWORD_BA_CAP(x Maximum bitrate that can be BA CAP bandwidth:
int
) used <200000 b>
VOLOG_KEYWORD_BA_INIT_BI Initial bitrate that should be BA initial bitrate: <200000
int
TRATE(x) selected bps>
VOLOG_KEYWORD_BA_CPU_L CPU loading value when
int BA CPU-loading: <57%>
OADING(x) performing bitrate adaptation
BA stream bitrate changes
VOLOG_KEYWORD_BA_SWITC
Stream bitrate is changed Int, int from bitrate: <200000 bps>
HING(x,y)
to bitrate: <737777 bps>

4.6.2 Buffer logs Table 15 lists the keywords, keywords’ definitions, parameter types, and
sample output messages for the buffer related logs labeled with
LOGLEVEL=0. All keywords are the information about player’s buffer pool
or the buffering operation.

OnStream MediaPlayer+ User Guide 175


VisualOn
Chapter 4: Logging System

Table 15. Buffer related logs

Parameter
Keyword Definition Sample output message
type
VOLOG_KEYWORD_BUFFER_M Maximum duration of buffer Buffer maximum length:
int
AXLEN(x) pool <20000 ms>
VOLOG_KEYWORD_BUFFER_B Position where bitrate Buffer BA position: <10032
int
A_POS(x,y) adaptation occurs ms>
VOLOG_KEYWORD_BUFFER_B Indicates that buffering is
N/A Buffer buffering in progress
UFFERING progress

4.6.3 Content Table 16 lists the keywords, keywords’ definitions, parameter types, and
logs sample output messages for the content related logs labeled with
LOGLEVEL=0.

Table 16. Content related logs

Parameter
Keyword Definition Sample output message
type
Content URL:
VOLOG_KEYWORD_CONTENT Information of content URL
char* <http://10.2.68.105/nts/app
_URL(x) string
le/gear4/fileSequence1.ts>
VOLOG_KEYWORD_CONTENT Video codec type used for the Content video codec:
char*
_VIDEO_CODEC(x) content being played <AVPlayer>
VOLOG_KEYWORD_CONTENT Audio codec type used for the Content audio codec:
char*
_AUDIO_CODEC(x) content being played <AAC>
VOLOG_KEYWORD_CONTENT Video resolution in width <x> Content resolution: <1024 x
int, int
_RESOLUTION(x,y) height <y> 768>
VOLOG_KEYWORD_CONTENT Streaming type that is either Content streaming type:
char*
_STREAMING_MEDIA_TYPE(x) Live or VOD <Live>

4.6.4 Controller Table 17 lists the keywords, keywords’ definitions, parameter types, and
logs sample output messages for the controller related logs labeled with
LOGLEVEL=0.

Table 17. Controller related logs


Keyword Definition Parameter type Sample output message
Controller downloads a
chunk [result<processing
OK>, size<942444 B>,
downloadtime<443 ms>,
VOLOG_KEYWORD_CONTRO
Information of chunk char*, int, long, chunk duration<17019302
LLER_DOWNLOAD_CHUNK(a,
being downloaded int, int, char* b>, download
b,c,d,e,f)
speed(123022
bps),url<http://10.2.68.105/n
ts/apple/gear4/fileSequenc
e1.ts>]
VOLOG_KEYWORD_CONTRO Streaming information (id, Controller streaming info
int, int,int
LLER_STREAMING_INFO(x,y,z) bitrate, selected(Y/N) [id<0>, bitrate<200000 bps>,

176 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 4: Logging System

Keyword Definition Parameter type Sample output message


from streaming parser. selected<N>]

4.6.5 DRM logs Table 18 lists the keywords, keywords’ definitions, parameter types, and
sample output messages for the DRM related logs labeled with
LOGLEVEL=0.

Table 18. DRM related logs

Parameter Sample output


Keyword Definition
type message
DRM engine
VOLOG_KEYWORD_DRM_START DRM engine initialization starts N/A
initialization starts
VOLOG_KEYWORD_DRM_STOP DRM engine stops N/A DRM engine stops
VOLOG_KEYWORD_DRM_LICENS Information of DRM license DRM license server URL:
char*
E_SERVER(x) server URL <http://10.2.68.105 >
DRM source URL:
VOLOG_KEYWORD_DRM_SOURC <http://10.2.68.105/nts/
Information of DRM source URL char*
E_URL(x) apple/gear1/fileSeque
nce0.ts>
DRM destination URL:
Information of DRM destination
VOLOG_KEYWORD_DRM_DESTIN <http://10.2.68.105/nts/
URL that is converted from the char*
ATION_URL(x) apple/gear1/fileSeque
source URL
nce0.ts>
VOLOG_KEYWORD_DRM_DRM_T Information of DRM vendor, for DRM type:
char*
YPE(x) example, playready. <AES128_CommonAPI>
VOLOG_KEYWORD_DRM_KEY_ST Information of the DRM key
char* DRM key string: <>
RING(x) string

4.6.6 Hardware Table 19 lists the keywords, keywords’ definitions, parameter types, and
Codec logs sample output messages for the hardware codec related logs labeled
with LOGLEVEL=0.

Table 19. Hardware codec related logs

Parameter
Keyword Definition Sample Output message
type
VOLOG_KEYWORD_MEDIAC Indicates that source is Hardware codec
N/A
ODEC_OPEN opened using MediaCodec MediaCodec is created
Indicates that source opened
VOLOG_KEYWORD_MEDIAC Hardware codec
with MediaCodec is N/A
ODEC_FINISHED MediaCodec is destroyed
completed
Hardware codec
VOLOG_KEYWORD_MEDIAC Shows the video head data of
char* MediaCodec video head
ODEC_VIDEO_HEAD_DATA(x) MediaCodec
data: <0x00>
VOLOG_KEYWORD_IOMX_ST Hardware codec IOMX is
MediaCodec starts N/A
ART created
VOLOG_KEYWORD_IOMX_ST MediaCodec completes N/A Hardware codec IOMX is

OnStream MediaPlayer+ User Guide 177


VisualOn
Chapter 4: Logging System

Parameter
Keyword Definition Sample Output message
type
OP destroyed
VOLOG_KEYWORD_IOMX_DE Hardware codec IOMX
Shows the device name char*
VICE_NAME(x) device name: <Galaxy S3>
Hardware codec IOMX
VOLOG_KEYWORD_IOMX_C Shows the IOMX component compontent:
char*
OMPONENT(x) information <OMX.Nvidia,h264,decode
r>
Hardware codec IOMX
VOLOG_KEYWORD_IOMX_VI
Shows the video resolution int, int video resolution: <1024 x
DEO_RESOLUTION(x,y)
768>
VOLOG_KEYWORD_IOMX_SU Shows the surface pointer Hardware codec IOMX
int
RFACE_POINTER(x) information surface pointer: <0x12345>

4.6.7 License Table 20 lists the keywords, keywords’ definitions, parameter types, and
logs sample output messages for the license related logs labeled with
LOGLEVEL=0.

Table 20. License related logs

Sample output
Keyword Definition Parameter type
message
VOLOG_KEYWORD_LICENSE_ Indicates that license check
N/A License check starts
START starts
VOLOG_KEYWORD_LICENSE_ Indicates that license check License check
N/A
STOP completes completes
VOLOG_KEYWORD_LICENSE_ Result of module being License check result:
int
CHECK_RESULT(x) performed the license check <successful>

4.6.8 Local File Table 21 lists the keywords, keywords’ definitions, parameter types, and
logs sample output messages for the local file related logs labeled with
LOGLEVEL=0.

Table 21. Local file related logs

Sample output
Keyword Definition Parameter type
message
VOLOG_KEYWORD_LOCAL_F Shows the file format Local file format:
char*
ILE_FORMAT(x) information <TS>
Local file clip
VOLOG_KEYWORD_LOCAL_ Shows the duration of local
int duration: <87670123
CLIP_DURATION(x) clip
ms>

4.6.9 KPI logs Table 22 lists the keywords, keywords’ definitions, parameter types, and
output messages for the KPI related logs labeled with LOGLEVEL=0.

178 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 4: Logging System

Table 22. KPI related logs

Sample output
Keyword Definition Parameter type
message
Information of video rendering KPI Video rendering
VOLOG_KEYWORD_KPI_FPS(x
performance in the unit of FPS int performance: <247
)
(frame per second) FPS>
VOLOG_KEYWORD_KPI_FRA Quantity of video frames KPI <241> Video
int
ME_DROP(x) being dropped after playback frame(s) dropped

4.6.10 OS Source Table 23 lists the keywords, keywords’ definitions, parameter types, and
logs sample output messages for the OS source related logs labeled with
LOGLEVEL=0.

Note: If ID number is -1 in output message, which means stream/audio/subtitle is


the track selected by default when opening the player.

Table 23. OS source related logs

Sample output
Keyword Definition Parameter type
message
OS source switches
VOLOG_KEYWORD_OSSOURCE Indicates that a stream is
int, int stream from ID <-1>
_SELECT_STREAM(x,y) selected
to ID <1>
OS source switches
VOLOG_KEYWORD_OSSOURCE Indicates video IDs selected
int, int video from ID <-1> to
_SELECT_VIDEO(x,y) by OS source
ID <1>
OS source switches
VOLOG_KEYWORD_OSSOURCE Indicates audio IDs selected
int, int audio from ID <-1> to
_SELECT_AUDIO(x,y) by OS source
ID <1>
OS source switches
VOLOG_KEYWORD_OSSOURCE Indicates subtitle IDs
int, int subtitle from ID <-1>
_SELECT_SUBTITLE(x,y) selected by OS source
to ID <1>
VOLOG_KEYWORD_OSSOURCE Indicates that program OS source program
N/A
_PROGRAMINFO_RESET information is reset. info gets reset
VOLOG_KEYWORD_OSSOURCE Indicates that program OS source program
N/A
_PROGRAMINFO_CHANGED information is changed. info gets changed

4.6.11 Output Table 24 lists the keywords, keywords’ definitions, parameter types, and
Control logs sample output messages for the OS source related logs labeled with
LOGLEVEL=0.

Table 24. Output control related logs

Parameter
Keyword Definition Sample output message
type
VOLOG_KEYWORD_OUTPUT_ Best effort setting is enabled or Output control best effort
int
CONTROL_BEST_EFFORT(x) not (0/1) setting enabled: <1>
VOLOG_KEYWORD_OUTPUT_ HDCP is enforced or not(0/1) int Output control HDCP

OnStream MediaPlayer+ User Guide 179


VisualOn
Chapter 4: Logging System

Parameter
Keyword Definition Sample output message
type
CONTROL_HDCP(x) when using HDMI output enforced: <0>
VOLOG_KEYWORD_OUTPUT_ Airplay anti-mirroring is Output control anti-
int
CONTROL_ANTI_MIRROR(x) enabled or not(0/1) mirroring enabled: <0>
Resolution is downgraded or
VOLOG_KEYWORD_OUTPUT_ Output control CIT digital
not(0/1) when HDCP rule int
CONTROL_CIT_DIGITAL(x) setting enabled: <1>
cannot be enforced
VOLOG_KEYWORD_OUTPUT_
HDMI cable status Output control HDMI
CONTROL_HDMI_CONNECTE int
plugged/unplugged(0/1) connected: <1>
D(x)
VOLOG_KEYWORD_OUTPUT_
Airplay mirroring status Output control Airplay
CONTROL_MIRROR_CONNEC int
connected/disconnected(0/1) mirroring connected: <0>
TED(x)
VOLOG_KEYWORD_OUTPUT_ Output is Output control output
int
CONTROL_BLOCK_OUTPUT(x) blocked/unblocked(0/1) blocked: <0>

4.6.12 RTSP logs Table 25 lists the keywords, keywords’ definitions, parameter types, and
sample output messages for the RTSP related logs labeled with
LOGLEVEL=0.

Table 25. RTSP related logs

Parameter
Keyword Definition Sample output message
type
RTSP server connection
VOLOG_KEYWORD_RTSP_SER Information of RTSP server
char*, int address: <102.110.0.8>
VER(x,y) address and port
and port: <80>
RTSP DESCRIBE request
message: <(DESCRIBE
rtsp://rtsp-
VOLOG_KEYWORD_RTSP_DES Information of RTSP DESCRIBE helix.visualon.com/source
char*
CRIBE_REQUEST(x) request string /mp4/mpeg4aac/mpeg4
_d1_1000kbps_30fps_aac_
ste_48khz_128kbps.mp4
RTSP/1.0>
RTSP DESCRIBE response
VOLOG_KEYWORD_RTSP_DES Information of RTSP DESCRIBE
char* message: <(RTSP/1.0 200
CRIBE_RESPONSE(x) response string
OK>
RTSP SETUP request
message: <(SETUP
rtsp://rtsp-
VOLOG_KEYWORD_RTSP_SET Information of RTSP SETUP helix.visualon.com/source
char*
UP_REQUEST(x) request string /mp4/mpeg4aac/mpeg4
_d1_1000kbps_30fps_aac_
ste_48khz_128kbps.mp4/st
reamid=65736 RTSP/1.0>
VOLOG_KEYWORD_RTSP_SET Information of RTSP SETUP RTSP SETUP response
char*
UP_RESPONSE(x) response string message: <(RTSP/1.0 200

180 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 4: Logging System

Parameter
Keyword Definition Sample output message
type
OK>
RTSP PLAY request
message: <(PLAY
rtsp://rtsp-
VOLOG_KEYWORD_RTSP_PLA Information of RTSP PLAY helix.visualon.com/source
char*
Y_REQUEST(x) request string /mp4/mpeg4aac/mpeg4
_d1_1000kbps_30fps_aac_
ste_48khz_128kbps.mp4/st
reamid=65736 RTSP/1.0>
RTSP PLAY response
VOLOG_KEYWORD_RTSP_PLA Information of RTSP PLAY
char* message: <(RTSP/1.0 200
Y_RESPONSE(x) response string
OK>
RTSP TEARDOWN request
message: <(TEARDOWN
rtsp://rtsp-
VOLOG_KEYWORD_RTSP_TEA Information of RTSP PLAY helix.visualon.com/source
char*
RDOWN_REQUEST(x) request string /mp4/mpeg4aac/mpeg4
_d1_1000kbps_30fps_aac_
ste_48khz_128kbps.mp4
RTSP/1.0>
RTSP TEARDOWN response
VOLOG_KEYWORD_RTSP_TEA Information of RTSP PLAY
char* message: <(RTSP/1.0 200
RDOWN_RESPONSE(x) response string
OK>
RTSP OPTIONS request
message: <(OPTIONS
rtsp://rtsp-
VOLOG_KEYWORD_RTSP_OP Information of RTSP OPTIONS helix.visualon.com/source
char*
TIONS_REQUEST(x) request string /mp4/mpeg4aac/mpeg4
_d1_1000kbps_30fps_aac_
ste_48khz_128kbps.mp4
RTSP/1.0>
RTSP OPTIONS response
VOLOG_KEYWORD_RTSP_OP Information of RTSP OPTIONS
char* message: <(RTSP/1.0 200
TIONS_RESPONSE(x) response string
OK>
RTSP GET_PARAMETER
request message:
<(GET_PARAMETER
rtsp://rtsp-
VOLOG_KEYWORD_RTSP_GET Information of RTSP
char* helix.visualon.com/source
PARAM_REQUEST(x) GET_PARAMETER request string
/mp4/mpeg4aac/mpeg4
_d1_1000kbps_30fps_aac_
ste_48khz_128kbps.mp4
RTSP/1.0>
Information of RTSP RTSP GET_PARAMETER
VOLOG_KEYWORD_RTSP_GET
GET_PARAMETER response char* response message:
PARAM_RESPONSE(x)
string <(RTSP/1.0 200 OK>
VOLOG_KEYWORD_RTSP_GET Information of RTSP GET char* RTSP GET request

OnStream MediaPlayer+ User Guide 181


VisualOn
Chapter 4: Logging System

Parameter
Keyword Definition Sample output message
type
_REQUEST(x) request string message: <(GET
rtsp://rtsp-
helix.visualon.com/source
/mp4/mpeg4aac/mpeg4
_d1_1000kbps_30fps_aac_
ste_48khz_128kbps.mp4
RTSP/1.0>
RTSP POST request
message: <(POST
rtsp://rtsp-
VOLOG_KEYWORD_RTSP_PO Information of RTSP POST helix.visualon.com/source
char*
ST_REQUEST(x) request string /mp4/mpeg4aac/mpeg4
_d1_1000kbps_30fps_aac_
ste_48khz_128kbps.mp4
RTSP/1.0>

4.6.13 Streaming Table 26 lists the keywords, keywords’ definitions, parameter types, and
logs sample output messages for the streaming related logs labeled with
LOGLEVEL=0.

Table 26. Streaming related logs

Sample output
Keyword Definition Parameter type
message
VOLOG_KEYWORD_STREAMI Streaming protocol Streaming protocol:
char*
NG_PROTOCOL(x) type(HLS/DASH/MS-SSTR) <HLS>
VOLOG_KEYWORD_STREAMI Streaming version:
Streaming spec version char*
NG_VERSION(x) <CE708>
VOLOG_KEYWORD_STREAMI All bitrates that streaming Streaming bitrate:
char*
NG_BITRATE(x) contains <200000 bps>
VOLOG_KEYWORD_STREAMI Streaming type:
Streaming type(VoD/Live/DVR) char*
NG_TYPE(x) <Live>
VOLOG_KEYWORD_STREAMI Streaming duration:
Streaming duration information int
NG_DURATION(x) <879932112 ms>

4.6.14 SourceIO Table 27 lists the keywords, keywords’ definitions, parameter types, and
logs sample output messages for the sourceIO related logs labeled with
LOGLEVEL=0.

Table 27. SourceIO related logs

Sample output
Keyword Definition Parameter type
message
SourceIO proxy
VOLOG_KEYWORD_SOURCEI address:
Proxy address and port char*, int
O_PROXY(x,y) <108.110.0.8> and
port: <8088>

182 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 4: Logging System

Sample output
Keyword Definition Parameter type
message
SourceIO redirects
from url:
<http://public.infoze
n.cshls.lldns.net/infoz
VOLOG_KEYWORD_SOURCEI Redirection operation occurs en/public/public.m3
char*, char*
O_REDIRECT(x,y) when requesting a normal url u8> to url:
<http://public.infoze
n.cshls.lldns.net/infoz
en/public/public/pu
blic_1000.m3u8>

4.6.15 Subtitle Table 28 lists the keywords, keywords’ definitions, parameter types, and
logs sample output messages for the sourceIO related logs labeled with
LOGLEVEL=0.

Table 28. Subtitle related logs

Sample output
Keyword Definition Parameter type
message
Indicates external subtitle is Subtitle external
VOLOG_KEYWORD_SUBTITLE_
played, and shows the subtitle char* subtitle URI:
EXTERNAL(x)
URI <http://108.110.0.2>
VOLOG_KEYWORD_SUBTITLE_ Indicates subtitle from Subtitle internal
N/A
INTERNAL streaming source is played subtitle
Indicates the subtitle sepc, like
VOLOG_KEYWORD_SUBTITLE_ Subtitle spec:
TTML, SMPTE-TT, CC608, CC708, char*
SEPC(x) <WEBVTT>
WEBVTT, DVB-Sub, and so on
Indicates the subtitle
VOLOG_KEYWORD_SUBTITLE_ Subtitle container:
container, like TS, MP4, char*
CONTAINER(x) <MP4>
Manifest, ID3

4.6.16 VOME2 Table 29 lists the keywords, keywords’ definitions, parameter types, and
engine logs sample output messages for the VOME2 engine related logs labeled with
LOGLEVEL=0.

Table 29. VOME2 engine related logs

Parameter
Keyword Definition Sample output message
type
VOLOG_KEYWORD_VOME2E VOME2 engine <video>
Indicates the buffering starts char*
NGINE_BUFFER_START(x) buffering starts
VOLOG_KEYWORD_VOME2E Indicates the buffering VOME2 engine <video>
char*
NGINE_BUFFER_END(x) completes buffering completes
VOME2 engine Warning:
Indicates the difference AV render time
VOLOG_KEYWORD_VOME2E
between render time and int diff(render time -
NGINE_AV_NSYNC(x)
playback time playback time): <270048
ms>. AV may not be in

OnStream MediaPlayer+ User Guide 183


VisualOn
Chapter 4: Logging System

Parameter
Keyword Definition Sample output message
type
sync!
Indicates frame dropping may VOME2 engine drops
VOLOG_KEYWORD_VOME2E
cause video play in fast N/A frame may cause video
NGINE_FRAME_DROP
forward play in fast forward
VOME2 engine <video>
VOLOG_KEYWORD_VOME2E Indicates dropping of video
drops frame may cause
NGINE_MODULE_FRAME_DR frame may cause the char*
video play in fast
OP(x) playback in fast forward
forward
VOLOG_KEYWORD_VOME2E Indicate VOME2 engine VOME2 engine
int
NGINE_READ_SOURCE(x) completes succeeds, <11 ms> used
VOLOG_KEYWORD_VOME2E Indicates the information of VOME2 engine <video>
char*
NGINE_NEW_FORMAT(x) new format new format
VOLOG_KEYWORD_VOME2E VOME2 engine <audio>
Indicate the content type char*
NGINE_AV_ONLY(x) only
VOME2 engine <video>
VOLOG_KEYWORD_VOME2E Indicates the content reaches
char* reaches the end of the
NGINE_EOS(x) the end of the source
source
VOME2 engine <audio>
VOLOG_KEYWORD_VOME2E Indicates the time that input
char*, int input timestamp jumps:
NGINE_INPUT_TIME_DIFF(x,y) timestamp jumps
<304600> ms
VOME2 engine <audio>
VOLOG_KEYWORD_VOME2E
Indicates the time that output decoder output
NGINE_DEC_OUTPUT_DIFF(x,y char*, int
timestamp jumps timestamp jumps:
)
<10519> ms
VOME2 engine Warning:
VOLOG_KEYWORD_VOME2E Indicates the audio latency is
int audio latency is too big:
NGINE_LATENCY_ABNM(x) too large
<304600> ms
VOME2 engine <video>
VOLOG_KEYWORD_VOME2E Indicates the time that render
char*, int render timestamp
NGINE_RENDER_DIFF(x,y) timestamp jumps
jumps: <304582> ms

184 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 5: License

Chapter 5 License

This chapter presents the following topics:

5.1 Evaluation license.........................................................................................186

5.2 Production license ........................................................................................186

OnStream MediaPlayer+ User Guide 185


VisualOn
Chapter 5: License

5.1 Evaluation license


The evaluation license has an expiration time from the date when the build
is created. You do not need the additional key to activate OSMP+.

5.2 Production license


The production license varies depending on the platform what you are
using. The production license file needs to match the package name
defined by customers on the Android platform. For Windows, Mac OS, iOS,
and Windows Phone platforms, a key is needed to activate OSMP+.

5.2.1 Android See the following for the required code to activate production license on
Android.

InputStream is = null;
byte[] b = new byte[32*1024];
try {
is = context.getAssets().open("voVidDec.dat");
is.read(b);
is.close();
} catch (IOException e) {
e.printStackTrace();
}
m_sdkPlayer.setLicenseContent(b);

5.2.2 iOS See the following for the required code to activate production license on
iOS.

//Set license text


id<VOCommonPlayerConfiguration> pPlayerConfiguration =
self.player;
NSString *strLicense = [[NSBundle mainBundle]
pathForResource:@"voVidDec.dat" ofType:nil];
[pPlayerConfiguration setLicenseFilePath:strLicense];
[pPlayerConfiguration setPreAgreedLicense:@"License key
here"];

5.2.3 Windows The following is the needed code to activate production license on
plug-in Windows plug-in.

Note: Set the value of


HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\VisualOn\BrowserPlugin\Pr
eAgreedLicense\key in Registry to empty when using setPreAgreedLicense() to
activate the production license.

186 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 5: License

// Write license in the Registry when install the plugin package


// Set the Registry place in "voPluginConfig.cpp" in
plugin source code file
/*
License key info,for example:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\VisualOn\BrowserPl
ugin\PreAgreedLicense\key = PreAgreedLicenseString
*/
const char* VOPLUGIN_REGISTER_PATH_ROOT =
"SOFTWARE\VisualOn\BrowserPlugin\";
const char* VOPLGUIN_ERGISTER_PRE_LICENSE_KEY =
"PreAgreedLicense";
const char* VOPLGUIN_ERGISTER_PRE_LICENSE_VALUE = "key";

5.2.4 Mac OS See the following for the required code to activate production license on
plug-in Mac OS plug-in.

Note: Set the license text in VOPlugin-Info.plist to empty when using


setPreAgreedLicense() to activate the production license.

// Put license in package folder /License/MacOS/


// Set license text in VOPlugin-Info.plist
<key>PreAgreedLicense</key>
<string>License key here</string>

5.2.5 Chrome See the following for the required code to activate production license for
PPAPI plug-in Chrome PPAPI plug-ins.

Note: Chrome PPAPI only supports activating the production license with
setPreAgreedLicense. The approach of editing the registry key on Windows or
editing Info.plist on Mac OS does not work yet.

// Replace the voVidDec.dat file with the production voVidDec.dat


file
// Set the PreAgreed license text in "commonVariable.js"
var preAgreedLicenseID = 'VisualOnPreAgreedLicenseText';

5.2.6 Windows See the following for the required code to activate production license on
Phone Windows Phone.

// read license file content.


Platform::String^ fullPath =
Windows::ApplicationModel::Package::Current->InstalledLocation-
>Path;
Platform::String^ lisenceFileName = fullPath +
"\\voVidDec.dat";
char stra[2048];
memset(stra, 0, sizeof(stra));
WideCharToMultiByte(CP_ACP, 0, (WCHAR*)lisenceFileName-
>Data(), -1, stra, 1024, NULL, NULL);

OnStream MediaPlayer+ User Guide 187


VisualOn
Chapter 5: License

std::string strFilePath = ((char*)stra);

FILE *f;
fopen_s(&f, strFilePath.c_str(), "rb");
fseek(f, 0, SEEK_END);
long fsize = ftell(f);
fseek(f, 0, SEEK_SET);
unsigned char *licenseContent = (unsigned char
*)malloc(fsize);
fread(licenseContent, 1, fsize, f);
fclose(f);
int nRC = m_commonPlayer-
>setLicenseContent(licenseContent, fsize);
nRC = m_commonPlayer->setPreAgreedLicense("License key
here");
free(licenseContent);

188 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 6: Frequently Asked Questions

Chapter 6 Frequently Asked Questions

This chapter presents the following topics:

6.1 Frequently Asked Questions ........................................................................190

OnStream MediaPlayer+ User Guide 189


VisualOn
Chapter 6: Frequently Asked Questions

6.1 Frequently Asked Questions


The list that follows is designed to answer your questions about OSMP+.

Question 1: Why my device cannot play the video with the highest bitrate?

Answer 1: This problem may be caused by the configuration in cap.xml


and your network bandwidth. Check the following to figure out the
solution depending on your case:
• Record your device model, and then check if your device model is
listed in the cap.xml file located under your installation package.
Configurations in cap.xml may result in the limited bitrate on your
device.
• Check your network bandwidth to see if the network bandwidth is
enough to play the content with the highest bitrate.

Question 2: Why I see the expiration message on the player?

Answer 2: The evaluation message appears on the video screen to


indicate that you are using the evaluation license. If your product is target
to release to market, check if you have the production license. If not,
contact VisualOn’s sales.

Question 3: How can I create the player for the debug purpose?

Answer 3: The solution may vary depending on the operating system that
you are using.
• Mac OS plug-in: Use the libraries under the Macintosh
/Libs/MacOS/x86/debug directory
• Android: Use the .so files under the \Libs\debug directory and the .jar
files under the \Jar\debug directory in your installation package.
• iOS: Use the .a files under the /Libs/debug directory.
• Windows plug-in: Use the .dll files and configuration files under
\Libs\Win32\debug directory.

Question 4: How can I quickly get started with the features provided by the
OSMP+ product?

Answer 4: The integration Labs, which are compressed into the labs.zip file
under Doc of your installation package, provide working examples to
accompany the OSMP+ Player SDK Integration Guide. The integration Labs
focus on individual integration topics and require installation of the SDK

190 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 6: Frequently Asked Questions

and license file. Start with README.txt compressed in the labs.zip file to
learn how to use Labs.

Question 5: When an HLS stream is paused, what is the default time that
OSMP+ will buffer?

Answer 5: The buffer time is the sum of maximum buffering time and one
segment. The default maximum buffering time is 20 seconds.

Question 6: When a Live stream is paused, what is the default time that
OSMP+ will buffer?

Answer 6: The buffer time is the sum of maximum buffering time and one
segment. The default maximum buffering time is 20 seconds.

Question 7: Is there a limit to the value of .setMaxBufferingTime?

Answer 7: This value varies from the device. We do not have a limitation on
the maximum buffering time.

Question 8: What is the supported language code for


setPreferredAudioLanguage?

Answer 8: The preferred audio language supports both ISO 639-1 and ISO
639-2. See Table 30 for the detailed language list.

Table 30. List of supported language codes

ISO 639-1 ISO 639-2 Language


aa aar Afar
ab abk Abkhazian
af afr Afrikaans
ak aka Akan
sq alb Albanian
am amh Amharic
ar ara Arabic
an arg Aragonese
hy arm Armenian
as asm Assamese
av ava Avaric
ay aym Aymara

OnStream MediaPlayer+ User Guide 191


VisualOn
Chapter 6: Frequently Asked Questions

ISO 639-1 ISO 639-2 Language


az aze Azerbaijani
ba bak Bashkir
bm bam Bambara
eu baq Basque
be bel Belarusian
bn ben Bengali
bi bis Bislama
bs bos Bosnian
br bre Breton
bg bul Bulgarian
my bur Burmese
ca cat Catalan
ch cha Chamorro
ce che Chechen
zh chi Chinese
cv chv Chuvash
kw cor Cornish
co cos Corsican
cr cre Cree
cs cze Czech
da dan Danish
dv div Dhivehi
nl dut Dutch
dz dzo Dzongkha
en eng English
et est Estonian
ee ewe Ewe
fo fao Faroese
fj fij Fijian
fi fin Finnish
fr fra French
fy fry Western Frisian
ff ful Fulah
ka geo Georgian
de ger German
gd gla Scottish Gaelic
ga gle Irish

192 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 6: Frequently Asked Questions

ISO 639-1 ISO 639-2 Language


gl glg Galician
gv glv Manx
el gre Modern Greek (1453-)
gn grn Guarani
gu guj Gujarati
ht hat Haitian
ha hau Hausa
he heb Hebrew
hz her Herero
hi hin Hindi
ho hmo Hiri Motu
hu hun Hungarian
hr hrv Croatian
ig ibo Igbo
is ice Icelandic
ii iii Sichuan Yi
iu iku Inuktitut
id ind Indonesian
ik ipk Inupiaq
it ita Italian
jv jav Javanese
ja jpn Japanese
kl kal Kalaallisut
kn kan Kannada
ks kas Kashmiri
kr kau Kanuri
kk kaz Kazakh
km khm Central Khmer
ki kik Kikuyu
rw kin Kinyarwanda
ky kir Kirghiz
kv kom Komi
kg kon Kongo
ko kor Korean
kj kua Kuanyama
ku kur Kurdish
lo lao Lao

OnStream MediaPlayer+ User Guide 193


VisualOn
Chapter 6: Frequently Asked Questions

ISO 639-1 ISO 639-2 Language


lv lav Latvian
li lim Limburgan
ln lin Lingala
lt lit Lithuanian
lb ltz Luxembourgish
lu lub Luba-Katanga
lg lug Ganda
mk mac Macedonian
mh mah Marshallese
ml mal Malayalam
mi mao Maori
mr mar Marathi
ms may Malay (macrolanguage)
mg mlg Malagasy
mt mlt Maltese
mn mon Mongolian
na nau Nauru
nn nno Norwegian Nynorsk
nv nav Navajo
nr nbl South Ndebele
nd nde North Ndebele
ng ndo Ndonga
ne nep Nepali
nb nob Norwegian Bokm
no nor Norwegian
ny nya Nyanja
oc oci Occitan (post 1500)
oj oji Ojibwa
or ori Oriya
om orm Oromo
os oss Ossetian
pa pan Panjabi
fa per Persian
pl pol Polish
pt por Portuguese
ps pus Pushto
qu que Quechua

194 OnStream MediaPlayer+ User Guide


VisualOn
Chapter 6: Frequently Asked Questions

ISO 639-1 ISO 639-2 Language


rm roh Romansh
ro rum Romanian
rn run Rundi
ru rus Russian
sg sag Sango
si sin Sinhala
sk slo Slovak
sl slv Slovenian
se sme Northern Sami
sm smo Samoan
sn sna Shona
sd snd Sindhi
so som Somali
st sot Southern Sotho
sr srp Serbian
es spa Spanish
sc srd Sardinian
ss ssw Swati
su sun Sundanese
sw swa Swahili (macrolanguage)
sv swe Swedish
ty tah Tahitian
ta tam Tamil
tt tat Tatar
te tel Telugu
tg tgk Tajik
tl tgl Tagalog
th tha Thai
bo tib Tibetan
ti tir Tigrinya
to ton Tonga (Tonga Islands)
tn tsn Tswana
ts tso Tsonga
tk tuk Turkmen
tr tur Turkish
tw twi Twi
ug uig Uighur

OnStream MediaPlayer+ User Guide 195


VisualOn
Chapter 6: Frequently Asked Questions

ISO 639-1 ISO 639-2 Language


uk ukr Ukrainian
ur urd Urdu
uz uzb Uzbek
ve ven Venda
vi vie Vietnamese
cy wel Welsh
wa wln Walloon
wo wol Wolof
xh xho Xhosa
yi yid Yiddish
yo yor Yoruba
za zha Zhuang
zu zul Zulu

196 OnStream MediaPlayer+ User Guide


VisualOn
Appendix A: Programming reference

Appendix A Programming reference

This appendix presents the following topics:

API reference ......................................................................................................198

Events ...................................................................................................................198

OnStream MediaPlayer+ User Guide 197


VisualOn
Appendix A: Programming reference

API reference

For more information about the OSMP+ API, refer to the API Reference
Manual.zip file under the Doc directory in the installation package.

Events
This section briefly introduces error codes and event IDs used in OSMP+.

Error codes VO_OSMP_ERR_NONE


Value: 0X00000000

Description: No error

Suggestion: The operation is successful. This error code can be ignored.

VO_OSMP_ERR_EOS
Value: 0X00000001

Suggestion: Reserved. Do not use.

VO_OSMP_ERR_RETRY
Value: 0X00000002

Suggestion: Reserved. Do not use.

VO_OSMP_ERR_FORMAT_CHANGE
Value: 0X00000003

Suggestion: Reserved. Do not use.

VO_OSMP_ERR_AUDIO_NO_NOW
Value: 0X00000010

Description: Audio is not available.

Suggestion: Status. The audio is not available, and user can choose to play
the video or stop playback.

VO_OSMP_ERR_VIDEO_NO_NOW
Value: 0X00000011

Description: Video is not available

Suggestion: Status. Video is not available, and user can choose to play the
video or stop playback.

198 OnStream MediaPlayer+ User Guide


VisualOn
Appendix A: Programming reference

VO_OSMP_ERR_FLUSH_BUFFER
Value: 0X00000012

Description: Buffer needs to be flushed

Suggestion: Status. This error code can be ignored.

VO_OSMP_ERR_VIDEO
Value: 0X80000004

Suggestion: Reserved. Do not use.

VO_OSMP_ERR_AUDIO
Value: 0X80000005

Suggestion: Reserved. Do not use.

VO_OSMP_ERR_OUTMEMORY
Value: 0X80000006

Description: Out of memory occurs. The player crashes in a moment.

Suggestion: Fatal error. It stops playback.

VO_OSMP_ERR_POINTER
Value: 0X80000007

Description: API calling sequence is incorrect or API parameters are invalid.

Suggestion: Fatal error. It stops playback.

VO_OSMP_ERR_PARAMID
Value: 0X80000008

Description: The current function is not implemented.

Suggestion: This is not a fatal error. Stop using the invalid parameter.

VO_OSMP_ERR_STATUS
Value: 0X80000009

Description: Cannot call the requested API under the current status.

Suggestion: Status. This error code can be ignored.

VO_OSMP_ERR_IMPLEMENT
Value: 0X8000000A

Description: The requested function is not implemented.

OnStream MediaPlayer+ User Guide 199


VisualOn
Appendix A: Programming reference

Suggestion: Function or parameter is not implemented. This error code can


be ignored.

VO_OSMP_ERR_SMALLSIZE
Value: 0X8000000B

Suggestion: Reserved. Do not use.

VO_OSMP_ERR_OUT_OF_TIME
Value: 0X8000000C

Suggestion: Reserved. Do not use.

VO_OSMP_ERR_WAIT_TIME
Value: 0X8000000D

Suggestion: Reserved. Do not use.

VO_OSMP_ERR_UNKNOWN
Value: 0X8000000E

Description: Undefined operation or behavior

Suggestion: Fatal error. It stops playback

VO_OSMP_ERR_JNI
Value: 0X8000000F

Description: JNI library cannot be used on iOS.

Suggestion: Fatal error. It stops playback.

VO_OSMP_ERR_LICENSE_FAIL
Value: 0X80000011

Description: VisualOn product license is not valid.

Suggestion: Fatal error. It stops playback.

VO_OSMP_ERR_HTTPS_CA_FAIL
Value: 0X80000012

Description: HTTPS certification authority failed.

Suggestion: Fatal error. It stops playback.

VO_OSMP_ERR_ARGUMENT
Value: 0X80000013

Description: Passed the wrong parameter.

200 OnStream MediaPlayer+ User Guide


VisualOn
Appendix A: Programming reference

Suggestion: Fatal error. It stops playback.

VO_OSMP_ERR_MULTIPLE_INSTANCES_NOT_SUPPORTED
Value: 0X80000014

Description: Multiple instances are forbidden (in some cases).

Suggestion: Fatal error. It stops playback.

VO_OSMP_ERR_UNINITIALIZE
Value: 0X80000101

Description: Requested object cannot be initialized.

Suggestion: Fatal error. It stops playback.

VO_OSMP_SRC_ERR_OPEN_SRC_FAIL
Value: 0X81000001

Description: Source cannot be opened.

Suggestion: Fatal error. It stops playback.

VO_OSMP_SRC_ERR_CONTENT_ENCRYPT
Value: 0X81000002

Description: Content is encrypted, further operations are required.

Suggestion: Fatal error. It stops playback.

VO_OSMP_SRC_ERR_PLAYMODE_UNSUPPORT
Value: 0X81000003

Description: Playmode is not supported on the current platform.

Suggestion: Status. Do not use this playmode.

VO_OSMP_SRC_ERR_ERROR_DATA
Value: 0X81000004

Description: Error in the source file.

Suggestion: Fatal error. It stops playback.

VO_OSMP_SRC_ERR_SEEK_FAIL
Value: 0X81000005

Description: Requested seek operation failed. Retry or skip the seek


operation.

Suggestion: Status. Seek failed. Seek again or skip the seek operation.

OnStream MediaPlayer+ User Guide 201


VisualOn
Appendix A: Programming reference

VO_OSMP_SRC_ERR_FORMAT_UNSUPPORT
Value: 0X81000006

Description: OSMP+ cannot support this media format.

Suggestion: Fatal error. It stops playback.

VO_OSMP_SRC_ERR_TRACK_NOTFOUND
Value: 0X81000007

Suggestion: Reserved. Do not use.

VO_OSMP_SRC_ERR_NO_DOWNLOAD_OP
Value: 0X81000008

Suggestion: Reserved. Do not use.

VO_OSMP_SRC_ERR_NO_LIB_OP
Value: 0X81000009

Suggestion: Reserved. Do not use.

VO_OSMP_SRC_ERR_OUTPUT_NOTFOUND
Value: 0X8100000A

Suggestion: Reserved. Do not use.

VO_OSMP_SRC_ERR_CHUNK_SKIP
Value: 0X8100000B

Suggestion: Reserved. Do not use.

VO_OSMP_SRC_ERR_SRC_UNINITIALIZE
Value: 0X80001001

Description: Source object is not initialized

Suggestion: Fatal error. It stops playback.

VO_OSMP_HTTP_CONNECT_FAILED

Value: 0x00000000

Description: Connection to HTTP server fails.

Suggestion: Status.

VO_OSMP_HTTP_INVALID_RESPONSE

Value: 0x00000001

202 OnStream MediaPlayer+ User Guide


VisualOn
Appendix A: Programming reference

Description: HTTP failed to get response or response cannot be parsed or is


too large.

Suggestion: Status.

VO_OSMP_HTTP_CLIENT_ERROR

Value: 0x00000002

Description: HTTP 4xx error occurs.

Suggestion: Status.

VO_OSMP_HTTP_SERVER_ERROR

Value: 0x00000003

Description: HTTP 5xx error occurs.

Suggestion: Status.

VO_OSMP_SRC_ERR_DIVXUNSUPPORTED

Value: 0X8100000D

Description: Indicate that video does not support DIVX

Suggestion: Fatal error. It stops playback.

VO_OSMP_CB_EVENT_ID

This is the enumeration for the callback event IDs.

VO_OSMP_CB_ERROR
Value: 0X8000000C

Description: Undefined operation or behavior

Suggestion: Fatal error. It stops playback.

VO_OSMP_CB_MULTIPLE_INSTANCES_NOT_SUPPORTED

Value: 0X80000029

Description: Multiple instances are forbidden (in some cases).

Suggestion: Fatal error. It stops playback.

VO_OSMP_CB_PLAY_COMPLETE
Value: 0X00000001

Description: Source playback completed

OnStream MediaPlayer+ User Guide 203


VisualOn
Appendix A: Programming reference

Suggestion: Status. It can be ignored or stop playback.

VO_OSMP_CB_VIDEO_START_BUFFER
Value: 0X00000003

Description: Video stream started buffering.

Suggestion: Status. This code can be ignored.

VO_OSMP_CB_VIDEO_STOP_BUFFER
Value: 0X00000004

Description: Video stream stopped buffering.

Suggestion: Status. This code can be ignored.

VO_OSMP_CB_AUDIO_START_BUFFER
Value: 0X00000005

Description: Audio stream started buffering.

Suggestion: Status. This code can be ignored.

VO_OSMP_CB_AUDIO_STOP_BUFFER
Value: 0X00000006

Description: Audio stream stopped buffering.

Suggestion: Status. This code can be ignored.

VO_OSMP_CB_SRC_BUFFERING_TIME
Value: 0X00000007

Description: Buffering time in the source.

Suggestion: Information. This code can be ignored.

VO_OSMP_CB_SEEK_COMPLETE
Value: 0X0000000D

Description: The engine starts rendering the data.

Suggestion: Status. This code can be ignored.

VO_OSMP_CB_VIDEO_ASPECT_RATIO
Value: 0X0000000E

Description: Video aspect ratio is changed.

Suggestion: Information. This code can be ignored.

204 OnStream MediaPlayer+ User Guide


VisualOn
Appendix A: Programming reference

VO_OSMP_CB_VIDEO_SIZE_CHANGED
Value: 0X0000000F

Description: Video size is changed.

Suggestion: Status. This code can be ignored.

VO_OSMP_CB_CODEC_NOT_SUPPORT
Value: 0X80000010

Description: The requested decoder is not supported.

Suggestion: Fatal error. It stops playback.

VO_OSMP_CB_DEBLOCK
Value: 0X00000011

Description: Enable/disable deblock event of video codec

Suggestion: Status. This code can be ignored.

VO_OSMP_CB_HW_DECODER_STATUS
Value: 0X00000013

Description: Hardware decoder status is available.

Suggestion: Status. This code can be ignored.

VO_OSMP_CB_AUTHENTICATION_RESPONSE
Value: 0X00000014

Description: Authentication response information, for example, report


information from server;

Suggestion: Information. This code can be ignored.

VO_OSMP_CB_LANGUAGE_INFO_AVAILABLE
Value: 0X00000015

Description: Subtitle language info is parsed and is available

Suggestion: Status. This code can be ignored.

VO_OSMP_CB_VIDEO_RENDER_START
Value: 0X00000016

Description: video render started

Suggestion: Status. This code can be ignored.

OnStream MediaPlayer+ User Guide 205


VisualOn
Appendix A: Programming reference

VO_OSMP_CB_OPEN_SRC_COMPLETE
Value: 0X00000017

Description: Open Source completed

Suggestion: Status. This code can be ignored.

VO_OSMP_CB_SEI_INFO
Value: 0X00000019

Description: Notify SEI info.

Suggestion: Information. This code can be ignored.

VO_OSMP_CB_AUDIO_RENDER_FAIL
Value: 0X8000001A

Description: The initialization of the audio track failed.

Suggestion: Fatal error. It stops playback.

VO_OSMP_CB_PCM_OUTPUT
Value: 0X0000001C

Description: This event is issued only when PCM data output is enabled.

Suggestion: Status. This code can be ignored.

VO_OSMP_CB_LICENSE_FAIL
Value: 0X8000001D

Description: The player cannot find a license or license is expired.

Suggestion: Fatal error. It stops playback.

VO_OSMP_CB_BLUETOOTHHANDSET_CONNECTION
Value: 0X00001011

Description: Bluetooth handset status

Suggestion: Status. This code can be ignored.

VO_OSMP_CB_OUTPUT_CONTROL_BLOCK_PLAYBACK
Value: 0x00000024

Description: Playback should be stopped on both local and external


devices

Suggestion: Fatal error. It stops playback

206 OnStream MediaPlayer+ User Guide


VisualOn
Appendix A: Programming reference

VO_OSMP_CB_OUTPUT_CONTROL_BLOCK_OUTPUT
Value: 0x00000025

Description: Sending output to external devices is blocked

Suggestion: Status. User can choose to play the video or stop playback.

VO_OSMP_CB_OUTPUT_CONTROL_CHANGE_RESOLUTION
Value: 0x00000026

Description: Resolution is changed by output control.

Suggestion: Status. This code can be ignored.

VO_OSMP_CB_OUTPUT_CONTROL_CAPTURE_SOFTWARE_RUNNING
Value: 0X0000002B

Description: Notify that the screen capturing software is running in the


system.

Suggestion: Status. The user can choose to play the video or stop
playback.

VO_OSMP_AD_CB_PLAYLIST_START
Value: 0X03000001

Description: Notify when the player starts displaying the first advertisement
video or content video.

Suggestion: N/A. Not used or not available.

VO_OSMP_AD_CB_PLAYLIST_END
Value: 0X03000002

Description: Notify when the player completes displaying the last


advertisement video or content video.

Suggestion: N/A. Not used or not available.

VO_OSMP_AD_CB_CONTENT_START
Value: 0X03000003

Description: Notify each time when a content is started.

Suggestion: The operation succeeded

VO_OSMP_AD_CB_CONTENT_END
Value: 0X03000004

Description: Notify when a content segment is finished.

OnStream MediaPlayer+ User Guide 207


VisualOn
Appendix A: Programming reference

Suggestion: The operation succeeded.

VO_OSMP_AD_CB_AD_START
Value: 0X03000005

Description: Notify when a video advertisement is started.

Suggestion: The operation succeeded.

VO_OSMP_AD_CB_AD_END
Value: 0X03000006

Description: Notify when a video advertisement is finished.

Suggestion: The operation succeeded.

VO_OSMP_AD_CB_VIDEO_PROGRESS
Value: 0X03000007

Description: Notify the current playing time.

Suggestion: The operation succeeded.

VO_OSMP_AD_CB_VIDEO_DONE
Value: 0X03000008

Description: Notify when the advertisement or content video is finished.

Suggestion: The operation succeeded.

VO_OSMP_AD_CB_STATE_CHANGE
Value: 0X03000009

Description: Notify when the status of player playback changes.

Suggestion: The operation succeeded.

VO_OSMP_AD_CB_PLAYBACKINFO
Value: 0X0300000A

Description: Get playback info.

Suggestion: The operation succeeded.

VO_OSMP_AD_CB_NO_AD_CONTENT
Value: 0X8300000B

Description: Notify when an advertisement has no content or does not be


loaded as expected.

Suggestion: N/A. Not used or not available.

208 OnStream MediaPlayer+ User Guide


VisualOn
Appendix A: Programming reference

VO_OSMP_AD_CB_AD_LOAD_ERROR
Value: 0X8300000C

Suggestion: Reserved. Do not use.

VO_OSMP_AD_CB_VIDEO_NOT_AVAILABLE
Value: 0X8300000D

Description: Notify when the content video is expired or is unavailable.

Suggestion: Fatal error. It stops playback.

VO_OSMP_AD_CB_DATA_LOAD_ERROR
Value: 0X8300000E

Description: Notify when the content video experiences a fatal error while
loading or playback

Suggestion: Fatal error. It stops playback.

VO_OSMP_AD_CB_VIDEO_GEO_BLOCKED
Value: 0X8300000F

Description: Notify when the GEO blocked

Suggestion: Fatal error. It stops playback.

VO_OSMP_SRC_CB_CONNECTING
Value: 0X02000001

Suggestion: Reserved. Do not use.

VO_OSMP_SRC_CB_CONNECTION_FINISHED
Value: 0X02000002

Suggestion: Reserved. Do not use.

VO_OSMP_SRC_CB_CONNECTION_TIMEOUT
Value: 0X82000003

Description: Source connection times out

Suggestion: This is a fatal error for PD module only.

VO_OSMP_SRC_CB_CONNECTION_LOSS
Value: 0X82000004

Suggestion: Reserved. Do not use.

OnStream MediaPlayer+ User Guide 209


VisualOn
Appendix A: Programming reference

VO_OSMP_SRC_CB_DOWNLOAD_STATUS
Value: 0X02000005

Description: HTTP download status.

Suggestion: Status. This code can be ignored.

VO_OSMP_SRC_CB_CONNECTION_FAIL
Value: 0X82000006

Description: Source connection failed

Suggestion: This is a fatal error for PD module. For Adaptive Streaming, this
is not a fatal error.

VO_OSMP_SRC_CB_DOWNLOAD_FAIL
Value: 0X82000007

Description: Source download failed

Suggestion: Status. This code can be ignored.

VO_OSMP_SRC_CB_DRM_FAIL
Value: 0X82000008

Description: Device provisioning failed or data decryption failed.

Suggestion: Fatal error. It stops playback.

VO_OSMP_SRC_CB_PLAYLIST_PARSE_ERR
Value: 0X82000009

Suggestion: Reserved. Do not use.

VO_OSMP_SRC_CB_CONNECTION_REJECTED
Value: 0X8200000A

Description: Reaches the maximum number of connections. This event is


only applicable for RTSP.

Suggestion: Fatal error. It stops playback.

VO_OSMP_SRC_CB_BA_HAPPENED
Value: 0X0200000B

Description: Bitrate is changed; param1 is new bitrate value (bps integer


type)

Suggestion: Status. This code can be ignored.

210 OnStream MediaPlayer+ User Guide


VisualOn
Appendix A: Programming reference

VO_OSMP_SRC_CB_DRM_NOT_SECURE
Value: 0X0200000C

Description: Device is rooted or is jail broken. This error code is only


applicable for showtime DRM.

Suggestion: Fatal error. It stops playback.

VO_OSMP_SRC_CB_DRM_AV_OUT_FAIL
Value: 0X8200000D

Description: Initialization of an AV (Audio/Video) file failed. This error code


is only applicable for showtime DRM.

Suggestion: Fatal error. It stops playback.

VO_OSMP_SRC_CB_DOWNLOAD_FAIL_WAITING_RECOVER
Value: 0X8200000E

Description: Download failed, waiting for recovery

Suggestion: Status. It can be ignored or user can stop playback.

VO_OSMP_SRC_CB_DOWNLOAD_FAIL_RECOVER_SUCCESS
Value: 0X0200000F

Description: Download recovery is successful.

Suggestion: Status. This code can be ignored.

VO_OSMP_SRC_CB_OPEN_FINISHED
Value: 0X02000010

Description: Source open completed.

Suggestion: Status. Send a notification when the source open is


completed.

VO_OSMP_SRC_CB_CUSTOMER_TAG
Value: 0X02000020

Description: Customer tag information is available inside the source.

Suggestion: Status. Handle this information or ignore it.

VO_OSMP_SRC_CB_ADAPTIVE_STREAMING_INFO
Value: 0X02000030

Description: Streaming information

Suggestion: Status. This code can be ignored.

OnStream MediaPlayer+ User Guide 211


VisualOn
Appendix A: Programming reference

VO_OSMP_SRC_CB_ADAPTIVE_STREAMING_ERROR
Value: 0X02000040

Description: Adaptive streaming error

Suggestion: Fatal error. It stops playback.

VO_OSMP_SRC_CB_ADAPTIVE_STREAM_WARNING
Value: 0X02000050

Description: Adaptive streaming error warning.

Suggestion: The App can ignore it or collect warning information;


VOOSMP_SRC_CB_Adaptive_Streaming_Error prompts after collecting
several warning information.

VO_OSMP_SRC_CB_RTSP_ERROR
Value: 0X02000060

Description: Notify RTSP error.

Suggestion: Fatal error. It stops playback.

VO_OSMP_SRC_CB_SEEK_COMPLETE
Value: 0X02000070

Description: Reserved. Do not use.

VO_OSMP_SRC_CB_PROGRAM_CHANGED
Value: 0X02000071

Description: Notify when the program information is changed in source

Suggestion: Status. This code can be ignored.

VO_OSMP_SRC_CB_PROGRAM_RESET
Value: 0X02000072

Description: Notify when the program information is reset in source

Suggestion: Status. This code can be ignored.

VO_OSMP_SRC_CB_ADAPTIVE_STREAMING_SEEK2LASTCHUNK
Value: 0X02000073

Description: Notify when seeking to the last chunk of playlist (NTS link
without END tag needs change to live mode)

Suggestion: Status. This code can be ignored.

212 OnStream MediaPlayer+ User Guide


VisualOn
Appendix A: Programming reference

VO_OSMP_SRC_CB_NOT_APPLICABLE_MEDIA
Value: 0X02000074

Description: Network is not available now, but the player still has some
buffer data that can be played.

Suggestion: Status. This code can be ignored.

VO_OSMP_SRC_CB_PD_DOWNLOAD_POSITION
Value: 0X02000075

Description: Notify the current media position downloaded by the


progressive download module.

Suggestion: Status. This code can be ignored.

VO_OSMP_SRC_CB_PD_BUFFERING_PERCENT
Value: 0X02000076

Description: Notify the current buffering percent of the progressive


download module.

Suggestion: Status. This code can be ignored.

VO_OSMP_SRC_CB_UPDATE_URL_COMPLETE
Value: 0X02000077

Description: Update source URL completed.

Suggestion: Status. This code can be ignored.

VO_OSMP_CB_SYNC_EVENT_ID

This is the enumeration for the callback sync event IDs. These events are
sent from the sub-thread. Do not update UI or call other VisualOn’s API in
callback.

VO_OSMP_SRC_CB_ IO_HTTP_START_DOWNLOAD
Value: 0X04000001

Description: Start HTTP download.

Suggestion: Status. This code can be ignored.

VO_OSMP_SRC_CB_ IO_HTTP_DOWNLOAD_FAIL
Value: 0X04000002

Description: HTTP download failed.

Suggestion: Status. This code can be ignored.

OnStream MediaPlayer+ User Guide 213


VisualOn
Appendix A: Programming reference

VO_OSMP_SRC_CB_DRM_INIT_DATA
Value: 0X03000004

Description: Event of DRM initialization data.

Suggestion: Status. This code can be ignored.

VO_OSMP_SRC_CUSTOMERTAGID

This is the enumeration of HLS customer tag IDs, and is used in


VO_OSMP_SRC_CB_Customer_Tag callback.

VO_OSMP_SRC_CUSTOMERTAGID_TIMEDTAG
Value: 0X00000001

Description: The player calls back the time tag of HLS streaming with this
tag ID

Suggestion: Information. This code can be ignored.

VO_OSMP_SRC_CB_IO_HTTP_DOWNLOAD_FAIL

Value: 0X04000002

Description: The player allows to retry the download.

Suggestion: Status. This code can be ignored.

VO_OSMP_SRC_ADAPTIVE_STREAMING_INFO_EVENT

This is the enumeration of available stream info event, and is used in


callback.

VO_OSMP_SRC_ADAPTIVE_STREAMING_INFO_EVENT_BITRATE_CHANGE
Value: 0X00000001

Description: Bitrate is changed.

Suggestion: Status. This code can be ignored.

VO_OSMP_SRC_ADAPTIVE_STREAMING_INFO_EVENT_MEDIATYPE_CHANGE
Value: 0X00000002

Description: Media type is changed.

Suggestion: Status. This code can be ignored.

VO_OSMP_SRC_ADAPTIVE_STREAMING_INFO_EVENT_PROGRAM_TYPE
Value: 0X00000003

Description: Program type.

214 OnStream MediaPlayer+ User Guide


VisualOn
Appendix A: Programming reference

Suggestion: Status. This code can be ignored.

VO_OSMP_SRC_ADAPTIVE_STREAMING_INFO_EVENT_CHUNK_BEGINDOWNL
OAD
Value: 0X00000004

Description: Chunk download starts. If the returned value of this callback is


VO_OSMP_RETURN_CODE or VO_OSMP_SRC_ERR_CHUNK_SKIP, source
must drop this chunk. This event is synced with callback by
onRequestListener, a value should be returned.

Suggestion: Status. This code can be ignored.

VO_OSMP_SRC_ADAPTIVE_STREAMING_INFO_EVENT_CHUNK_DROPPED
Value: 0X00000005

Description: Downloaded chunk is dropped.

Suggestion: Status. This code can be ignored.

VO_OSMP_SRC_ADAPTIVE_STREAMING_INFO_EVENT_CHUNK_DOWNLOAD
OK
Value: 0X00000006

Description: Chunk download completed.

Suggestion: Status. This code can be ignored.

VO_OSMP_SRC_ADAPTIVE_STREAMING_INFO_EVENT_PLAYLIST_DOWNLOAD
OK
Value: 0X00000007

Description: Indicate that playlist download completed.

Suggestion: Status. This code can be ignored.

VO_OSMP_SRC_ADAPTIVE_STREAMING_INFO_EVENT_PROGRAM_CHANGE
Value: 0X00000008

Description: Indicates that program is changed in the source. When this


event is received, you should get program information again. Ignore
Parameter 2.

Suggestion: Status. This code can be ignored.

VO_OSMP_SRC_ADAPTIVE_STREAMING_INFO_EVENT_FILE_FORMATSUPPORT
ED
Value: 0X00000009

Description: Indicates that chunk is supported

OnStream MediaPlayer+ User Guide 215


VisualOn
Appendix A: Programming reference

Suggestion: Status. This code can be ignored.

VO_OSMP_SRC_ADAPTIVE_STREAMING_INFO_EVENT_LIVESEEKABLE
Value: 0X0000000A

Description: Indicates that the live clip can be sought now.

Suggestion: Status. This code can be ignored.

VO_OSMP_SRC_ADAPTIVE_STREAMING_INFO_EVENT_DISCONTINUE_SAMPLE
Value: 0X0000000B

Description: Indicates that this is the first sample from the discontinue
chunk.

Suggestion: Status. This code can be ignored.

VO_OSMP_SRC_ADAPTIVE_STREAMING_ERROR_EVENT

This is the enumeration of available streaming error codes, and is used in


VO_OSMP_SRC_CB_Adaptive_Streaming_Error callback.

VO_OSMP_SRC_ADAPTIVE_STREAMING_ERROR_EVENT_PLAYLIST_PARSEFAIL
Value: 0X00000001

Suggestion: Reserved. Do not use.

VO_OSMP_SRC_ADAPTIVE_STREAMING_ERROR_EVENT_PLAYLIST_UNSUPPOR
TED
Value: 0X00000002

Suggestion: Reserved. Do not use.

VO_OSMP_SRC_ADAPTIVE_STREAMING_ERROR_EVENT_STREAMING_UNSUPP
ORTED
Value: 0X00000003

Description: Stream is not supported.

Suggestion: Fatal error. It stops playback.

VO_OSMP_SRC_ADAPTIVE_STREAMING_ERROR_EVENT_STREAMING_DOWNL
OADFAIL
Value: 0X00000004

Description:

• If the download of master playlist is failed, this event is emitted


immediately.
• If the download of media playlist is failed:

216 OnStream MediaPlayer+ User Guide


VisualOn
Appendix A: Programming reference

 Live: this event will be emitted after two minutes.


 VOD: this event will be emitted after HLS parser attempts to retry
the download of total playsession (multiple playlists) five times. For
every single playlist, the HLS parser attempts to retry the download
four times.
• If the download of media segment is failed:
 Live: this event will be emitted after two minutes.
 VOD: every segment is retried for 3 times. This event will be
emitted if continuous ten segments have been retried.
Suggestion: Fatal error. It stops playback.

VO_OSMP_SRC_ADAPTIVE_STREAMING_ERROR_EVENT_STREAMING_DRMLIC
ENSEERROR
Value: 0X00000005

Description: DRM error occurs.

Suggestion: Fatal error. It stops playback.

VO_OSMP_SRC_ADAPTIVE_STREAMING_ERROR_EVENT_STREAMING_VOLIBLI
CENSEERROR
Value: 0X00000006

Description: Notify License error

Suggestion: Fatal error. It stops playback.

VO_OSMP_SRC_ADAPTIVE_STREAMING_WARNING_EVENT

This is the enumeration of available streaming warning events, and is used


in VO_OSMP_SRC_CB_Adaptive_Stream_Warning callback.

VO_OSMP_SRC_ADAPTIVE_STREAMING_WARNING_EVENT_CHUNK_DOWNL
OADERROR
Value: 0X00000001

Description: Chunk download is failed.

Suggestion: Status. An adaptive streaming chunk fails to download.

VO_OSMP_SRC_ADAPTIVE_STREAMING_WARNING_EVENT_CHUNK_FILEFOR
MATUNSUPPORTED
Value: 0X00000002

Description: Chunk format is not supported.

Suggestion: Status. An adaptive streaming chunk’s media format is not


supported.

OnStream MediaPlayer+ User Guide 217


VisualOn
Appendix A: Programming reference

VO_OSMP_SRC_ADAPTIVE_STREAMING_WARNING_EVENT_CHUNK_DRMERR
OR
Value: 0X00000003

Description: DRM error occurs.

Suggestion: Status. The chunk decryption operation failed.

VO_OSMP_SRC_ADAPTIVE_STREAMING_WARNING_EVENT_PLAYLIST_DOWNL
OADERROR
Value: 0X00000004

Description: Playlist download failed.

Suggestion: Status. Download of adaptive streaming’s playlist failed.

VO_OSMP_AVAILABLE_TRACK_TYPE

This is the enumeration of available track types, and is used in


VO_OSMP_SRC_ADAPTIVE_STREAMING_INFO_EVENT or
VO_OSMP_SRC_ADAPTIVE_STREAMING_INFO_EVENT_MEDIATYPE_CHANGE
callback.

VO_OSMP_AVAILABLE_PUREAUDIO
Value: 0X00000000

Description: Only audio is available.

Suggestion: Status. User can choose to play the audio only or stop
playback.

VO_OSMP_AVAILABLE_PUREVIDEO
Value: 0X00000001

Description: Only video is available.

Suggestion: Status. User can choose to play video only or stop playback.

VO_OSMP_AVAILABLE_AUDIOVIDEO
Value: 0X00000002

Description: Both audio and video are available.

Suggestion: Status.

VO_OSMP_SRC_RTSP_ERROR

This is the enumeration of RTSP error.

218 OnStream MediaPlayer+ User Guide


VisualOn
Appendix A: Programming reference

VO_OSMP_SRC_RTSP_ERROR_CONNECT_FAIL
Value: 0X00000001

Description: Connection to the RSTP server failed.

Suggestion: Fatal error. It stops playback.

VO_OSMP_SRC_RTSP_ERROR_DESCRIBE_FAIL
Value: 0X00000002

Description:

• The player failed to send DESCRIBE command to the RTSP server.


• The player cannot get DESCRIBE response from the RTSP server.
• The RTSP server cannot reply using the response of 'RTSP/1.0 200 OK'.
Suggestion: Fatal error. It stops playback.

VO_OSMP_SRC_RTSP_ERROR_SETUP_FAIL
Value: 0X00000003

Description:

• The player failed to send SETUP command to the RTSP server.


• The player cannot get SETUP response from the RTSP server.
• The RTSP server cannot reply using the response of 'RTSP/1.0 200 OK'.
Suggestion: Fatal error. It stops playback.

VO_OSMP_SRC_RTSP_ERROR_PLAY_FAIL
Value: 0X00000004

Description:

• The player failed to send PLAY command to the RTSP server.


• The player cannot get PLAY response from the RTSP server.
• The RTSP server cannot reply using the response of 'RTSP/1.0 200 OK'.
Suggestion: Fatal error. It stops playback.

VO_OSMP_SRC_RTSP_ERROR_PAUSE_FAIL
Value: 0X00000005

Description:

• The player failed to send PAUSE command to the RTSP server.


• The player cannot get PAUSE response from the RTSP server.
• The RTSP server cannot reply using the response of 'RTSP/1.0 200 OK'.

OnStream MediaPlayer+ User Guide 219


VisualOn
Appendix A: Programming reference

Suggestion: Status. This code can be ignored.

VO_OSMP_SRC_RTSP_ERROR_OPTION_FAIL
Value: 0X00000006

Description:

• The player failed to send OPTION command to the RTSP server.


• The player cannot get OPTION response from the RTSP server.
• The RTSP server cannot reply using the response of 'RTSP/1.0 200 OK'.
Suggestion: Status. This code can be ignored.

VO_OSMP_SRC_RTSP_ERROR_SOCKET_ERROR
Value: 0X00000007

Description:

• Socket error occurs when receiving the data.


• The player cannot receive the data after timeout.
Suggestion: Fatal error. It stops playback.

VO_OSMP_SRC_RTSP_ERROR_MAX
Value: 0XFFFFFFFF

Description: Maximum value definition

Suggestion: Fatal error. It stops playback.

VO_OSMP_CB_STREAMING_DOWNLOADER_EVENT_ID

This is the enumeration for the callback sync event IDs. This event is sent
from the sub thread. Do not update UI or call other VisualOn’s API in
callback.

VO_OSMP_CB_STREAMING_DOWNLOADER_OPEN_COMPLETE
Value: 0X10000001

Description: Open operation completed.

Suggestion: Status

VO_OSMP_CB_STREAMING_DOWNLOADER_MANIFEST_OK
Value: 0X10000002

Description: Manifest file download is successful.

Suggestion: The Player can play back the URL.

220 OnStream MediaPlayer+ User Guide


VisualOn
Appendix A: Programming reference

VO_OSMP_CB_STREAMING_DOWNLOADER_END
Value: 0X10000004

Description: Entire content download completed.

Suggestion: This code can be ignored.

VO_OSMP_CB_STREAMING_DOWNLOADER_PROGRAM_INFO_CHANGE
Value: 0X10000005

Description: Program information is changed.

Suggestion: Status

VO_OSMP_CB_STREAMING_DOWNLOADER_MANIFEST_UPDATE
Value: 0X10000006

Description: Manifest file is updated.

Suggestion: Status

VO_OSMP_CB_STREAMING_DOWNLOADER_DOWNLOAD_MANIFEST_FAIL
Value: 0X90000001

Description: Download of manifest file failed because of network issues.

Suggestion: Fatal error

VO_OSMP_CB_STREAMING_DOWNLOADER_WRITE_MANIFEST_FAIL
Value: 0X90000002

Description: Write operation to manifest file failed.

Suggestion: Fatal error

VO_OSMP_CB_STREAMING_DOWNLOADER_DOWNLOAD_CHUNK_FAIL
Value: 0X90000003

Description: Three minutes after chunk download failed.

Suggestion: Fatal error

VO_OSMP_CB_STREAMING_DOWNLOADER_WRITE_CHUNK_FAIL
Value: 0X90000004

Description: Write operation to chunk file failed.

Suggestion: Fatal error

VO_OSMP_CB_STREAMING_DOWNLOADER_DISK_FULL
Value: 0X90000005

OnStream MediaPlayer+ User Guide 221


VisualOn
Appendix A: Programming reference

Description: Disk is full.

Suggestion: Fatal error

VO_OSMP_CB_STREAMING_DOWNLOADER_GENERATE_MANIFEST_FAIL
Value: 0X90000006

Description: Generation of manifest fails

Suggestion: Fatal error

VO_OSMP_CB_STREAMING_DOWNLOADER_LIVE_STREAM_NOT_SUPPORT
Value: 0X90000007

Description: Live stream is not supported

Suggestion: Fatal error

VO_OSMP_CB_STREAMING_DOWNLOADER_LOCAL_STREAM_NOT_SUPPORT
Value: 0X90000008

Description: Stream on local disk is not supported.

Suggestion: Fatal error

VO_OSMP_CB_STREAMING_DOWNLOADER_LOCAL_PLAYLIST_INIT_FAIL
Value: 0X90000009

Description: Playlist initialization failed

Suggestion: Fatal error

VO_OSMP_CB_STREAMING_DOWNLOADER_LISENCE_CHECK_FAIL
Value: 0X9000000A

Description: License check failed

Suggestion: Fatal error

VO_OSMP_CB_STREAMING_DOWNLOADER_INIT_IO_FAIL
Value: 0X9000000B

Description: Initialization of IO failed

Suggestion: Fatal error

VO_OSMP_CB_STREAMING_DOWNLOADER_SWITCH_STATUS_FAIL
Value: 0X9000000C

Description: Switching status failed

222 OnStream MediaPlayer+ User Guide


VisualOn
Appendix A: Programming reference

Suggestion: Status. This code can be ignored.

VO_OSMP_CB_STREAMING_DOWNLOADER_CHECK_STATUS_FAIL
Value: 0X9000000D

Description: Checking status failed

Suggestion: Status. This code can be ignored.

VO_OSMP_CB_STREAMING_DOWNLOADER_CREATE_FOLDER_FAIL
Value: 0X90000010

Description: Download manager fails to create the folder.

Suggestion: Fatal error

OnStream MediaPlayer+ User Guide 223


VisualOn
Appendix B: Configuration Files

Appendix B Configuration Files

This appendix presents the following topics:

Cap file.................................................................................................................225

White List ..............................................................................................................226

224 OnStream MediaPlayer+ User Guide


VisualOn
Appendix B: Configuration Files

Cap file
The device capability file (cap.xml) is an Extensible Markup Language
(XML) file that specifies the maximum bitrate that the SDK tries to play
when targeting a variant playlist (multiple tracks of the same content) on a
specific type of device. The maximum bitrate defined in the device
capability file overrides the default initial bitrate selection. The maximum
bitrate is also respected by the SDK bitrate adaptation algorithm.

Note: The bitrate cap defined in the cap.xml file is only applied when targeting a
variant playlist. If there is only a single audio or video track, the bitrate cap does
not apply.

Clusters or groups of devices can be identified in the device capability file


by their platform characteristics. Platforms characteristics include the
following:
• Number of cores
• Availability of optimizations
• CPU frequency
The device capability file can be packaged with the application or be
downloaded at runtime, and is supported across all platforms including
Android, iOS, Windows browser plug-in, and Mac OS browser plug-in.

The cap.xml file is located:

Note: Do not change the file name of cap.xml or hw_cap.xml.

• Android: under the \SamplePlayer\assets directory of your package.


• iOS: under the / SamplePlayer/AppUI/config directory of your
package.
 cap.xml: for OSMP+ usage
 hw_cap.xml: for AV player usage
• Windows NPAPI & PPAPI plug-ins: under the \Libs\Win32 directory of
your package.
• Mac OS NPAPI plug-in: under the /Project/MacOS directory of your
package.

• Mac OS PPAPI plug-in: under the /Project/MacOS/


BrowserPluginHelper directory of your package.
For more information about the cap.xml file, refer to the OnStream
MediaPlayer+.Device Capability File AG.pdf under the Doc directory of
your installation package.

OnStream MediaPlayer+ User Guide 225


VisualOn
Appendix B: Configuration Files

White List
OSMP+ offers the option to change the default audio and video hardware
decoding settings for specific devices configurations. The list of devices
configurations (also known as the white list) is saved in the device.xml file
under the assets directory of the Android package.

Refer to 1.4.5.1.2 White List for details about the device.xml file.

226 OnStream MediaPlayer+ User Guide


VisualOn
Appendix C: Reference Documentation

Appendix C Reference Documentation

This appendix presents the following topics:

VisualOn Documentation ..................................................................................228

Links.......................................................................................................................228

OnStream MediaPlayer+ User Guide 227


VisualOn
Appendix C: Reference Documentation

VisualOn Documentation
The following documents, available from your installation package,
provide additional and relevant information. If you cannot find any
document, contact your VisualOn representative.
• API Reference Manual.zip
• Labs.zip
• OnStream MediaPlayer+.Device Capability File AG.pdf
• OnStream MediaPlayer+.Player SDK Integration Guide for Android.pdf
• OnStream MediaPlayer+.SDK Project Setup for Android.pdf
• OnStream MediaPlayer+.Player SDK Integration Guide for iOS.pdf
• OnStream MediaPlayer+.SDK Project Setup for iOS.pdf
• OnStream MediaPlayer+ Plugin SDK Integration Guide for Mac OS.pdf
• OnStream MediaPlayer+ Plugin SDK Integration Guide for
Windows.pdf
• OnStream MediaPlayer+ Plugin UI-Control API Reference.pdf

Links
Refer to the following topics for the references related to separate
platforms when integrating or interfacing with the OSMP+ product.

Note: The links provided were working correctly at the time of publication.

• Android 4.4 APIs


• SurfaceView on Android
• TextureView on Android
• Tags for HTTP Live Streaming
• RFC 2326: Real Time Streaming Protocol (RTSP)
• RFC 2327: SDP: Session Description Protocol
• RFC 3550: RTP: A Transport Protocol for Real-Time Applications
• RFC 3551: RTP Profile for Audio and Video Conferences with Minimal
Control
• RFC 3984: RTP Payload Format for H.264 Video
• RFC 3016: RTP Payload Format for MPEG-4 Audio/Visual Streams
• RFC 4629: RTP Payload Format for ITU-T Rec.H.263 Video

228 OnStream MediaPlayer+ User Guide


VisualOn
Appendix C: Reference Documentation

• RFC 3267: Real-Time Transport Protocol (RTP) Payload Format and File
Storage Format for the Adaptive Multi-Rate (AMR) and Adaptive
Multi-Rate Wideband (ARM-WB) Audio Codecs
• RFC 4352: RTP Payload Format for the Extended Adaptive Multi-Rate
Wideband (AMR-WB+) Audio Codec
• RFC 2658: RTP Payload Format for PureVoice (tm) Audio
• MS-RTSP: RTP Payload Format for ASF Streams
• Single File Streaming
• [MS-WMSP]: Windows Media HTTP Streaming Protocol
• Dolby Digital Plus
• Analyzing Display and Performance
• Android Performance Case Study
• Improving Layout Performance
• Improving Your Code with lint
• Optimizing Your UI
• Using the Dev Tools App
• Timed Text Markup Language 1 (TTML)
• WebVtt: The Web Video Text Tracks Format
• FCC Notice

OnStream MediaPlayer+ User Guide 229


VisualOn

You might also like