1 Star 0 Fork 4K

Feng Lin/interface_sdk-js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
@ohos.multimedia.avsession.d.ts 313.72 KB
一键复制 编辑 原始数据 按行查看 历史
openharmony_ci 提交于 2024-09-03 15:55 +08:00 . !12709 增加更多DLNA相关的属性定义
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661
/*
* Copyright (c) 2022-2024 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
* @kit AVSessionKit
*/
import type { ErrorCallback, AsyncCallback, Callback } from './@ohos.base';
import { WantAgent } from './@ohos.wantAgent';
import { KeyEvent } from './@ohos.multimodalInput.keyEvent';
import { ElementName } from './bundleManager/ElementName';
import image from './@ohos.multimedia.image';
import audio from './@ohos.multimedia.audio';
import type media from './@ohos.multimedia.media';
import type Context from './application/BaseContext';
/**
* @namespace avSession
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 9
*/
/**
* @namespace avSession
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
declare namespace avSession {
/**
* Create an AVSession instance. An ability can only create one AVSession
* @param { Context } context - The context of application
* @param { string } tag - A user-defined name for this session
* @param { AVSessionType } type - The type of session {@link AVSessionType}
* @param { AsyncCallback<AVSession> } callback - async callback for AVSession.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
function createAVSession(context: Context, tag: string, type: AVSessionType, callback: AsyncCallback<AVSession>): void;
/**
* Create an AVSession instance. An ability can only create one AVSession
* @param { Context } context - The context of application
* @param { string } tag - A user-defined name for this session
* @param { AVSessionType } type - The type of session {@link AVSessionType}
* @returns { Promise<AVSession> } Promise for AVSession
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Create an AVSession instance. An ability can only create one AVSession
* @param { Context } context - The context of application
* @param { string } tag - A user-defined name for this session
* @param { AVSessionType } type - The type of session {@link AVSessionType}
* @returns { Promise<AVSession> } Promise for AVSession
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
function createAVSession(context: Context, tag: string, type: AVSessionType): Promise<AVSession>;
/**
* Get all avsession descriptors of the system
* @permission ohos.permission.MANAGE_MEDIA_RESOURCES
* @param { AsyncCallback<Array<Readonly<AVSessionDescriptor>>> } callback - async callback for an array of AVSessionDescriptors.
* @throws { BusinessError } 201 - permission denied
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 6600101 - Session service exception.
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi
* @since 9
*/
function getAllSessionDescriptors(callback: AsyncCallback<Array<Readonly<AVSessionDescriptor>>>): void;
/**
* Get all avsession descriptors of the system
* @permission ohos.permission.MANAGE_MEDIA_RESOURCES
* @returns { Promise<Array<Readonly<AVSessionDescriptor>>> } Promise for an array of AVSessionDescriptors
* @throws { BusinessError } 201 - permission denied
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 6600101 - Session service exception.
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi
* @since 9
*/
function getAllSessionDescriptors(): Promise<Array<Readonly<AVSessionDescriptor>>>;
/**
* Get history avsession records. These sessions have been destroyed.
* @permission ohos.permission.MANAGE_MEDIA_RESOURCES
* @param { number } maxSize - Specifies the maximum size of the returned value array.
* @param { AsyncCallback<Array<Readonly<AVSessionDescriptor>>> } callback - async callback for an array of AVSessionDescriptors.
* If provided '0' or not provided, the maximum value is determined by the system.
* @throws { BusinessError } 201 - permission denied
* @throws { BusinessError } 202 - Not System App
* @throws { BusinessError } 401 - parameter check failed. Possible causes: 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi Hide this for inner system use
* @since 10
*/
function getHistoricalSessionDescriptors(maxSize: number, callback: AsyncCallback<Array<Readonly<AVSessionDescriptor>>>): void;
/**
* Get history avsession records. These sessions have been destroyed.
* @permission ohos.permission.MANAGE_MEDIA_RESOURCES
* @param { number } maxSize - Specifies the maximum size of the returned value array.
* If provided '0' or not provided, the maximum value is determined by the system.
* @returns { Promise<Array<Readonly<AVSessionDescriptor>>> } Promise for an array of AVSessionDescriptors
* @throws { BusinessError } 201 - permission denied
* @throws { BusinessError } 202 - Not System App
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi Hide this for inner system use
* @since 10
*/
function getHistoricalSessionDescriptors(maxSize?: number): Promise<Array<Readonly<AVSessionDescriptor>>>;
/**
* Get history play list information records.
* @permission ohos.permission.MANAGE_MEDIA_RESOURCES
* @param { number } maxSize - Specifies the maximum size of the returned value array.
* @param { number } maxAppSize - Specifies the maximum app size of the returned value array.
* @param { AsyncCallback<Array<Readonly<AVQueueInfo>>> } callback - async callback for an array of AVQueueInfo.
* If provided '0' or not provided, the maximum value is determined by the system.
* @throws { BusinessError } 201 - permission denied
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi Hide this for inner system use
* @since 11
*/
function getHistoricalAVQueueInfos(maxSize: number, maxAppSize: number, callback: AsyncCallback<Array<Readonly<AVQueueInfo>>>): void;
/**
* Get history play list information records.
* @permission ohos.permission.MANAGE_MEDIA_RESOURCES
* @param { number } maxSize - Specifies the maximum size of the returned value array.
* @param { number } maxAppSize - Specifies the maximum app size of the returned value array.
* @returns { Promise<Array<Readonly<AVQueueInfo>>> } Promise for an array of AVQueueInfo
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi Hide this for inner system use
* @since 11
*/
function getHistoricalAVQueueInfos(maxSize: number, maxAppSize: number): Promise<Array<Readonly<AVQueueInfo>>>;
/**
* Create an avsession controller
* @permission ohos.permission.MANAGE_MEDIA_RESOURCES
* @param { string } sessionId - Specifies the sessionId to create the controller.
* @param { AsyncCallback<AVSessionController> } callback - async callback for AVSessionController.
* If provided 'default', the system will create a default controller, Used to control the system default session
* @throws { BusinessError } 201 - permission denied
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi
* @since 9
*/
function createController(sessionId: string, callback: AsyncCallback<AVSessionController>): void;
/**
* Create an avsession controller
* @permission ohos.permission.MANAGE_MEDIA_RESOURCES
* @param { string } sessionId - Specifies the sessionId to create the controller.
* If provided 'default', the system will create a default controller, Used to control the system default session
* @returns { Promise<AVSessionController> } Promise for AVSessionController
* @throws { BusinessError } 201 - permission denied
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi
* @since 9
*/
function createController(sessionId: string): Promise<AVSessionController>;
/**
* Cast Audio to the remote devices or cast back local device
* @permission ohos.permission.MANAGE_MEDIA_RESOURCES
* @param { SessionToken | 'all' } session - Specifies the sessionId which to send to remote.
* @param { Array<audio.AudioDeviceDescriptor> } audioDevices - Specifies the audio devices to cast.
* @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully
* 'all' means cast all the media audio of this device to remote.
* @throws { BusinessError } 201 - permission denied
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600104 - The remote session connection failed.
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi
* @since 9
*/
function castAudio(session: SessionToken | 'all', audioDevices: Array<audio.AudioDeviceDescriptor>, callback: AsyncCallback<void>): void;
/**
* Cast Audio to the remote devices or cast back local device
* @permission ohos.permission.MANAGE_MEDIA_RESOURCES
* @param { SessionToken | 'all' } session - Specifies the sessionId which to send to remote.
* @param { Array<audio.AudioDeviceDescriptor> } audioDevices - Specifies the audio devices to cast.
* @returns { Promise<void> } void promise when executed successfully
* 'all' means cast all the media audio of this device to remote.
* @throws { BusinessError } 201 - permission denied
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600104 - The remote session connection failed.
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi
* @since 9
*/
function castAudio(session: SessionToken | 'all', audioDevices: Array<audio.AudioDeviceDescriptor>): Promise<void>;
/**
* Start an application for media playback.
* @permission ohos.permission.MANAGE_MEDIA_RESOURCES
* @param { string } bundleName - Specifies the bundleName which to be started.
* @param { string } assetId - Specifies the assetId to be started.
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 201 - permission denied
* @throws { BusinessError } 202 - Not System App. Interface caller is not a system app.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types. 3.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi
* @since 11
*/
function startAVPlayback(bundleName: string, assetId: string): Promise<void>;
/**
* Session token. Used to judge the legitimacy of the session.
* @typedef SessionToken
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi
* @since 9
*/
interface SessionToken {
/**
* The unique session id of the avsession object
* @permission ohos.permission.MANAGE_MEDIA_RESOURCES
* @type { string }
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi
* @since 9
*/
sessionId: string;
/**
* Process id of session
* @permission ohos.permission.MANAGE_MEDIA_RESOURCES
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi
* @since 9
*/
pid?: number;
/**
* User id
* @permission ohos.permission.MANAGE_MEDIA_RESOURCES
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi
* @since 9
*/
uid?: number;
}
/**
* Register session create callback
* @param { 'sessionCreate' } type - Registration Type, 'sessionCreate'
* @param { function } callback - Used to handle ('sessionCreate' command)
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi
* @since 9
*/
function on(type: 'sessionCreate', callback: (session: AVSessionDescriptor) => void): void;
/**
* Register session destroy callback
* @param { 'sessionDestroy' } type - Registration Type, 'sessionDestroy'
* @param { function } callback - Used to handle ('sessionDestroy' command)
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi
* @since 9
*/
function on(type: 'sessionDestroy', callback: (session: AVSessionDescriptor) => void): void;
/**
* Register top session changed callback
* @param { 'topSessionChange' } type - Registration Type, top priority session change, 'topSessionChange'
* @param { function } callback - Used to handle ('topSessionChange' command)
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi
* @since 9
*/
function on(type: 'topSessionChange', callback: (session: AVSessionDescriptor) => void): void;
/**
* Unregister session create callback
* @param { 'sessionCreate' } type - Registration Type, session creation, 'sessionCreate'
* @param { function } callback - Used to unregister listener for ('sessionCreate') command
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi
* @since 9
*/
function off(type: 'sessionCreate', callback?: (session: AVSessionDescriptor) => void): void;
/**
* Unregister session destroy callback
* @param { 'sessionDestroy' } type - Registration Type, session deletion, 'sessionDestroy'
* @param { function } callback - Used to unregister listener for ('sessionDestroy') command
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi
* @since 9
*/
function off(type: 'sessionDestroy', callback?: (session: AVSessionDescriptor) => void): void;
/**
* Unregister top session changed callback
* @param { 'topSessionChange' } type - Registration Type, top priority session change, 'topSessionChange'
* @param { function } callback - Used to unregister listener for ('topSessionChange') command
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi
* @since 9
*/
function off(type: 'topSessionChange', callback?: (session: AVSessionDescriptor) => void): void;
/**
* Register Session service death callback, notifying the application to clean up resources.
* @param { 'sessionServiceDie' } type - Registration Type, 'sessionServiceDie'
* @param { function } callback - Used to handle ('sessionServiceDie') command.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @systemapi
* @since 9
*/
function on(type: 'sessionServiceDie', callback: () => void): void;
/**
* Unregister Session service death callback, notifying the application to clean up resources.
* @param { 'sessionServiceDie' } type - Registration Type, 'sessionServiceDie'
* @param { function } callback - Used to unregister listener for ('sessionServiceDie') command.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @systemapi
* @since 9
*/
function off(type: 'sessionServiceDie', callback?: () => void): void;
/**
* Send system media key event.The system automatically selects the recipient.
* @permission ohos.permission.MANAGE_MEDIA_RESOURCES
* @param { KeyEvent } event - The key event to be sent
* @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully
* @throws { BusinessError } 201 - permission denied
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600105 - Invalid session command.
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi
* @since 9
*/
function sendSystemAVKeyEvent(event: KeyEvent, callback: AsyncCallback<void>): void;
/**
* Send system media key event.The system automatically selects the recipient.
* @permission ohos.permission.MANAGE_MEDIA_RESOURCES
* @param { KeyEvent } event - The key event to be sent
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 201 - permission denied
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600105 - Invalid session command.
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi
* @since 9
*/
function sendSystemAVKeyEvent(event: KeyEvent): Promise<void>;
/**
* Send system control command.The system automatically selects the recipient.
* @permission ohos.permission.MANAGE_MEDIA_RESOURCES
* @param { AVControlCommand } command - The command to be sent. See {@link AVControlCommand}
* @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully
* @throws { BusinessError } 201 - permission denied
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600105 - Invalid session command.
* @throws { BusinessError } 6600107 - Too many commands or events.
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi
* @since 9
*/
function sendSystemControlCommand(command: AVControlCommand, callback: AsyncCallback<void>): void;
/**
* Send system control command.The system automatically selects the recipient.
* @permission ohos.permission.MANAGE_MEDIA_RESOURCES
* @param { AVControlCommand } command - The command to be sent. See {@link AVControlCommand}
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 201 - permission denied
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600105 - Invalid session command.
* @throws { BusinessError } 6600107 - Too many commands or events.
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi
* @since 9
*/
function sendSystemControlCommand(command: AVControlCommand): Promise<void>;
/**
* Define different protocol capability
* @enum { number }
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 11
*/
/**
* Define different protocol capability
* @enum { number }
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
enum ProtocolType {
/**
* The default cast type "local", media can be routed on the same device,
* including internal speakers or audio jack on the device itself, A2DP devices.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 11
*/
/**
* The default cast type "local", media can be routed on the same device,
* including internal speakers or audio jack on the device itself, A2DP devices.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
TYPE_LOCAL = 0,
/**
* Cast+ mirror capability
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 10
*/
TYPE_CAST_PLUS_MIRROR = 1,
/**
* The Cast+ Stream indicating the media is presenting on a different device
* the application need get an AVCastController to control remote playback.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 11
*/
/**
* The Cast+ Stream indicating the media is presenting on a different device
* the application need get an AVCastController to control remote playback.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
TYPE_CAST_PLUS_STREAM = 2,
/**
* The DLNA type indicates the device supports DLNA protocol,
* the application needs to get an AVCastController to control remote playback.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
TYPE_DLNA = 4,
}
/**
* Start device discovery.
* @param { AsyncCallback<void> } callback a callback function
* @throws { BusinessError } 202 - Not System App.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 10
*/
function startCastDeviceDiscovery(callback: AsyncCallback<void>): void;
/**
* Start device discovery.
* @param { number } filter device filter when discovering, can be an union of {@link ProtocolType}
* @param { AsyncCallback<void> } callback a callback function
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 10
*/
function startCastDeviceDiscovery(filter: number, callback: AsyncCallback<void>): void;
/**
* Start device discovery.
* @param { number } filter device filter when discovering, can be an union of {@link ProtocolType}
* @returns { Promise<void> } Promise for the result
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 10
*/
/**
* Start device discovery.
* @param { number } [filter] - device filter when discovering, can be an union of {@link ProtocolType}
* @param { Array<string> } [drmSchemes] - filter drm-enabled devices which are represented by uuid.
* It is effective when protocol type is TYPE_CAST_PLUS_STREAM.
* @returns { Promise<void> } Promise for the result
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types. 3.Parameter verification failed.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 12
*/
function startCastDeviceDiscovery(filter?: number, drmSchemes?: Array<string>): Promise<void>;
/**
* Stop device discovery.
* @param { AsyncCallback<void> } callback a callback function
* @throws { BusinessError } 202 - Not System App.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 10
*/
function stopCastDeviceDiscovery(callback: AsyncCallback<void>): void;
/**
* Stop device discovery.
* @returns { Promise<void> } Promise for the result
* @throws { BusinessError } 202 - Not System App.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 10
*/
function stopCastDeviceDiscovery(): Promise<void>;
/**
* Enable or disable device to be discoverable, used at sink side.
* @param { boolean } enable true: can be discoverable, false: cannot be discoverable.
* @param { AsyncCallback<void> } callback a callback function
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 10
*/
function setDiscoverable(enable: boolean, callback: AsyncCallback<void>): void;
/**
* Enable or disable device to be discoverable, used at sink side.
* @param { boolean } enable true: can be discoverable, false: cannot be discoverable.
* @returns { Promise<void> } Promise for the result
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 10
*/
function setDiscoverable(enable: boolean): Promise<void>;
/**
* Register device discovery callback
* @param { 'deviceAvailable' } type Registration Type
* @param { function } callback Used to returns the device info
* @throws { BusinessError } 202 - Not System App.
* @throws {BusinessError} 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 10
*/
function on(type: 'deviceAvailable', callback: (device: OutputDeviceInfo) => void): void;
/**
* Unregister device discovery callback
* @param { 'deviceAvailable' } type Registration Type
* @param { function } callback Used to returns the device info
* @throws { BusinessError } 202 - Not System App.
* @throws {BusinessError} 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 10
*/
function off(type: 'deviceAvailable', callback?: (device: OutputDeviceInfo) => void): void;
/**
* Register device offline callback
* @param { 'deviceOffline' } type - Registration Type
* @param { function } callback - Used to returns the device info
* @throws { BusinessError } 202 - Not System App.
* @throws {BusinessError} 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 11
*/
function on(type: 'deviceOffline', callback: (deviceId: string) => void): void;
/**
* Unregister device offline callback
* @param { 'deviceOffline' } type - Registration Type
* @param { function } callback - Used to returns the device info
* @throws { BusinessError } 202 - Not System App.
* @throws {BusinessError} 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 11
*/
function off(type: 'deviceOffline', callback?: (deviceId: string) => void): void;
/**
* Register a callback to retrieve an avsession cast controller.
* This function can be used at both side to get the same controller to do the playback control.
* @permission ohos.permission.MANAGE_MEDIA_RESOURCES
* @param { string } sessionId Specifies the sessionId to get controller.
* @param { AsyncCallback<AVCastController> } callback - async callback for the AVCastController.
* @throws {BusinessError} 201 - permission denied
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws {BusinessError} 6600101 - Session service exception
* @throws {BusinessError} 6600102 - session does not exist
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 10
*/
function getAVCastController(sessionId: string, callback: AsyncCallback<AVCastController>): void;
/**
* Get the current session's remote controller client.
* If the avsession is not under casting state, the controller will return null.
* @permission ohos.permission.MANAGE_MEDIA_RESOURCES
* @param { string } sessionId Specifies the sessionId to get controller.
* @returns { Promise<AVCastController> } Promise for the AVCastController
* @throws {BusinessError} 201 - permission denied
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws {BusinessError} 6600101 - server exception
* @throws {BusinessError} 6600102 - session does not exist
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 10
*/
function getAVCastController(sessionId: string): Promise<AVCastController>;
/**
* Cast resource to remote device.
* @permission ohos.permission.MANAGE_MEDIA_RESOURCES
* @param { SessionToken } session Specifies the sessionId which is to be casted.
* @param { OutputDeviceInfo } device Specifies the device to cast.
* @param { AsyncCallback<void> } callback A callback instance used to return when start casting.
* @throws {BusinessError} 201 - permission denied
* @throws { BusinessError } 202 - Not System App.
* @throws {BusinessError} 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types. 3.Parameter verification failed.
* @throws {BusinessError} 6600101 - Session service exception
* @throws {BusinessError} 6600108 - Device connecting failed
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 10
*/
function startCasting(session: SessionToken, device: OutputDeviceInfo, callback: AsyncCallback<void>): void;
/**
* Cast resource to remote device.
* @permission ohos.permission.MANAGE_MEDIA_RESOURCES
* @param { SessionToken } session Specifies the sessionId which is to be casted.
* @param { OutputDeviceInfo } device Specifies the device to cast.
* @returns { Promise<void> } Promise for the result
* @throws {BusinessError} 201 - permission denied
* @throws { BusinessError } 202 - Not System App.
* @throws {BusinessError} 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types. 3.Parameter verification failed.
* @throws {BusinessError} 6600101 - Session service exception
* @throws {BusinessError} 6600108 - Device connecting failed
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 10
*/
function startCasting(session: SessionToken, device: OutputDeviceInfo): Promise<void>;
/**
* Stop current cast and disconnect device connection.
* @param { SessionToken } session Specifies the sessionId which is to be stopped.
* @param { AsyncCallback<void> } callback A callback instance used to return when cast stopped completed.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types. 3.Parameter verification failed.
* @throws { BusinessError } 6600109 - The remote connection is not established
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 10
*/
function stopCasting(session: SessionToken, callback: AsyncCallback<void>): void;
/**
* Stop current cast and disconnect device connection.
* @param { SessionToken } session Specifies the sessionId which is to be stopped.
* @returns { Promise<void> } Promise for the result
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types. 3.Parameter verification failed.
* @throws { BusinessError } 6600109 - The remote connection is not established
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 10
*/
function stopCasting(session: SessionToken): Promise<void>;
/**
* Begin to write device logs into a file descriptor for the purpose of problem locating.
* If the logs exceed max file size, no logs will be written and DEVICE_LOG_FULL event will be omitted.
* @param { string } url - The file descriptor to be written.
* @param { number } maxSize - The max size to be written in kilobyte.
* if not set, then written process will exit when there is no space to write.
* @returns { Promise<void> } Promise for the result
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 13
*/
function startDeviceLogging(url: string, maxSize?: number): Promise<void>;
/**
* Stop the current device written even the discovery is ongoing.
* @returns { Promise<void> } Promise for the result
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 13
*/
function stopDeviceLogging(): Promise<void>;
/**
* Register log event callback.
* @param { 'deviceLogEvent' } type - Command to register 'deviceLogEvent'.
* @param { Callback<DeviceLogEventCode> } callback - Used to handle ('deviceLogEvent') command
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 13
*/
function on(type: 'deviceLogEvent', callback: Callback<DeviceLogEventCode>): void;
/**
* UnRegister log event callback.
* @param { 'deviceLogEvent' } type - Command to register 'deviceLogEvent'.
* @param { Callback<DeviceLogEventCode> } callback - Used to handle ('deviceLogEvent') command
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 13
*/
function off(type: 'deviceLogEvent', callback?: Callback<DeviceLogEventCode>): void;
/**
* Enumerates device log event code.
* @enum { number }
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 13
*/
enum DeviceLogEventCode {
/**
* Log is full.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 13
*/
DEVICE_LOG_FULL = 1,
/**
* Log is written with exception, such as the fd cannot be written and so on.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 13
*/
DEVICE_LOG_EXCEPTION = 2,
}
/**
* Session type, support audio & video
* @typedef { 'audio' | 'video' } AVSessionType
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Session type, support audio & video, voice_call
* @typedef { 'audio' | 'video' | 'voice_call' } AVSessionType
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* Session type supports audio & video, voice_call, video_call
* @typedef { 'audio' | 'video' | 'voice_call' | 'video_call' } AVSessionType
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
type AVSessionType = 'audio' | 'video' | 'voice_call' | 'video_call';
/**
* AVSession object.
* @interface AVSession
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* AVSession object.
* @interface AVSession
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
interface AVSession {
/**
* unique session Id
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* unique session Id
* @type { string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
readonly sessionId: string;
/**
* Get current session type
* @type { AVSessionType }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Get current session type
* @type { AVSessionType }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
readonly sessionType: AVSessionType;
/**
* Set the metadata of this session.
* In addition to the required properties, users can fill in partially supported properties
* @param { AVMetadata } data {@link AVMetadata}
* @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
setAVMetadata(data: AVMetadata, callback: AsyncCallback<void>): void;
/**
* Set the metadata of this session.
* In addition to the required properties, users can fill in partially supported properties
* @param { AVMetadata } data {@link AVMetadata}
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Set the metadata of this session.
* In addition to the required properties, users can fill in partially supported properties
* @param { AVMetadata } data {@link AVMetadata}
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
setAVMetadata(data: AVMetadata): Promise<void>;
/**
* Set the metadata related with current call.
* @param { CallMetadata } data - {@link CallMetadata}
* @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types. 3.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
setCallMetadata(data: CallMetadata, callback: AsyncCallback<void>): void;
/**
* Set the metadata related with current call.
* @param { CallMetadata } data - {@link CallMetadata}
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types. 3.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
setCallMetadata(data: CallMetadata): Promise<void>;
/**
* Set the playback state of this session.
* @param { AVPlaybackState } state {@link AVPlaybackState}
* @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
setAVPlaybackState(state: AVPlaybackState, callback: AsyncCallback<void>): void;
/**
* Set the playback state of this session.
* @param { AVPlaybackState } state {@link AVPlaybackState}
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Set the playback state of this session.
* @param { AVPlaybackState } state {@link AVPlaybackState}
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
setAVPlaybackState(state: AVPlaybackState): Promise<void>;
/**
* Set the call state of this session.
* @param { AVCallState } state - {@link AVCallState}
* @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
setAVCallState(state: AVCallState, callback: AsyncCallback<void>): void;
/**
* Set the call state of this session.
* @param { AVCallState } state - {@link AVCallState}
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
setAVCallState(state: AVCallState): Promise<void>;
/**
* Set the ability to start the session corresponding to
* @param { WantAgent } ability - The WantAgent for launch the ability
* @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
setLaunchAbility(ability: WantAgent, callback: AsyncCallback<void>): void;
/**
* Set the ability to start the session corresponding to
* @param { WantAgent } ability - The WantAgent for launch the ability
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Set the ability to start the session corresponding to
* @param { WantAgent } ability - The WantAgent for launch the ability
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
setLaunchAbility(ability: WantAgent): Promise<void>;
/**
* Dispatch the session event of this session.
* @param { string } event - Session event name to dispatch
* @param { object } args - The parameters of session event
* @param { AsyncCallback<void>} callback - The asyncCallback triggered when the command is executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types. 3.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
dispatchSessionEvent(event: string, args: {[key: string]: Object}, callback: AsyncCallback<void>): void;
/**
* Dispatch the session event of this session.
* @param { string } event - Session event name to dispatch
* @param { object } args - The parameters of session event
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types. 3.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Dispatch the session event of this session.
* @param { string } event - Session event name to dispatch
* @param { object } args - The parameters of session event
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types. 3.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
dispatchSessionEvent(event: string, args: {[key: string]: Object}): Promise<void>;
/**
* Set the playlist of queueItem. Identifies the content of the playlist presented by this session.
* @param { Array<AVQueueItem> } items - An array of the AVQueueItem
* @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
setAVQueueItems(items: Array<AVQueueItem>, callback: AsyncCallback<void>): void;
/**
* Set the playlist of queueItem. Identifies the content of the playlist presented by this session.
* @param { Array<AVQueueItem> } items - An array of the AVQueueItem
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Set the playlist of queueItem. Identifies the content of the playlist presented by this session.
* @param { Array<AVQueueItem> } items - An array of the AVQueueItem
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
setAVQueueItems(items: Array<AVQueueItem>): Promise<void>;
/**
* Set the name of the playlist presented by this session.
* @param { string } title - The name of the playlist
* @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
setAVQueueTitle(title: string, callback: AsyncCallback<void>): void;
/**
* Set the name of the playlist presented by this session.
* @param { string } title - The name of the playlist
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Set the name of the playlist presented by this session.
* @param { string } title - The name of the playlist
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
setAVQueueTitle(title: string): Promise<void>;
/**
* Set the custom media packets for this session.
* @param { object } extras - The custom media packets
* @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
setExtras(extras: {[key: string]: Object}, callback: AsyncCallback<void>): void;
/**
* Set the custom media packets for this session.
* @param { object } extras - The custom media packets
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Set the custom media packets for this session.
* @param { object } extras - The custom media packets
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
setExtras(extras: {[key: string]: Object}): Promise<void>;
/**
* Get the current session's own controller
* @param { AsyncCallback<AVSessionController> } callback - async callback for the AVSessionController.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
getController(callback: AsyncCallback<AVSessionController>): void;
/**
* Get the current session's own controller
* @returns { Promise<AVSessionController> } Promise for the AVSessionController
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Get the current session's own controller
* @returns { Promise<AVSessionController> } Promise for the AVSessionController
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
getController(): Promise<AVSessionController>;
/**
* Get the cast controller when the session is casted to remote device.
* If the avsession is not under casting state, the controller will return null.
* @param { AsyncCallback<AVCastController> } callback - async callback for the AVCastController.
* @throws {BusinessError} 6600102 - The session does not exist
* @throws {BusinessError} 6600109 - The remote connection is not established
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
getAVCastController(callback: AsyncCallback<AVCastController>): void;
/**
* Get the cast controller when the session is casted to remote device.
* If the avsession is not under casting state, the controller will return null.
* @returns { Promise<AVCastController> } Promise for the AVCastController
* @throws {BusinessError} 6600102 - The session does not exist
* @throws {BusinessError} 6600109 - The remote connection is not established
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
/**
* Get the cast controller when the session is casted to remote device.
* If the avsession is not under casting state, the controller will return null.
* @returns { Promise<AVCastController> } Promise for the AVCastController
* @throws {BusinessError} 6600102 - The session does not exist
* @throws {BusinessError} 6600109 - The remote connection is not established
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
getAVCastController(): Promise<AVCastController>;
/**
* Get output device information
* @param { AsyncCallback<OutputDeviceInfo> } callback - async callback for the OutputDeviceInfo.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
getOutputDevice(callback: AsyncCallback<OutputDeviceInfo>): void;
/**
* Get output device information
* @returns { Promise<OutputDeviceInfo> } Promise for the OutputDeviceInfo
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Get output device information
* @returns { Promise<OutputDeviceInfo> } Promise for the OutputDeviceInfo
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
getOutputDevice(): Promise<OutputDeviceInfo>;
/**
* Get output device information
* @returns { OutputDeviceInfo } the OutputDeviceInfo
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Get output device information
* @returns { OutputDeviceInfo } the OutputDeviceInfo
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
getOutputDeviceSync(): OutputDeviceInfo;
/**
* Get all the current virtual display information for extended display.
* @returns { Promise<Array<CastDisplayInfo>> } Promise for the CastDisplayInfo
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast
* @atomicservice
* @since 12
*/
getAllCastDisplays(): Promise<Array<CastDisplayInfo>>;
/**
* Register play command callback.
* As long as it is registered, it means that the ability supports this command.
* If you cancel the callback, you need to call off {@link off}
* When canceling the callback, need to update the supported commands list.
* Each playback command only supports registering one callback,
* and the new callback will replace the previous one.
* @param { 'play' } type - Command to register 'play'.
* @param { function } callback - Used to handle ('play') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Register play command callback.
* As long as it is registered, it means that the ability supports this command.
* If you cancel the callback, you need to call off {@link off}
* When canceling the callback, need to update the supported commands list.
* Each playback command only supports registering one callback,
* and the new callback will replace the previous one.
* @param { 'play' } type - Command to register 'play'.
* @param { function } callback - Used to handle ('play') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'play', callback: () => void): void;
/**
* Register pause command callback.
* As long as it is registered, it means that the ability supports this command.
* If you cancel the callback, you need to call off {@link off}
* When canceling the callback, need to update the supported commands list.
* Each playback command only supports registering one callback,
* and the new callback will replace the previous one.
* @param { 'pause' } type - Command to register 'pause'.
* @param { function } callback - Used to handle ('pause') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Register pause command callback.
* As long as it is registered, it means that the ability supports this command.
* If you cancel the callback, you need to call off {@link off}
* When canceling the callback, need to update the supported commands list.
* Each playback command only supports registering one callback,
* and the new callback will replace the previous one.
* @param { 'pause' } type - Command to register 'pause'.
* @param { function } callback - Used to handle ('pause') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'pause', callback: () => void): void;
/**
* Register stop command callback.
* As long as it is registered, it means that the ability supports this command.
* If you cancel the callback, you need to call off {@link off}
* When canceling the callback, need to update the supported commands list.
* Each playback command only supports registering one callback,
* and the new callback will replace the previous one.
* @param { 'stop' } type - Command to register 'stop'.
* @param { function } callback - Used to handle ('stop') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Register stop command callback.
* As long as it is registered, it means that the ability supports this command.
* If you cancel the callback, you need to call off {@link off}
* When canceling the callback, need to update the supported commands list.
* Each playback command only supports registering one callback,
* and the new callback will replace the previous one.
* @param { 'stop' } type - Command to register 'stop'.
* @param { function } callback - Used to handle ('stop') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'stop', callback: () => void): void;
/**
* Register playNext command callback.
* As long as it is registered, it means that the ability supports this command.
* If you cancel the callback, you need to call off {@link off}
* When canceling the callback, need to update the supported commands list.
* Each playback command only supports registering one callback,
* and the new callback will replace the previous one.
* @param { 'playNext' } type - Command to register 'playNext'.
* @param { function } callback - Used to handle ('playNext') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Register playNext command callback.
* As long as it is registered, it means that the ability supports this command.
* If you cancel the callback, you need to call off {@link off}
* When canceling the callback, need to update the supported commands list.
* Each playback command only supports registering one callback,
* and the new callback will replace the previous one.
* @param { 'playNext' } type - Command to register 'playNext'.
* @param { function } callback - Used to handle ('playNext') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'playNext', callback: () => void): void;
/**
* Register playPrevious command callback.
* As long as it is registered, it means that the ability supports this command.
* If you cancel the callback, you need to call off {@link off}
* When canceling the callback, need to update the supported commands list.
* Each playback command only supports registering one callback,
* and the new callback will replace the previous one.
* @param { 'playPrevious' } type - Command to register 'playPrevious'.
* @param { function } callback - Used to handle ('playPrevious') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Register playPrevious command callback.
* As long as it is registered, it means that the ability supports this command.
* If you cancel the callback, you need to call off {@link off}
* When canceling the callback, need to update the supported commands list.
* Each playback command only supports registering one callback,
* and the new callback will replace the previous one.
* @param { 'playPrevious' } type - Command to register 'playPrevious'.
* @param { function } callback - Used to handle ('playPrevious') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'playPrevious', callback: () => void): void;
/**
* Register fastForward command callback.
* As long as it is registered, it means that the ability supports this command.
* If you cancel the callback, you need to call off {@link off}
* When canceling the callback, need to update the supported commands list.
* Each playback command only supports registering one callback,
* and the new callback will replace the previous one.
* @param { 'fastForward' } type - Command to register 'fastForward'.
* @param { function } callback - Used to handle ('fastForward') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Register fastForward command callback.
* As long as it is registered, it means that the ability supports this command.
* If you cancel the callback, you need to call off {@link off}
* When canceling the callback, need to update the supported commands list.
* Each playback command only supports registering one callback,
* and the new callback will replace the previous one.
* @param { 'fastForward' } type - Command to register 'fastForward'.
* @param { function } callback - Used to handle ('fastForward') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'fastForward', callback: (time ?: number) => void): void;
/**
* Register rewind command callback.
* As long as it is registered, it means that the ability supports this command.
* If you cancel the callback, you need to call off {@link off}
* When canceling the callback, need to update the supported commands list.
* Each playback command only supports registering one callback,
* and the new callback will replace the previous one.
* @param { 'rewind' } type - Command to register 'rewind'.
* @param { function } callback - Used to handle ('rewind') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Register rewind command callback.
* As long as it is registered, it means that the ability supports this command.
* If you cancel the callback, you need to call off {@link off}
* When canceling the callback, need to update the supported commands list.
* Each playback command only supports registering one callback,
* and the new callback will replace the previous one.
* @param { 'rewind' } type - Command to register 'rewind'.
* @param { function } callback - Used to handle ('rewind') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'rewind', callback: (time ?: number) => void): void;
/**
* Unregister play command callback.
* When canceling the callback, need to update the supported commands list.
* @param { 'play' } type - Command to register 'play'.
* @param { function } callback - Used to handle ('play') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Unregister play command callback.
* When canceling the callback, need to update the supported commands list.
* @param { 'play' } type - Command to register 'play'.
* @param { function } callback - Used to handle ('play') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'play', callback?: () => void): void;
/**
* Unregister pause command callback.
* When canceling the callback, need to update the supported commands list.
* @param { 'pause' } type - Command to register 'pause'.
* @param { function } callback - Used to handle ('pause') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Unregister pause command callback.
* When canceling the callback, need to update the supported commands list.
* @param { 'pause' } type - Command to register 'pause'.
* @param { function } callback - Used to handle ('pause') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'pause', callback?: () => void): void;
/**
* Unregister stop command callback.
* When canceling the callback, need to update the supported commands list.
* @param { 'stop' } type - Command to register 'stop'.
* @param { function } callback - Used to handle ('stop') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Unregister stop command callback.
* When canceling the callback, need to update the supported commands list.
* @param { 'stop' } type - Command to register 'stop'.
* @param { function } callback - Used to handle ('stop') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'stop', callback?: () => void): void;
/**
* Unregister playNext command callback.
* When canceling the callback, need to update the supported commands list.
* @param { 'playNext' } type - Command to register 'playNext'.
* @param { function } callback - Used to handle ('playNext') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Unregister playNext command callback.
* When canceling the callback, need to update the supported commands list.
* @param { 'playNext' } type - Command to register 'playNext'.
* @param { function } callback - Used to handle ('playNext') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'playNext', callback?: () => void): void;
/**
* Unregister playPrevious command callback.
* When canceling the callback, need to update the supported commands list.
* @param { 'playPrevious' } type - Command to register 'playPrevious'.
* @param { function } callback - Used to handle ('playPrevious') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Unregister playPrevious command callback.
* When canceling the callback, need to update the supported commands list.
* @param { 'playPrevious' } type - Command to register 'playPrevious'.
* @param { function } callback - Used to handle ('playPrevious') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'playPrevious', callback?: () => void): void;
/**
* Unregister fastForward command callback.
* When canceling the callback, need to update the supported commands list.
* @param { 'fastForward' } type - Command to register 'fastForward'.
* @param { function } callback - Used to handle ('fastForward') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Unregister fastForward command callback.
* When canceling the callback, need to update the supported commands list.
* @param { 'fastForward' } type - Command to register 'fastForward'.
* @param { function } callback - Used to handle ('fastForward') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'fastForward', callback?: () => void): void;
/**
* Unregister rewind command callback.
* When canceling the callback, need to update the supported commands list.
* @param { 'rewind' } type - Command to register 'rewind'.
* @param { function } callback - Used to handle ('rewind') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Unregister rewind command callback.
* When canceling the callback, need to update the supported commands list.
* @param { 'rewind' } type - Command to register 'rewind'.
* @param { function } callback - Used to handle ('rewind') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'rewind', callback?: () => void): void;
/**
* Register playFromAssetId command callback.
* As long as it is registered, it means that the ability supports this command.
* If you cancel the callback, you need to call off {@link off}
* When canceling the callback, need to update the supported commands list.
* Each playback command only supports registering one callback,
* and the new callback will replace the previous one.
* @param { 'playFromAssetId' } type - Command to register 'playFromAssetId'.
* @param { function } callback - Used to handle ('playFromAssetId') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* Register playFromAssetId command callback.
* As long as it is registered, it means that the ability supports this command.
* If you cancel the callback, you need to call off {@link off}
* When canceling the callback, need to update the supported commands list.
* Each playback command only supports registering one callback,
* and the new callback will replace the previous one.
* @param { 'playFromAssetId' } type - Command to register 'playFromAssetId'.
* @param { function } callback - Used to handle ('playFromAssetId') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'playFromAssetId', callback: (assetId: number) => void): void;
/**
* Unregister playFromAssetId command callback.
* @param { 'playFromAssetId' } type - Command to register 'playFromAssetId'.
* @param { function } callback - Used to handle ('playFromAssetId') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* Unregister playFromAssetId command callback.
* @param { 'playFromAssetId' } type - Command to register 'playFromAssetId'.
* @param { function } callback - Used to handle ('playFromAssetId') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'playFromAssetId', callback?: (assetId: number) => void): void;
/**
* Register seek command callback
* @param { 'seek' } type - Registration Type 'seek'
* @param { function } callback - Used to handle seek command.The callback provides the seek time(ms)
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Register seek command callback
* @param { 'seek' } type - Registration Type 'seek'
* @param { function } callback - Used to handle seek command.The callback provides the seek time(ms)
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'seek', callback: (time: number) => void): void;
/**
* Unregister seek command callback
* @param { 'seek' } type - Registration Type 'seek'
* @param { function } callback - Used to handle seek command.The callback provides the seek time(ms)
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Unregister seek command callback
* @param { 'seek' } type - Registration Type 'seek'
* @param { function } callback - Used to handle seek command.The callback provides the seek time(ms)
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'seek', callback?: (time: number) => void): void;
/**
* Register setSpeed command callback
* @param { 'setSpeed' } type - Registration Type 'setSpeed'
* @param { function } callback - Used to handle setSpeed command.The callback provides the speed value
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Register setSpeed command callback
* @param { 'setSpeed' } type - Registration Type 'setSpeed'
* @param { function } callback - Used to handle setSpeed command.The callback provides the speed value
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'setSpeed', callback: (speed: number) => void): void;
/**
* Unregister setSpeed command callback
* @param { 'setSpeed' } type - Registration Type 'setSpeed'
* @param { function } callback - Used to handle setSpeed command.The callback provides the speed value
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Unregister setSpeed command callback
* @param { 'setSpeed' } type - Registration Type 'setSpeed'
* @param { function } callback - Used to handle setSpeed command.The callback provides the speed value
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'setSpeed', callback?: (speed: number) => void): void;
/**
* Register setLoopMode command callback
* @param { 'setLoopMode' } type - Registration Type 'setLoopMode'
* @param { function } callback - Used to handle setLoopMode command.The callback provides the {@link LoopMode}
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Register setLoopMode command callback
* @param { 'setLoopMode' } type - Registration Type 'setLoopMode'
* @param { function } callback - Used to handle setLoopMode command.The callback provides the {@link LoopMode}
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'setLoopMode', callback: (mode: LoopMode) => void): void;
/**
* Unregister setLoopMode command callback
* @param { 'setLoopMode' } type - Registration Type 'setLoopMode'
* @param { function } callback - Used to handle setLoopMode command.The callback provides the {@link LoopMode}
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Unregister setLoopMode command callback
* @param { 'setLoopMode' } type - Registration Type 'setLoopMode'
* @param { function } callback - Used to handle setLoopMode command.The callback provides the {@link LoopMode}
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'setLoopMode', callback?: (mode: LoopMode) => void): void;
/**
* Register toggle favorite command callback
* @param { 'toggleFavorite' } type - Registration Type 'toggleFavorite'
* @param { function } callback - Used to handle toggleFavorite command.The callback provides
* the assetId for which the favorite status needs to be switched.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Register toggle favorite command callback
* @param { 'toggleFavorite' } type - Registration Type 'toggleFavorite'
* @param { function } callback - Used to handle toggleFavorite command.The callback provides
* the assetId for which the favorite status needs to be switched.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'toggleFavorite', callback: (assetId: string) => void): void;
/**
* Unregister toggle favorite command callback
* @param { 'toggleFavorite' } type - Registration Type 'toggleFavorite'
* @param { function } callback - Used to handle toggleFavorite command.The callback provides
* the assetId for which the favorite status needs to be switched.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Unregister toggle favorite command callback
* @param { 'toggleFavorite' } type - Registration Type 'toggleFavorite'
* @param { function } callback - Used to handle toggleFavorite command.The callback provides
* the assetId for which the favorite status needs to be switched.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'toggleFavorite', callback?: (assetId: string) => void): void;
/**
* Register media key handling callback
* @param { 'handleKeyEvent' } type - Registration Type 'handleKeyEvent'
* @param { function } callback - Used to handle key events.The callback provides the KeyEvent
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Register media key handling callback
* @param { 'handleKeyEvent' } type - Registration Type 'handleKeyEvent'
* @param { function } callback - Used to handle key events.The callback provides the KeyEvent
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'handleKeyEvent', callback: (event: KeyEvent) => void): void;
/**
* Unregister media key handling callback
* @param { 'handleKeyEvent' } type - Registration Type 'handleKeyEvent'
* @param { function } callback - Used to handle key events.The callback provides the KeyEvent
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Unregister media key handling callback
* @param { 'handleKeyEvent' } type - Registration Type 'handleKeyEvent'
* @param { function } callback - Used to handle key events.The callback provides the KeyEvent
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'handleKeyEvent', callback?: (event: KeyEvent) => void): void;
/**
* Register session output device change callback
* @param { 'outputDeviceChange' } type - Registration Type 'outputDeviceChange'
* @param { function } callback - Used to handle output device changed.
* The callback provide the new device info {@link OutputDeviceInfo} and related connection state {@link ConnectionState}.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @throws { BusinessError } 6600102 - The session does not exist
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Register session output device change callback
* @param { 'outputDeviceChange' } type - Registration Type 'outputDeviceChange'
* @param { function } callback - Used to handle output device changed.
* The callback provide the new device info {@link OutputDeviceInfo} and related connection state {@link ConnectionState}.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @throws { BusinessError } 6600102 - The session does not exist
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'outputDeviceChange', callback: (state: ConnectionState, device: OutputDeviceInfo) => void): void;
/**
* Unregister session output device change callback
* @param { 'outputDeviceChange' } type - Registration Type 'outputDeviceChange'
* @param { function } callback - Used to handle output device changed.
* The callback provide the new device info {@link OutputDeviceInfo} and related connection state {@link ConnectionState}.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @throws { BusinessError } 6600102 - The session does not exist
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Unregister session output device change callback
* @param { 'outputDeviceChange' } type - Registration Type 'outputDeviceChange'
* @param { function } callback - Used to handle output device changed.
* The callback provide the new device info {@link OutputDeviceInfo} and related connection state {@link ConnectionState}.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @throws { BusinessError } 6600102 - The session does not exist
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'outputDeviceChange', callback?: (state: ConnectionState, device: OutputDeviceInfo) => void): void;
/**
* Register session custom command change callback
* @param { 'commonCommand' } type - Registration Type 'commonCommand'
* @param { function } callback - Used to handle event when the common command is received
* The callback provide the command name and command args
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Register session custom command change callback
* @param { 'commonCommand' } type - Registration Type 'commonCommand'
* @param { function } callback - Used to handle event when the common command is received
* The callback provide the command name and command args
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'commonCommand', callback: (command: string, args: {[key: string]: Object}) => void): void;
/**
* Unregister session custom command change callback
* @param { 'commonCommand' } type - Registration Type 'commonCommand'
* @param { function } callback - Used to cancel a specific listener
* The callback provide the command name and command args
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Unregister session custom command change callback
* @param { 'commonCommand' } type - Registration Type 'commonCommand'
* @param { function } callback - Used to cancel a specific listener
* The callback provide the command name and command args
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'commonCommand', callback?: (command: string, args: {[key: string]: Object}) => void): void;
/**
* Register the item to play from the playlist change callback
* @param { 'skipToQueueItem' } type - Registration Type 'skipToQueueItem'
* @param { function } callback - Used to handle the item to be played.
* The callback provide the new device info {@link OutputDeviceInfo}
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Register the item to play from the playlist change callback
* @param { 'skipToQueueItem' } type - Registration Type 'skipToQueueItem'
* @param { function } callback - Used to handle the item to be played.
* The callback provide the new device info {@link OutputDeviceInfo}
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'skipToQueueItem', callback: (itemId: number) => void): void;
/**
* Unregister the item to play from the playlist change callback
* @param { 'skipToQueueItem' } type - Registration Type 'skipToQueueItem'
* @param { function } callback - Used to handle the item to be played.
* The callback provide the new device info {@link OutputDeviceInfo}
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Unregister the item to play from the playlist change callback
* @param { 'skipToQueueItem' } type - Registration Type 'skipToQueueItem'
* @param { function } callback - Used to handle the item to be played.
* The callback provide the new device info {@link OutputDeviceInfo}
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'skipToQueueItem', callback?: (itemId: number) => void): void;
/**
* Register answer command callback.
* As long as it is registered, it means that the ability supports this command.
* If you cancel the callback, you need to call off {@link off}
* @param { 'answer' } type - Command to register 'answer'.
* @param { Callback<void> } callback - Used to handle ('answer') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* Register answer command callback.
* As long as it is registered, it means that the ability supports this command.
* If you cancel the callback, you need to call off {@link off}
* @param { 'answer' } type - Command to register 'answer'.
* @param { Callback<void> } callback - Used to handle ('answer') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'answer', callback: Callback<void>): void;
/**
* Unregister answer command callback.
* @param { 'answer' } type - Command to register 'answer'.
* @param { Callback<void> } callback - Used to handle ('answer') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* Unregister answer command callback.
* @param { 'answer' } type - Command to register 'answer'.
* @param { Callback<void> } callback - Used to handle ('answer') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'answer', callback?: Callback<void>): void;
/**
* Register hangUp command callback.
* As long as it is registered, it means that the ability supports this command.
* If you cancel the callback, you need to call off {@link off}
* @param { 'hangUp' } type - Command to register 'hangUp'.
* @param { Callback<void> } callback - Used to handle ('hangUp') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* Register hangUp command callback.
* As long as it is registered, it means that the ability supports this command.
* If you cancel the callback, you need to call off {@link off}
* @param { 'hangUp' } type - Command to register 'hangUp'.
* @param { Callback<void> } callback - Used to handle ('hangUp') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'hangUp', callback: Callback<void>): void;
/**
* Unregister hangUp command callback.
* @param { 'hangUp' } type - Command to register 'hangUp'.
* @param { Callback<void> } callback - Used to handle ('hangUp') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* Unregister hangUp command callback.
* @param { 'hangUp' } type - Command to register 'hangUp'.
* @param { Callback<void> } callback - Used to handle ('hangUp') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'hangUp', callback?: Callback<void>): void;
/**
* Register toggleCallMute command callback.
* As long as it is registered, it means that the ability supports this command.
* If you cancel the callback, you need to call off {@link off}
* @param { 'toggleCallMute' } type - Command to register 'toggleCallMute'.
* @param { Callback<void> } callback - Used to handle ('toggleCallMute') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* Register toggleCallMute command callback.
* As long as it is registered, it means that the ability supports this command.
* If you cancel the callback, you need to call off {@link off}
* @param { 'toggleCallMute' } type - Command to register 'toggleCallMute'.
* @param { Callback<void> } callback - Used to handle ('toggleCallMute') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'toggleCallMute', callback: Callback<void>): void;
/**
* Unregister toggleCallMute command callback.
* @param { 'toggleCallMute' } type - Command to register 'toggleCallMute'.
* @param { Callback<void> } callback - Used to handle ('toggleCallMute') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* Unregister toggleCallMute command callback.
* @param { 'toggleCallMute' } type - Command to register 'toggleCallMute'.
* @param { Callback<void> } callback - Used to handle ('toggleCallMute') command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'toggleCallMute', callback?: Callback<void>): void;
/**
* Register listener for cast display information changed.
* @param { 'castDisplayChange' } type - Type of the 'castDisplayChange' to listen for.
* @param { Callback<CastDisplayInfo> } callback - Callback used to return cast display information.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @throws { BusinessError } 6600102 - The session does not exist
* @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast
* @atomicservice
* @since 12
*/
on(type: 'castDisplayChange', callback: Callback<CastDisplayInfo>): void;
/**
* Unregister listener for cast display information changed.
* @param { 'castDisplayChange' } type - Type of the 'castDisplayChange' to listen for.
* @param { Callback<CastDisplayInfo> } callback - Callback used to return cast display information.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @throws { BusinessError } 6600102 - The session does not exist
* @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast
* @atomicservice
* @since 12
*/
off(type: 'castDisplayChange', callback?: Callback<CastDisplayInfo>): void;
/**
* Stop current cast and disconnect device connection.
* @param { AsyncCallback<void> } callback A callback instance used to return when cast stopped completed.
* @throws { BusinessError } 6600109 - The remote connection is not established
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
stopCasting(callback: AsyncCallback<void>): void;
/**
* Stop current cast and disconnect device connection.
* @returns { Promise<void> } void result promise when executed successfully
* @throws { BusinessError } 6600109 - The remote connection is not established
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
/**
* Stop current cast and disconnect device connection.
* @returns { Promise<void> } void result promise when executed successfully
* @throws { BusinessError } 6600109 - The remote connection is not established
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
stopCasting(): Promise<void>;
/**
* Activate the session, indicating that the session can accept control commands
* @param { AsyncCallback<void> } callback - The asyncCallback triggered when the session is activated.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
activate(callback: AsyncCallback<void>): void;
/**
* Activate the session, indicating that the session can accept control commands
* @returns { Promise<void> } void result promise when executed successfully
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Activate the session, indicating that the session can accept control commands
* @returns { Promise<void> } void result promise when executed successfully
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
activate(): Promise<void>;
/**
* Deactivate the session, indicating that the session not ready to accept control commands
* @param { AsyncCallback<void> } callback - The asyncCallback triggered when the session is deactivated.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
deactivate(callback: AsyncCallback<void>): void;
/**
* Deactivate the session, indicating that the session not ready to accept control commands
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Deactivate the session, indicating that the session not ready to accept control commands
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
deactivate(): Promise<void>;
/**
* Destroy this session, the server will clean up the session resources
* @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
destroy(callback: AsyncCallback<void>): void;
/**
* Destroy this session, the server will clean up the session resources
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Destroy this session, the server will clean up the session resources
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
destroy(): Promise<void>;
}
/**
* The type of control command
* @typedef { 'play' | 'pause' | 'stop' | 'playNext' | 'playPrevious' | 'fastForward' | 'rewind' | 'seek' |
* 'setVolume' | 'setSpeed' | 'setLoopMode' | 'toggleFavorite' | 'toggleMute' } AVCastControlCommandType
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
/**
* The type of control command
* @typedef { 'play' | 'pause' | 'stop' | 'playNext' | 'playPrevious' | 'fastForward' | 'rewind' | 'seek' |
* 'setVolume' | 'setSpeed' | 'setLoopMode' | 'toggleFavorite' | 'toggleMute' } AVCastControlCommandType
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
type AVCastControlCommandType = 'play' | 'pause' | 'stop' | 'playNext' | 'playPrevious' | 'fastForward' | 'rewind' |
'seek' | 'setVolume' | 'setSpeed' | 'setLoopMode' | 'toggleFavorite' | 'toggleMute';
/**
* The definition of command to be sent to the session
* @interface AVCastControlCommand
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
/**
* The definition of command to be sent to the session
* @interface AVCastControlCommand
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
interface AVCastControlCommand {
/**
* The command value {@link AVCastControlCommandType}
*
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
/**
* The command value {@link AVCastControlCommandType}
* @type { AVCastControlCommandType }
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
command: AVCastControlCommandType;
/**
* Parameter carried in the command.
* The seek command must carry the number parameter.
* The setVolume command must carry the number parameter.
* The toggleFavorite command must carry the {@link AVMediaDescription.assetId} parameter.
* The setSpeed command must carry the {@link #media.PlaybackSpeed} parameter.
* The setLoopMode command must carry the {@link LoopMode} parameter.
* Other commands do not need to carry parameters.
* @type { ?(media.PlaybackSpeed | number | string | LoopMode) }
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
/**
* Parameter carried in the command.
* The seek command must carry the number parameter.
* The setVolume command must carry the number parameter.
* The toggleFavorite command must carry the {@link AVMediaDescription.assetId} parameter.
* The setSpeed command must carry the {@link #media.PlaybackSpeed} parameter.
* The setLoopMode command must carry the {@link LoopMode} parameter.
* Other commands do not need to carry parameters.
* @type { ?(media.PlaybackSpeed | number | string | LoopMode) }
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
parameter?: media.PlaybackSpeed | number | string | LoopMode;
}
/**
* AVCastController definition used to implement a remote control when a cast is connected
* @interface AVCastController
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
/**
* AVCastController definition used to implement a remote control when a cast is connected
* @interface AVCastController
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
interface AVCastController {
/**
* Set a surface instance to display playing view, used at sink side.
* @param { string } surfaceId - surface id, video player will use this id get a surface instance.
* @param { AsyncCallback<void> } callback - A callback instance used to return when set surface completed.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600109 - The remote connection is not established
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 10
*/
setDisplaySurface(surfaceId: string, callback: AsyncCallback<void>): void;
/**
* Set a surface instance to display playing view, used at sink side.
* @param { string } surfaceId - surface id, video player will use this id get a surface instance.
* @returns { Promise<void> } Promise used to return the result.
* @throws { BusinessError } 202 - Not System App.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600109 - The remote connection is not established
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 10
*/
setDisplaySurface(surfaceId: string): Promise<void>;
/**
* Get the playback status of the current player
* @param { AsyncCallback<AVPlaybackState> } callback - The triggered asyncCallback when (getAVPlaybackState).
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
getAVPlaybackState(callback: AsyncCallback<AVPlaybackState>): void;
/**
* Get the playback status of the current player
* @returns { Promise<AVPlaybackState> } (AVPlaybackState) returned through promise
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
/**
* Get the playback status of the current player
* @returns { Promise<AVPlaybackState> } (AVPlaybackState) returned through promise
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
getAVPlaybackState(): Promise<AVPlaybackState>;
/**
* Send control commands to remote player
* @param { AVCastControlCommand } command The command to be send.
* @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception
* @throws { BusinessError } 6600105 - Invalid session command
* @throws { BusinessError } 6600109 - The remote connection is not established
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
sendControlCommand(command: AVCastControlCommand, callback: AsyncCallback<void>): void;
/**
* Send control commands to remote player
* @param { AVCastControlCommand } command The command to be send.
* @returns { Promise<void> } Promise used to return the result.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception
* @throws { BusinessError } 6600105 - Invalid session command
* @throws { BusinessError } 6600109 - The remote connection is not established
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
/**
* Send control commands to remote player
* @param { AVCastControlCommand } command The command to be send.
* @returns { Promise<void> } Promise used to return the result.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception
* @throws { BusinessError } 6600105 - Invalid session command
* @throws { BusinessError } 6600109 - The remote connection is not established
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
sendControlCommand(command: AVCastControlCommand): Promise<void>;
/**
* Play the current item, should contain mediaUri otherwise the playback will fail.
* @param { AVQueueItem } item media item info.
* @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully
* @throws {BusinessError} 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws {BusinessError} 6600101 - Session service exception
* @throws {BusinessError} 6600109 - The remote connection is not established
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
start(item: AVQueueItem, callback: AsyncCallback<void>): void;
/**
* Play the current item, should contain mediaUri otherwise the playback will fail.
* @param { AVQueueItem } item media item info.
* @returns { Promise<void> } Promise used to return the result.
* @throws {BusinessError} 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws {BusinessError} 6600101 - Session service exception
* @throws {BusinessError} 6600109 - The remote connection is not established
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
/**
* Play the current item, should contain mediaUri otherwise the playback will fail.
* @param { AVQueueItem } item media item info.
* @returns { Promise<void> } Promise used to return the result.
* @throws {BusinessError} 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws {BusinessError} 6600101 - Session service exception
* @throws {BusinessError} 6600109 - The remote connection is not established
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
start(item: AVQueueItem): Promise<void>;
/**
* Load the current item and mediaUri can be null, this is needed for sink media information displaying
* @param { AVQueueItem } item media item info.
* @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully
* @throws {BusinessError} 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws {BusinessError} 6600101 - Session service exception
* @throws {BusinessError} 6600109 - The remote connection is not established
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
prepare(item: AVQueueItem, callback: AsyncCallback<void>): void;
/**
* Load the current item and mediaUri can be null, this is needed for sink media information displaying
* @param { AVQueueItem } item media item info.
* @returns { Promise<void> } Promise used to return the result.
* @throws {BusinessError} 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws {BusinessError} 6600101 - Session service exception
* @throws {BusinessError} 6600109 - The remote connection is not established
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
/**
* Load the current item and mediaUri can be null, this is needed for sink media information displaying
* @param { AVQueueItem } item media item info.
* @returns { Promise<void> } Promise used to return the result.
* @throws {BusinessError} 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws {BusinessError} 6600101 - Session service exception
* @throws {BusinessError} 6600109 - The remote connection is not established
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
prepare(item: AVQueueItem): Promise<void>;
/**
* Get the current playing item
* @param { AsyncCallback<AVQueueItem> } callback - The triggered asyncCallback.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
getCurrentItem(callback: AsyncCallback<AVQueueItem>): void;
/**
* Get the current playing item
* @returns { Promise<AVQueueItem> } (AVQueueItem) returned through promise
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
/**
* Get the current playing item
* @returns { Promise<AVQueueItem> } (AVQueueItem) returned through promise
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
getCurrentItem(): Promise<AVQueueItem>;
/**
* Get commands supported by the current cast controller
* @param { AsyncCallback<Array<AVCastControlCommandType>> } callback - The triggered asyncCallback when (getValidCommands).
* @throws { BusinessError } 6600101 - Session service exception.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 11
*/
getValidCommands(callback: AsyncCallback<Array<AVCastControlCommandType>>): void;
/**
* Get commands supported by the current cast controller
* @returns { Promise<Array<AVCastControlCommandType>> } array of AVCastControlCommandType promise
* @throws { BusinessError } 6600101 - Session service exception.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 11
*/
getValidCommands(): Promise<Array<AVCastControlCommandType>>;
/**
* Process the response corresponding to the media key request obtained by the application.
* @param { string } assetId - The assetId of resource which provides the response.
* @param { Uint8Array } response - Response corresponding to the request.
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
processMediaKeyResponse(assetId: string, response: Uint8Array): Promise<void>;
/**
* Destroy the controller
* @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully.
* @throws { BusinessError } 6600101 - Session service exception.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 11
*/
release(callback: AsyncCallback<void>): void;
/**
* Destroy the controller
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 6600101 - Session service exception.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 11
*/
/**
* Destroy the controller
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 6600101 - Session service exception.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
release(): Promise<void>;
/**
* Register playback state changed callback
* @param { 'playbackStateChange' } type
* @param { Array<keyof AVPlaybackState> | 'all' } filter - The properties of {@link AVPlaybackState} that you cared about
* @param { function } callback - The callback used to handle playback state changed event.
* The callback function provides the {@link AVPlaybackState} parameter.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
/**
* Register playback state changed callback
* @param { 'playbackStateChange' } type
* @param { Array<keyof AVPlaybackState> | 'all' } filter - The properties of {@link AVPlaybackState} that you cared about
* @param { function } callback - The callback used to handle playback state changed event.
* The callback function provides the {@link AVPlaybackState} parameter.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
on(type: 'playbackStateChange', filter: Array<keyof AVPlaybackState> | 'all', callback: (state: AVPlaybackState) => void): void;
/**
* Unregister playback state changed callback
* @param { 'playbackStateChange' } type
* @param { function } callback - The callback used to handle playback state changed event.
* The callback function provides the {@link AVPlaybackState} parameter.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
/**
* Unregister playback state changed callback
* @param { 'playbackStateChange' } type
* @param { function } callback - The callback used to handle playback state changed event.
* The callback function provides the {@link AVPlaybackState} parameter.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
off(type: 'playbackStateChange', callback?: (state: AVPlaybackState) => void): void;
/**
* Register listener for current media item playback events.
* @param { 'mediaItemChange' } type Type of the playback event to listen for.
* @param { Callback<AVQueueItem> } callback Callback used to listen for current item changed.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
/**
* Register listener for current media item playback events.
* @param { 'mediaItemChange' } type Type of the playback event to listen for.
* @param { Callback<AVQueueItem> } callback Callback used to listen for current item changed.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
on(type: 'mediaItemChange', callback: Callback<AVQueueItem>): void;
/**
* Unregister listener for current media item playback events.
* @param { 'mediaItemChange' } type Type of the playback event to listen for.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
/**
* Unregister listener for current media item playback events.
* @param { 'mediaItemChange' } type Type of the playback event to listen for.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
off(type: 'mediaItemChange'): void;
/**
* Register playback command callback sent by remote side or media center.
* Application needs update the new media resource when receive these commands by using playItem.
* @param { 'playNext' } type - Type of the 'playNext' event to listen for.
* @param { Callback<void> } callback - Used to handle 'playNext' command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
/**
* Register playback command callback sent by remote side or media center.
* Application needs update the new media resource when receive these commands by using playItem.
* @param { 'playNext' } type - Type of the 'playNext' event to listen for.
* @param { Callback<void> } callback - Used to handle 'playNext' command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
on(type: 'playNext', callback: Callback<void>): void;
/**
* Unregister playback command callback sent by remote side or media center.
* When canceling the callback, need to update the supported commands list.
* @param { 'playNext' } type - Type of the 'playNext' event to listen for.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
/**
* Unregister playback command callback sent by remote side or media center.
* When canceling the callback, need to update the supported commands list.
* @param { 'playNext' } type - Type of the 'playNext' event to listen for.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
off(type: 'playNext'): void;
/**
* Register playback command callback sent by remote side or media center.
* Application needs update the new media resource when receive these commands by using playItem.
* @param { 'playPrevious' } type - Type of the 'playPrevious' to listen for.
* @param { Callback<void> } callback - Used to handle 'playPrevious' command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
/**
* Register playback command callback sent by remote side or media center.
* Application needs update the new media resource when receive these commands by using playItem.
* @param { 'playPrevious' } type - Type of the 'playPrevious' to listen for.
* @param { Callback<void> } callback - Used to handle 'playPrevious' command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
on(type: 'playPrevious', callback: Callback<void>): void;
/**
* Unregister playback command callback sent by remote side or media center.
* When canceling the callback, need to update the supported commands list.
* @param { 'playPrevious' } type - Type of the 'playPrevious' to listen for.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
/**
* Unregister playback command callback sent by remote side or media center.
* When canceling the callback, need to update the supported commands list.
* @param { 'playPrevious' } type - Type of the 'playPrevious' to listen for.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
off(type: 'playPrevious'): void;
/**
* Register requested playback command callback sent by remote side or media center.
* The AVQueueItem may include the requested assetId, starting position and other configurations.
* @param { 'requestPlay' } type - Type of the 'requestPlay' to listen for.
* @param { Callback<AVQueueItem> } callback - Used to handle 'requestPlay' command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 11
*/
on(type: 'requestPlay', callback: Callback<AVQueueItem>): void;
/**
* Unregister requested playback command callback sent by remote side or media center.
* @param { 'requestPlay' } type - Type of the 'requestPlay' to listen for.
* @param { Callback<AVQueueItem> } callback - Used to handle 'requestPlay' command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 11
*/
off(type: 'requestPlay', callback?: Callback<AVQueueItem>): void;
/**
* Register endOfStream state callback.
* Application needs update the new media resource when receive these commands by using playItem.
* @param { 'endOfStream' } type - Type of the 'endOfStream' to listen for.
* @param { Callback<void> } callback - Used to handle 'endOfStream' command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 11
*/
on(type: 'endOfStream', callback: Callback<void>): void;
/**
* Unregister endOfStream state callback.
* @param { 'endOfStream' } type - Type of the 'endOfStream' to listen for.
* @param { Callback<void> } callback - Used to handle 'endOfStream' command
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 11
*/
off(type: 'endOfStream', callback?: Callback<void>): void;
/**
* Register listens for playback events.
* @param { 'seekDone' } type - Type of the 'seekDone' to listen for.
* @param { Callback<number> } callback - Callback used to listen for the playback seekDone event.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
/**
* Register listens for playback events.
* @param { 'seekDone' } type - Type of the 'seekDone' to listen for.
* @param { Callback<number> } callback - Callback used to listen for the playback seekDone event.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
on(type: 'seekDone', callback: Callback<number>): void;
/**
* Unregister listens for playback events.
* @param { 'seekDone' } type - Type of the 'seekDone' to listen for.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
/**
* Unregister listens for playback events.
* @param { 'seekDone' } type - Type of the 'seekDone' to listen for.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
off(type: 'seekDone'): void;
/**
* Register the valid commands of the casted session changed callback
* @param { 'validCommandChange' } type - 'validCommandChange'
* @param { Callback<Array<AVCastControlCommandType>> } callback - The callback used to handle the changes.
* The callback function provides an array of AVCastControlCommandType.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 11
*/
on(type: 'validCommandChange', callback: Callback<Array<AVCastControlCommandType>>);
/**
* Unregister the valid commands of the casted session changed callback
* @param { 'validCommandChange' } type - 'validCommandChange'
* @param { Callback<Array<AVCastControlCommandType>> } callback - The callback used to handle the changes.
* The callback function provides an array of AVCastControlCommandType.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 11
*/
off(type: 'validCommandChange', callback?: Callback<Array<AVCastControlCommandType>>);
/**
* Register listener for video size change event, used at remote side.
* @param { 'videoSizeChange' } type - Type of the 'videoSizeChange' to listen for.
* @param { function } callback - Callback used to return video size.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 12
*/
on(type: 'videoSizeChange', callback: (width: number, height: number) => void): void;
/**
* Unregister listener for video size change event, used at remote side.
* @param { 'videoSizeChange' } type - Type of the 'videoSizeChange' to listen for.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 12
*/
off(type: 'videoSizeChange'): void;
/**
* Register listeners for playback error events.
* @param { 'error' } type Type of the 'error' to listen for.
* @param { ErrorCallback } callback Callback used to listen for the playback error event.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 5400101 - No memory.
* @throws { BusinessError } 5400102 - Operation not allowed.
* @throws { BusinessError } 5400103 - I/O error.
* @throws { BusinessError } 5400104 - Time out.
* @throws { BusinessError } 5400105 - Service died.
* @throws { BusinessError } 5400106 - Unsupport format.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
/**
* Register listeners for playback error events.
* @param { 'error' } type Type of the 'error' to listen for.
* @param { ErrorCallback } callback Callback used to listen for the playback error event.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 5400101 - No memory.
* @throws { BusinessError } 5400102 - Operation not allowed.
* @throws { BusinessError } 5400103 - I/O error.
* @throws { BusinessError } 5400104 - Time out.
* @throws { BusinessError } 5400105 - Service died.
* @throws { BusinessError } 5400106 - Unsupport format.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
on(type: 'error', callback: ErrorCallback): void;
/**
* Unregister listens for playback error events.
* @param { 'error' } type Type of the 'error' to listen for.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 5400101 - No memory.
* @throws { BusinessError } 5400102 - Operation not allowed.
* @throws { BusinessError } 5400103 - I/O error.
* @throws { BusinessError } 5400104 - Time out.
* @throws { BusinessError } 5400105 - Service died.
* @throws { BusinessError } 5400106 - Unsupport format.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
/**
* Unregister listens for playback error events.
* @param { 'error' } type Type of the 'error' to listen for.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 5400101 - No memory.
* @throws { BusinessError } 5400102 - Operation not allowed.
* @throws { BusinessError } 5400103 - I/O error.
* @throws { BusinessError } 5400104 - Time out.
* @throws { BusinessError } 5400105 - Service died.
* @throws { BusinessError } 5400106 - Unsupport format.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
off(type: 'error'): void;
/**
* Register listeners for cast control generic error events.
* @param { 'castControlGenericError' } type Type of the 'castControlGenericError' to listen for.
* @param { ErrorCallback } callback Callback used to listen for the cast control error event.
* @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types.
* @throws { BusinessError } 6611000 - The error code for cast control is unspecified.
* @throws { BusinessError } 6611001 - An unspecified error occurs in the remote player.
* @throws { BusinessError } 6611002 - The playback position falls behind the live window.
* @throws { BusinessError } 6611003 - The process of cast control times out.
* @throws { BusinessError } 6611004 - The runtime check failed.
* @throws { BusinessError } 6611100 - Cross-device data transmission is locked.
* @throws { BusinessError } 6611101 - The specified seek mode is not supported.
* @throws { BusinessError } 6611102 - The position to seek to is out of the range of the media asset
* or the specified seek mode is not supported.
* @throws { BusinessError } 6611103 - The specified playback mode is not supported.
* @throws { BusinessError } 6611104 - The specified playback speed is not supported.
* @throws { BusinessError } 6611105 - The action failed because either the media source device or the media sink device has been revoked.
* @throws { BusinessError } 6611106 - The parameter is invalid, for example, the url is illegal to play.
* @throws { BusinessError } 6611107 - Allocation of memory failed.
* @throws { BusinessError } 6611108 - Operation is not allowed.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
on(type: 'castControlGenericError', callback: ErrorCallback): void;
/**
* Unregister listeners for cast control generic error events.
* @param { 'castControlGenericError' } type Type of the 'castControlGenericError' to listen for.
* @param { ErrorCallback } callback Callback used to listen for the cast control error event.
* @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
off(type: 'castControlGenericError', callback?: ErrorCallback): void;
/**
* Register listeners for cast control input/output error events.
* @param { 'castControlIoError' } type Type of the 'castControlIoError' to listen for.
* @param { ErrorCallback } callback Callback used to listen for the cast control error event.
* @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types.
* @throws { BusinessError } 6612000 - An unspecified input/output error occurs.
* @throws { BusinessError } 6612001 - Network connection failure.
* @throws { BusinessError } 6612002 - Network timeout.
* @throws { BusinessError } 6612003 - Invalid "Content-Type" HTTP header.
* @throws { BusinessError } 6612004 - The HTTP server returns an unexpected HTTP response status code.
* @throws { BusinessError } 6612005 - The file does not exist.
* @throws { BusinessError } 6612006 - No permission is granted to perform the IO operation.
* @throws { BusinessError } 6612007 - Access to cleartext HTTP traffic is not allowed by the app's network security configuration.
* @throws { BusinessError } 6612008 - Reading data out of the data bound.
* @throws { BusinessError } 6612100 - The media does not contain any contents that can be played.
* @throws { BusinessError } 6612101 - The media cannot be read, for example, because of dust or scratches.
* @throws { BusinessError } 6612102 - This resource is already in use.
* @throws { BusinessError } 6612103 - The content using the validity interval has expired.
* @throws { BusinessError } 6612104 - Using the requested content to play is not allowed.
* @throws { BusinessError } 6612105 - The use of the allowed content cannot be verified.
* @throws { BusinessError } 6612106 - The number of times this content has been used as requested has reached the maximum allowed number of uses.
* @throws { BusinessError } 6612107 - An error occurs when sending packet from source device to sink device.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
on(type: 'castControlIoError', callback: ErrorCallback): void;
/**
* Unregister listeners for cast control input/output error events.
* @param { 'castControlIoError' } type Type of the 'castControlIoError' to listen for.
* @param { ErrorCallback } callback Callback used to listen for the cast control error event.
* @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
off(type: 'castControlIoError', callback?: ErrorCallback): void;
/**
* Register listeners for cast control parsing error events.
* @param { 'castControlParsingError' } type Type of the 'castControlParsingError' to listen for.
* @param { ErrorCallback } callback Callback used to listen for the cast control error event.
* @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types.
* @throws { BusinessError } 6613000 - Unspecified error related to content parsing.
* @throws { BusinessError } 6613001 - Parsing error associated with media container format bit streams.
* @throws { BusinessError } 6613002 - Parsing error associated with the media manifest.
* @throws { BusinessError } 6613003 - An error occurs when attempting to extract a file with an unsupported media container format
* or an unsupported media container feature.
* @throws { BusinessError } 6613004 - Unsupported feature in the media manifest.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
on(type: 'castControlParsingError', callback: ErrorCallback): void;
/**
* Unregister listeners for cast control parsing error events.
* @param { 'castControlParsingError' } type Type of the 'castControlParsingError' to listen for.
* @param { ErrorCallback } callback Callback used to listen for the cast control error event.
* @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
off(type: 'castControlParsingError', callback?: ErrorCallback): void;
/**
* Register listeners for cast control decoding error events.
* @param { 'castControlDecodingError' } type Type of the 'castControlDecodingError' to listen for.
* @param { ErrorCallback } callback Callback used to listen for the cast control error event.
* @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types.
* @throws { BusinessError } 6614000 - Unspecified decoding error.
* @throws { BusinessError } 6614001 - Decoder initialization failed.
* @throws { BusinessError } 6614002 - Decoder query failed.
* @throws { BusinessError } 6614003 - Decoding the media samples failed.
* @throws { BusinessError } 6614004 - The format of the content to decode exceeds the capabilities of the device.
* @throws { BusinessError } 6614005 - The format of the content to decode is not supported.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
on(type: 'castControlDecodingError', callback: ErrorCallback): void;
/**
* Unregister listeners for cast control decoding error events.
* @param { 'castControlDecodingError' } type Type of the 'castControlDecodingError' to listen for.
* @param { ErrorCallback } callback Callback used to listen for the cast control error event.
* @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
off(type: 'castControlDecodingError', callback?: ErrorCallback): void;
/**
* Register listeners for cast control audio renderer error error events.
* @param { 'castControlAudioRendererError' } type Type of the 'castControlAudioRendererError' to listen for.
* @param { ErrorCallback } callback Callback used to listen for the cast control error event.
* @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types.
* @throws { BusinessError } 6615000 - Unspecified errors related to the audio renderer.
* @throws { BusinessError } 6615001 - Initializing the audio renderer failed.
* @throws { BusinessError } 6615002 - The audio renderer fails to write data.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
on(type: 'castControlAudioRendererError', callback: ErrorCallback): void;
/**
* Unregister listeners for cast control audio renderer error events.
* @param { 'castControlAudioRendererError' } type Type of the 'castControlAudioRendererError' to listen for.
* @param { ErrorCallback } callback Callback used to listen for the cast control error event.
* @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
off(type: 'castControlAudioRendererError', callback?: ErrorCallback): void;
/**
* Register listeners for cast control drm error events.
* @param { 'castControlDrmError' } type Type of the 'castControlDrmError' to listen for.
* @param { ErrorCallback } callback Callback used to listen for the cast control error event.
* @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types.
* @throws { BusinessError } 6616000 - Unspecified error related to DRM.
* @throws { BusinessError } 6616001 - The chosen DRM protection scheme is not supported by the device.
* @throws { BusinessError } 6616002 - Device provisioning failed.
* @throws { BusinessError } 6616003 - The DRM-protected content to play is incompatible.
* @throws { BusinessError } 6616004 - Failed to obtain a license.
* @throws { BusinessError } 6616005 - The operation is disallowed by the license policy.
* @throws { BusinessError } 6616006 - An error occurs in the DRM system.
* @throws { BusinessError } 6616007 - The device has revoked DRM privileges.
* @throws { BusinessError } 6616008 - The DRM license being loaded into the open DRM session has expired.
* @throws { BusinessError } 6616100 - An error occurs when the DRM processes the key response.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
on(type: 'castControlDrmError', callback: ErrorCallback): void;
/**
* Unregister listeners for cast control drm error events.
* @param { 'castControlDrmError' } type Type of the 'castControlDrmError' to listen for.
* @param { ErrorCallback } callback Callback used to listen for the cast control error event.
* @throws { BusinessError } 401 - Parameter check failed. 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
off(type: 'castControlDrmError', callback?: ErrorCallback): void;
/**
* Register listener for drm key request.
* @param { 'keyRequest' } type - Type of the 'keyRequest' to listen for.
* @param { KeyRequestCallback } callback - Callback used to request drm key.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
on(type: 'keyRequest', callback: KeyRequestCallback): void;
/**
* Unregister listener for drm key request.
* @param { 'keyRequest' } type - Type of the 'keyRequest' to listen for.
* @param { KeyRequestCallback } callback - Callback used to request drm key.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
off(type: 'keyRequest', callback?: KeyRequestCallback): void;
}
/**
* The callback of key request.
*
* @typedef { function } KeyRequestCallback
* @param { string } assetId - request key for current assetId
* @param { Uint8Array } requestData - media key request data sent to media key server
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
type KeyRequestCallback = (assetId: string, requestData: Uint8Array) => void;
/**
* Enumerates the cast display states.
*
* @enum { number }
* @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast
* @atomicservice
* @since 12
*/
enum CastDisplayState {
/**
* Screen off.
*
* @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast
* @atomicservice
* @since 12
*/
STATE_OFF = 1,
/**
* Screen on.
*
* @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast
* @atomicservice
* @since 12
*/
STATE_ON = 2,
}
/**
* Define the information for extended display screen.
* @typedef CastDisplayInfo
* @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast
* @atomicservice
* @since 12
*/
interface CastDisplayInfo {
/**
* Display ID.
* The application can get more display information based on the same id from display interface.
* @type { number }
* @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast
* @atomicservice
* @since 12
*/
id: number;
/**
* Display name.
* @type { string }
* @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast
* @atomicservice
* @since 12
*/
name: string;
/**
* The state of display.
* @type { CastDisplayState }
* @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast
* @atomicservice
* @since 12
*/
state: CastDisplayState;
/**
* Display width, in pixels.
* @type { number }
* @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast
* @atomicservice
* @since 12
*/
width: number;
/**
* Display height, in pixels.
* @type { number }
* @syscap SystemCapability.Multimedia.AVSession.ExtendedDisplayCast
* @atomicservice
* @since 12
*/
height: number;
}
/**
* Define the device connection state.
* @enum { number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Define the device connection state.
* @enum { number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
enum ConnectionState {
/**
* A connection state indicating the device is in the process of connecting.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* A connection state indicating the device is in the process of connecting.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
STATE_CONNECTING = 0,
/**
* A connection state indicating the device is connected.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* A connection state indicating the device is connected.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
STATE_CONNECTED = 1,
/**
* The default connection state indicating the device is disconnected.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The default connection state indicating the device is disconnected.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
STATE_DISCONNECTED = 6,
}
/**
* The pre-defined display tag by system.
* @enum { number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
enum DisplayTag {
/**
* Indicate the AUDIO VIVID property of current media resource.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
TAG_AUDIO_VIVID = 1,
}
/**
* The play list information definition.
* @interface AVQueueInfo
* @syscap SystemCapability.Multimedia.AVSession.Core
* @systemapi
* @since 11
*/
interface AVQueueInfo {
/**
* The bundle name of application which current play list belongs to.
* @type { string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @systemapi
* @since 11
*/
bundleName: string;
/**
* The name of play list
* @type { string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @systemapi
* @since 11
*/
avQueueName: string;
/**
* The id of play list
* @type { string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @systemapi
* @since 11
*/
avQueueId: string;
/**
* The artwork of play list, can be a {@link PixelMap} or a URI formatted string,
* @type { image.PixelMap | string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @systemapi
* @since 11
*/
avQueueImage: image.PixelMap | string;
/**
* The time when the user last played the playlist.
* The time format can be system, such as 1611081385000, it means 2021-01-20 02:36:25.
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @systemapi
* @since 11
*/
lastPlayedTime?: number;
}
/**
* The metadata of the current media.Used to set the properties of the current media file
* @interface AVMetadata
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The metadata of the current media.Used to set the properties of the current media file
* @interface AVMetadata
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
interface AVMetadata {
/**
* Unique ID used to represent this media.
* @type { string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Unique ID used to represent this media.
* @type { string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
assetId: string;
/**
* The title of this media, for display in media center.
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The title of this media, for display in media center.
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
title?: string;
/**
* The artist of this media
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The artist of this media
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
artist?: string;
/**
* The author of this media
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The author of this media
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
author?: string;
/**
* The name of play list which current media belongs to
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 12
*/
avQueueName?: string;
/**
* The id of play list which current media belongs to, it should be an unique identifier in the application.
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
avQueueId?: string;
/**
* The artwork of play list as a {@link PixelMap} or an uri formatted String,
* @type { ?(image.PixelMap | string) }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
avQueueImage?: image.PixelMap | string;
/**
* The album of this media
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The album of this media
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
album?: string;
/**
* The writer of this media
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The writer of this media
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
writer?: string;
/**
* The composer of this media
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
composer?: string;
/**
* The duration of this media, used to automatically calculate playback position
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The duration of this media, used to automatically calculate playback position
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
duration?: number;
/**
* The image of the media as a {@link PixelMap} or an uri formatted String,
* used to display in media center.
* @type { ?(image.PixelMap | string) }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The image of the media as a {@link PixelMap} or an uri formatted String,
* used to display in media center.
* @type { ?(image.PixelMap | string) }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
mediaImage?: image.PixelMap | string;
/**
* The publishDate of the media
* @type { ?Date }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
publishDate?: Date;
/**
* The subtitle of the media, used for display
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The subtitle of the media, used for display
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
subtitle?: string;
/**
* The discription of the media, used for display
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The discription of the media, used for display
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
description?: string;
/**
* The lyric of the media, it should be in standard lyric format
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
lyric?: string;
/**
* The previous playable media id.
* Used to tell the controller if there is a previous playable media
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The previous playable media id.
* Used to tell the controller if there is a previous playable media
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
previousAssetId?: string;
/**
* The next playable media id.
* Used to tell the controller if there is a next playable media
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The next playable media id.
* Used to tell the controller if there is a next playable media
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
nextAssetId?: string;
/**
* The protocols supported by this session, if not set, the default is {@link TYPE_CAST_PLUS_STREAM}.
* See {@link ProtocolType}
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* The protocols supported by this session, if not set, the default is {@link TYPE_CAST_PLUS_STREAM}.
* See {@link ProtocolType}
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
filter?: number;
/**
* The drm schemes supported by this session which are represented by uuid.
* @type { ?Array<string> }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 12
*/
drmSchemes?: Array<string>;
/**
* The supported skipIntervals when doing fast forward and rewind operation, the default is {@link SECONDS_15}.
* See {@link SkipIntervals}
* @type { ?SkipIntervals }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
skipIntervals?: SkipIntervals;
/**
* The display tags supported by application to be displayed on media center
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
displayTags?: number;
}
/**
* The description of the media for an item in the playlist of the session
* @interface AVMediaDescription
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The description of the media for an item in the playlist of the session
* @interface AVMediaDescription
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
interface AVMediaDescription {
/**
* Unique ID used to represent this media.
* @type { string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Unique ID used to represent this media.
* @type { string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
assetId: string;
/**
* The title of this media, for display in media center.
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The title of this media, for display in media center.
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
title?: string;
/**
* The subtitle of the media, used for display
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The subtitle of the media, used for display
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
subtitle?: string;
/**
* The description of this media
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The description of this media
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
description?: string;
/**
* The image of this media asset displayed in the media center.
* It can be a {@link PixelMap} or a URI formatted string,
* @type { ?(image.PixelMap | string) }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The image of this media asset displayed in the media center.
* It can be a {@link PixelMap} or a URI formatted string,
* @type { ?(image.PixelMap | string) }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
mediaImage?: image.PixelMap | string;
/**
* Any additional attributes that can be represented as key-value pairs
* @type { ?object }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
extras?: {[key: string]: Object};
/**
* The type of this media, such as video, audio and so on.
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The type of this media, such as video, audio and so on.
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
mediaType?: string;
/**
* The size of this media.
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The size of this media.
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
mediaSize?: number;
/**
* The album title of this media
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The album title of this media
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
albumTitle?: string;
/**
* The album cover uri of this media
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The album cover uri of this media
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
albumCoverUri?: string;
/**
* The lyric content of the media, it should be in standard lyric format
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The lyric content of the media, it should be in standard lyric format
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
lyricContent?: string;
/**
* The lyric uri of the media.
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The lyric uri of the media.
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
lyricUri?: string;
/**
* The artist of this media.
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The artist of this media.
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
artist?: string;
/**
* The uri of the media, used to locate the media in some special cases
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The uri of the media, used to locate the media in some special cases
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
mediaUri?: string;
/**
* Media file descriptor.
* @type { ?media.AVFileDescriptor }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Media file descriptor.
* @type { ?media.AVFileDescriptor }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
fdSrc?: media.AVFileDescriptor;
/**
* DataSource descriptor. The caller ensures the fileSize and callback are valid.
* @type { ?media.AVDataSrcDescriptor }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 12
*/
dataSrc?: media.AVDataSrcDescriptor;
/**
* The drm scheme supported by this resource which is represented by uuid.
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 12
*/
drmScheme?: string;
/**
* The duration of this media
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The duration of this media
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
duration?: number;
/**
* Media start position, described by milliseconds.
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Media start position, described by milliseconds.
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
startPosition?: number;
/**
* Media credits position, described by milliseconds.
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Media credits position, described by milliseconds.
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
creditsPosition?: number;
/**
* Application name.
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Application name.
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
appName?: string;
/**
* The display tags supported by application to be displayed on media center
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* The display tags supported by application to be displayed on media center
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
displayTags?: number;
}
/**
* The item in the playlist of the session
* @interface AVQueueItem
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The item in the playlist of the session
* @interface AVQueueItem
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
interface AVQueueItem {
/**
* Sequence number of the item in the playlist.
* @type { number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Sequence number of the item in the playlist.
* @type { number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
itemId: number;
/**
* The media description of the item in the playlist.
* @type { ?AVMediaDescription }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The media description of the item in the playlist.
* @type { ?AVMediaDescription }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
description?: AVMediaDescription;
}
/**
* Used to indicate the playback state of the current media.
* If the playback state of the media changes, it needs to be updated synchronously
* @interface AVPlaybackState
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Used to indicate the playback state of the current media.
* If the playback state of the media changes, it needs to be updated synchronously
* @interface AVPlaybackState
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
interface AVPlaybackState {
/**
* Current playback state. See {@link PlaybackState}
* @type { ?PlaybackState }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Current playback state. See {@link PlaybackState}
* @type { ?PlaybackState }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
state?: PlaybackState;
/**
* Current playback speed
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Current playback speed
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
speed?: number;
/**
* Current playback position of this media. See {@link PlaybackPosition}
* @type { ?PlaybackPosition }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Current playback position of this media. See {@link PlaybackPosition}
* @type { ?PlaybackPosition }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
position?: PlaybackPosition;
/**
* The current buffered time, the maximum playable position
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The current buffered time, the maximum playable position
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
bufferedTime?: number;
/**
* Current playback loop mode. See {@link LoopMode}
* @type { ?LoopMode }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Current playback loop mode. See {@link LoopMode}
* @type { ?LoopMode }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
loopMode?: LoopMode;
/**
* Current Favorite Status
* @type { ?boolean }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Current Favorite Status
* @type { ?boolean }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
isFavorite?: boolean;
/**
* Current active item id
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Current active item id
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
activeItemId?: number;
/**
* Current player volume
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Current player volume
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
volume?: number;
/**
* maximum volume
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* maximum volume
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
maxVolume?: number;
/**
* Current muted status
* @type { ?boolean }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* Current muted status
* @type { ?boolean }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
muted?: boolean;
/**
* The duration of this media asset.
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
duration?: number;
/**
* The video width of this media asset.
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* The video width of this media asset.
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
videoWidth?: number;
/**
* The video height of this media asset.
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* The video height of this media asset.
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
videoHeight?: number;
/**
* Current custom media packets
* @type { ?object }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Current custom media packets
* @type { ?object }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
extras?: {[key: string]: Object};
}
/**
* Playback position definition
* @interface PlaybackPosition
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Playback position definition
* @interface PlaybackPosition
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
interface PlaybackPosition {
/**
* Elapsed time(position) of this media set by the app.
* @type { number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Elapsed time(position) of this media set by the app.
* @type { number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
elapsedTime: number;
/**
* Record the system time when elapsedTime is set.
* @type { number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Record the system time when elapsedTime is set.
* @type { number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
updateTime: number;
}
/**
* The metadata of the current call.
* @interface CallMetadata
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* The metadata of the current call.
* @typedef CallMetadata
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
interface CallMetadata {
/**
* The displayed user name of current call.
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* The displayed user name of current call.
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
name?: string;
/**
* The phone number of current call.
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* The phone number of current call.
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
phoneNumber?: string;
/**
* The displayed picture that represents a particular user.
* @type { ?image.PixelMap }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* The displayed picture that represents a particular user.
* @type { ?image.PixelMap }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
avatar?: image.PixelMap;
}
/**
* Used to indicate the call state of the current call.
* @interface AVCallState
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* Used to indicate the call state of the current call.
* @typedef AVCallState
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
interface AVCallState {
/**
* Current call state. See {@link CallState}
* @type { CallState }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* Current call state. See {@link CallState}
* @type { CallState }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
state: CallState;
/**
* Current muted status.
* @type { boolean }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* Current muted status.
* @type { boolean }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
muted: boolean;
}
/**
* Enumeration of current call state
* @enum { number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* Enumeration of current call state
* @enum { number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
enum CallState {
/**
* Idle state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* Idle state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
CALL_STATE_IDLE = 0,
/**
* Incoming state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* Incoming state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
CALL_STATE_INCOMING = 1,
/**
* Active state in calling.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* Active state in calling.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
CALL_STATE_ACTIVE = 2,
/**
* Dialing state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* Dialing state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
CALL_STATE_DIALING = 3,
/**
* Waiting state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* Waiting state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
CALL_STATE_WAITING = 4,
/**
* Holding state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* Holding state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
CALL_STATE_HOLDING = 5,
/**
* Disconnecting state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* Disconnecting state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
CALL_STATE_DISCONNECTING = 6,
}
/**
* cast category indicating different playback scenes
* @enum { number }
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
/**
* cast category indicating different playback scenes
* @enum { number }
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
enum AVCastCategory {
/**
* The default cast type "local", media can be routed on the same device,
* including internal speakers or audio jack on the device itself, A2DP devices.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
/**
* The default cast type "local", media can be routed on the same device,
* including internal speakers or audio jack on the device itself, A2DP devices.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
CATEGORY_LOCAL = 0,
/**
* The remote category indicating the media is presenting on a remote device,
* the application needs to get an AVCastController to control remote playback.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
/**
* The remote category indicating the media is presenting on a remote device,
* the application needs to get an AVCastController to control remote playback.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
CATEGORY_REMOTE = 1,
}
/**
* Device type definition
* @enum { number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Device type definition
* @enum { number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
enum DeviceType {
/**
* A device type indicating the route is on internal speakers or audio jack on the device itself.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* A device type indicating the route is on internal speakers or audio jack on the device itself.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
DEVICE_TYPE_LOCAL = 0,
/**
* A device type indicating the route is on a TV.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
/**
* A device type indicating the route is on a TV.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
DEVICE_TYPE_TV = 2,
/**
* A device type indicating the route is on a smart speaker.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 10
*/
/**
* A device type indicating the route is on a smart speaker.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
DEVICE_TYPE_SMART_SPEAKER = 3,
/**
* A device type indicating the route is on a bluetooth device.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* A device type indicating the route is on a bluetooth device.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
DEVICE_TYPE_BLUETOOTH = 10,
}
/**
* Device Information Definition
* @interface DeviceInfo
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Device Information Definition
* @interface DeviceInfo
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
interface DeviceInfo {
/**
* The playback type supported by the device. See {@link AVCastCategory}
* @type { AVCastCategory }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The playback type supported by the device. See {@link AVCastCategory}
* @type { AVCastCategory }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
castCategory: AVCastCategory;
/**
* Audio device id.The length of the audioDeviceId array is greater than 1
* if output to multiple devices at the same time.
* @type { string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Audio device id.The length of the audioDeviceId array is greater than 1
* if output to multiple devices at the same time.
* @type { string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
deviceId: string;
/**
* Device name. The length of the deviceName array is greater than 1
* if output to multiple devices at the same time.
* @type { string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Device name. The length of the deviceName array is greater than 1
* if output to multiple devices at the same time.
* @type { string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
deviceName: string;
/**
* device type.
* @type { DeviceType }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* device type.
* @type { DeviceType }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
deviceType: DeviceType;
/**
* Device manufacturer.
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
manufacturer?: string;
/**
* Device model name.
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
modelName?: string;
/**
* Network id.
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 13
*/
networkId?: string;
/**
* device ip address if available.
* @type { ?string }
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 10
*/
ipAddress?: string;
/**
* device provider which supplies the route capability.
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 10
*/
providerId?: number;
/**
* The protocols supported by current device, can be union of {@link ProtocolType}.
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @since 11
*/
/**
* The protocols supported by current device, can be union of {@link ProtocolType}.
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
supportedProtocols?: number;
/**
* The drm capability supported by current device, each drm is represented by uuid.
* @type { ?Array<string> }
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 12
*/
supportedDrmCapabilities?: Array<string>;
/**
* Define different authentication status.
* 0: Device not authenticated.
* 1: Device already authenticated.
* @type { ?number }
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @systemapi
* @since 11
*/
authenticationStatus?: number;
}
/**
* Target Device Information Definition
* @interface OutputDeviceInfo
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Target Device Information Definition
* @interface OutputDeviceInfo
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
interface OutputDeviceInfo {
/**
* Arrays of device information
* @type { Array<DeviceInfo> }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Arrays of device information
* @type { Array<DeviceInfo> }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
devices: Array<DeviceInfo>;
}
/**
* Loop Play Mode Definition
* @enum { number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Loop Play Mode Definition
* @enum { number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
enum LoopMode {
/**
* The default mode is sequential playback
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The default mode is sequential playback
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
LOOP_MODE_SEQUENCE = 0,
/**
* Single loop mode
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Single loop mode
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
LOOP_MODE_SINGLE = 1,
/**
* List loop mode
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* List loop mode
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
LOOP_MODE_LIST = 2,
/**
* Shuffle playback mode
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Shuffle playback mode
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
LOOP_MODE_SHUFFLE = 3,
/**
* Custom playback mode supported by application
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* Custom playback mode supported by application
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
LOOP_MODE_CUSTOM = 4,
}
/**
* Supported skip intervals definition
* @enum { number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
enum SkipIntervals {
/**
* 10 seconds
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
SECONDS_10 = 10,
/**
* 15 seconds
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
SECONDS_15 = 15,
/**
* 30 seconds
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
SECONDS_30 = 30,
}
/**
* Definition of current playback state
* @enum { number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Definition of current playback state
* @enum { number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
enum PlaybackState {
/**
* Initial state. The initial state of media file
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Initial state. The initial state of media file
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
PLAYBACK_STATE_INITIAL = 0,
/**
* Preparing state. Indicates that the media file is not ready to play,
* the media is loading or buffering
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Preparing state. Indicates that the media file is not ready to play,
* the media is loading or buffering
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
PLAYBACK_STATE_PREPARE = 1,
/**
* Playing state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Playing state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
PLAYBACK_STATE_PLAY = 2,
/**
* Paused state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Paused state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
PLAYBACK_STATE_PAUSE = 3,
/**
* Fast forwarding state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Fast forwarding state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
PLAYBACK_STATE_FAST_FORWARD = 4,
/**
* Rewinding state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Rewinding state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
PLAYBACK_STATE_REWIND = 5,
/**
* Stopped state.The server will clear the media playback position and other information.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Stopped state.The server will clear the media playback position and other information.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
PLAYBACK_STATE_STOP = 6,
/**
* Completed state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Completed state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
PLAYBACK_STATE_COMPLETED = 7,
/**
* Released state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Released state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
PLAYBACK_STATE_RELEASED = 8,
/**
* error state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* error state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
PLAYBACK_STATE_ERROR = 9,
/**
* Idle state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* Idle state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
PLAYBACK_STATE_IDLE = 10,
/**
* Buffering state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* Buffering state.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
PLAYBACK_STATE_BUFFERING = 11,
}
/**
* The description of the session
* @interface AVSessionDescriptor
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi
* @since 9
*/
interface AVSessionDescriptor {
/**
* Unique ID of the session
* @type { string }
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi
* @since 9
*/
sessionId: string;
/**
* Session type, currently supports audio or video
* @type { AVSessionType }
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi
* @since 9
*/
type: AVSessionType;
/**
* The session tag set by the application
* @type { string }
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi
* @since 9
*/
sessionTag: string;
/**
* The elementName of the ability that created this session. See {@link ElementName} in bundle/elementName.d.ts
* @type { ElementName }
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi
* @since 9
*/
elementName: ElementName;
/**
* Session active state
* @type { boolean }
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi
* @since 9
*/
isActive: boolean;
/**
* Is it the top priority session
* @type { boolean }
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi
* @since 9
*/
isTopSession: boolean;
/**
* The current output device information.
* It will be undefined if this is a local session.
* @type { OutputDeviceInfo }
* @syscap SystemCapability.Multimedia.AVSession.Manager
* @systemapi
* @since 9
*/
outputDevice: OutputDeviceInfo;
}
/**
* Session controller,used to control media playback and get media information
* @interface AVSessionController
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Session controller,used to control media playback and get media information
* @typedef AVSessionController
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
interface AVSessionController {
/**
* Unique session Id
* @type { string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Unique session Id
* @type { string }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
readonly sessionId: string;
/**
* Get the playback status of the current session
* @param { AsyncCallback<AVPlaybackState> } callback - The triggered asyncCallback when (getAVPlaybackState).
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
getAVPlaybackState(callback: AsyncCallback<AVPlaybackState>): void;
/**
* Get the playback status of the current session
* @returns { Promise<AVPlaybackState> } (AVPlaybackState) returned through promise
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Get the playback status of the current session
* @returns { Promise<AVPlaybackState> } (AVPlaybackState) returned through promise
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
getAVPlaybackState(): Promise<AVPlaybackState>;
/**
* Get the playback status of the current session
* @returns { AVPlaybackState } (AVPlaybackState) returned
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Get the playback status of the current session
* @returns { AVPlaybackState } (AVPlaybackState) returned
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
getAVPlaybackStateSync(): AVPlaybackState;
/**
* Get the metadata of the current session
* @param { AsyncCallback<AVMetadata> } callback - The triggered asyncCallback when (getAVMetadata).
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
getAVMetadata(callback: AsyncCallback<AVMetadata>): void;
/**
* Get the metadata of the current session
* @returns { Promise<AVMetadata> } (AVMetadata) returned through promise
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Get the metadata of the current session
* @returns { Promise<AVMetadata> } (AVMetadata) returned through promise
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
getAVMetadata(): Promise<AVMetadata>;
/**
* Get the metadata of the current session
* @returns { AVMetadata } (AVMetadata) returned
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Get the metadata of the current session
* @returns { AVMetadata } (AVMetadata) returned
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
getAVMetadataSync(): AVMetadata;
/**
* Get the call status of the current session
* @param { AsyncCallback<AVCallState> } callback - The triggered asyncCallback when (getAVCallState).
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
getAVCallState(callback: AsyncCallback<AVCallState>): void;
/**
* Get the call status of the current session
* @returns { Promise<AVCallState> } (AVCallState) returned through promise
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
getAVCallState(): Promise<AVCallState>;
/**
* Get the call metadata of the current session
* @param { AsyncCallback<CallMetadata> } callback - The triggered asyncCallback when (getCallMetadata).
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
getCallMetadata(callback: AsyncCallback<CallMetadata>): void;
/**
* Get the call metadata of the current session
* @returns { Promise<CallMetadata> } (CallMetadata) returned through promise
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
getCallMetadata(): Promise<CallMetadata>;
/**
* Get the name of the playlist of the current session
* @param { AsyncCallback<string> } callback - The triggered asyncCallback when (getAVQueueTitle).
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
getAVQueueTitle(callback: AsyncCallback<string>): void;
/**
* Get the name of the playlist of the current session
* @returns { Promise<string> } (string) returned through promise
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Get the name of the playlist of the current session
* @returns { Promise<string> } (string) returned through promise
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
getAVQueueTitle(): Promise<string>;
/**
* Get the name of the playlist of the current session
* @returns { string } (string) returned
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Get the name of the playlist of the current session
* @returns { string } (string) returned
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
getAVQueueTitleSync(): string;
/**
* Get the playlist of the current session
* @param { AsyncCallback<Array<AVQueueItem>> } callback - The triggered asyncCallback when (getAVQueueItems).
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
getAVQueueItems(callback: AsyncCallback<Array<AVQueueItem>>): void;
/**
* Get the playlist of the current session
* @returns { Promise<Array<AVQueueItem>> } (Array<AVQueueItem>) returned through promise
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Get the playlist of the current session
* @returns { Promise<Array<AVQueueItem>> } (Array<AVQueueItem>) returned through promise
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
getAVQueueItems(): Promise<Array<AVQueueItem>>;
/**
* Get the playlist of the current session
* @returns { Array<AVQueueItem> } (Array<AVQueueItem>) returned
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Get the playlist of the current session
* @returns { Array<AVQueueItem> } (Array<AVQueueItem>) returned
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
getAVQueueItemsSync(): Array<AVQueueItem>;
/**
* Set the item in the playlist to be played
* @param { number } itemId - The serial number of the item to be played
* @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
skipToQueueItem(itemId: number, callback: AsyncCallback<void>): void;
/**
* Set the item in the playlist to be played
* @param { number } itemId - The serial number of the item to be played
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Set the item in the playlist to be played
* @param { number } itemId - The serial number of the item to be played
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
skipToQueueItem(itemId: number): Promise<void>;
/**
* Get output device information
* @param { AsyncCallback<OutputDeviceInfo> } callback - The triggered asyncCallback when (getOutputDevice).
* @throws { BusinessError } 600101 - Session service exception.
* @throws { BusinessError } 600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
getOutputDevice(callback: AsyncCallback<OutputDeviceInfo>): void;
/**
* Get output device information
* @returns { Promise<OutputDeviceInfo> } (OutputDeviceInfo) returned through promise
* @throws { BusinessError } 600101 - Session service exception.
* @throws { BusinessError } 600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Get output device information
* @returns { Promise<OutputDeviceInfo> } (OutputDeviceInfo) returned through promise
* @throws { BusinessError } 600101 - Session service exception.
* @throws { BusinessError } 600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
getOutputDevice(): Promise<OutputDeviceInfo>;
/**
* Get output device information
* @returns { OutputDeviceInfo } (OutputDeviceInfo) returned
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Get output device information
* @returns { OutputDeviceInfo } (OutputDeviceInfo) returned
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
getOutputDeviceSync(): OutputDeviceInfo;
/**
* Send media key event to this session
* @param { KeyEvent } event - The KeyEvent
* @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 600101 - Session service exception.
* @throws { BusinessError } 600102 - The session does not exist.
* @throws { BusinessError } 600103 - The session controller does not exist.
* @throws { BusinessError } 600105 - Invalid session command.
* @throws { BusinessError } 600106 - The session is not activated.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
sendAVKeyEvent(event: KeyEvent, callback: AsyncCallback<void>): void;
/**
* Send media key event to this session
* @param { KeyEvent } event - The KeyEvent
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 600101 - Session service exception.
* @throws { BusinessError } 600102 - The session does not exist.
* @throws { BusinessError } 600103 - The session controller does not exist.
* @throws { BusinessError } 600105 - Invalid session command.
* @throws { BusinessError } 600106 - The session is not activated.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Send media key event to this session
* @param { KeyEvent } event - The KeyEvent
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 600101 - Session service exception.
* @throws { BusinessError } 600102 - The session does not exist.
* @throws { BusinessError } 600103 - The session controller does not exist.
* @throws { BusinessError } 600105 - Invalid session command.
* @throws { BusinessError } 600106 - The session is not activated.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
sendAVKeyEvent(event: KeyEvent): Promise<void>;
/**
* Get the {@link WantAgent} of this session that can launch the session ability
* @param { AsyncCallback<WantAgent> } callback - The asyncCallback triggered when getting the WantAgent.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
getLaunchAbility(callback: AsyncCallback<WantAgent>): void;
/**
* Get the {@link WantAgent} of this session that can launch the session ability
* @returns { Promise<WantAgent> } WantAgent promise
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Get the {@link WantAgent} of this session that can launch the session ability
* @returns { Promise<WantAgent> } WantAgent promise
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
getLaunchAbility(): Promise<WantAgent>;
/**
* Get the adjusted playback position. The time automatically calculated by the system
* taking into account factors such as playback status, playback speed, and application update time.
* @returns { number } current playback position in ms.Note that the returns value of each call will be different.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Get the adjusted playback position. The time automatically calculated by the system
* taking into account factors such as playback status, playback speed, and application update time.
* @returns { number } current playback position in ms.Note that the returns value of each call will be different.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
getRealPlaybackPositionSync(): number;
/**
* Check if the current session is active
* @param { AsyncCallback<boolean> } callback - The triggered asyncCallback when (isActive).
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
isActive(callback: AsyncCallback<boolean>): void;
/**
* Check if the current session is active
* @returns { Promise<boolean> } boolean promise
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Check if the current session is active
* @returns { Promise<boolean> } boolean promise
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
isActive(): Promise<boolean>;
/**
* Check if the current session is active
* @returns { boolean } boolean
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Check if the current session is active
* @returns { boolean } boolean
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
isActiveSync(): boolean;
/**
* Destroy the server controller
* @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
destroy(callback: AsyncCallback<void>): void;
/**
* Destroy the server controller
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Destroy the server controller
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
destroy(): Promise<void>;
/**
* Get commands supported by the current session
* @param { AsyncCallback<Array<AVControlCommandType>> } callback - The triggered asyncCallback when (getValidCommands).
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
getValidCommands(callback: AsyncCallback<Array<AVControlCommandType>>): void;
/**
* Get commands supported by the current session
* @returns { Promise<Array<AVControlCommandType>> } array of AVControlCommandType promise
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Get commands supported by the current session
* @returns { Promise<Array<AVControlCommandType>> } array of AVControlCommandType promise
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
getValidCommands(): Promise<Array<AVControlCommandType>>;
/**
* Get commands supported by the current session
* @returns {Array<AVControlCommandType> } array of AVControlCommandType
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Get commands supported by the current session
* @returns {Array<AVControlCommandType> } array of AVControlCommandType
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
getValidCommandsSync(): Array<AVControlCommandType>;
/**
* Send control commands to this session
* @param { AVControlCommand } command - The command to be sent. See {@link AVControlCommand}
* @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @throws { BusinessError } 6600105 - Invalid session command.
* @throws { BusinessError } 6600106 - The session is not activated.
* @throws { BusinessError } 6600107 - Too many commands or events.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
sendControlCommand(command: AVControlCommand, callback: AsyncCallback<void>): void;
/**
* Send control commands to this session
* @param { AVControlCommand } command - The command to be sent. See {@link AVControlCommand}
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @throws { BusinessError } 6600105 - Invalid session command.
* @throws { BusinessError } 6600106 - The session is not activated.
* @throws { BusinessError } 6600107 - Too many commands or events.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Send control commands to this session
* @param { AVControlCommand } command - The command to be sent. See {@link AVControlCommand}
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @throws { BusinessError } 6600105 - Invalid session command.
* @throws { BusinessError } 6600106 - The session is not activated.
* @throws { BusinessError } 6600107 - Too many commands or events.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
sendControlCommand(command: AVControlCommand): Promise<void>;
/**
* Send common commands to this session
* @param { string } command - The command name to be sent.
* @param { object } args - The parameters of session event
* @param { AsyncCallback<void> } callback - The asyncCallback triggered when the command is executed successfully.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @throws { BusinessError } 6600105 - Invalid session command.
* @throws { BusinessError } 6600106 - The session is not activated.
* @throws { BusinessError } 6600107 - Too many commands or events.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
sendCommonCommand(command: string, args: {[key: string]: Object}, callback: AsyncCallback<void>): void;
/**
* Send common commands to this session
* @param { string } command - The command name to be sent.
* @param { object } args - The parameters of session event
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @throws { BusinessError } 6600105 - Invalid session command.
* @throws { BusinessError } 6600106 - The session is not activated.
* @throws { BusinessError } 6600107 - Too many commands or events.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Send common commands to this session
* @param { string } command - The command name to be sent.
* @param { object } args - The parameters of session event
* @returns { Promise<void> } void promise when executed successfully
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @throws { BusinessError } 6600105 - Invalid session command.
* @throws { BusinessError } 6600106 - The session is not activated.
* @throws { BusinessError } 6600107 - Too many commands or events.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
sendCommonCommand(command: string, args: {[key: string]: Object}): Promise<void>;
/**
* Get custom media packets provided by the corresponding session
* @param { AsyncCallback<{[key: string]: Object}> } callback - The triggered asyncCallback when (getExtras).
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types. 3.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @throws { BusinessError } 6600105 - Invalid session command.
* @throws { BusinessError } 6600107 - Too many commands or events.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
getExtras(callback: AsyncCallback<{[key: string]: Object}>): void;
/**
* Get custom media packets provided by the corresponding session
* @returns { Promise<{[key: string]: Object}> } the parameters of extras
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types. 3.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @throws { BusinessError } 6600105 - Invalid session command.
* @throws { BusinessError } 6600107 - Too many commands or events.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Get custom media packets provided by the corresponding session
* @returns { Promise<{[key: string]: Object}> } the parameters of extras
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types. 3.Parameter verification failed.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600102 - The session does not exist.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @throws { BusinessError } 6600105 - Invalid session command.
* @throws { BusinessError } 6600107 - Too many commands or events.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
getExtras(): Promise<{[key: string]: Object}>;
/**
* Register metadata changed callback
* @param { 'metadataChange' } type
* @param { Array<keyof AVMetadata> | 'all' } filter - The properties of {@link AVMetadata} that you cared about
* @param { function } callback - The callback used to handle metadata changed event.
* The callback function provides the {@link AVMetadata} parameter.
* It only contains the properties set in the filter.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Register metadata changed callback
* @param { 'metadataChange' } type
* @param { Array<keyof AVMetadata> | 'all' } filter - The properties of {@link AVMetadata} that you cared about
* @param { function } callback - The callback used to handle metadata changed event.
* The callback function provides the {@link AVMetadata} parameter.
* It only contains the properties set in the filter.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'metadataChange', filter: Array<keyof AVMetadata> | 'all', callback: (data: AVMetadata) => void);
/**
* Unregister metadata changed callback
* @param { 'metadataChange' } type
* @param { function } callback - The callback used to handle metadata changed event.
* The callback function provides the {@link AVMetadata} parameter.
* It only contains the properties set in the filter.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Unregister metadata changed callback
* @param { 'metadataChange' } type
* @param { function } callback - The callback used to handle metadata changed event.
* The callback function provides the {@link AVMetadata} parameter.
* It only contains the properties set in the filter.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'metadataChange', callback?: (data: AVMetadata) => void);
/**
* Register playback state changed callback
* @param { 'playbackStateChange' } type
* @param { Array<keyof AVPlaybackState> | 'all' } filter - The properties of {@link AVPlaybackState} that you cared about
* @param { function } callback - The callback used to handle playback state changed event.
* The callback function provides the {@link AVPlaybackState} parameter.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Register playback state changed callback
* @param { 'playbackStateChange' } type
* @param { Array<keyof AVPlaybackState> | 'all' } filter - The properties of {@link AVPlaybackState} that you cared about
* @param { function } callback - The callback used to handle playback state changed event.
* The callback function provides the {@link AVPlaybackState} parameter.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'playbackStateChange', filter: Array<keyof AVPlaybackState> | 'all', callback: (state: AVPlaybackState) => void);
/**
* Unregister playback state changed callback
* @param { 'playbackStateChange' } type
* @param { function } callback - The callback used to handle playback state changed event.
* The callback function provides the {@link AVPlaybackState} parameter.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Unregister playback state changed callback
* @param { 'playbackStateChange' } type
* @param { function } callback - The callback used to handle playback state changed event.
* The callback function provides the {@link AVPlaybackState} parameter.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'playbackStateChange', callback?: (state: AVPlaybackState) => void);
/**
* Register call metadata changed callback
* @param { 'callMetadataChange' } type - 'callMetadataChange'
* @param { Array<keyof CallMetadata> | 'all' } filter - The properties of {@link CallMetadata} that you cared about
* @param { Callback<CallMetadata> } callback - The callback used to handle call metadata changed event.
* The callback function provides the {@link CallMetadata} parameter.
* It only contains the properties set in the filter.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* Register call metadata changed callback
* @param { 'callMetadataChange' } type - 'callMetadataChange'
* @param { Array<keyof CallMetadata> | 'all' } filter - The properties of {@link CallMetadata} that you cared about
* @param { Callback<CallMetadata> } callback - The callback used to handle call metadata changed event.
* The callback function provides the {@link CallMetadata} parameter.
* It only contains the properties set in the filter.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'callMetadataChange', filter: Array<keyof CallMetadata> | 'all', callback: Callback<CallMetadata>): void;
/**
* Unregister call metadata changed callback
* @param { 'callMetadataChange' } type - 'callMetadataChange'
* @param { Callback<CallMetadata> } callback - The callback used to handle call metadata changed event.
* The callback function provides the {@link CallMetadata} parameter.
* It only contains the properties set in the filter.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* Unregister call metadata changed callback
* @param { 'callMetadataChange' } type - 'callMetadataChange'
* @param { Callback<CallMetadata> } callback - The callback used to handle call metadata changed event.
* The callback function provides the {@link CallMetadata} parameter.
* It only contains the properties set in the filter.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'callMetadataChange', callback?: Callback<CallMetadata>): void;
/**
* Register call state changed callback
* @param { 'callStateChange' } type - 'callStateChange'
* @param { Array<keyof AVCallState> | 'all' } filter - The properties of {@link AVCallState} that you cared about
* @param { Callback<AVCallState> } callback - The callback used to handle call state changed event.
* The callback function provides the {@link AVCallState} parameter.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* Register call state changed callback
* @param { 'callStateChange' } type - 'callStateChange'
* @param { Array<keyof AVCallState> | 'all' } filter - The properties of {@link AVCallState} that you cared about
* @param { Callback<AVCallState> } callback - The callback used to handle call state changed event.
* The callback function provides the {@link AVCallState} parameter.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'callStateChange', filter: Array<keyof AVCallState> | 'all', callback: Callback<AVCallState>): void;
/**
* Unregister playback state changed callback
* @param { 'callStateChange' } type - 'callStateChange'
* @param { Callback<AVCallState> } callback - The callback used to handle call state changed event.
* The callback function provides the {@link AVCallState} parameter.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* Unregister playback state changed callback
* @param { 'callStateChange' } type - 'callStateChange'
* @param { Callback<AVCallState> } callback - The callback used to handle call state changed event.
* The callback function provides the {@link AVCallState} parameter.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'callStateChange', callback?: Callback<AVCallState>): void;
/**
* Register current session destroyed callback
* @param { 'sessionDestroy' } type
* @param { function } callback - The callback used to handle current session destroyed event.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Register current session destroyed callback
* @param { 'sessionDestroy' } type
* @param { function } callback - The callback used to handle current session destroyed event.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'sessionDestroy', callback: () => void);
/**
* Unregister current session destroyed callback
* @param { 'sessionDestroy' } type - 'sessionDestroy'
* @param { function } callback - The callback used to handle current session destroyed event.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Unregister current session destroyed callback
* @param { 'sessionDestroy' } type - 'sessionDestroy'
* @param { function } callback - The callback used to handle current session destroyed event.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'sessionDestroy', callback?: () => void);
/**
* Register the active state of this session changed callback
* @param { 'activeStateChange' } type - 'activeStateChange'
* @param { function } callback - The callback used to handle the active state of this session changed event.
* The callback function provides the changed session state.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Register the active state of this session changed callback
* @param { 'activeStateChange' } type - 'activeStateChange'
* @param { function } callback - The callback used to handle the active state of this session changed event.
* The callback function provides the changed session state.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'activeStateChange', callback: (isActive: boolean) => void);
/**
* Unregister the active state of this session changed callback
* @param { 'activeStateChange' } type - 'activeStateChange'
* @param { function } callback - The callback used to handle the active state of this session changed event.
* The callback function provides the changed session state.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Unregister the active state of this session changed callback
* @param { 'activeStateChange' } type - 'activeStateChange'
* @param { function } callback - The callback used to handle the active state of this session changed event.
* The callback function provides the changed session state.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'activeStateChange', callback?: (isActive: boolean) => void);
/**
* Register the valid commands of the session changed callback
* @param { 'validCommandChange' } type - 'validCommandChange'
* @param { function } callback - The callback used to handle the changes.
* The callback function provides an array of AVControlCommandType.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Register the valid commands of the session changed callback
* @param { 'validCommandChange' } type - 'validCommandChange'
* @param { function } callback - The callback used to handle the changes.
* The callback function provides an array of AVControlCommandType.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'validCommandChange', callback: (commands: Array<AVControlCommandType>) => void);
/**
* Unregister the valid commands of the session changed callback
* @param { 'validCommandChange' } type - 'validCommandChange'
* @param { function } callback - The callback used to handle the changes.
* The callback function provides an array of AVControlCommandType.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Unregister the valid commands of the session changed callback
* @param { 'validCommandChange' } type - 'validCommandChange'
* @param { function } callback - The callback used to handle the changes.
* The callback function provides an array of AVControlCommandType.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'validCommandChange', callback?: (commands: Array<AVControlCommandType>) => void);
/**
* Register session output device change callback
* @param { 'outputDeviceChange' } type - Registration Type 'outputDeviceChange'
* @param { function } callback - Used to handle output device changed.
* The callback provide the new device info {@link OutputDeviceInfo} and related connection state {@link ConnectionState}.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @throws { BusinessError } 6600103 - The session controller does not exist
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Register session output device change callback
* @param { 'outputDeviceChange' } type - Registration Type 'outputDeviceChange'
* @param { function } callback - Used to handle output device changed.
* The callback provide the new device info {@link OutputDeviceInfo} and related connection state {@link ConnectionState}.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @throws { BusinessError } 6600103 - The session controller does not exist
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'outputDeviceChange', callback: (state: ConnectionState, device: OutputDeviceInfo) => void): void;
/**
* Unregister session output device change callback
* @param { 'outputDeviceChange' } type - Registration Type 'outputDeviceChange'
* @param { function } callback - Used to handle output device changed.
* The callback provide the new device info {@link OutputDeviceInfo} and related connection state {@link ConnectionState}.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @throws { BusinessError } 6600103 - The session controller does not exist
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Unregister session output device change callback
* @param { 'outputDeviceChange' } type - Registration Type 'outputDeviceChange'
* @param { function } callback - Used to handle output device changed.
* The callback provide the new device info {@link OutputDeviceInfo} and related connection state {@link ConnectionState}.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception
* @throws { BusinessError } 6600103 - The session controller does not exist
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'outputDeviceChange', callback?: (state: ConnectionState, device: OutputDeviceInfo) => void): void;
/**
* Register session event callback
* @param { 'sessionEvent' } type - 'sessionEvent'
* @param { function } callback - The callback used to handle session event changed event.
* The callback function provides the event string and key-value pair parameters.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Register session event callback
* @param { 'sessionEvent' } type - 'sessionEvent'
* @param { function } callback - The callback used to handle session event changed event.
* The callback function provides the event string and key-value pair parameters.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'sessionEvent', callback: (sessionEvent: string, args: {[key: string]: Object}) => void): void;
/**
* Unregister session event callback
* @param { 'sessionEvent' } type - 'sessionEvent'
* @param { function } callback - Used to cancel a specific listener
* The callback function provides the event string and key-value pair parameters.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Unregister session event callback
* @param { 'sessionEvent' } type - 'sessionEvent'
* @param { function } callback - Used to cancel a specific listener
* The callback function provides the event string and key-value pair parameters.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'sessionEvent', callback?: (sessionEvent: string, args: {[key: string]: Object}) => void): void;
/**
* Register session playlist change callback
* @param { 'queueItemsChange' } type - Registration Type 'queueItemsChange'
* @param { function } callback - Used to handle playlist changed.
* The callback provides the new array of AVQueueItem {@link AVQueueItem}
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Register session playlist change callback
* @param { 'queueItemsChange' } type - Registration Type 'queueItemsChange'
* @param { function } callback - Used to handle playlist changed.
* The callback provides the new array of AVQueueItem {@link AVQueueItem}
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'queueItemsChange', callback: (items: Array<AVQueueItem>) => void): void;
/**
* Unregister session playlist change callback
* @param { 'queueItemsChange' } type - Registration Type 'queueItemsChange'
* @param { function } callback - Used to handle playlist changed.
* The callback provides the new array of AVQueueItem {@link AVQueueItem}
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Unregister session playlist change callback
* @param { 'queueItemsChange' } type - Registration Type 'queueItemsChange'
* @param { function } callback - Used to handle playlist changed.
* The callback provides the new array of AVQueueItem {@link AVQueueItem}
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'queueItemsChange', callback?: (items: Array<AVQueueItem>) => void): void;
/**
* Register the name of session playlist change callback
* @param { 'queueTitleChange' } type - Registration Type 'queueTitleChange'
* @param { function } callback - Used to handle name of playlist changed.
* The callback provides the new name.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Register the name of session playlist change callback
* @param { 'queueTitleChange' } type - Registration Type 'queueTitleChange'
* @param { function } callback - Used to handle name of playlist changed.
* The callback provides the new name.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'queueTitleChange', callback: (title: string) => void): void;
/**
* Unregister the name of session playlist change callback
* @param { 'queueTitleChange' } type - Registration Type 'queueTitleChange'
* @param { function } callback - Used to handle name of playlist changed.
* The callback provides the new name.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Unregister the name of session playlist change callback
* @param { 'queueTitleChange' } type - Registration Type 'queueTitleChange'
* @param { function } callback - Used to handle name of playlist changed.
* The callback provides the new name.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'queueTitleChange', callback?: (title: string) => void): void;
/**
* Register the custom media packets change callback
* @param { 'extrasChange' } type - Registration Type 'extrasChange'
* @param { function } callback - Used to handle custom media packets changed.
* The callback provides the new media packets.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Register the custom media packets change callback
* @param { 'extrasChange' } type - Registration Type 'extrasChange'
* @param { function } callback - Used to handle custom media packets changed.
* The callback provides the new media packets.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
on(type: 'extrasChange', callback: (extras: {[key: string]: Object}) => void): void;
/**
* Unregister the custom media packets change callback
* @param { 'extrasChange' } type - Registration Type 'extrasChange'
* @param { function } callback - Used to handle custom media packets changed.
* The callback provides the new media packets.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Unregister the custom media packets change callback
* @param { 'extrasChange' } type - Registration Type 'extrasChange'
* @param { function } callback - Used to handle custom media packets changed.
* The callback provides the new media packets.
* @throws { BusinessError } 401 - parameter check failed. 1.Mandatory parameters are left unspecified.
* 2.Incorrect parameter types.
* @throws { BusinessError } 6600101 - Session service exception.
* @throws { BusinessError } 6600103 - The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
off(type: 'extrasChange', callback?: (extras: {[key: string]: Object}) => void): void;
}
/**
* The type of control command
* @typedef { 'play' | 'pause' | 'stop' | 'playNext' | 'playPrevious' | 'fastForward' | 'rewind' | 'seek' |
* 'setSpeed' | 'setLoopMode' | 'toggleFavorite' } AVControlCommandType
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The type of control command, add new support 'playFromAssetId' | 'answer' | 'hangUp' | 'toggleCallMute'
* @typedef { 'play' | 'pause' | 'stop' | 'playNext' | 'playPrevious' | 'fastForward' | 'rewind' | 'seek' |
* 'setSpeed' | 'setLoopMode' | 'toggleFavorite' | 'playFromAssetId' | 'answer' | 'hangUp' |
* 'toggleCallMute' } AVControlCommandType
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 11
*/
/**
* The type of control command, add new support 'playFromAssetId' | 'answer' | 'hangUp' | 'toggleCallMute'
* @typedef { 'play' | 'pause' | 'stop' | 'playNext' | 'playPrevious' | 'fastForward' | 'rewind' | 'seek' |
* 'setSpeed' | 'setLoopMode' | 'toggleFavorite' | 'playFromAssetId' | 'answer' | 'hangUp' |
* 'toggleCallMute' } AVControlCommandType
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
type AVControlCommandType = 'play' | 'pause' | 'stop' | 'playNext' | 'playPrevious' | 'fastForward' | 'rewind' |
'seek' | 'setSpeed' | 'setLoopMode' | 'toggleFavorite' | 'playFromAssetId' | 'answer' | 'hangUp' | 'toggleCallMute';
/**
* The definition of command to be sent to the session
* @interface AVControlCommand
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The definition of command to be sent to the session
* @typedef AVControlCommand
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
interface AVControlCommand {
/**
* The command value {@link AVControlCommandType}
* @type { AVControlCommandType }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The command value {@link AVControlCommandType}
* @type { AVControlCommandType }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
command: AVControlCommandType;
/**
* parameter of the command. Whether this command requires parameters, see {@link AVSessionCommand}
* seek command requires a number parameter
* setSpeed command requires a number parameter
* setLoopMode command requires a {@link LoopMode} parameter.
* toggleFavorite command requires assetId {@link AVMetadata.assetId} parameter
* other commands need no parameter
* @type { ?(LoopMode | string | number) }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* parameter of the command. Whether this command requires parameters, see {@link AVSessionCommand}
* seek command requires a number parameter
* setSpeed command requires a number parameter
* setLoopMode command requires a {@link LoopMode} parameter.
* toggleFavorite command requires assetId {@link AVMetadata.assetId} parameter
* other commands need no parameter
* @type { ?(LoopMode | string | number) }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
parameter?: LoopMode | string | number;
}
/**
* Enumerates ErrorCode types, returns in BusinessError.code.
* @enum { number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Enumerates ErrorCode types, returns in BusinessError.code.
* @enum { number }
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
enum AVSessionErrorCode {
/**
* Session service exception.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Session service exception.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
ERR_CODE_SERVICE_EXCEPTION = 6600101,
/**
* The session does not exist
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The session does not exist
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
ERR_CODE_SESSION_NOT_EXIST = 6600102,
/**
* The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The session controller does not exist.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
ERR_CODE_CONTROLLER_NOT_EXIST = 6600103,
/**
* The remote session connection failed.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The remote session connection failed.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
ERR_CODE_REMOTE_CONNECTION_ERR = 6600104,
/**
* Invalid session command.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Invalid session command.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
ERR_CODE_COMMAND_INVALID = 6600105,
/**
* The session is not activated.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The session is not activated.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
ERR_CODE_SESSION_INACTIVE = 6600106,
/**
* Too many commands or events.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Too many commands or events.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
ERR_CODE_MESSAGE_OVERLOAD = 6600107,
/**
* Device connecting failed.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* Device connecting failed.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
ERR_CODE_DEVICE_CONNECTION_FAILED = 6600108,
/**
* The remote connection is not established.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @since 10
*/
/**
* The remote connection is not established.
* @syscap SystemCapability.Multimedia.AVSession.Core
* @atomicservice
* @since 12
*/
ERR_CODE_REMOTE_CONNECTION_NOT_EXIST = 6600109,
/**
* The error code for cast control is unspecified.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_UNSPECIFIED = 6611000,
/**
* An unspecified error occurs in the remote player.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_REMOTE_ERROR = 6611001,
/**
* The playback position falls behind the live window.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_BEHIND_LIVE_WINDOW = 6611002,
/**
* The process of cast control times out.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_TIMEOUT = 6611003,
/**
* The runtime check failed.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_RUNTIME_CHECK_FAILED = 6611004,
/**
* Cross-device data transmission is locked.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_PLAYER_NOT_WORKING = 6611100,
/**
* The specified seek mode is not supported.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_SEEK_MODE_UNSUPPORTED = 6611101,
/**
* The position to seek to is out of the range of the media asset or the specified seek mode is not supported.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_ILLEGAL_SEEK_TARGET = 6611102,
/**
* The specified playback mode is not supported.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_PLAY_MODE_UNSUPPORTED = 6611103,
/**
* The specified playback speed is not supported.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_PLAY_SPEED_UNSUPPORTED = 6611104,
/**
* The action failed because either the media source device or the media sink device has been revoked.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_DEVICE_MISSING = 6611105,
/**
* The parameter is invalid, for example, the url is illegal to play.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_INVALID_PARAM = 6611106,
/**
* Allocation of memory failed.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_NO_MEMORY = 6611107,
/**
* Operation is not allowed.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_OPERATION_NOT_ALLOWED = 6611108,
/**
* An unspecified input/output error occurs.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_IO_UNSPECIFIED = 6612000,
/**
* Network connection failure.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_IO_NETWORK_CONNECTION_FAILED = 6612001,
/**
* Network timeout.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_IO_NETWORK_CONNECTION_TIMEOUT = 6612002,
/**
* Invalid "Content-Type" HTTP header.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_IO_INVALID_HTTP_CONTENT_TYPE = 6612003,
/**
* The HTTP server returns an unexpected HTTP response status code.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_IO_BAD_HTTP_STATUS = 6612004,
/**
* The file does not exist.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_IO_FILE_NOT_FOUND = 6612005,
/**
* No permission is granted to perform the IO operation.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_IO_NO_PERMISSION = 6612006,
/**
* Access to cleartext HTTP traffic is not allowed by the app's network security configuration.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_IO_CLEARTEXT_NOT_PERMITTED = 6612007,
/**
* Reading data out of the data bound.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_IO_READ_POSITION_OUT_OF_RANGE = 6612008,
/**
* The media does not contain any contents that can be played.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_IO_NO_CONTENTS = 6612100,
/**
* The media cannot be read, for example, because of dust or scratches.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_IO_READ_ERROR = 6612101,
/**
* This resource is already in use.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_IO_CONTENT_BUSY = 6612102,
/**
* The content using the validity interval has expired.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_IO_CONTENT_EXPIRED = 6612103,
/**
* Using the requested content to play is not allowed.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_IO_USE_FORBIDDEN = 6612104,
/**
* The use of the allowed content cannot be verified.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_IO_NOT_VERIFIED = 6612105,
/**
* The number of times this content has been used as requested has reached the maximum allowed number of uses.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_IO_EXHAUSTED_ALLOWED_USES = 6612106,
/**
* An error occurs when sending packet from source device to sink device.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_IO_NETWORK_PACKET_SENDING_FAILED = 6612107,
/**
* Unspecified error related to content parsing.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_PARSING_UNSPECIFIED = 6613000,
/**
* Parsing error associated with media container format bit streams.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_PARSING_CONTAINER_MALFORMED = 6613001,
/**
* Parsing error associated with the media manifest.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_PARSING_MANIFEST_MALFORMED = 6613002,
/**
* An error occurs when attempting to extract a file with an unsupported media container format
* or an unsupported media container feature.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_PARSING_CONTAINER_UNSUPPORTED = 6613003,
/**
* Unsupported feature in the media manifest.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_PARSING_MANIFEST_UNSUPPORTED = 6613004,
/**
* Unspecified decoding error.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_DECODING_UNSPECIFIED = 6614000,
/**
* Decoder initialization failed.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_DECODING_INIT_FAILED = 6614001,
/**
* Decoder query failed.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_DECODING_QUERY_FAILED = 6614002,
/**
* Decoding the media samples failed.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_DECODING_FAILED = 6614003,
/**
* The format of the content to decode exceeds the capabilities of the device.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_DECODING_FORMAT_EXCEEDS_CAPABILITIES = 6614004,
/**
* The format of the content to decode is not supported.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_DECODING_FORMAT_UNSUPPORTED = 6614005,
/**
* Unspecified errors related to the audio renderer.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_AUDIO_RENDERER_UNSPECIFIED = 6615000,
/**
* Initializing the audio renderer failed.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_AUDIO_RENDERER_INIT_FAILED = 6615001,
/**
* The audio renderer fails to write data.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_AUDIO_RENDERER_WRITE_FAILED = 6615002,
/**
* Unspecified error related to DRM.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_DRM_UNSPECIFIED = 6616000,
/**
* The chosen DRM protection scheme is not supported by the device.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_DRM_SCHEME_UNSUPPORTED = 6616001,
/**
* Device provisioning failed.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_DRM_PROVISIONING_FAILED = 6616002,
/**
* The DRM-protected content to play is incompatible.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_DRM_CONTENT_ERROR = 6616003,
/**
* Failed to obtain a license.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_DRM_LICENSE_ACQUISITION_FAILED = 6616004,
/**
* The operation is disallowed by the license policy.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_DRM_DISALLOWED_OPERATION = 6616005,
/**
* An error occurs in the DRM system.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_DRM_SYSTEM_ERROR = 6616006,
/**
* The device has revoked DRM privileges.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_DRM_DEVICE_REVOKED = 6616007,
/**
* The DRM license being loaded into the open DRM session has expired.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_DRM_LICENSE_EXPIRED = 6616008,
/**
* An error occurs when the DRM processes the key response.
* @syscap SystemCapability.Multimedia.AVSession.AVCast
* @atomicservice
* @since 13
*/
ERR_CODE_CAST_CONTROL_DRM_PROVIDE_KEY_RESPONSE_ERROR = 6616100,
}
}
export default avSession;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lffl8796/interface_sdk-js.git
git@gitee.com:lffl8796/interface_sdk-js.git
lffl8796
interface_sdk-js
interface_sdk-js
master

搜索帮助