apivideo / api.video-flutter-live-stream

Flutter RTMP live stream client. Made with ♥ by api.video
MIT License
62 stars 37 forks source link

[Bug]: No implementation found for method getVideoSize on channel video.api.livestream/controller #45

Closed LucaJeevanjee closed 7 months ago

LucaJeevanjee commented 7 months ago

Version

v1.1.1

Which operating systems have you used?

Environment that reproduces the issue

Using version 1.1.3 actually.

On iOS 17 Iphone 14 pro

Is it reproducible in the example application?

Not tested

RTMP Server

rtmp://global-live.mux.com:5222/app/streamKey

Reproduction steps

  1. init a basic controller as shown below

ApiVideoLiveStreamController initLiveStreamController() { print("Initializing live stream controller"); return ApiVideoLiveStreamController( initialAudioConfig: AudioConfig(), initialVideoConfig: VideoConfig.withDefaultBitrate(), initialCameraPosition: CameraPosition.front, onConnectionSuccess: () { print("Connected to live stream"); }, onConnectionFailed: (error) { print("Connection failed: $error"); appToastView(title: "Connection Failed - $error"); isStreaming.value = false; }, onError: (error) { print("Error Failed - $error"); appToastView(title: "Error - $error"); isStreaming.value = false; }, onDisconnection: () { appToastView(title: "Disconnected"); isStreaming.value = false; }); }

basic setup in my GetxController

`controller.value?.initialize().onError((error, stackTrace) { print('Start Streaming error: $error'); appToastView(title: "Streaming Error: $error"); });

// Listen to stream
stream.listen((currentStream) {
  if (currentStream != null && !isStreaming.value) {
    if (controller.value != null &&
        (controller.value?.isInitialized ?? false)) {
      isStreaming.value = true;
      startVideoStreaming(controller.value);
    }
  }
});

controller.value?.addEventsListener(eventListener);`

var eventListener = ApiVideoLiveStreamEventsListener( onConnectionSuccess: () => print("Connection successful"), onConnectionFailed: (error) => print("Connection failed: $error"), onError: (error) => print("On error: $error"), onDisconnection: () => print("On disconnection"), );

and then my start video streaming

`void startVideoStreaming(ApiVideoLiveStreamController? c) async { final ApiVideoLiveStreamController? controller = c;

if (controller == null) {
  print("You must create a controller");
  return;
}

print(
    "Start video streaming: ${stream.value!.video!.streamKey}, ${MuxService.streamBaseURL}");
try {
  await controller.startStreaming(
      streamKey: stream.value!.video!.streamKey,
      url: MuxService.streamBaseURL);

  startTimer();
  Wakelock.enable();
} catch (error) {
  print('Start Streaming error: $error');
  appToastView(title: "Start Streaming: $error");
}

}`

Expected result

The player successfully starts live streaming - broadcasting to mux for other users to watch.

Actual result

Camera preview working, however my mux stream has no data being sent to it.

Getting: flutter: MissingPluginException(No implementation found for method getVideoSize on channel video.api.livestream/controller) flutter:

0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:308:7)

#1 ApiVideoMobileLiveStreamPlatform.getVideoSize (package:apivideo_live_stream/src/apivideo_live_stream_mobile_platform.dart:99:9) in my terminal. ### Additional context Flutter 3.13.7 • channel stable • https://github.com/flutter/flutter.git Framework • revision 2f708eb839 (8 weeks ago) • 2023-10-09 09:58:08 -0500 Engine • revision a794cf2681 Tools • Dart 3.1.3 • DevTools 2.25.0 Package Version: 1.1.3 ### Relevant logs output ```shell flutter: Initializing live stream controller flutter: ----------------FIREBASE CRASHLYTICS---------------- flutter: MissingPluginException(No implementation found for method getVideoSize on channel video.api.livestream/controller) flutter: #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:308:7) #1 ApiVideoMobileLiveStreamPlatform.getVideoSize (package:apivideo_live_stream/src/apivideo_live_stream_mobile_platform.dart:99:9) flutter: ---------------------------------------------------- ```
ThibaultBee commented 7 months ago

Hi,

This has already been fixed in the main branch but it has not been released yet. I guess that why you closed it. I don't remember why I did not release. Do you need this release?

LucaJeevanjee commented 7 months ago

Hi,

This has already been fixed in the main branch but it has not been released yet. I guess that why you closed it.

I don't remember why I did not release. Do you need this release?

Hi, just found the error to be the order I was applying my functions. I'm having another error overall with connection but I don't know if it's the package

coryswainston commented 5 months ago

Hi, just found the error to be the order I was applying my functions. I'm having another error overall with connection but I don't know if it's the package

@LucaJeevanjee can you expand on what change you made to resolve the issue? I'm encountering the same thing.