Core Spotlight API - kUTTypeAudio play button in search results

this is my first question on SO :)

Is it possible if the new search API would have a play button in the search results cell?

I've tried something like this:

let attributeSet = CSSearchableItemAttributeSet(itemContentType: kUTTypeAudio as String)
...
attributeSet.contentType = kUTTypeAudio as String
attributeSet.contentURL = NSURL(fileURLWithPath: dataPath)

      

In the main recording, they searched for a movie and got the result with the play button. Perhaps this is possible with later beta?

Thank you for your help!

+3


source to share


1 answer


Yes and no. Go through the docs, which is always my favorite place to go with questions :). As far as Core Spotlight is concerned, if it's a viable feature, it is not publicly annotated in the documents that Apple has provided us so far. As you can see in the main article, they discussed "Rich Result" (dialing a phone number, playing a movie, etc.) During the index you showed that contained Rich Result, more specifically in the Web Markup API , so you saw that that was seen in the master record. They comment that you can perform movie or sound playback in two ways:

You can also use schema markup to trigger actions within rich outcomes. For example, you can allow users to dial a phone number, get directions to an address, or play audio or video by integrating markup similar to the code below:

<!-- Two ways to enable playing audio or video. ->

<!-- Using Open Graph markup: ->
<meta property="og:video:url" content="https://example.com/videofile">

<!-- Using Schema.org markup: ->
<div itemscope itemtype=
   "http://schema.org/AudioObject">
   <meta itemprop="contentUrl"
content="http://example.com/x.m4a" />
</div>

      



SOURCE

+1


source







All Articles