Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not getting resolution of video #43

Closed
wertpoiu opened this issue Jul 19, 2020 · 3 comments
Closed

Not getting resolution of video #43

wertpoiu opened this issue Jul 19, 2020 · 3 comments

Comments

@wertpoiu
Copy link

print("Size = (String(describing: playerView.playerLayer.player?.naturalSize))")

this gives me

Size = Optional((0.0, 0.0))

I am not getting resolution can you help please @kingslay ?

@kingslay
Copy link
Owner


    override open func player(layer: KSPlayerLayer, state: KSPlayerState) {
        super.player(layer: layer, state: state)
        if state == .readyToPlay, let player = layer.player {
            print(player.naturalSize)
            // list the all subtitles
            let subtitleInfos = srtControl.filterInfos { _ in true }
            subtitleInfos.forEach {
                print($0.name)
            }
            subtitleInfos.first?.makeSubtitle { result in
                self.resource?.subtitle = try? result.get()
            }
            for track in player.tracks(mediaType: .audio) {
                print("audio name: \(track.name) language: \(track.language ?? "")")
            }
        }
    }

@wertpoiu
Copy link
Author

wertpoiu commented Aug 1, 2020


    override open func player(layer: KSPlayerLayer, state: KSPlayerState) {
        super.player(layer: layer, state: state)
        if state == .readyToPlay, let player = layer.player {
            print(player.naturalSize)
            // list the all subtitles
            let subtitleInfos = srtControl.filterInfos { _ in true }
            subtitleInfos.forEach {
                print($0.name)
            }
            subtitleInfos.first?.makeSubtitle { result in
                self.resource?.subtitle = try? result.get()
            }
            for track in player.tracks(mediaType: .audio) {
                print("audio name: \(track.name) language: \(track.language ?? "")")
            }
        }
    }

Player has issue getting resolution of video it always returns 0 , 0

@kingslay
Copy link
Owner

kingslay commented Aug 1, 2020

please provide the playback url

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants