New Media Processor is Running

  • 🏰 The Fediverse is up. If you know, you know.
  • Want to keep track of this thread?
    Accounts can bookmark posts, watch threads for updates, and jump back to where you stopped reading.
    Create account
Not sure if there's anything that you can do about it, but a bothersome thing I'm finding about the new video player is that you can't see the total duration of the video until you start playing to get the player's full UI. The old player, on the other hand, always shows the duration when it's not playing:
1778694907570.png

This makes a big difference in the browsing experience. When scrolling through pages (especially quickly to catch up on a long thread), it's very useful to be immediately informed on whether any embedded video is a quick seconds-long clip or a feature-length film.

Comparatively, it's very common to see video thumbnails and players elsewhere display the video duration without any interaction, including on YouTube.
 
A bit of video subtitle sperging:
  • How is the subtitle toggle setting saved? Is it saved to the KF account so it works across devices and sessions or is it just local cookies? I browse KF in a private window across devices and the subtitles always seem to pop up, blocking a good portion of the screen when the video is embedded and not fullscreened. This is a minor annoyance as more often than not I do not need them. Maybe make them an opt in feature instead of on by default. Video player sticky settings like contrast, subtitles, playback speed etc could be put in the KF account page or something idk.
  • Do the subtitles have the capability to translate non-English languages back into English or do they exclusively work for Eng videos and then translate to other languages. It would be handy if I could see what the people in videos from USPG2 or the Iran/US war thread are saying.
  • A potential useful feature might be to get a linked plaintext transcription of uploaded videos that could be pasted below the video. Then I would not need to suffer through long boring speeches or have to listen to troon accents or third world jeetspeak.
 
How is the subtitle toggle setting saved? Is it saved to the KF account so it works across devices and sessions or is it just local cookies? I browse KF in a private window across devices and the subtitles always seem to pop up, blocking a good portion of the screen when the video is embedded and not fullscreened. This is a minor annoyance as more often than not I do not need them. Maybe make them an opt in feature instead of on by default. Video player sticky settings like contrast, subtitles, playback speed etc could be put in the KF account page or something idk.
To add to this, I think if it is stored in cookies, it is only read on initial load. So for example if you have a browsing habit like I do which is to load watched threads, and then run down the ones you're interested in clicking open in new tab, turning the subtitles off in the first you read is already too late because the other tabs have already read "subtitles" on when they loaded. So you have to either remember this and set it to off (like you, I am having to do this each time I open the site) before opening your extra tabs; or turn if off for every tab.

I really don't know who it is useful to that it should be on by default. My own comment on it last page:
1778716480751.png
 
Since my user script broke (the data-fallback parameter was removed, which seems to have broken downloads as well), I whipped my computer slaves to fix it, and then rewrote most of it myself since they're all retarded.

So in case anyone else has issues with the new player and can't be bothered to poke their local LLM:

JavaScript:
// ==UserScript==
// @name         Ephyra Player → Native Video
// @namespace    https://github.com/local/userscripts
// @version      1.0.0
// @description  Replaces Ephyra custom video players with plain <video> elements using hls.js.
// @author       you
// @match        *://kiwifarms.st/*
// @run-at       document-body
// @grant        none
// @require      https://cdn.jsdelivr.net/npm/hls.js@1.6.16/dist/hls.min.js
// ==/UserScript==

console.assert(Hls.isSupported());

const playM3u8 = (video, src) => {
  console.log('playing', src, 'on', video);
  if (video.hls) {
    console.log('already has wrapper');
    video.hls.loadSource(src);
    return;
  }
  const hls = new Hls({enableWorker:false, debug: false});
  hls.on(Hls.Events.ERROR, (event, data) => {
    if (!data.fatal) {
      console.warn('unhandled error encountered', event, data);
      return;
    }
    switch (data.type) {
    case Hls.ErrorTypes.MEDIA_ERROR:
      console.warn('fatal media error encountered, try to recover');
      hls.recoverMediaError();
      break;
    case Hls.ErrorTypes.NETWORK_ERROR:
      console.error('fatal network error encountered', data);
      // All retries and media options have been exhausted.
      // Immediately trying to restart loading could cause loop loading.
      // Consider modifying loading policies to best fit your asset and network
      // conditions (manifestLoadPolicy, playlistLoadPolicy, fragLoadPolicy).
      break;
    default:
      console.error('unrecoverable error encountered', event, data);
      // cannot recover
      if (video?.hls === hls) delete video.hls;
      hls.destroy();
      break;
    }
  });
  video.hls = hls;
  hls.loadSource(src);
  hls.attachMedia(video);

};

