shiyiya / oplayer

:zap: Another HTM5 video player.

Home Page:https://oplayer.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Videos played by this player are being blocked by adblocker

nadecancode opened this issue · comments

commented

For example, uBlockOrigin blocks the video from this link https://enime.moe/watch/vermeil-in-gold/10 and it throws UNKNOWN_ERROR . However, other players like https://github.com/zhw2590582/ArtPlayer don't trigger the block with exactly same video link and HLS.

commented

Please provide the error and try to print the error.

player.on((type, payload) => {
  if (type.indexOf('error')) {
    console.log(payload)
  }
})
commented

Please provide the error and try to print the error.

player.on((type, payload) => {
  if (type.indexOf('error')) {
    console.log(payload)
  }
})

I added logging to that page, it should log errors now. I don't know why but it looks like non-errors are also getting logged even there's type.indexOf('error')

commented
player.on(({ type, payload }) => {
  if (type.indexOf('error') != -1) {
    console.log(payload)
  }
})
commented
player.on(({type, payload}) => {
  if (type.indexOf('error')) {
    console.log(payload)
  }
})

I added this player.on(({ type, payload }) => { if (type?.indexOf('error')) { console.log(payload) } }) and it still logs like everything

EDIT: nvm I forgot the -1

commented

image

This is the error

commented

@shiyiya Update: I just realized oplayer sets default preload attribute to "auto" which some adlockers kinda hate it cuz it means ads. I changed it to metadata and it seems to no longer block.

commented

🤯

commented

🤯

I think it's better to make OPlayer default to metadata for preload to avoid further issues