Giter Site home page Giter Site logo

Comments (8)

Dador avatar Dador commented on September 24, 2024

What is your chrome version?

Fullscreen on your link works fine for me.
Chrome 39.0.2171.95 m (last stable)

Screenshot:
fullscreen_subtitles

from libjass.

xtsss avatar xtsss commented on September 24, 2024

ok, i checked it, it happens when you set default zoom page for example 125%, zoom page to 125% and you will see that default is ok but fs is not ok, maybe it is also in firefox cause in firefox i had it without zoom.

from libjass.

Arnavion avatar Arnavion commented on September 24, 2024

This is a bug in videojs-ass. On going fullscreen, it tells the renderer to resize to (screen.width, screen.height). This does not take browser zoom into account.

Eg: If I have a 1920x1200 monitor and the browser is zoomed to 200%, the fullscreen video element (iframe) is 960x600. However screen.width and screen.height continue to be 1920x1200 since they are measured in device pixels, not viewport pixels.

Instead of using screen.width and screen.height, it should use some method of getting the player's width and height. (It did not seem that player.width() and player.height() report it because they continued to give the pre-fullscreen dimensions. Not sure whether videojs can give that information.)

from libjass.

Arnavion avatar Arnavion commented on September 24, 2024

(DefaultRenderer also has this bug, but videojs-ass doesn't use it so it's not relevant here.)

from libjass.

Denoder avatar Denoder commented on September 24, 2024

in reply to this, the only way i was able to fix this problem was to make the player responsive and have libass.css size up to the responsiveness of the player by making the wrapper wrap around the full layer of the player.

IT will work when you zoom out (to a certain degree) and will resize on phones. (subtitles will be all the way at the bottom when in portrait view)

from libjass.

Arnavion avatar Arnavion commented on September 24, 2024

@ChristianMcQuilkin Can you elaborate? Do you mean you put the video element inside the .libjass-wrapper wrapper, or the .libjass-subs wrapper? How do you call renderer.resize when going in and out of fullscreen?

from libjass.

Denoder avatar Denoder commented on September 24, 2024

I'm basing this off of video-js-ass
What i did was made videojs and vjs-tech relative and have an auto height.

Then i'd have libjass wrapper have a
width: 100%; height: 100% !important; top: 0;

i would also have the libjass-subs wrap around too.

Just take a look here: and look for the differences:
http://anime.genenx.squidix.me/assets/css/libjass.css

Go here for the test:
http://anime.genenx.squidix.me/shows/39-death-parade/seasons/1/episodes/1

from libjass.

Arnavion avatar Arnavion commented on September 24, 2024

I see. That is not correct, unfortunately. Setting width and height to 100% will break with full-screen letterboxed video. For example on your test page, notice how the relative position of the subs is wrong:

Regular:
image

Full-screen - the subs are outside the video, and no margins are being applied:
image

The reason the renderer works with absolute sizes is also because it is essential for calculating widths, margins, zoom, etc. For example, on your page, entering and exiting fullscreen results in an incorrect width calculation - the wrapper and subs are too wide, causing the subs to shift right.

image

Instead of hacking the renderer's size calculation, you should endeavor to call it with the correct size. For DefaultRenderer, a simple fix was to delay the resize with setTimeout after the actual fullscreenChange event, so that the browser reported the correct full-screen pixel size of the video element. You can probably do the same with videojs.

from libjass.

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.