You are viewing a potentially older version of this package. View all versions.
ValMedia-OdinOnDemand-1.0.6 icon

OdinOnDemand

Step into Valheim's ultimate media experience with OdinOnDemand - Cinema screens and music players at your command! Watch YouTube and movies, listen to music and more all with your friends!

Date uploaded 7 months ago
Version 1.0.6
Download link ValMedia-OdinOnDemand-1.0.6.zip
Downloads 2497
Dependency string ValMedia-OdinOnDemand-1.0.6

This mod requires the following mods to function

ValheimModding-Jotunn-2.20.2 icon
ValheimModding-Jotunn

Jötunn (/ˈjɔːtʊn/, 'giant'), the Valheim Library was created with the goal of making the lives of mod developers easier. It enables you to create mods for Valheim using an abstracted API so you can focus on the actual content creation.

Preferred version: 2.20.2
ValMedia-OOD_LIB-1.0.1 icon
ValMedia-OOD_LIB

Support libraries for OdinOnDemand

Preferred version: 1.0.1

README

Introducing OdinOnDemand 1.0: The Ultimate Media Experience for Valheim!

OdinOnDemand (OOD) adds tons of unique mediaplayers to Valheim that allow you to watch YouTube, direct video files, listen to Soundcloud, music, and dynamic radio stations all on in-game screens and radios! It's fully multiplayer synced, low resource, and easy to use.

1.0 brings you a brand new experience with full time sync, new cart & belt player, linkable speakers, dynamic radio stations, new waveform visualizer and more! See documentation and changelog.

Please enjoy OdinOnDemand 1.0! Moddy

Found a bug? -> Nexus || GitHub Issue Tracker

ValMedia recommends playing without bloom while watching cinema for the best viewing experience.

1.0 Video Preview Video

If you are enjoying the mod, please consider donating to my Ko-Fi.

Features

  • Universal media support
  • Full time sync and multiplayer integration
  • Cinema screens
    • Theater Screen, Flatscreen TV, Table TV, Monitor, Old TV, Laptop
  • Musicplayers
    • Gramophone, Boombox, Radio, Receiver
  • Speakers that can be linked to any stationary mediaplayer using remote control
    • Linked speakers change center of audio location
  • Remote control to use screens from a distance
  • Mobile Players;
    • Cart - "Bard's Wagon", buildable. Used by pointing and clicking with remote control.
    • Belt - "Skald's Girdle", purchased from Haldor, with configurable recipe. Used by equipping & using remote control when pointing at empty space, e.g. not at a mediaplayer. Admins can point and click at other user's Belt and open it's menu.
  • YouTube playlist support
  • Unique dynamic radio stations system with easy radio addon support
  • New Music Waveform Visualizer
    • Configurable scaling factor
  • Full mediaplayer configuration
    • Audio control, looping, admin only options
  • Custom Piece and Item Recipe Configuration

YouTube error reporting has been completely changed to increase verbosity. If you find harmless exceptions that could be classified as a user UI message, please open up a suggestion on GitHub. Please report any other issues on the Nexus or GitHub tracker.

Installation

Installation of the plugin is fairly straightforward, just install into Bepinex/plugins or use r2modman. It must be installed on both server and client.

Use

MediaPlayers

In game, place down a mediaplayer. Interact with it to open the GUI.

Remote Playback

You can paste direct links into the URL field to play online remote files. The linked file should be of a compatible codec. You can also paste youtube/youtu.be links and the plugin will process this for you on all mediaplayers.

All mediaplayers have the added ability to play audio files of compatible codecs, as well as soundcloud.com links - some SoundCloud songs are unavailable, depending on the artist and how they upload/license their art.

Local Playback

Mediaplayers can play files from your computer's local filesystem. You can use absolute and relative path lookup for local files.

Absolute path lookup includes a drive letter, and is not synced over multiplayer unless players have identical file path structures (which is unlikely). For example, C:\videos\bunny.mp4 or file://C:\videos\bunny.mp4

