Giter Club home page Giter Club logo

Comments (14)

kingslay avatar kingslay commented on May 23, 2024

You can get the size of the video and update the layout yourself
MediaPlayerProtocol.naturalSize

from ksplayer.

UnknownCoder807 avatar UnknownCoder807 commented on May 23, 2024

Thanks

from ksplayer.

wertpoiu avatar wertpoiu commented on May 23, 2024

i am having same issue no code anywhere to fill phone screen .scaletofill dont work at all

from ksplayer.

wertpoiu avatar wertpoiu commented on May 23, 2024

please update demo

from ksplayer.

UnknownCoder807 avatar UnknownCoder807 commented on May 23, 2024

Is it possible to add this feature please? It's the one major thing missing for me. thanks

from ksplayer.

kingslay avatar kingslay commented on May 23, 2024

What effect do you hope to achieve? Can you draw a schematic diagram for me to see

from ksplayer.

UnknownCoder807 avatar UnknownCoder807 commented on May 23, 2024

Basically, for example, some video's are in 4:3 format and when they are displayed they look like the first image below

If I can set the aspect ratio to 4:3 then the video will look like the 2nd image below.

Screenshot 2021-02-27 at 15 04 28

Screenshot 2021-02-27 at 15 04 40

from ksplayer.

kingslay avatar kingslay commented on May 23, 2024

@UnknownCoder807 can you provide the video to me? I will test it.

from ksplayer.

UnknownCoder807 avatar UnknownCoder807 commented on May 23, 2024

Normally I would but these videos links aren’t mine to share. they are paid for links.

from ksplayer.

kingslay avatar kingslay commented on May 23, 2024

Can you download it, and then take a small part of it through ffmepg and send it to me separately by email? I won't leak out

from ksplayer.

kingslay avatar kingslay commented on May 23, 2024
class MeOptions: KSOptions {
    override func drawableSize(par: CGSize, sar: CGSize) -> CGSize {
        return CGSize(width: par.width, height: par.width*3/4)
    }
}
  let res0 = KSPlayerResourceDefinition(url: url, definition: "高清", options: MeOptions())
                let asset = KSPlayerResource(name: url.lastPathComponent, definitions: [res0], cover: URL(string: "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Big_buck_bunny_poster_big.jpg/848px-Big_buck_bunny_poster_big.jpg"))
                playerView.set(resource: asset)

from ksplayer.

UnknownCoder807 avatar UnknownCoder807 commented on May 23, 2024

Thank I got this to work. I have a question though. How do I read the original aspect ratio so I can have a return to default option for the user? Default, 4:3, 5:4, 16:9 etc

the user selects default and it reverts back to the original aspect ratio?

from ksplayer.

kingslay avatar kingslay commented on May 23, 2024

let original = super.drawableSize(par: CGSize, sar: CGSize)

from ksplayer.

UnknownCoder807 avatar UnknownCoder807 commented on May 23, 2024

Thanks, that works.

from ksplayer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.