nativescript-videoplayer icon indicating copy to clipboard operation
nativescript-videoplayer copied to clipboard

Event listeners for javascript

Open joeynylund opened this issue 5 years ago • 3 comments

Can't for the life of me get the event listeners working for Javascript. Anyone have a working code example they can share? Thanks

joeynylund avatar Apr 04 '19 13:04 joeynylund

same issue in nativescript-vue

robertoandres24 avatar Apr 12 '19 12:04 robertoandres24

As well. NS Core, JS

delanick avatar Sep 27 '19 20:09 delanick

i think the ticket can be closed now after 2 years ;)

  function pageLoaded(args) {
    //needed so that view is scrollable, even if keyboard is visible
    let page = args.object;
    try {
      const video = page.getViewById("nativeVideoPlayer");
      video.on(Video.currentTimeUpdatedEvent, (ev) => {
        if (ev.position >= 4500 && highlightText == 1) {
          highlightText = 2;
        } else if (ev.position < 4500 && highlightText != 1) {
          highlightText = 1;
        }
      });
    } catch (err) {
      console.log(err);
    }
  }

eikaramba avatar Feb 10 '22 18:02 eikaramba