Comments (14)
You can get the size of the video and update the layout yourself
MediaPlayerProtocol.naturalSize
from ksplayer.
Thanks
from ksplayer.
i am having same issue no code anywhere to fill phone screen .scaletofill dont work at all
from ksplayer.
please update demo
from ksplayer.
Is it possible to add this feature please? It's the one major thing missing for me. thanks
from ksplayer.
What effect do you hope to achieve? Can you draw a schematic diagram for me to see
from ksplayer.
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.
from ksplayer.
@UnknownCoder807 can you provide the video to me? I will test it.
from ksplayer.
Normally I would but these videos links aren’t mine to share. they are paid for links.
from ksplayer.
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.
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.
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.
let original = super.drawableSize(par: CGSize, sar: CGSize)
from ksplayer.
Thanks, that works.
from ksplayer.
Related Issues (20)
- 无法显示cc隐藏字幕
- Fullscreen button
- Demo App HOT 4
- 25 / 30 FPS streams stutter HOT 28
- 某些视频播放时会崩溃 HOT 3
- tvOS 端播放时卡顿会是什么原因? HOT 6
- OpenSSL and KSME Crash on tvOS HOT 10
- Slider and SwiftUI
- 在播放一个广播音频时,会一直在buffering HOT 4
- 请问有什么方式可以设置一个默认的播放速度 类似默认的播放开始位置一样 谢谢 HOT 4
- 音频是使用native原生解码吗? HOT 4
- Potentially Incorrect Uses of "available" HOT 2
- SOS,播放器播放过程中,视频流自己创建了新的控件 HOT 3
- Pauses when playing m3u8 HOT 2
- SPM无法添加 HOT 2
- How to set `subtitleDelay` now? HOT 1
- Testing new OpenSSL initialization - results and first crashes HOT 11
- 画面比例会影响pip功能
- 能否删掉默认的 User-Agent: ksplayer? HOT 1
- 如何设置字幕的 UA? HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ksplayer.