0
votes

I am using OpenTok v2.14.0.0, for screen share. Streaming etc are working seamlessly. The only problem is, on the subscriber side, I am not able to see the complete Publisher's screen. On resizing the subscriber window (in which the streaming is happening), the video inside stretches maintaining the aspect ratio. I have tried changing my WPF UI element control to Grid and UniformGrid, but did not work. Hence, I believe this has something to do with my subscriber's configurations. On js side, there is a property fitMode, I am looking for a similar setting on windows side.

Here is the video where one can see that the publisher (he is publishing his chrome window), gets stretched outside the bounds.

xaml control:

<Grid x:Name="SubscriberGrid"/>

when I receive the stream:

var uiElement = ((UIElement)subscriber.VideoRenderer);                       
SubscriberGrid.Children.Add(uiElement);
1

1 Answers

0
votes

I had this issue and for me it was because I had set the fitMode property to 'cover' instead of 'contain'. Changing fitMode to 'contain' fixed the issue:

var subscriber = session.subscribe(event.stream, 'subscribers', {
            insertMode: 'append',
            width: "100%",
            height: "100%",
            fitMode: "contain"
        }, function (error) {
            if (error) {
                console.error('Failed to subscribe', error);
            }
            });