(function () {
  'use strict';


  /**
   * Replace a single .ephyra-player element with a native <video>.
   * @param {HTMLElement} player
   */
  const replacePlayer = player => {
    const manifest = player.dataset.manifest;
    if (!manifest) return;

    const poster   = player.dataset.poster      || '';
    const width    = player.dataset.width        || '560';
    const height   = player.dataset.height       || '315';

    const video = document.createElement('video');
    video.controls = true;
    if (poster) video.poster = poster;

    // Preserve the original player's layout constraints
    video.style.cssText = player.style.cssText;
    // Make sure the element itself fills available space
    video.style.display    = 'block';
    video.style.maxWidth   = '100%';
    video.style.background = '#000';

    player.replaceWith(video);
    playM3u8(video, manifest);
    console.debug('[ephyra→video] replaced', player.id || player, '→', manifest);
  }

  const selector = '.ephyra-player[data-manifest]';

  /** Replace every Ephyra player currently in the DOM. */
  const replaceAll = () => {
    const players = document.querySelectorAll(selector);
    players.forEach(replacePlayer);
    return players.length > 0;
  }

  // Run immediately on existing players
  if (replaceAll()) return;
  console.log('player not found, installing obeserver');
  // Also watch for players injected after page load (infinite scroll, XHR, etc.)
  const observer = new MutationObserver(mutations => {
    for (const { addedNodes } of mutations) {
      for (const node of addedNodes) {
        if (!(node instanceof Element)) continue;
        // The node itself might be the player
        if (node.matches(selector)) {
          replacePlayer(node);
          continue;
        }
        // Or it might contain players
        node.querySelectorAll?.(selector).forEach(replacePlayer);
      }
    }
  });

  observer.observe(document.body, { childList: true, subtree: true });
})();

(assuming you're using a competent userscript manager like violentmonkey, the @require scripts are downloaded once and cached/persisted, and then concatenated with the userscript, so it doesn't add a new external script to every page load, nor should it leak to anyone that you're visiting teh evil kiwi farms.)
 
Last edited:
Can't download videos anymore. Null should stop trying to fix something that isn't broken.
 
Can't download videos anymore. Null should stop trying to fix something that isn't broken.
Eh, videos have been pretty bad for a long time, and the new m3u8 stuff is much faster. I can actually play random videos on the site instantly (including seeking), without having to get a coffee while it buffers.

(The only issue for me is the custom interface, but I'm also someone who thinks Motif and CDE were the peak of UX and design. And it was very straightforward to write a userscript to use a plain <video> element with nice and familiar controls.)
 
Unfortunately it seems like a hash (possibly of the file content, it's the right format for md5) is part of the path for the original video files on uploads.kiwifarms.st, so it isn't straightforward to reconstruct the URLs in yet another usercript (the other parts of the URL are preserved in attributes it seems, though).
 
Unfortunately it seems like a hash (possibly of the file content, it's the right format for md5) is part of the path for the original video files on uploads.kiwifarms.st, so it isn't straightforward to reconstruct the URLs in yet another usercript (the other parts of the URL are preserved in attributes it seems, though).
Yes, this is the entire fucking point of the fucking system!!!!
 
Is my computer retarded or are these video durations being printed under all your own videos now
1778786422480.png
 
Unfortunately it seems like a hash (possibly of the file content, it's the right format for md5) is part of the path for the original video files on uploads.kiwifarms.st, so it isn't straightforward to reconstruct the URLs in yet another usercript (the other parts of the URL are preserved in attributes it seems, though).
You can also access the original video files through the xenforo attachment path
Example:
 
Is my computer retarded or are these video durations being printed under all your own videos now
can you LINk the FUCKING VIDEO so I can check myself if it's hardcoded!?

I don't understand why people can't take 10 seconds to give me additional information so I can give them what they're fucking asking for!
 
can you LINk the FUCKING VIDEO so I can check myself if it's hardcoded!?

I don't understand why people can't take 10 seconds to give me additional information so I can give them what they're fucking asking for!
I see it for every video using the new player as of today
1778787288542.png
Firefox 150.0.3 (64-bit), no js stuff or tampermonkey anything

Edge works, I see where the duration is meant to be
1778787601052.png
Chrome also seems fine
1778787728920.png
 
Last edited:
Back
Top Bottom