tvos

AVUrlAsset and WebVTTs

狂风中的少年 提交于 2021-01-28 04:37:15
问题 On iOS/TVOS, is it possible to load a remote .vtt file from a URL and use it as a subtitle track with a remote HLS video also loaded from a URL (as opposed to the VTT being specified within the m3u8 playlist)? pseudocode: AVAsset* video_asset = AVAsset( "http://video.m3u8" ); AVAsset* subtitle_asset = AVAsset( "http://subtitle.vtt" ); AVPlayer player = player.playVideoWithSubtitle( video_asset, subtitle_asset ); player.play(). Edit: The docs mention using AVAsset for subtitles, but does

How to set button focus in SwiftUI?

白昼怎懂夜的黑 提交于 2021-01-27 08:17:47
问题 !!! TVOS !!! I have list of buttons and it somehow autofocus first button in that list (when view is loaded). Is there any way how to focus another button in that list using SwiftUI ? I know there is preferredFocusedView in UIKit but id like to do this in SwiftUI . Thanks for any advice! 回答1: SwiftUI 2.0 Note: !! Partial solution !! The following approach, as tested with Xcode 12b5 / tvOS 14 works only with stacks and does not work (in any tested combination) for List/ScrollView. Anyway for

How to set button focus in SwiftUI?

五迷三道 提交于 2021-01-27 08:16:27
问题 !!! TVOS !!! I have list of buttons and it somehow autofocus first button in that list (when view is loaded). Is there any way how to focus another button in that list using SwiftUI ? I know there is preferredFocusedView in UIKit but id like to do this in SwiftUI . Thanks for any advice! 回答1: SwiftUI 2.0 Note: !! Partial solution !! The following approach, as tested with Xcode 12b5 / tvOS 14 works only with stacks and does not work (in any tested combination) for List/ScrollView. Anyway for

tvOS Textfield Transparent Background

北城以北 提交于 2021-01-05 07:08:47
问题 I am working on a tvOS project. I use swift and siwftUI, and I want to create a TextField with a transparent background. The thing is when I set the background color to transparent, there is still a layer of highlight and when you navigate and focus is on the text field it expands. I tried many things but I was not able to solve it. Then I decided to go with the background color but this layer is still there and I cannot get rid of it. As you can see in the picture, that layer is visible in

tvOS Textfield Transparent Background

孤人 提交于 2021-01-05 07:07:41
问题 I am working on a tvOS project. I use swift and siwftUI, and I want to create a TextField with a transparent background. The thing is when I set the background color to transparent, there is still a layer of highlight and when you navigate and focus is on the text field it expands. I tried many things but I was not able to solve it. Then I decided to go with the background color but this layer is still there and I cannot get rid of it. As you can see in the picture, that layer is visible in

tvOS Textfield Transparent Background

℡╲_俬逩灬. 提交于 2021-01-05 07:07:08
问题 I am working on a tvOS project. I use swift and siwftUI, and I want to create a TextField with a transparent background. The thing is when I set the background color to transparent, there is still a layer of highlight and when you navigate and focus is on the text field it expands. I tried many things but I was not able to solve it. Then I decided to go with the background color but this layer is still there and I cannot get rid of it. As you can see in the picture, that layer is visible in

Detect if TV is turned off on tvOS

自闭症网瘾萝莉.ら 提交于 2020-12-26 08:34:00
问题 Does anyone know how, or if, it is possible to detect programmatically on tvOS if the TV is turned off? The case is that I’m developing a video content app, where I don’t want the content to continue to play when the user turns off the TV. This is expensive due to bandwidth fees and give imprecise analytics. I’ve tried searching around and could find any clues. Best regards. 回答1: FWIW tvOS does automatically pause the content when the TV is turned off. In my case I was test on live content. I

Detect if TV is turned off on tvOS

 ̄綄美尐妖づ 提交于 2020-12-26 08:30:02
问题 Does anyone know how, or if, it is possible to detect programmatically on tvOS if the TV is turned off? The case is that I’m developing a video content app, where I don’t want the content to continue to play when the user turns off the TV. This is expensive due to bandwidth fees and give imprecise analytics. I’ve tried searching around and could find any clues. Best regards. 回答1: FWIW tvOS does automatically pause the content when the TV is turned off. In my case I was test on live content. I