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

Creating Video throws error Directions undefined #316

Open
RalicAleksandar opened this issue Dec 17, 2024 · 1 comment
Open

Creating Video throws error Directions undefined #316

RalicAleksandar opened this issue Dec 17, 2024 · 1 comment

Comments

@RalicAleksandar
Copy link

    const video = new nodeDatachannel.Video("video", nodeDatachannel.Direction.SendOnly);
Logs:

2024-12-17 19:25:39.209 DEBUG [28228] [PeerConnectionWrapper::PeerConnectionWrapper@77] Constructor called
2024-12-17 19:25:39.210 DEBUG [28228] [PeerConnectionWrapper::PeerConnectionWrapper@248] Creating a new Peer Connection
2024-12-17 19:25:39.210 DEBUG [28228] [rtc::impl::Init::doInit@113] Global initialization
2024-12-17 19:25:39.210 DEBUG [28228] [rtc::impl::Init::doInit@123] Spawning 16 threads
2024-12-17 19:25:39.212 DEBUG [10300] [rtc::impl::PollService::runLoop@164] Poll service started
2024-12-17 19:25:39.212 VERB [10300] [rtc::impl::PollService::runLoop@182] Entering poll
2024-12-17 19:25:39.216 VERB [28228] [rtc::impl::PeerConnection::PeerConnection@50] Creating PeerConnection
2024-12-17 19:25:39.216 DEBUG [28228] [PeerConnectionWrapper::PeerConnectionWrapper@257] Peer Connection created
2024-12-17 19:25:39.216 DEBUG [29468] [rtc::impl::Certificate::Generate@445] Generating certificate (OpenSSL)
2024-12-17 19:25:39.217 VERB [29468] [rtc::impl::Certificate::Generate@461] Generating ECDSA P-256 key pair
TypeError: Cannot read properties of undefined (reading 'SendOnly')

@murat-dogan
Copy link
Owner

I run the example below with no error.

import { initLogger, Direction, Video, PeerConnection } from 'node-datachannel';

initLogger('Debug');

let peerConnection = new PeerConnection('pc', {
    iceServers: [],
  });
let video = new Video('video', Direction.SendOnly);

let track = peerConnection.addTrack(video);
2024-12-18 21:28:17.940 DEBUG [17064] [PeerConnectionWrapper::PeerConnectionWrapper@81] Constructor called
2024-12-18 21:28:17.940 DEBUG [17064] [PeerConnectionWrapper::PeerConnectionWrapper@257] Creating a new Peer Connection
2024-12-18 21:28:17.940 DEBUG [17064] [rtc::impl::Init::doInit@113] Global initialization
2024-12-18 21:28:17.940 DEBUG [17064] [rtc::impl::Init::doInit@123] Spawning 8 threads
2024-12-18 21:28:17.941 DEBUG [17079] [rtc::impl::PollService::runLoop@164] Poll service started
2024-12-18 21:28:17.943 DEBUG [17064] [PeerConnectionWrapper::PeerConnectionWrapper@266] Peer Connection created
2024-12-18 21:28:17.943 DEBUG [17071] [rtc::impl::Certificate::Generate@445] Generating certificate (OpenSSL)
2024-12-18 21:28:17.943 DEBUG [17064] [PeerConnectionWrapper::addTrack@1054] addTrack() called
2024-12-18 21:28:17.943 DEBUG [17064] [TrackWrapper::TrackWrapper@64] Constructor called
2024-12-18 21:28:17.943 DEBUG [17064] [TrackWrapper::TrackWrapper@66] Track created

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

2 participants