The current repo belongs to Closed status, and some functions are restricted. For details, please refer to the description of repo status
46 Star 180 Fork 4.8K

OpenHarmony/interface_sdk-js
Closed

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
@ohos.multimedia.drm.d.ts 76.42 KB
Copy Edit Raw Blame History
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022
/*
* Copyright (C) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file Defines the DRM capability.
* @kit DrmKit
*/
/**
* This module provides the DRM capability to multimedia player.
* @namespace drm
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* This module provides the DRM capability to multimedia player.
* @namespace drm
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
declare namespace drm {
/**
* Enumerates drm error code.
* @enum { number }
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Enumerates drm error code.
* @enum { number }
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
enum DrmErrorCode {
/**
* All unknown errors.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* All unknown errors.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
ERROR_UNKNOWN = 24700101,
/**
* Meet max MediaKeySystem num limit.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Meet max MediaKeySystem num limit.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
MAX_SYSTEM_NUM_REACHED = 24700103,
/**
* Meet max MediaKeySession num limit.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Meet max MediaKeySession num limit.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
MAX_SESSION_NUM_REACHED = 24700104,
/**
* Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
SERVICE_FATAL_ERROR = 24700201
}
/**
* Enumerates which config name we can get.
* @enum { string }
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Enumerates which config name we can get.
* @enum { string }
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
enum PreDefinedConfigName {
/**
* Config name vendor
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Config name vendor
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
CONFIG_DEVICE_VENDOR = 'vendor',
/**
* Config name version
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Config name version
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
CONFIG_DEVICE_VERSION = 'version',
/**
* Config name description
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Config name description
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
CONFIG_DEVICE_DESCRIPTION = 'description',
/**
* Config name algorithms
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Config name algorithms
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
CONFIG_DEVICE_ALGORITHMS = 'algorithms',
/**
* Config name deviceUniqueId
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Config name deviceUniqueId
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
CONFIG_DEVICE_UNIQUE_ID = 'deviceUniqueId',
/**
* Config name maxSessionNum
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Config name maxSessionNum
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
CONFIG_SESSION_MAX = 'maxSessionNum',
/**
* Config name currentSessionNum
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Config name currentSessionNum
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
CONFIG_SESSION_CURRENT = 'currentSessionNum',
}
/**
* Enumerates media key type.
* @enum { number }
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Enumerates media key type.
* @enum { number }
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
enum MediaKeyType {
/**
* Offline media key type.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Offline media key type.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
MEDIA_KEY_TYPE_OFFLINE = 0,
/**
* Online media key type.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Online media key type.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
MEDIA_KEY_TYPE_ONLINE,
}
/**
* Enumerates offline media key status.
* @enum { number }
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Enumerates offline media key status.
* @enum { number }
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
enum OfflineMediaKeyStatus {
/**
* Offline media key status unknown.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Offline media key status unknown.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
OFFLINE_MEDIA_KEY_STATUS_UNKNOWN = 0,
/**
* Offline media key status usable.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Offline media key status usable.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
OFFLINE_MEDIA_KEY_STATUS_USABLE = 1,
/**
* Offline media key status inactive.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Offline media key status inactive.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
OFFLINE_MEDIA_KEY_STATUS_INACTIVE = 2,
}
/**
* Enumerates certificate status.
* @enum { number }
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Enumerates certificate status.
* @enum { number }
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
enum CertificateStatus {
/**
* Device already provisioned.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Device already provisioned.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
CERT_STATUS_PROVISIONED = 0,
/**
* Device not provisioned.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Device not provisioned.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
CERT_STATUS_NOT_PROVISIONED,
/**
* Cert already expired.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Cert already expired.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
CERT_STATUS_EXPIRED,
/**
* Certs are invalid.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Certs are invalid.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
CERT_STATUS_INVALID,
/**
* Get certs status failed.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Get certs status failed.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
CERT_STATUS_UNAVAILABLE,
}
/**
* Enumerates media key request types.
* @enum { number }
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Enumerates media key request types.
* @enum { number }
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
enum MediaKeyRequestType {
/**
* Media key request type unknown.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Media key request type unknown.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
MEDIA_KEY_REQUEST_TYPE_UNKNOWN = 0,
/**
* Media key request type initial.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Media key request type initial.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
MEDIA_KEY_REQUEST_TYPE_INITIAL = 1,
/**
* Media key request type renewal.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Media key request type renewal.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
MEDIA_KEY_REQUEST_TYPE_RENEWAL = 2,
/**
* Media key request type release.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Media key request type release.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
MEDIA_KEY_REQUEST_TYPE_RELEASE = 3,
/**
* Media key request type none.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Media key request type none.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
MEDIA_KEY_REQUEST_TYPE_NONE = 4,
/**
* Media key request type update.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Media key request type update.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
MEDIA_KEY_REQUEST_TYPE_UPDATE = 5,
}
/**
* Enumerates content protection level.
* @enum { number }
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Enumerates content protection level.
* @enum { number }
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
enum ContentProtectionLevel {
/**
* Device decrypt and decode type unknown.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Device decrypt and decode type unknown.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
CONTENT_PROTECTION_LEVEL_UNKNOWN = 0,
/**
* Device using software level.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Device using software level.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
CONTENT_PROTECTION_LEVEL_SW_CRYPTO,
/**
* Device using hardware level.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Device using hardware level.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
CONTENT_PROTECTION_LEVEL_HW_CRYPTO,
/**
* Device using enhanced hardware level.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Device using enhanced hardware level.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
CONTENT_PROTECTION_LEVEL_ENHANCED_HW,
/**
* Max mode.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Max mode.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
CONTENT_PROTECTION_LEVEL_MAX,
}
/**
* Provides the drm provision request definitions.
* @interface ProvisionRequest
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Provides the drm provision request definitions.
* @interface ProvisionRequest
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
interface ProvisionRequest {
/**
* Provision request data sent to provision server.
* @type { Uint8Array }
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Provision request data sent to provision server.
* @type { Uint8Array }
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
data: Uint8Array;
/**
* Provision server URL.
* @type { string }
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Provision server URL.
* @type { string }
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
defaultURL: string;
}
/**
* Provides the drm media key request info optional data.
* @interface OptionsData
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Provides the drm media key request info optional data.
* @interface OptionsData
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
interface OptionsData {
/**
* App defined optional data name.
* @type { string }
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* App defined optional data name.
* @type { string }
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
name: string;
/**
* App defined optional data value.
* @type { string }
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* App defined optional data value.
* @type { string }
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
value: string;
}
/**
* Provides the drm media key request definitions.
* @interface MediaKeyRequest
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Provides the drm media key request definitions.
* @interface MediaKeyRequest
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
interface MediaKeyRequest {
/**
* Media key request type.
* @type { MediaKeyRequestType }
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Media key request type.
* @type { MediaKeyRequestType }
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
mediaKeyRequestType: MediaKeyRequestType;
/**
* Media key request data sent to media key server.
* @type { Uint8Array }
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Media key request data sent to media key server.
* @type { Uint8Array }
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
data: Uint8Array;
/**
* Media key server URL.
* @type { string }
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Media key server URL.
* @type { string }
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
defaultURL: string;
}
/**
* Used to indicates the event info attached to specific event type.
* @interface EventInfo
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Used to indicates the event info attached to specific event type.
* @interface EventInfo
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
interface EventInfo {
/**
* Event info.
* @type { Uint8Array }
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Event info.
* @type { Uint8Array }
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
info: Uint8Array;
/**
* Event extra info.
* @type { string }
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Event extra info.
* @type { string }
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
extraInfo: string;
}
/**
* Used to indicates the statistic info.
* @interface StatisticKeyValue
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Used to indicates the statistic info.
* @interface StatisticKeyValue
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
interface StatisticKeyValue {
/**
* Statistic info name.
* @type { string }
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Statistic info name.
* @type { string }
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
name: string;
/**
* Statistic info value.
* @type { string }
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Statistic info value.
* @type { string }
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
value: string;
}
/**
* Used to indicates the media key status.
* @interface MediaKeyStatus
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Used to indicates the media key status.
* @interface MediaKeyStatus
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
interface MediaKeyStatus {
/**
* Media key Id in string.
* @type { string }
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Media key Id in string.
* @type { string }
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
name: string;
/**
* Media key status description.
* @type { string }
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Media key status description.
* @type { string }
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
value: string;
}
/**
* Used to indicates the media key status with a key and its value.
* @interface KeysInfo
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Used to indicates the media key status with a key and its value.
* @interface KeysInfo
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
interface KeysInfo {
/**
* Keys Id in media key.
* @type { Uint8Array }
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Keys Id in media key.
* @type { Uint8Array }
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
keyId: Uint8Array;
/**
* Keys status description.
* @type { string }
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Keys status description.
* @type { string }
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
value: string;
}
/**
* Used to indicates the media key system info of media source.
* @interface MediaKeySystemInfo
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Used to indicates the media key system info of media source.
* @interface MediaKeySystemInfo
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
interface MediaKeySystemInfo {
/**
* Drm system ID.
* @type { string }
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Drm system ID.
* @type { string }
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
uuid: string;
/**
* PSSH(protection scheme specific header) contain drm info.
* @type { Uint8Array }
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* PSSH(protection scheme specific header) contain drm info.
* @type { Uint8Array }
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
pssh: Uint8Array;
}
/**
* Name and UUID of DRM plugin.
* @interface MediaKeySystemDescription
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 12
*/
/**
* Name and UUID of DRM plugin.
* @interface MediaKeySystemDescription
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
interface MediaKeySystemDescription {
/**
* Name of DRM plugin.
* @type { string }
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 12
*/
/**
* Name of DRM plugin.
* @type { string }
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
name: string;
/**
* UUID supported by DRM plugin.
* @type { string }
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 12
*/
/**
* UUID supported by DRM plugin.
* @type { string }
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
uuid: string;
}
/**
* Get a MediaKeySystem's UUID.
* @param { string } name - The Digital Right Management solution name.
* @returns { string } The MediaKeySystem uuid.
* @throws { BusinessError } 401 - The parameter check failed.Possibly because:
* <br>1.Mandatory parameters are left unspecified. 2.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 12
*/
/**
* Get a MediaKeySystem's UUID.
* @param { string } name - The Digital Right Management solution name.
* @returns { string } The MediaKeySystem uuid.
* @throws { BusinessError } 401 - The parameter check failed.Possibly because:
* <br>1.Mandatory parameters are left unspecified. 2.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
function getMediaKeySystemUuid(name: string): string;
/**
* Get all media key systems supported.
* @returns { MediaKeySystemDescription[] } The MediaKeySystem name and uuid info list.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 12
*/
/**
* Get all media key systems supported.
* @returns { MediaKeySystemDescription[] } The MediaKeySystem name and uuid info list.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
function getMediaKeySystems(): MediaKeySystemDescription[];
/**
* Creates a MediaKeySystem instance.
* @param { string } name - Used to point a Digital Right Management solution.
* @returns { MediaKeySystem } The MediaKeySystem instance.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified. 2.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700103 - Meet max MediaKeySystem num limit.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Creates a MediaKeySystem instance.
* @param { string } name - Used to point a Digital Right Management solution.
* @returns { MediaKeySystem } The MediaKeySystem instance.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified. 2.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700103 - Meet max MediaKeySystem num limit.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
function createMediaKeySystem(name: string): MediaKeySystem;
/**
* Judge whether a system that specifies name, mimetype and content protection level is supported.
* @param { string } name - Used to point a Digital Right Management solution.
* @param { string } mimeType - Used to specifies the media type.
* @param { ContentProtectionLevel } level - Used to specifies the ContentProtectionLevel.
* @returns { boolean } Whether these conditions will be met.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Judge whether a system that specifies name, mimetype and content protection level is supported.
* @param { string } name - Used to point a Digital Right Management solution.
* @param { string } mimeType - Used to specifies the media type.
* @param { ContentProtectionLevel } level - Used to specifies the ContentProtectionLevel.
* @returns { boolean } Whether these conditions will be met.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
function isMediaKeySystemSupported(name: string, mimeType: string, level: ContentProtectionLevel): boolean;
/**
* Judge whether a system that specifies name, mimetype is supported.
* @param { string } name - Used to point a Digital Right Management solution.
* @param { string } mimeType - Used to specifies the media type.
* @returns { boolean } Whether these conditions will be met.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Judge whether a system that specifies name, mimetype is supported.
* @param { string } name - Used to point a Digital Right Management solution.
* @param { string } mimeType - Used to specifies the media type.
* @returns { boolean } Whether these conditions will be met.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
function isMediaKeySystemSupported(name: string, mimeType: string): boolean;
/**
* Judge whether a system that specifies name is supported.
* @param { string } name - Used to point a Digital Right Management solution.
* @returns { boolean } Whether these conditions will be met.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified. 2.Parameter verification failed,
* the param name's length is zero or too big(exceeds 4096 Bytes).
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Judge whether a system that specifies name is supported.
* @param { string } name - Used to point a Digital Right Management solution.
* @returns { boolean } Whether these conditions will be met.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified. 2.Parameter verification failed,
* the param name's length is zero or too big(exceeds 4096 Bytes).
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
function isMediaKeySystemSupported(name: string): boolean;
/**
* Manages and record MediaKeySessions. Before calling an MediaKeySystem method, we must use getMediaKeySystem
* to get a MediaKeySystem instance, then we can call functions.
* @interface MediaKeySystem
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Manages and record MediaKeySessions. Before calling an MediaKeySystem method, we must use getMediaKeySystem
* to get a MediaKeySystem instance, then we can call functions.
* @interface MediaKeySystem
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
interface MediaKeySystem {
/**
* Get the specified configuration.
* @param { string } configName - Used to specify the config name.
* @returns { string } The config value string.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified. 2.Parameter verification failed,
* the param's length is zero or too big(exceeds 4096 Bytes).
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Get the specified configuration.
* @param { string } configName - Used to specify the config name.
* @returns { string } The config value string.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified. 2.Parameter verification failed,
* the param's length is zero or too big(exceeds 4096 Bytes).
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
getConfigurationString(configName: string): string;
/**
* Set the specified configuration.
* @param { string } configName - Used to specify the config name.
* @param { string } value - The value to be set.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Set the specified configuration.
* @param { string } configName - Used to specify the config name.
* @param { string } value - The value to be set.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
setConfigurationString(configName: string, value: string): void;
/**
* Get the specified configuration.
* @param { string } configName - Used to specify the config name.
* @returns { Uint8Array } The config value.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified. 2.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Get the specified configuration.
* @param { string } configName - Used to specify the config name.
* @returns { Uint8Array } The config value.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified. 2.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
getConfigurationByteArray(configName: string): Uint8Array;
/**
* Set the specified configuration.
* @param { string } configName - Used to specify the config name.
* @param { Uint8Array } value - The value to be set.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Set the specified configuration.
* @param { string } configName - Used to specify the config name.
* @param { Uint8Array } value - The value to be set.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
setConfigurationByteArray(configName: string, value: Uint8Array): void;
/**
* Get performance statistics information.That includes currentSessionNum, version, decryptNumber,
* and errorDecryptNumber.
* @returns { StatisticKeyValue[] } A list that includes performance index and corresponding statistics.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Get performance statistics information.That includes currentSessionNum, version, decryptNumber,
* and errorDecryptNumber.
* @returns { StatisticKeyValue[] } A list that includes performance index and corresponding statistics.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
getStatistics(): StatisticKeyValue[];
/**
* Get max content protection level the device supports.
* @returns { ContentProtectionLevel } The max content protection level of the MediaKeySystem instance.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Get max content protection level the device supports.
* @returns { ContentProtectionLevel } The max content protection level of the MediaKeySystem instance.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
getMaxContentProtectionLevel(): ContentProtectionLevel;
/**
* Generate a media key system provision request.
* @returns { Promise<ProvisionRequest> } Promise with ProvisionRequest used to return the result.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Generate a media key system provision request.
* @returns { Promise<ProvisionRequest> } Promise with ProvisionRequest used to return the result.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
generateKeySystemRequest(): Promise<ProvisionRequest>;
/**
* Process the response corresponding the key system request obtained by the application.
* @param { Uint8Array } response - Response corresponding to the request.
* @returns { Promise<void> } Promise used to return the result.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Process the response corresponding the key system request obtained by the application.
* @param { Uint8Array } response - Response corresponding to the request.
* @returns { Promise<void> } Promise used to return the result.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
processKeySystemResponse(response: Uint8Array): Promise<void>;
/**
* Get certificate status of the MediaKeySystem.
* @returns { CertificateStatus } Certificate Status of the MediaKeySystem instance.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Get certificate status of the MediaKeySystem.
* @returns { CertificateStatus } Certificate Status of the MediaKeySystem instance.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
getCertificateStatus(): CertificateStatus;
/**
* Register keySystemRequired events.
* @param { 'keySystemRequired' } type - Type of the drm event to listen for.
* @param { function } callback - Used to listen for the key system required event.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
* @throws { BusinessError } 24700101 - All unknown errors.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Register keySystemRequired events.
* @param { 'keySystemRequired' } type - Type of the drm event to listen for.
* @param { function } callback - Used to listen for the key system required event.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
* @throws { BusinessError } 24700101 - All unknown errors.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
on(type: 'keySystemRequired', callback: (eventInfo: EventInfo) => void): void;
/**
* Unregister keySystemRequired events.
* @param { 'keySystemRequired' } type - Type of the drm event to listen for.
* @param { function } callback - Used to listen for the key system required event.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
* @throws { BusinessError } 24700101 - All unknown errors.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Unregister keySystemRequired events.
* @param { 'keySystemRequired' } type - Type of the drm event to listen for.
* @param { function } callback - Used to listen for the key system required event.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
* @throws { BusinessError } 24700101 - All unknown errors.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
off(type: 'keySystemRequired', callback?: (eventInfo: EventInfo) => void): void;
/**
* Create a MediaKeySession instance with level.
* @param { ContentProtectionLevel } level - Used to specify the content protection level.
* @returns { MediaKeySession } A MediaKeySession instance.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified. 2.The param level exceeds reasonable range,
* please use value in ContentProtectionLevel.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700104 - Meet max MediaKeySession num limit.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Create a MediaKeySession instance with level.
* @param { ContentProtectionLevel } level - Used to specify the content protection level.
* @returns { MediaKeySession } A MediaKeySession instance.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified. 2.The param level exceeds reasonable range,
* please use value in ContentProtectionLevel.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700104 - Meet max MediaKeySession num limit.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
createMediaKeySession(level: ContentProtectionLevel): MediaKeySession;
/**
* Create a MediaKeySession instance.
* @returns { MediaKeySession } A MediaKeySession instance.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700104 - Meet max MediaKeySession num limit.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Create a MediaKeySession instance.
* @returns { MediaKeySession } A MediaKeySession instance.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700104 - Meet max MediaKeySession num limit.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
createMediaKeySession(): MediaKeySession;
/**
* Get the list of offline MediaKeyIds.
* @returns { Uint8Array[] } The list of offline MediaKeyIds.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Get the list of offline MediaKeyIds.
* @returns { Uint8Array[] } The list of offline MediaKeyIds.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
getOfflineMediaKeyIds(): Uint8Array[];
/**
* Get offline media key status corresponding to the mediaKeyId.
* @param { Uint8Array } mediaKeyId - The media key identifier.
* @returns { OfflineMediaKeyStatus } Offline media key Status.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Get offline media key status corresponding to the mediaKeyId.
* @param { Uint8Array } mediaKeyId - The media key identifier.
* @returns { OfflineMediaKeyStatus } Offline media key Status.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
getOfflineMediaKeyStatus(mediaKeyId: Uint8Array): OfflineMediaKeyStatus;
/**
* Remove media key corresponding to the mediaKeyId.
* @param { Uint8Array } mediaKeyId - The mediaKeyId specifies which media key should be clear.
* @throws { BusinessError } 401 - The parameter check failed.Possibly because:
* 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Remove media key corresponding to the mediaKeyId.
* @param { Uint8Array } mediaKeyId - The mediaKeyId specifies which media key should be clear.
* @throws { BusinessError } 401 - The parameter check failed.Possibly because:
* 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
clearOfflineMediaKeys(mediaKeyId: Uint8Array): void;
/**
* Release the resource before the MediaKeySystem gonna be unused.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Release the resource before the MediaKeySystem gonna be unused.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 14
*/
destroy(): void;
}
/**
* Provide functions and keep a decrypt module. Before calling an MediaKeySession method, we must
* use MediaKeySystem's createMediaKeySession to get a MediaKeySession instance.
* @interface MediaKeySession
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Provide functions and keep a decrypt module. Before calling an MediaKeySession method, we must
* use MediaKeySystem's createMediaKeySession to get a MediaKeySession instance.
* @interface MediaKeySession
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
interface MediaKeySession {
/**
* Generate the media key request.
* @param { string } mimeType - Media type.
* @param { Uint8Array } initData - PSSH info.
* @param { number } mediaKeyType - Offline or online.
* @param { OptionsData[] } options - Optional data the application set to drm framework.
* @returns { Promise<MediaKeyRequest> } Promise with MediaKeyRequest used to return the result.
* @throws { BusinessError } 401 -The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Generate the media key request.
* @param { string } mimeType - Media type.
* @param { Uint8Array } initData - PSSH info.
* @param { number } mediaKeyType - Offline or online.
* @param { OptionsData[] } options - Optional data the application set to drm framework.
* @returns { Promise<MediaKeyRequest> } Promise with MediaKeyRequest used to return the result.
* @throws { BusinessError } 401 -The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
generateMediaKeyRequest(mimeType: string, initData: Uint8Array, mediaKeyType: number, options?: OptionsData[]): Promise<MediaKeyRequest>;
/**
* Process the response corresponding to the media key request obtained by the application.
* @param { Uint8Array } response - The response.
* @returns { Promise<Uint8Array> } Promise with media key identifier in Uint8ARRY used to return the result.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Process the response corresponding to the media key request obtained by the application.
* @param { Uint8Array } response - The response.
* @returns { Promise<Uint8Array> } Promise with media key identifier in Uint8ARRY used to return the result.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
processMediaKeyResponse(response: Uint8Array): Promise<Uint8Array>;
/**
* Check the media key status
* @returns { MediaKeyStatus[] } A list of media key status description pairs.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Check the media key status
* @returns { MediaKeyStatus[] } A list of media key status description pairs.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
checkMediaKeyStatus(): MediaKeyStatus[];
/**
* Remove media key.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Remove media key.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
clearMediaKeys(): void;
/**
* Generate offline media key request.
* @param { Uint8Array } mediaKeyId - The mediaKeyId specifies which media content's media key request
* should be generated.
* @returns { Promise<Uint8Array> } Promise with media key request in Uint8Array used to return the result.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Generate offline media key request.
* @param { Uint8Array } mediaKeyId - The mediaKeyId specifies which media content's media key request
* should be generated.
* @returns { Promise<Uint8Array> } Promise with media key request in Uint8Array used to return the result.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
generateOfflineReleaseRequest(mediaKeyId: Uint8Array): Promise<Uint8Array>;
/**
* Process offline media key response.
* @param { Uint8Array } mediaKeyId - The mediaKeyId specifies which media content's media key it is.
* @param { Uint8Array } response - The offline media key.
* @returns { Promise<void> } Promise used to return the result.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Process offline media key response.
* @param { Uint8Array } mediaKeyId - The mediaKeyId specifies which media content's media key it is.
* @param { Uint8Array } response - The offline media key.
* @returns { Promise<void> } Promise used to return the result.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
processOfflineReleaseResponse(mediaKeyId: Uint8Array, response: Uint8Array): Promise<void>;
/**
* Restore offline media key.
* @param { Uint8Array } mediaKeyId - The mediaKeyId specifies which media key should be restore.
* @returns { Promise<void> } Promise used to return the result.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Restore offline media key.
* @param { Uint8Array } mediaKeyId - The mediaKeyId specifies which media key should be restore.
* @returns { Promise<void> } Promise used to return the result.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
restoreOfflineMediaKeys(mediaKeyId: Uint8Array): Promise<void>;
/**
* Get content protection level.
* @returns { ContentProtectionLevel } MediaKeySession content protection level.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Get content protection level.
* @returns { ContentProtectionLevel } MediaKeySession content protection level.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
getContentProtectionLevel(): ContentProtectionLevel;
/**
* Whether the encrypted content require a secure decoder or not.
* @param { string } mimeType - The media type.
* @returns { boolean } Whether secure decoder is required.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Whether the encrypted content require a secure decoder or not.
* @param { string } mimeType - The media type.
* @returns { boolean } Whether secure decoder is required.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
requireSecureDecoderModule(mimeType: string): boolean;
/**
* Register keyRequired event.
* @param { 'keyRequired' } type - Type of the drm event to listen for.
* @param { function } callback used to listen for the key required event.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Register keyRequired event.
* @param { 'keyRequired' } type - Type of the drm event to listen for.
* @param { function } callback used to listen for the key required event.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
on(type: 'keyRequired', callback: (eventInfo: EventInfo) => void): void;
/**
* Unregister keyRequired event.
* @param { 'keyRequired' } type - Type of the drm event to listen for.
* @param { function } callback used to listen for the key required event.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Unregister keyRequired event.
* @param { 'keyRequired' } type - Type of the drm event to listen for.
* @param { function } callback used to listen for the key required event.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
off(type: 'keyRequired', callback?: (eventInfo: EventInfo) => void): void;
/**
* Register keyExpired event.
* @param { 'keyExpired' } type - Type of the drm event to listen for.
* @param { function } callback - Used to listen for the key required event.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Register keyExpired event.
* @param { 'keyExpired' } type - Type of the drm event to listen for.
* @param { function } callback - Used to listen for the key required event.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
on(type: 'keyExpired', callback: (eventInfo: EventInfo) => void): void;
/**
* Unregister keyExpired event.
* @param { 'keyExpired' } type - Type of the drm event to listen for.
* @param { function } callback - Used to listen for the key required event.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Unregister keyExpired event.
* @param { 'keyExpired' } type - Type of the drm event to listen for.
* @param { function } callback - Used to listen for the key required event.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
off(type: 'keyExpired', callback?: (eventInfo: EventInfo) => void): void;
/**
* Register vendorDefined event.
* @param { 'vendorDefined' } type - Type of the drm event to listen for.
* @param { function } callback - Used to listen for the vendor defined event.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Register vendorDefined event.
* @param { 'vendorDefined' } type - Type of the drm event to listen for.
* @param { function } callback - Used to listen for the vendor defined event.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
on(type: 'vendorDefined', callback: (eventInfo: EventInfo) => void): void;
/**
* Unregister vendorDefined event.
* @param { 'vendorDefined' } type - Type of the drm event to listen for.
* @param { function } callback - Used to listen for the vendor defined event.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Unregister vendorDefined event.
* @param { 'vendorDefined' } type - Type of the drm event to listen for.
* @param { function } callback - Used to listen for the vendor defined event.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
off(type: 'vendorDefined', callback?: (eventInfo: EventInfo) => void): void;
/**
* Register expirationUpdate event.
* @param { 'expirationUpdate' } type - Type of the drm event to listen for.
* @param { function } callback - Used to listen for expiration update event.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Register expirationUpdate event.
* @param { 'expirationUpdate' } type - Type of the drm event to listen for.
* @param { function } callback - Used to listen for expiration update event.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
on(type: 'expirationUpdate', callback: (eventInfo: EventInfo) => void): void;
/**
* Unregister expirationUpdate event.
* @param { 'expirationUpdate' } type - Type of the drm event to listen for.
* @param { function } callback - Used to listen for expiration update event.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Unregister expirationUpdate event.
* @param { 'expirationUpdate' } type - Type of the drm event to listen for.
* @param { function } callback - Used to listen for expiration update event.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
off(type: 'expirationUpdate', callback?: (eventInfo: EventInfo) => void): void;
/**
* Register keysChange event.
* @param { 'keysChange' } type - Type of the drm event to listen for.
* @param { function } callback - Used to listen for keys change event.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Register keysChange event.
* @param { 'keysChange' } type - Type of the drm event to listen for.
* @param { function } callback - Used to listen for keys change event.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
on(type: 'keysChange', callback: (keyInfo: KeysInfo[], newKeyAvailable: boolean) => void): void;
/**
* Unregister keysChange event.
* @param { 'keysChange' } type - Type of the drm event to listen for.
* @param { function } callback - Used to listen for keys change event.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Unregister keysChange event.
* @param { 'keysChange' } type - Type of the drm event to listen for.
* @param { function } callback - Used to listen for keys change event.
* @throws { BusinessError } 401 - The parameter check failed. Possibly because:
* 1.Mandatory parameters are left unspecified or too many parameters. 2.Incorrect parameter types.
* 3.Parameter verification failed.
* @throws { BusinessError } 24700101 - All unknown errors.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
off(type: 'keysChange', callback?: (keyInfo: KeysInfo[], newKeyAvailable: boolean) => void): void;
/**
* Release the resource before the session gonna be unused.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @since 11
*/
/**
* Release the resource before the session gonna be unused.
* @throws { BusinessError } 24700101 - All unknown errors.
* @throws { BusinessError } 24700201 - Fatal service error, for example, service died.
* @syscap SystemCapability.Multimedia.Drm.Core
* @atomicservice
* @since 12
*/
destroy(): void;
}
}
export default drm;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openharmony/interface_sdk-js.git
git@gitee.com:openharmony/interface_sdk-js.git
openharmony
interface_sdk-js
interface_sdk-js
master

Search