daily_motion_player_flutter_interface 0.0.1 copy "daily_motion_player_flutter_interface: ^0.0.1" to clipboard
daily_motion_player_flutter_interface: ^0.0.1 copied to clipboard

A Flutter Package for Dailymotion native iOS & Android SDK integration

example/lib/main.dart

import 'dart:io';
import 'dart:math';

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


void main() {
  runApp(const MyApp());
}

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  late String id;

  @override
  void initState() {
    super.initState();
    id = _generateRandomString(4);
    print("code $id");
  }

  String _generateRandomString(int length) {
    const chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
    final rnd = Random();
    return String.fromCharCodes(
      Iterable.generate(length, (_) => chars.codeUnitAt(rnd.nextInt(chars.length))),
    );
  }

  @override
  Widget build(BuildContext context) {
    final controller = DailymotionPlayerController(
      videoId: "x9czhlw", // put a real videoId
      playerId: "xqzrc",
      channelName: Platform.isIOS ?  'dailymotion-player-channel' : 'dailymotion-player-channel-$id', // your own ID
    );

    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Dailymotion Player Example')),
        body: Center(
          child: RawDailymotionPlayerWidget(
            controller: controller,
            height: 200,
            width: 350,
          ),
        ),
        floatingActionButton: FloatingActionButton(onPressed: (){
          controller.setMute();
        }),
      ),
    );
  }
}
1
likes
140
points
15
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter Package for Dailymotion native iOS & Android SDK integration

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on daily_motion_player_flutter_interface

Packages that implement daily_motion_player_flutter_interface