2

There is an application called Miracast This app is capable to mirror screen to Smart TV (I need specially Samsung TV) and play videos from gallery to the TV

I tried to search but couldn't find any resources online talking about this task

I am using Smart View SDK to connect to the TV, and I was able to show photos from Gallery on the TV

Here is the code to show photo on Samsung TV

 let appID: URL = URL(string: "http://prod-multiscreen-examples.s3-website-us-west-1.amazonaws.com/examples/photoshare/tv/")!
    let channelID: String = "com.samsung.multiscreen.photoshare"
    let msApplication = service.createApplication(appID as AnyObject, channelURI: channelID, args: nil)
    msApplication!.connectionTimeout = 5.0
    msApplication!.connect([:], completionHandler: { (client, error) in
        let data = self.compressImage(image: image)

        msApplication?.publish(event: "showPhoto", message: nil, data: data!, target: MessageTarget.Host.rawValue as AnyObject)
    })

If anyone has successfully worked on something similar or has any resources it will be appreciated

1 Answer 1

0

Yes, yes yes. Its a very simply function call, just access the video file instead of the picture. So see https://developer.samsung.com/smarttv/design/smart-view-sdk.html#playback-sync the code is very, very simple to implement:

 let appID: URL = URL(string: "http://prod-multiscreen-examples.s3-website-us-west-1.amazonaws.com/examples/photoshare/tv/")!
    let channelID: String = "com.samsung.multiscreen.photoshare"
    let msApplication = service.createApplication(appID as AnyObject, channelURI: channelID, args: nil)
    msApplication!.connectionTimeout = 5.0
    msApplication!.connect([:], completionHandler: { (client, error) in
        let data = self.compressVideo(video: video) //this here is the key

        msApplication?.publish(event: "showPhoto", message: nil, data: data!, target: MessageTarget.Host.rawValue as AnyObject)
    })
1
  • 1
    From where you got the video, I want to use a video from gallery, and what I got is an URL Commented Apr 13, 2020 at 11:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.