Comments (6)
I created a new class called CastMediaPlus
. I read the official Google docs and implemented several new features. Here is an implementation of the class.
import 'package:dart_chromecast/casting/cast_media.dart';
class CastMediaPlus extends CastMedia {
final String contentId;
String title;
String subtitle;
String artist;
String composer;
bool autoPlay = true;
double position;
String contentType;
List<String> images;
CastMediaPlus({
this.contentId,
this.title,
this.subtitle,
this.artist,
this.composer,
this.autoPlay = true,
this.position = 0.0,
this.contentType = 'video/mp4',
this.images,
}) {
if (null == images) {
images = [];
}
}
Map toChromeCastMap() {
return {
'type': 'LOAD',
'autoPlay': autoPlay,
'currentTime': position,
'activeTracks': [],
'media': {
'contentId': contentId,
'contentType': contentType,
'images': images.map((image) {
return {
'url': image,
};
}).toList(),
'title': title,
'streamType': 'BUFFERED',
'metadata': {
'metadataType': 3,
'title': title,
'albumName': subtitle,
'artist': artist,
'composer': composer,
'images': images.map((image) {
return {
'url': image,
};
}).toList(),
}
}
};
}
}
Now, you can use CastMediaPlus
in place of CastMedia
.
CastMediaPlus cmp = CastMediaPlus(
title: "My title",
subtitle: "My subtitle",
artist: "Artist's name",
composer: "Composer's name",
contentId: "URL to the audio file",
images: ["URL to the cover image"],
contentType: 'audio/mp4',
);
Hope it helps. I wanted to release my own version of the plugin but I am kind of too busy to do it right now.
from flutter_chromecast_example.
Found the workaround.
from flutter_chromecast_example.
@samarthagarwal Hi, I am having the same problem, how were you able to you get around this issue?
from flutter_chromecast_example.
You are a life saver :)
from flutter_chromecast_example.
@samarthagarwal thanks for the details on showing images. Can you pls point me to the documentation you used. I am trying to change playback speed on the cast audio. Not sure where to start or if it's even possible. Do you have any idea about this?
from flutter_chromecast_example.
Hope it helps. I wanted to release my own version of the plugin but I am kind of too busy to do it right now.
Would be way more helpful if you'd create a pull request for this repo instead of creating yet another version of this plugin. Since you already have everything working that shouldn't be that much work.
from flutter_chromecast_example.
Related Issues (13)
- Update plugin HOT 1
- Supporting playback of video files in local storage HOT 1
- Disconnect not working HOT 2
- Cast Image HOT 2
- Updated Example
- Cannot run with Flutter 0.11.3 HOT 5
- The getter 'host' isn't defined for the class 'ServiceInfo' HOT 4
- Can't discover chromecast devices HOT 3
- Example crashing in Android Simulator -- UiThread Method called outside of main thread -- in Native code HOT 6
- EXCEPTION CAUGHT BY IMAGE RESOURCE SERVICE HOT 1
- Unable to resolve dep version requirements HOT 1
- Errors on build attempt - AAPT HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_chromecast_example.