Comments (4)
Has there been any progress on supporting steaming?
from ableplayer.
@terrill
Any updates made in this front?
from ableplayer.
+1 for adding HLS format, please.
from ableplayer.
It's a bit hacky, but I was able to make it work using hls.js.
When you determine the source url for your stream, you have to enable Hls only after AblePlayer has finished loading. I have to use the data-able-player
tag due to forces outside of my control. I couldn't find an event I could use to trigger the time to setup Hls, so I ended up just waiting 1 second at a time. (Yes, very hacky) But this will load the hls javascript without it already being in the html document, too.
const myVideo = {video element};
const streamSrc = "https://something.com/path/to/a.m3u8";
async function waitForAblePlayerLoad() {
let count = 0;
const waitFor = delay => new Promise(resolve => setTimeout(resolve, delay));
const frameDelay = () => new Promise(resolve => requestAnimationFrame(resolve));
let foundPlayer = null;
do {
await waitFor(1000);
//await frameDelay();
AblePlayerInstances.forEach(player => {
if (player.media == myVideo) {
foundPlayer = player;
}
});
count++;
//console.log(count);
if (count > 20) {
// just in case we don't want to wait forever
throw new Error("Timeout: AblePlayer not created after 20 seconds... should not happen");
break;
}
} while (foundPlayer == null || !foundPlayer.playerCreated);
if (hlsScriptTagPromise == null) {
hlsScriptTagPromise = new Promise((resolve) => {
var hlsScriptTag = document.createElement('script');
hlsScriptTag.onload = () => {
resolve();
};
hlsScriptTag.src = "https://cdn.jsdelivr.net/npm/hls.js@latest";
const firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode?.insertBefore(hlsScriptTag, firstScriptTag);
});
}
await hlsScriptTagPromise;
if (Hls.isSupported()) {
var hls = new Hls();
//console.log(hls);
hls.loadSource(streamSrc);
hls.attachMedia(myVideo);
}
}
waitForAblePlayerLoad();
from ableplayer.
Related Issues (20)
- Want to open another layer instead of modal for settings HOT 2
- Pause in Playlist HOT 4
- All JQuery click events are unbind on init of speech description HOT 2
- On small display areas the big play button makes interacting with controls difficult HOT 1
- Modify playlist after page loading
- New feature request: add a stop time for audio and video players
- Preference Changes Require Screen Refresh (w Multiple Viewers) HOT 4
- YouTube Embed Issue with Version 4.5.0 - Incorrect Video Duration Display
- Scroll to top issue on fullscreen exit , if multiple video able player are there in the same page
- aria-atomic missing when aria-live=assertive is used
- Full screen toggle named incorrectly
- A way to easily proof read translation/check its accuracy HOT 1
- Feature request: Toggle between primary video and ASL video
- Unexpected Behavior - Descriptions Button with Multiple Viewers on Page HOT 1
- Italics/Bold tags cause unwanted transcript line breaks in `data-lyrics-mode`
- translation ca.js do not loading
- Able Player not loading within shadow root element
- Word limit of transcript
- Compatible with tiktok?
- Accessibility Issue: VoiceOver keep saying "Close" when YouTube video is used HOT 5
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 ableplayer.