Comments (23)
Can you send me a URL to check this please?
from mediaelement-plugins.
https://jsfiddle.net/Luuwnjfm/1/
from mediaelement-plugins.
It can only be one sender per page; I implemented something that might help you:
https://jsfiddle.net/Luuwnjfm/6/
Let me know your thoughts; otherwise, you might need to reach Chromecast directly, since I couldn't find any documentation about this, other than the fact there should be only one instance of the player per page
from mediaelement-plugins.
Can use that
But I Think this will be a recurring issue among others so I think it would be best if built in to the plugin
from mediaelement-plugins.
Please download the master branch; I was able to put a restriction so only one sender per page is now allow and you can use https://jsfiddle.net/Luuwnjfm/1/ without any hacks. Let me know
from mediaelement-plugins.
Works
from mediaelement-plugins.
I'm glad it worked for you
from mediaelement-plugins.
Hmm, didn't work where we'll
The Chromecast don't appear after I set a video source. And the check for the button makes it never appear cuz it's always true?
from mediaelement-plugins.
I'll check this on your scenario; do you have a fiddle that I can use for testing scenario?
from mediaelement-plugins.
If you get this fiddle to work without modification then i think you have solved both my Chromecast bugs
- The video source should be possible to set after you have initiated a MediaElementPlayer and you got yourself a visible ChromeCast icon
- The google-cast-button shouldn't throw an error when initiating a new MediaElementPlayer on the same page more then once
(as you can see console.log(document.createElement('google-cast-button').constructor === HTMLElement)
prints true, which makes the script to bail out early
from mediaelement-plugins.
@jimmywarting Can you try this Fiddle and check if that solves your issues? https://jsfiddle.net/Luuwnjfm/8/
from mediaelement-plugins.
Any updates on this?
from mediaelement-plugins.
The chromecast isn't available after I set a source
from mediaelement-plugins.
Hmmm I'll take a look at this again. It was working for me before
from mediaelement-plugins.
maybe that isn't the problem. document.createElement('x-y').constructor === HTMLElement
is always equal to true
(as you can see console.log(document.createElement('google-cast-button').constructor === HTMLElement) prints true, which makes the script to bail out early
which makes this code return early without building the cast button
from mediaelement-plugins.
Hmmmm yeah I need to research how to check if the button has been truly registered, because I thought that would be enough. I'll keep you posted
from mediaelement-plugins.
@jimmywarting OK I think I finally got it; I added a new Fiddle so you can see the end result. Dealing with Chromecast is a little complicated so I'll be thinking in a better way to do this but for now you should get everything fine: https://jsfiddle.net/Luuwnjfm/13/. Let me know
from mediaelement-plugins.
@jimmywarting I have refactor MediaElement to integrate Chromecast inside the player and not as a plugin. If you can help me testing this, please test this Fiddle so it can be part of the next release: https://jsfiddle.net/Luuwnjfm/18/
from mediaelement-plugins.
FYI i have completed more work to enable errors properly on the player UI but that should affect your testing. Keep me posted since I'm planning to release this week
from mediaelement-plugins.
@jimmywarting I have 2 new branches (one for the player and one for the plugins) named the same: mejs-new
. Please test Chromecast using them by enabling the chromecast
feature inside your player's configuration:
features: ['playpause', 'current', 'progress', 'duration', 'speed', 'volume', 'chromecast']
**You will need to include chromecast.min.js ** after the MediaElement
library, and also the chromecast.min.css stylesheet:
These new branches had addressed many issues in terms of integrating properly Chromecast and achieved the dual-nature of Chromecast and MediaElement, and had integrated all the fixes that will go for the next release. Please let me know your findings. Thanks again for testing this.
from mediaelement-plugins.
@rafa8626 Thanks for your work. Testing your new code. I'm getting following tag for chromecast button <button type="button" is="google-cast-button" aria-controls="mep_0" title="Chromecast" aria-label="Chromecast" tabindex="0" style="display: none;"></button>
style="display: none;" cause cast button to disappear. once it's removed rest works fine.
from mediaelement-plugins.
The display: none
remains there to make sure the Cast is found or not. It shouldn't be hidden once Cast is detected. Is that your scenario? I merged the mejs-new
branch into master.
from mediaelement-plugins.
Closing this issue since all issues related to Chromecast have been discussed and addressed on mediaelement/mediaelement#2273
from mediaelement-plugins.
Related Issues (20)
- mediaelementjs marker plugins not working with youtube link or embed HOT 1
- how do i add a subtitle in a11y plugin HOT 1
- Picture-in-Picture plugin isn't build like other plugins ? HOT 1
- Add audio track switcher HOT 1
- Picture-in-Picture don't work when Player is load m3u8 LiveBroadcast
- Quality plugin plays mp4 first by default (2nd <source>) and only switches source once. HOT 2
- Error on building Player using playlist plugin on safari
- Quality switch doesn't work with m3u8 file HOT 1
- Audio description in a11y not working for external YouTube videos
- End behavior differs depending on during-play action
- Broken Controls display
- Timeslider disappearing with individual settings
- Audio file storage
- mediaelement Web site problems HOT 1
- Help in Ads plugin to run on specific event HOT 10
- Player SBS, TaB (3D) to anaglyph or VR
- Playlist plugin fails at the end of playlist run
- Playlist fails to play next audio after first ends HOT 1
- Change color of audio player
- HLS Quality Selection
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 mediaelement-plugins.