Relative path lookup begins searching for files from OdinOnDemand's folder. Relative path lookup must include prefix local:// or local:\\ To load files from the plugin's folder, identify your media location - for example, a media subfolder in OdinOnDemand's plugin folder - here the path would belocal://movies/media.mp4 <- insert this into the URL field in-game. This would translate into F:\SteamLibrary\steamapps\common\Valheim\BepInEx\plugins\Valmedia-OdinOnDemand\movies\media.mp4 or wherever the user's Valheim installation may reside. You can bundle video files with your modpacks or instruct Vikings to place files in appropriate locations for easier synced local playback. Play them in-game for events and lore and more. You can pull from anywhere in the local plugin folder.

Youtube Playlists

Mediaplayers have support for Youtube playlists. When a playlist is set, new info will appear in the UI. The Viking who initially sets the playlist handles playlist logic, so if they leave the area or disconnect playlist playback will stop. It is multiplayer synced. Do not skip through tracks too fast. You can choose to shuffle or loop the playlist. If looping, the whole playlist will loop - not individual videos. The last video played will be saved as the autoplay video.

Time Sync

Mediaplayers will regularly send out requests to sync time with current mediaplayer (ZDO) owner. You can configure the time between requests sent in the Config file.

To manually seek to a time in the media, use the "Set Time" button under the Cog wheel settings menu. Input time in seconds.

Remote Control

Mediaplayers can be controlled from a distance with a remote control. A remote control can be crafted with 1 bronze. Simply equip, point at a Mediaplayer and click. Point and click at Bard's Wagon to use it. Point and click at no other mediaplayer with Skald's Girdle equipped to use it. Admins can point and click at other player's Skald's Girdle. You can link speakers with mediaplayers using the secondary remote control action. Select a speaker, then select a mediaplayer to pair. Repeat this process to unpair. You can view speaker count and unlink all speakers from the mediaplayer's settings panel. Config options include key configs, max controller distance, and an option to make remote control access private.

Locking

Mediaplayers can be locked in the top right corner of the menu. When a Mediaplayer is locked, Vikings can only access it if they have access to the private area created by a Ward. Admins can lock down mediaplayers from the cog menu, preventing normal Vikings from interacting with specific screens.

Additional Options

The cog button in the bottom right displays extra options. Options for admin only access, listening distance and master volume exist here.

  • Master volume controls the overall volume level for that type of mediaplayer, from every single mediaplayer. It is a client sided option designed to allow Vikings to mute or boost audio for mediaplayers to their personal liking. There is an individual mixer for each type of media player - Cinema screens, radios, and mobile players.
  • Listening distance is a multiplayer synced parameter that changes how far away audio is heard from individual mediaplayers. This can be limited in the plugin's config, which is not enforced on admins.

Default values and client sided master volume values can also be changed in the config.

Most features are synced over multiplayer through RPC events including player time. Volume is client sided.

Waveform visualizer

You can configure the scale factor of the audio waveform visualizer from the config settings. If you play with the volume turned down, you will want to turn this up.

Dynamic Radio Stations

To use the Dynamic Audio Loader, you need to prepare your audio files and additional assets in a specific format. You can create your own station from an asset bundle or from a folder containing audio files, then distribute them via mod repositories or modpacks.

Note: File names cannot include the character "#".

Create From Asset Bundle

  1. Prepare Asset Bundle:

    • Your asset bundle should contain all the audio clips you want to include in your station.
    • Include a title text asset that contains the name of your station.
    • Optionally, include a thumbnail sprite asset to represent your station visually. Ensure it is set to "Sprite" type asset in the properties Inspector.
    • If you want your station to play tracks in a random order, include a shuffle text asset.
  2. Loading Station:

    • The station will be automatically created when the asset bundle is placed in (Plugin Path, e.g. OdinOnDemand)\assetbundles.

Create From Folder

  1. Prepare Folder:

    • Place all your audio files (supported formats: .ogg, .wav, .mp3, .flac) in a single folder.
    • Create a title.txt file containing the name of your station and place it in the same folder.
    • Optionally, add an image file named thumbnail with one of the supported extensions (.png, .jpg, .jpeg, .bmp, .tga, .gif) to be used as the station's thumbnail.
    • If you want your station to play tracks in a random order, create an empty file named shuffle.txt in the folder.
  2. Loading Station:

    • The station will be automatically created when the folder is placed in (Plugin Path, e.g. OdinOnDemand)\radio.

