Miracast card

You can invoke a Miracast card to discover and establish a connection to a nearby Miracast device. You can invoke the Miracast card in two modes: play on and show on.

Showing content on a Miracast device

In ShowOn mode, the application is not aware of the streaming. The content is streamed to a Miracast device in the native resolution of the BlackBerry device. Here are the invocation attributes you use to invoke the Miracast card to show your content on a Miracast device:

Attribute Value
Target ID

sys.miracastviewer

Action

bb.action.VIEW

MIME type application/vnd.rim.miracast.showon

The following code sample shows how you can invoke the Miracast card in ShowOn mode:

...
actions: {
    ActionItem {
        id: showOn
        title: "Show on"
    imageSource: "asset:///images/ic_show_on.png"
        ActionBar.placement: ActionBarPlacement.OnBar
        onTriggered: {
            _application.ShowOn()
        }
    }
}
void ShowOn() {
    // ...
  
    InvokeRequest request;
    request.setTarget("sys.miracastviewer");
    request.setAction("bb.action.VIEW");
    request.setMimeType("application/vnd.rim.miracast.showon");
  
    invokeManager->invoke(request);
    // ...
  
}

Playing content on a Miracast device

In PlayOn mode, your app renders content to a Miracast device at a resolution that can be different from the native resolution of the BlackBerry device. Here are the invocation attributes you use to invoke the Miracast card to play your content on a Miracast device:

Attribute Value
Target ID

sys.miracastviewer

Action

bb.action.VIEW

MIME type application/vnd.rim.miracast.playon

The following code sample shows how you can invoke the Miracast card in PlayOn mode:

...
actions: {
    ActionItem {
        id: playOn
        title: "Play on"
        imageSource: "asset:///images/ic_play_on.png"
        ActionBar.placement: ActionBarPlacement.OnBar
        onTriggered: {
            _application.PlayOn()
        }
    }
}
void PlayOn() {
    // ...
 
    InvokeRequest request;
    request.setTarget("sys.miracastviewer");
    request.setAction("bb.action.SHARE");
    request.setMimeType("application/vnd.rim.miracast.playon");
 
    invokeManager->invoke(request)
    // ...
 
}

Last modified: 2014-09-30



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus