Comments (4)
Hi @theraw
As @PooriaN already mentioned, it is possible to pass a percentage to timeOffset
, just like you did in your example.
To show the visual cues, however, you should modify the detectTimeOffset()
function from the ui-visual-cues-midroll
example a bit (this currently only draws cues for seconds, 'start', and 'end'). This can be done in the following way:
function detectTimeOffset() {
if (adsPresent) {
var t = 0;
for (var ad of player.source.ads) {
to[t] =
ad.timeOffset == undefined
? 0
: ad.timeOffset == "start"
? 0
: isNaN(ad.timeOffset) && ad.timeOffset != "end"
? (parseFloat(ad.timeOffset.replace("%", "")) / 100) *
player.duration
: ad.timeOffset;
t++;
}
}
}
from samples-html5-sdk.
@TimLeenaers that's working perfectly thank you
@PooriaN thank you
from samples-html5-sdk.
Hi @theraw,
Thank you for your question, this function is definitely possible, you can check out this example:
https://codesandbox.io/embed/github/THEOplayer/samples-web/tree/master/?fontsize=14&hidenavigation=1&theme=dark
from samples-html5-sdk.
hello @PooriaN
i'm trying to look over demos but i can't find the one where is used a timeOffset with percentage, can you please tell me the name which one is it?!
from samples-html5-sdk.
Related Issues (14)
- display player fully on page HOT 1
- Fallback/Alternate Stream HOT 1
- Prevent play event if no source is setted HOT 3
- Event for quality change HOT 3
- Reasons for "There appears to be a playback issue". HOT 8
- Show upnext bar on pause HOT 2
- Sample Code for 360 Demo does not work as expected HOT 1
- how do i set retry timer? HOT 1
- MPD AdaptationSet format issue HOT 1
- Can't make an AES-128 stream (Azure Media Services) work with THEOPlayer
- Impossible to start theoplayer because 'Player' is not exported by 'THEOplayer.js'
- how to enable withcredentials for sending local cookies to server?
- Seek player programmatically 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 samples-html5-sdk.