Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Not able to see the video through punch hole

    Qt WebKit
    3
    9
    2676
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      Srinath last edited by koahnig

      Hi Team,

      We have been working on browser application on SOC which render and plays video on video plane. We made video playing rectangle as punch hole to see the video from graphics plane. Also we made this rectangle as transparent in QT webkit we are not able to see the backend video ( which is playing on video plane), only black screen is appearing.

      Can any body faced similar kind of issue while using QT webkit + opengles combination.. If yes please let me know...anybody help is appreciated....

      [edit:koahnig, blanks before first paragraph removed]

      K 1 Reply Last reply Reply Quote 0
      • K
        koahnig @Srinath last edited by

        @Srinath

        Hi and welcome to devnet forum

        The forum has a feature for formatting the input as source. Accidently you hit this feature by adding a couple of blanks as start of the first paragraph. I have removed them for you.

        Vote the answer(s) that helped you to solve your issue(s)

        S 1 Reply Last reply Reply Quote 1
        • S
          Srinath @koahnig last edited by

          @koahnig Thank you

          K 1 Reply Last reply Reply Quote 1
          • K
            Konstantin Tokarev @Srinath last edited by

            @Srinath Easiest way to puch a hole in web page is to paint player rect with QPainter::CompositionMode_Clear. It will make a transparent hole clearing all backgrounds underneath your video element, but other elements such as tooltips of playbackcontrols will be able to overlap video just like in "normal" browser.

            Also, this thread might be helpful for you too: https://forum.qt.io/topic/76208/how-to-find-the-absolute-screen-position-of-an-element-on-a-webpage

            1 Reply Last reply Reply Quote 0
            • S
              Srinath last edited by

              @Konstantin-Tokarev Thanks for the quick response. I tried with the above Composition mode. Still black screen is appearing ,not able to see the back video.

              This is the code part i am referring:

              void GraphicsContext::clearRect(const FloatRect& rect)
              {

              if (paintingDisabled())
                  return;
              
              QPainter* p = m_data->p();
              QPainter::CompositionMode currentCompositionMode = p->compositionMode();
              p->setCompositionMode(QPainter::CompositionMode_Clear);   
              p->fillRect(rect,Qt::transparent);
              p->setCompositionMode(currentCompositionMode);
              

              }

              I have also tried with commenting fillRect in this case, still white screen appears. Not able to see the video through rectangle. Could you please let me know is there anything to modify to see the below video.

              1 Reply Last reply Reply Quote 0
              • S
                Srinath last edited by

                Hi @Konstantin-Tokarev , Problem got resolved for me. I have used GL_SCISSOR_TEST instead of fillrect. Now i am able to see the video through punch hole.

                K 2 Replies Last reply Reply Quote 0
                • K
                  Konstantin Tokarev @Srinath last edited by

                  @Srinath I assumed you can see through qt widgets filled with transparent color, otherwise my advise is not applicable

                  S 1 Reply Last reply Reply Quote 0
                  • S
                    Srinath @Konstantin Tokarev last edited by

                    @Konstantin-Tokarev ok

                    1 Reply Last reply Reply Quote 0
                    • K
                      Konstantin Tokarev @Srinath last edited by

                      AFAIU, using GL_SCISSOR_TEST won't allow page to paint anything on top of the hole. This may work for you, but many implementations of media controls rely heavily on painting semi-transparent elements on top of video. This includes built-in controls of QtWebKit.

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post