Radio Station Addons - Example Mod

To create a custom radio station addon for easy distribution, follow these simple steps:

  1. Create your station folder
  2. Create Essential Files:
    • odinondemand.txt: This file signifies that the folder is a radio station addon. Simply create an empty odinondemand.txt file in your station's folder.
    • title.txt: This file should contain the name of your radio station. Create a title.txt file in your station's folder and write your station's name in it.
  3. Add Audio Files: Include your audio files (.ogg, .wav, .mp3, or .flac) in the station's folder. The plugin will recognize these files as part of your radio station.
  4. (Optional) AssetBundle Support: If you prefer using AssetBundles, follow the instructions above to create your AssetBundle, then place your AssetBundle file in your station folder with the file extension ".assetbundle".
  5. Zip the files up inside for upload to Thunderstore / Nexus, or place the folder in Valheim\BepInEx\plugins\

Station Playback

When you the game world is initialized, the Server Station Manager initiates the playback simulation:

  1. Track Selection: If shuffle mode is enabled, the tracks are shuffled to create a random playback order. Otherwise, tracks are played in the order they appear in the station.

  2. Synchronization: In multiplayer games, the Station Manager ensures that all players hear the same track at the same time, creating a shared audio experience. This is done by regularly syncing the current track and playback time with all players.

  3. Track Advancement: Tracks are played in sequence. When one track ends, the next one begins. If shuffle is enabled, the order will change after each full cycle through the station tracklist.

  4. Looping: The station continuously loops through its tracklist. Once the last track finishes, playback returns to the first track (or a shuffled track if shuffle is enabled).

The server will simulate station playback position or "time" and send this to players when needed. Once a player initiates playback of a station via a mediaplayer, they receive the most recent station data from the server, load the radio station client side, and play the media.

Clients and servers must have identical files for proper playback.

Config

Starting with OOD 1.0, config files are now stored in BepInEx\config\OdinOnDemand
The config includes settings for YouTube API selection, volume control, distance parameters for audio playback, server and client-side configurations, remote control functionalities, VIP mode settings, and audio fade options. It allows for extensive customization of media player behavior in the game, including options for enabling or disabling certain features, adjusting volumes, setting distances for audio reception, and specifying admin-only settings.

Recipes

Recipes (piece and items) can now be tweaked through a json file located at BepInEx\config\recipes.json & recipes_item.json. the mod will automatically create these. However the default recipe files can be found here if needed.

Some helpful links to help you edit this file are here

Beautify/Validate JSON Valheim Item List

Do not change item names unless you want them removed. If you have any issues keep in mind you can delete your .json file and the mod will re-create it with default values.

VIP System (Beta)

When enabled, Only VIPs can place, remove, and interact with OdinOnDemand Pieces (admins excluded)

Enabled via Config files. Set VIP Mode to True, and add SteamIDs for VIPs. You may customize the message as well. The system is very barebones, so please provide any feedback to Github or Nexus.

Known Issues

  • Boomboxes are currently difficult to place. Just.. keep trying. They place easier on terrain it seems. I'm not quite sure why this is happening. Gramophones are not affected.

If you have V-Sync force enabled in your GPU driver control panel, the mod may not function.

V-Sync Screenshot

If the mod fails to play any sort of video file, not just YouTube - Please check your GPU driver's control panel and make sure the vertical sync setting is either identical your in-game settings or set to "match application setting". You can also check your Player.log. If there are errors about Direct3D and refresh rate / v-sync you may have to do this.

Screenshots

Mod Screenshot Mod Screenshot Mod Screenshot Mod Screenshot Mod Screenshot Build by DanAugust Last picture is with back-light setting turned off.

For any tech-savvy Vikings out there, there is a backup YouTube api that can be self hosted using Node and youtube-dl. This is completely optional and not required as long as the built in library is maintained (YouTubeExplode)

Tutorial Video

Github Instructions

Acknowledgements

CHANGELOG

Versions:

1.0.7

  • Fix Relative URL Lookup
  • Fix Loop UI Text
  • Remote Controller support for ValheimRAFT, and any other similar mods
  • Fix Relative Video loading prepare
  • Potential URL fix for foreign languages

1.0.6

  • Fixed crash when attempting to listen to SoundCloud links

1.0.5

  • Updated to new game version

1.0.4

  • Added new settings buttons: Reload player, Sync Time
  • Changed "SyncTime" repeated event to only broadcast if ZDO owner, instead of pinging server from each player
  • Speakers now check for Owner & PrivateArea access
  • Fix master volume mixer bug
  • UI, Speaker Tweaks

1.0.3

  • Audio Waveform Visualizer tweaks:
    • Added configurable waveform visualizer scale factors (turns out I have my volume settings very low)
    • Tweaked base values to fit default volume levels better, if you have volume turned down then adjust your scale factors as needed
    • Changes to height limits

1.0.2

  • Changed radio station addons to search for .assetbundle files due to flat file structure download from Thunderstore

1.0.1

  • Fixed missing directory issues
  • Switch to OOD_LIB Dependancy package over Runtime Assembly Loading

1.0.0

  • Change: Config files moved to BepInEx\config\OdinOnDemand[...]
  • Improvement: Multiplayer - All videos and audio clips are now fully multiplayer time synced even upon fresh loading. Players will regularly sync time with current ZDO owner. All players "autoplay". This means that tracking forward and autoplay options have been removed. You can manually set seek time in seconds through the Cog wheel settings sub-menu.
  • New Piece: Bard's Wagon - A mobile mediaplayer on wheels!
  • New Item: Skald's Girdle - An equipable mediaplayer sold by Haldor.
    • Control Cart Player & Skald's Girdle via the Remote Control item. Looping always enabled.
  • New Feature: Linkable Speakers - Speakers can now be (un)linked to all types of stationary mediaplayers via the remote control. This changes the center of their audio output, displayed briefly as a red circle.
  • Improved Feature: Reciever is now a mediaplayer.
  • New Feature: Dynamic Audio Stations - Create radio stations from folders and assetbundles that are simulated server-side. When players have the same radio stations, they hear the same songs at the same time.
  • New Feature: Audio Waveform Visualizer - Enabled when listening to dynamic stations, audio files & soundcloud on cinema screens and radio displays.
  • Improvement: All mediaplayers can play audio files and Soundcloud.
  • Improvement: RPC overhaul to reduce server side network load
  • Improvement: *Explode handling overhaul to lower amount of unexplained errors when using YouTube/Soundcloud Links. Increased error verbosity for YouTube/Soundcloud Explode. Removed timeout settings to opt for built in *Explode timeout.
  • Improvement: Configurable Item json recipes added for Remote Control & Skald's Girdle
  • Change: Relative path lookup now begins from OdinOnDemand plugin folder, no prefix needed.
  • Refactor: Abstraction, Organization
  • Fixed: Missing Remote Icon

0.9.96-beta

  • Fixed master volume fluctuations caused by incorrect mixer in Radio prefab audioSource

0.9.95-beta

  • New feature: In-Game Music Audio Crossfade based on distance [See config file]
  • New feature: Configurable vertical volume drop-off [See Mediaplayer Settings Panel]
  • Fixed missing meshes (How long was it like this?)
  • Combined & Condensed Shaders
  • Increased default YTExpolode Timeout

0.9.94-beta

  • Hopefully fixed issues with new updates

0.9.93-beta

  • Fixed local file unpause for real this time

0.9.92-beta

  • Fixed relative/local path file unpause and playback issues

0.9.91-beta

  • Config reorganized, now divided by categories.
  • Piece recipe rework. Fixed file not saving, now auto-updates when certain recipes are missing. You can disable this in the config.

0.9.90-beta

  • Fixed issues stemming from Bepinex removing unstripped corlibs (thanks OrianaVenture)
  • VIP System Beta. Very barebones, meant for feedback. Prevents non-VIP users from placing and interacting with Mediaplayers. Please check/wipe config for new settings.

0.9.89-beta

  • Fixed flow issue preventing remote recipe loading

0.9.88-beta

  • Fixed missing GetMyID method

0.9.87-beta

  • Fixed relative path audio file playback
  • Radio mesh edit

