tvOS AVPlayerViewController Video Info -
in built in apps tvos when watch video shows information video when swipe down. can't find information on how developer can same thing. i'm sure designed possible says "swipe down info" has figured out? i'm using avplayerviewcontroller. thanks.
to "info" section show in "swipe down info" pane in avplayerviewcontroller
create avmutablemetadataitem
s avmetadatakeyspacecommon
keyspace , of following keys:
avmetadatacommonkeytitle avmetadatacommonkeydescription avmetadataitunesmetadatakeycontentrating avmetadataquicktimemetadatakeygenre
and add them avplayeritem
's externalmetadata
array. in order each avmutablemetadataitem
show must @ least set identifier
, extendedlanguagetag
, , value
properties. here's example:
let mediaitem = avplayeritem(url: mediaurl) let titlemetadataitem = avmutablemetadataitem() titlemetadataitem.locale = nslocale.currentlocale() titlemetadataitem.key = avmetadatacommonkeytitle titlemetadataitem.keyspace = avmetadatakeyspacecommon titlemetadataitem.value = "the title" let descriptionmetadataitem = avmutablemetadataitem() descriptionmetadataitem.locale = nslocale.currentlocale() descriptionmetadataitem.key = avmetadatacommonkeydescription descriptionmetadataitem.keyspace = avmetadatakeyspacecommon descriptionmetadataitem.value = "this description" mediaitem.externalmetadata.append(titlemetadataitem) mediaitem.externalmetadata.append(descriptionmetadataitem)
this isn't well-documented. this forum post critical figuring out.
objective-c example @jenelejercitomyers:
avplayeritem *mediaitem = [[avplayeritem alloc] initwithurl:mediaurl]; avmutablemetadataitem *titlemetadataitem = [[avmutablemetadataitem alloc] init]; titlemetadataitem.locale = nslocale.currentlocale; titlemetadataitem.key = avmetadatacommonkeytitle; titlemetadataitem.keyspace = avmetadatakeyspacecommon; titlemetadataitem.value = @"the title"; nsarray *externalmetadata = [[nsarray alloc] initwithobjects:titlemetadataitem, nil]; mediaitem.externalmetadata = externalmetadata;
Comments
Post a Comment