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

setVolume not working at all #376

Open
MazenxELGayar opened this issue Aug 6, 2023 · 0 comments
Open

setVolume not working at all #376

MazenxELGayar opened this issue Aug 6, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@MazenxELGayar
Copy link

player.setVolume(0.1); not working, it just set the slider to 10% but the volume is still a 100%, sometimes it works, sometimes it doesn't, sometimes i have to keep repeating the function by putting it in build of the stateful widget so it keeps on rebuilding and repeating it until it works but this makes me unable to change the volume at all.


import 'dart:io';

import 'package:dart_vlc/dart_vlc.dart';
import 'package:flutter/material.dart';


class VideoPlayer extends StatefulWidget {
  @override
  _VideoPlayerState createState() => _VideoPlayerState();
}

class _VideoPlayerState extends State<VideoPlayer> {
  late Player player;
  bool isPlaying = false;

  @override
  void initState() {
    super.initState();
    player = Player(id: 0);
    player.open(
      Media.file(File(r"I:\F.r.i.e.n.d.s\[EgyBest].Friends.The.Reunion.2021.WEB-DL.1080p.x264.mp4")),
    );
    player.playbackStream.listen((event) {
      setState(() {
        isPlaying = event.isPlaying;
      });
    });
    player.setVolume(0.1);

  }

  @override
  void dispose() {
    player.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {


    return Video(
      player: player,
      height: MediaQuery.of(context).size.height,
      width: MediaQuery.of(context).size.width,
    );
  }
}
@MazenxELGayar MazenxELGayar added the bug Something isn't working label Aug 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant