A simple DLNA DMC library implemented by Dart.

Overview

DLNA-Dart

A simple DLNA DMC library implemented by Dart.
It is tiny and only the basic network video casting function is supported.

Structure

structure

Flutter Demo

Flutter-DLNA

Usage

Android Manifest.xml

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />

Pub

https://pub.dev/packages/dlna

Import

import 'package:dlna/dlna.dart';

Start search

var dlnaManager = DLNAManager();
dlnaManager.setRefresher(DeviceRefresher(onDeviceAdd: (dlnaDevice) {
    print('add ' + dlnaDevice.toString());
}, onDeviceRemove: (dlnaDevice) {
    print('remove ' + dlnaDevice.toString());
}, onDeviceUpdate: (dlnaDevice) {
    print('update ' + dlnaDevice.toString());
}, onSearchError: (error) {
    print(error);
}));
dlnaManager.startSearch();

Stop search

dlnaManager.stopSearch();

Send the video url to the device

var videoObject = VideoObject(title, url, VideoObject.VIDEO_MP4);
await dlnaManager.actSetVideoUrl(videoObject);

Release server

dlnaManager.release();

Search Cache

For the quick search, when the device is found, it is saved locally.

dlnaManager.enableCache();
var localDevices = dlnaManager.getLocalDevices();
Comments
  • Get audio data from DLNA device

    Get audio data from DLNA device

    Hello @succlz123 , i just found this cool project because i wanted to create an audio player with flutter. However i'm not really sure where to start, what functionality is missing. If you could give me a headsup what is required, i'd also happily contribute. Thanks

    opened by feliwir 4
  • Content size exceeds specified content length.1091bytes written while expected 1086.

    Content size exceeds specified content length.1091bytes written while expected 1086.

    Snipaste_2020-06-18_15-12-12 当设置title为中文时会报错:Content size exceeds specified content length. 修复这个问题的方法是,在文件 \lib\src\soap\soap_action.dart 的第45行,把 headers.contentLength = content.length ,修·改为 headers.contentLength = utf8.encode(content).length,因为中文字符在 UTF-8 编码后的长度不等于原字符串长度。(1中文字符=2英文字符)


    The error occurs when setting the title to Chinese: Content size exceeds specified content length. The way to fix this problem is to add it to the file \lib\src\soap\soap_action. dart on line 45 and replace headers.contentLength = content.length , amend - to headers. contentLength = utf8.encode(content).length,because the length of Chinese characters after UTF-8 encoding is not equal to the length of the original string. (1 Chinese character = 2 English characters)

    opened by idootop 2
  • ios devices joinMulticast throw error

    ios devices joinMulticast throw error

    Now has error when i search on ios devices. It works as expected on Android.

    OS Error: Can't assign requested address, errno = 49 flutter: #0 _NativeSocket.nativeJoinMulticast (dart:io-patch/socket_patch.dart:1379:56) #1 _NativeSocket.joinMulticast (dart:io-patch/socket_patch.dart:1331:5) #2 _RawDatagramSocket.joinMulticast (dart:io-patch/socket_patch.dart:2127:13) #3 SSDPController.start (package:dlna/src/ssdp/ssdp_controller.dart:89:17) #4 SSDPController.startSearch (package:dlna/src/ssdp/ssdp_controller.dart:143:13) #5 DLNAManager._search (package:dlna/src/dlna_manager.dart:82:27) #6 DLNAManager.startSearch (package:dlna/src/dlna_manager.dart:69:7)

    opened by a582468113 2
  • Is there a way to cast the local file on your phone?

    Is there a way to cast the local file on your phone?

    Hello. I am growing feature that allows users to use the audio for their phone, later by playing music on DLNA applications such as TVs, speakers, etc. Is there any way to do this?

    opened by Hungpv-ashen 1
  • why reusePort?

    why reusePort?

    E/Dart ( 1417): Dart Socket ERROR: ../../third_party/dart/runtime/bin/socket_android.cc:147: reusePort not supported for Android. I/chatty ( 1417): uid=10130(com.orange.lion) 1.ui identical 1 line I/flutter ( 1417): Sending from 0.0.0.0:1900 I/flutter ( 1417): Sending from 127.0.0.1:1900 I/flutter ( 1417): Sending from 192.168.50.12:1900

    opened by yangsk94 4
Owner
Ning
May the stars guide you.
Ning
A Flutter project that implemented getx package and firebase services.

Get X Firebase A Flutter Package that implemented firebase services with getx package. It's free, open source, complete, rapid development package for

Faisal Ramdan 19 Nov 26, 2022
A test for a position as a mobile engineer at the company Phi. (I did not participate in the selection process, I implemented the application for study purposes only)

Phi Bank Aplicativo desenvolvido baseado num teste para o cargo de desenvolvedor mobile na empresa Phi. (Não participei do processo seletivo, implemen

null 1 Dec 1, 2021
Front-end of multiplayer web3 games implemented with Flutter to run on all platforms (Web, Android, iOS, Linux, Window, macOS, TV-OS)

Front-end of multiplayer web3 games implemented with Flutter to run on all platforms (Web, Android, iOS, Linux, Window, macOS, TV-OS)

R-Team 5 Nov 15, 2022
A Dart library for creating a Dart object to represent directory trees.

Directory Tree A Dart library for creating a Dart object to represent directory trees. Getting Started Import and initialize package import 'package:d

Chiziaruhoma Ogbonda 5 Dec 1, 2021
QR.Flutter is a Flutter library for simple and fast QR code rendering via a Widget or custom painter.

QR.Flutter is a Flutter library for simple and fast QR code rendering via a Widget or custom painter. Need help? Please do not submit an issue for a "

Yakka 612 Jan 4, 2023
A type-safe command-line parsing library for Dart

plade Plade is a type-safe CLI parsing library for Dart. Highlights Fully type-safe and null-safe. Support for a variety of different parsing styles (

Ryan Gonzalez 6 Jan 1, 2022
Agent library for Internet Computer, in Dart

agent_dart An agent library built for Internet Computer, a plugin package for dart and flutter apps. Developers can build ones to interact with Dfinit

null 87 Dec 31, 2022
ThingsBoard PE API client library for Dart developers.

ThingsBoard PE API client library for Dart developers. It's compatible with TB PE 3.3.0. Usage A simple usage example: import 'package:thingsboard_pe_

ThingsBoard - Open-source IoT Platform 45 Sep 28, 2022
An equation solving library written purely in Dart.

An equation solving library written purely in Dart Thanks to the equations package you will be able to solve numerical analysis problems with ease. It

Alberto 43 Dec 27, 2022
A Dart library with a solution to use smart enums

Smart Enums Author: Jop Middelkamp A package that can help you create 'smarter' enums that could be extended with some domain logic. Usage final bestF

Jop Middelkamp 2 Oct 1, 2022
A mock library for Dart inspired by mockito

?? mocktail This repository contains mocking libraries for Dart inspired by mockito. package:mocktail A Dart mocking library which simplifies mocking

Felix Angelov 430 Dec 25, 2022
Bosun is a library for building organized command line applications in Dart.

Bosun A library for parsing CLI input and structuring CLI commands Features Structure CLI commands in a nice, uniform fashion. Parse args and flag inf

null 3 Oct 13, 2022
A fast and space efficient library to deal with data in Dart, Flutter and the web.

Dart Data Dart Data is a fast and space efficient library to deal with data in Dart, Flutter and the web. As of today this mostly includes data struct

Lukas Renggli 14 Nov 4, 2022
Dart library with stack blur algorithm for RGBA images

stack_blur The Dart library for blurring images with the Stack blur algorithm. T

Artёm IG 3 Nov 19, 2022
Postgres-conector - A library for connecting to and querying PostgreSQL databases in Dart.

TODO: Put a short description of the package here that helps potential users know whether this package might be useful for them. Features TODO: List w

null 2 Nov 14, 2021
Ethers: A dart library that connects to interact with the Ethereum blockchain and inspired by ethers.js

Ethers For Flutter Ethers is a dart library that connects to interact with the Ethereum blockchain and inspired by ethers.js. Thanks to web3dart which

Hanggi 12 Oct 30, 2022
A simple and easy to use Redis client for Dart

redis_dart A simple and minimalist Redis client for Dart See it in pub: https://pub.dev/packages/redis_dart and GitHub: https://github.com/gabrielpach

Gabriel Pacheco 7 Dec 25, 2022
A simple app to keep track the time you Learn, Playing, Reading, ... in every week. This is also my attempt to teach myself Flutter & Dart

Progressor 0.0.1 Sometime you want to set a target for you weekly, for example: "Reading Book for 8 hours every week". This app helps you to do that.

Son Nguyen Hoang 4 Oct 12, 2022
DChisel is simple Dart Framework for creating REST API

DChisel Dart Framework DChisel is simple Dart Framework for creating REST API Features Custom host server and port GET, POST, PUT, DELETE, PATCH Route

M Nasrul Alawy 23 Jan 6, 2023