GithubHelp home page GithubHelp logo

Comments (6)

aullman avatar aullman commented on July 30, 2024 1

Yes, we are working on a feature to replace the tracks. The issue is we have been waiting for browsers to support this feature. Now Chrome supports it too and so we are looking into it. For now you do have to unpublish and publish a whole new Publisher unfortunately.

That's a concern that you're getting black videos. Can you file your issue on Stackoverflow and we can find an answer for you there. https://stackoverflow.com/questions/tagged/tokbox+or+opentok

from opentok-web-samples.

aullman avatar aullman commented on July 30, 2024 1

2.14 now has cycleVideo() which lets you switch between cameras without having to unpublish and publish again. https://tokbox.com/developer/sdks/js/reference/Publisher.html#cycleVideo

from opentok-web-samples.

heygambo avatar heygambo commented on July 30, 2024

This would be really nice, because I'm stuck with this atm.

I've created a stream using OT.getUserMedia and I'm passing those tracks into a new OT.Publisher. The problem is when I unpublish this publisher destroy it and create a new one with different tracks then it doesn't publish anymore. I'm just getting black videos.

I'd like if I didn't need to unpublish the publisher at all but I couldn't find a way how to add and remove tracks from the publisher.

Here is what happens to me:

screenshot 2018-03-09 23 36 18

Here are some code samples.

startStreaming () {
  const { session, properties, errorHandler, publish } = this
  console.log('properties', properties)
  this.$nextTick(() => {
    this.publisher = OT.initPublisher(properties, errorHandler)
    this.publisher.on('streamCreated', this.handleStreamCreated)
    this.publisher.on('streamDestroyed', this.handleStreamDestroyed)
    this.publisher.on('audioLevelUpdated', this.handleAudioLevelChange)

    session.on('sessionConnected', publish)
    if (session.isConnected()) { publish() }
  })
},
publish () {
  this.session.publish(this.publisher, this.errorHandler)
},
stopStreaming () {
  this.session.off('sessionConnected')
  this.publisher.off('streamCreated')
  this.publisher.off('streamDestroyed')

  this.session.unpublish(this.publisher)
  if (this.publisher) {
    this.publisher.destroy()
  }
},

from opentok-web-samples.

heygambo avatar heygambo commented on July 30, 2024

@aullman cool I'll put it on our roadmap!

from opentok-web-samples.

heygambo avatar heygambo commented on July 30, 2024

@aullman we've just discovered that it's not possible to pass a new set of device ids. Unfortunately we cannot use this function.

from opentok-web-samples.

meljason avatar meljason commented on July 30, 2024

When we use OT.getUserMedia, how do we disconnect the call without refreshing the page? It seems that session.disconnect(publisher) does not work when there is OT.getUserMedia.

from opentok-web-samples.

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.