0.9.86-beta

  • Fixed SetURL behavior
  • Fixed radio behavior, audio properties

0.9.85-beta

  • Added prefabs:
    • New mediaplayer: Radio, a vintage style wooden radio
    • Studio Speaker, Standing Speaker, Receiver
      • Decorative pieces, with future planned mechanics
  • Added relative path file lookup from plugin dir (local:// or local:\)
  • Default recipe JSON is now properly formatted
  • Autoplay YouTube and SoundCloud links are now stored and sent un-parsed, fixing old CDN video timeout
  • Proper key config for Remote Control
  • Modifications to YoutubeExplode Library
  • Readme update
  • Code refactoring

0.9.82-beta

  • Added crash disclaimer from 2020.3.45 upgrade

0.9.81-beta

  • Updated YoutubeExplode to version 6.2.12

0.9.80-beta

  • Theater Screen
    • Very large screen roughly 16m x 9m for theater environments.
  • Fixed ward locking behavior
  • Fixed musicplayer volume mixer
  • Added settings overlay, click the cog icon!
  • Added ZDO for several variables
    • Distance, Autoplay/URL, Admin Only, isLocked, and isLooping are saved to world and synced over multiplayer.
    • This means each individual player can have it's own distance and properties, which will sync and persist after reloading world or areas!
    • Custom listening distance can be limited via config. This is not enforced on admins.
  • Added admin only
  • Added autoplay
    • Playlists are currently NOT supported.
    • .mp3/SoundCloud autoplay is currently NOT supported. Direct video links or youtube only.
    • Autoplayed videos are NOT SYCNED. The video will start upon object loading for every viking.
    • Please be aware that YouTube videos saved from autoplay will expire after an indeterminable amount of time. This is simply the nature of Google's content delivery and as such cannot be avoided.

0.9.76-beta

  • Fixed playlist index string
  • Fixed unnecessary debug logging

0.9.75-beta

  • UI Redesign
    • Button icons, combined overflow menus, volume slider
  • Ward interaction, when a media-player is Locked it will check for access with Wards. Media-players are locked by default. You may have to cycle the lock for newly loaded Vikings.
  • Removed pickup button. All media-players can be destroyed via the Hammer just like any piece, you will get appropriate materials refunded.
  • All media-players now have Wear N Tear - they can take damage, and be destroyed. Media-players are weak to pickaxes.
  • Changed Screen Render Distance calculations to hopefully be more efficient. It no longer does any distance calculations and instead just uses collider OnTrigger events.

0.9.71-beta

  • Fixed missing Monitor recipe. If your recipe file is outdated, the default one will be loaded. Check logs and delete recipe file if needed.

0.9.70-beta

  • Monitor Prefab added, larger than Old TV but smaller than Table TV.
  • Remote control for interacting with media-players from a distance
  • Basic playlist support implemented
  • Shuffle feature for playlists
  • Fixed resources not refunding on destruction
  • Media-player code refactoring
  • More multiplayer code refactoring

0.9.60-beta

  • First Gramophone prefab release
  • Added custom recipes via json config
  • Added looping with multiplayer sync
  • Added Boombox YouTube support
  • Added loading circle to cinema screens
  • Greatly increased efficiency of how plugin finds media-players for multiplayer
  • Changed volume handling, added default player volume
  • Fixed Boombox volume bug
  • Fixed boombox playing previous SoundCloud song on set video button press when song unavailable
  • Cleaned up debug logging
  • Cleaned up config

0.9.58-beta

  • Fixed GUI not closing when media-player destroyed by other player.

0.9.57-beta

  • Added Vulkan Support

0.9.56-beta

  • Small adjustment in Rendering distance calculations

0.9.55-beta

  • Fixed Screen volume bug
  • Added "Screens Stop Rendering Out of Range" and config

0.9.51-beta

  • Fix spelling mistake

0.9.5-beta

  • Added native YouTube Functionality. No need to use an external server now, but it's still there if you want it. YouTube is now enabled by default and should work just fine. Let me know if you have any issues. Be sure to wipe configs.

0.9.1-beta

  • Fixed Boombox Default Distance
  • Separate Boombox Default Distance and Master Volume

0.9.0-beta Initial Release