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

Overlaying publisher-video element on top of subscriber-video element not working #244

Open
primashah opened this issue Feb 13, 2018 · 3 comments

Comments

@primashah
Copy link

Hi ,
I am working on ionic 2 cordova app.

I am trying to set publisher's Video with absolute position in a way that it sits on top of subscriber video. I tried following css and code to make it work, but the publisher video is always positioned on top left corner of IPad screen:

css

.publisher-video{
      height: 120px;
      width: 250px;
      position: absolute;
     bottom: 0px;
      right: 0px;
      z-index: 9;
}

The publisher properties used for initialisation are:

{

  width: "250px",
  height: "120px",
  resolution: "1280x720",
  publishAudio: true,
  publishVideo: true

}

The subscriber properties are:
{

  width: "100%",
  height: "100%"

}

@msach22
Copy link
Contributor

msach22 commented May 31, 2018

@primashah Are you using the updated plugin ? https://github.com/opentok/cordova-plugin-opentok

@alexisjcr07
Copy link

Hello, I have the same error, but in my case I am trying to show another view on the video.

my code:
.ts

none(){
this.cc = 'none';
this.style = 'none';
}
block(){
this.cc = 'block';
this.style = 'block';
}

    streamCreated: (event) => {

    let subscriberProperties = {width:"100%",height:"91% !important"};

    if(event.stream.videoType === 'screen') {
    this.session.subscribe(event.stream, 'screen-preview', subscriberProperties);
    this.none();
 }else 
   {
    this.session.subscribe(event.stream, 'subscriber', subOptions);
    this.block();
    OT.updateViews();
    
   }
  },

.html

.css
#subscriber {
width: 100% !important;
top: 0;
height: 91% !important;
overflow: hidden;
position: fixed;
margin: 0px;
background: #0c0c0c;
left: 0px;

}

.none {
width: 100% !important;
top: 0;
height: 91% !important;
overflow: hidden;
position: relative;
margin: 0px !important;
left: 0px;
display: none !important;

}

.block {
width: 100% !important;
top: 0;
height: 91% !important;
overflow: hidden;
position: relative;
margin: 0px !important;
left: 0px;
display: block !important;

}

#publisher {
width: 30% !important;
height: 18% !important;
overflow: hidden;
position: fixed;
margin: 0px !important;
right: 14px;
bottom: 80px;
left: auto;
z-index: 40;
}

#screen-preview {
width: 100% !important;
top: 0;
height: 91% !important;
overflow: hidden;
position: fixed;
margin: 0px !important;
background: transparent !important;
z-index: 999;
left: 0px;
}

@mmubasher
Copy link

I am using following design and it works perfectly for me using cordova-plugin-opentok

<div id="publisher"
     style="width: 30vh; height: 25vh; position: absolute; top: 0; left: 0; z-index: 1000; pointer-events:none;"></div>
<div id="subscriber"
     style="width: 100%; height: 100vh; position: absolute; top: 0; left: 0; z-index: 500; pointer-events:none;"></div>

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

4 participants