Skip to content

Video not playing #27

@Chaaang

Description

@Chaaang

Hello, I tried using your package and its now working on my end. No errors on the code, the link is working.
I use the correct version based on my flutter version.

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

class VideoScreen extends StatefulWidget {
const VideoScreen({super.key});

@OverRide
State createState() => _VideoScreenState();
}

class _VideoScreenState extends State {
Video360Controller? controller;

String durationText = '';
String totalText = '';

@OverRide
void initState() {
super.initState();
}

@OverRide
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Video 360 Plugin example app'),
),
body: Stack(
children: [
Center(
child: SizedBox(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
child: Video360View(
url:
'https://codetricity.github.io/flutter_video_display/ageda.MP4',
onVideo360ViewCreated: _onVideo360ViewCreated,
onPlayInfo: (Video360PlayInfo info) {
setState(() {
durationText = info.duration.toString();
totalText = info.total.toString();
});
},
),
),
),
Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
MaterialButton(
onPressed: () {
controller?.play();
},
color: Colors.grey[100],
child: const Text('Play'),
),
MaterialButton(
onPressed: () {
controller?.stop();
},
color: Colors.grey[100],
child: const Text('Stop'),
),
MaterialButton(
onPressed: () {
controller?.reset();
},
color: Colors.grey[100],
child: const Text('Reset'),
),
MaterialButton(
onPressed: () {
controller?.jumpTo(80000);
},
color: Colors.grey[100],
child: const Text('1:20'),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
MaterialButton(
onPressed: () {
controller?.seekTo(-2000);
},
color: Colors.grey[100],
child: const Text('<<'),
),
MaterialButton(
onPressed: () {
controller?.seekTo(2000);
},
color: Colors.grey[100],
child: const Text('>>'),
),
Flexible(
child: MaterialButton(
onPressed: () {},
color: Colors.grey[100],
child: Text('$durationText / $totalText'),
),
),
],
)
],
)
],
),
);
}

void _onVideo360ViewCreated(Video360Controller controller) {
this.controller = controller;
this.controller?.play();
}
}

Image

Image

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions