Skip to content

Issue when enabling autoplay and live #8

Description

@fahmih6

Hi. i'm experiencing an issue when enabling Autoplay and Live option.
here is the error message.

[38;5;248m════════ Exception caught by widgets library ═══════════════════════════════════[39;49m
[38;5;244mThe following NoSuchMethodError was thrown building Positioned(left: 0.0, right: 0.0, bottom: 0.0):[39;49m
The method 'addListener' was called on null.
Receiver: null
Tried calling: addListener(Closure: () => Null)

[38;5;244mThe relevant error-causing widget was[39;49m
    [38;5;248mNeekoPlayerWidget[39;49m
[38;5;244mWhen the exception was thrown, this was the stack[39;49m
[38;5;244m#0      Object.noSuchMethod  (dart:core-patch/object_patch.dart:53:5)[39;49m
[38;5;248m#1      _LiveBottomBarState._attachListenerToController[39;49m
[38;5;248m#2      _LiveBottomBarState.initState[39;49m
[38;5;244m#3      StatefulElement._firstBuild[39;49m
[38;5;244m#4      ComponentElement.mount[39;49m
[38;5;244m...[39;49m
[38;5;248m════════════════════════════════════════════════════════════════════════════════[39;49m

[38;5;248m════════ Exception caught by widgets library ═══════════════════════════════════[39;49m
The method 'addListener' was called on null.
Receiver: null
Tried calling: addListener(Closure: () => Null)
[38;5;244mThe relevant error-causing widget was[39;49m
    [38;5;248mNeekoPlayerWidget[39;49m
[38;5;248m════════════════════════════════════════════════════════════════════════════════[39;49m

[38;5;248m════════ Exception caught by widgets library ═══════════════════════════════════[39;49m
The method 'addListener' was called on null.
Receiver: null
Tried calling: addListener(Closure: () => Null)
[38;5;244mThe relevant error-causing widget was[39;49m
    [38;5;248mNeekoPlayerWidget[39;49m
[38;5;248m════════════════════════════════════════════════════════════════════════════════[39;49m

[38;5;248m════════ Exception caught by widgets library ═══════════════════════════════════[39;49m
The method 'addListener' was called on null.
Receiver: null
Tried calling: addListener(Closure: () => Null)
[38;5;244mThe relevant error-causing widget was[39;49m
    [38;5;248mNeekoPlayerWidget[39;49m
[38;5;248m════════════════════════════════════════════════════════════════════════════════[39;49m

Here is my code :

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:neeko/neeko.dart';
import 'package:flutter/foundation.dart';

class PlayerPage extends StatefulWidget {
  PlayerPage({Key key, @required this.url, @required this.title})
      : super(key: key);

  final String url;
  final String title;

  @override
  _PlayerPageState createState() => _PlayerPageState();
}

class _PlayerPageState extends State<PlayerPage> {
  VideoControllerWrapper videoControllerWrapper;

  @override
  void initState() {
    super.initState();
    videoControllerWrapper = VideoControllerWrapper(
        DataSource.network(widget.url, displayName: widget.title));
    SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.top]);
  }

  @override
  void dispose() {
    SystemChrome.restoreSystemUIOverlays();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: NeekoPlayerWidget(
        playerOptions: NeekoPlayerOptions(autoPlay: true, isLive: true),
        videoControllerWrapper: videoControllerWrapper,
      ),
    );
  }
}

The player's works perfectly if i set the autoplay and live to false tho.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions