Installing GTA 5 Mods on PC (2024)

Modding has pushed the creativity of individuals to its limits in the gaming industry, allowing players and creators to not only enjoy a fun experience, but also keep the games relevant beyond their originally expected lifecycle.

The Grand Theft Auto franchise is no stranger to the modding community. Modding has become a staple aspect of every GTA game released in the last decade and more, most notably GTA 5, GTA 4, and the classic GTA San Andreas.

If you want to spice up your GTA 5’s single-player experience, look no further, as this guide will walk you through everything you need to know about GTA 5 mods.

GTA 5 PC Modding Steps

Game Backup

As with anything you alter, it is always a good idea to create a backup of your original files in case something goes wrong. First, it is best to create a backup of your original GTA 5 game directory.

If you have the game on Steam, you can reach the game directory by right-clicking on the game name, going to ‘Manage,’ and selecting ‘Browse local files.’

You will land inside the GTA 5 game directory. Go back up one folder, create a copy of the Grand Theft Auto V folder, and paste it somewhere safe. I usually keep it in the same folder to save time in the future, should I need to get the original files back.

You will have two files once copied. The one named ‘Grand Theft Auto V’ is the game executable folder and the one we will mod. And ‘Grand Theft Auto V – copy’ is the backup. You can rename the backup folder, whatever you like. But do not name it ‘Grand Theft Auto V,’ or the game will recognize the executable from that folder.

Open IV Setup

Next, we need to set up Open IV. Open IV is a multi-purpose mod manager for the PC version of GTA 5. You can download Open IV from the official website.

Click on the green button to download the file and install it.

Run the program, and you will be asked to select the game and platform you want to mod.

Select ‘Grand Theft Auto V’ and the ‘Windows’ button under the name.

It will ask you to navigate to the GTA 5 game folder. When you click ‘Browse,’ it sometimes automatically detects the folder. However, if it doesn’t, you can return to your game directory and copy the folder path from the top.

Go back to Open IV, paste it into the path bar, and click ‘Select Folder.’

It will show green text indicating the correct folder has been identified.

Click ‘Continue,’ and it will load and take you to the main Open IV interface.

At the top, click on Tools > ASI Manager.

You need to install two main components from the ASI Manager. The first is the ASI Loader, and the second is the OpenIV.ASI. These two files are the fundamental files needed for the mods to work.

You can also get openCamera if you’re an avid Rockstar Editor user. This removes the default camera boundary in Rockstar Editor, which is quite handy and leaves more room for creativity.

Click ‘Edit Mode’ at the top-right corner of the interface, which will now put you in edit mode. While in edit mode, you can edit, create or delete the game files.

Click ‘New’ at the top-left corner and create a new folder named ‘scripts.’ It is case-sensitive, so ensure it is written exactly as I’ve written it.

Next, you need to download Script Hook V. Script Hook V allows you to run different scripts in GTA 5. You can download the latest version from the official Script Hook V website.

Once downloaded, extract the zip file, and you will get a bin folder. Inside the bin folder, you will find three files. You only need two of these. You can ignore the NativeTrainer.asi file, as we will install a better trainer.

Copy both dinput8.dll and ScriptHookV.dll files to your GTA 5 game directory. You can do it by going to the directory or dragging and dropping it in your Open IV, which always opens up with the game directory at the forefront. Script Hook V is now installed.

Next, you need to install ScriptHookVDotNet. You can download it from the official Github. When you visit the link, look at the right side of the page to find the latest release.

Go to the latest release page, scroll down, and download the ScriptHookVDotNet.zip file.

Extract the content of the zip file and copy them to your game directory. You will see around six files with .xml, .dll, and .asi extensions.

Now we will download NativeUI. Native UI is a ScriptHookVDotNet based library that allows modders to create a Rockstar Games-like user interface for a seamless in-game menu experience.

NativeUI can also be downloaded from the official Github. Click on the Release.zip file to download NativeUI.

Extract the files and copy NativeUI.dll and NativeUI.xml files to the ‘scripts’ folder you created earlier inside the GTA 5 game directory.

Finally, we can install a better trainer called MenyooSP. It has an excellent interface and an easy-to-use menu with an option to spawn custom content based on the mods you install in the future. It makes it very convenient to access the modded content altogether.

The updated version of MenyooSP is also found on the official Github. Click on the MenyooSP.zip file to download it.

Extract the files and copy the menyooStuff folder and Menyoo.asi to your GTA 5 game directory. Again, you can do this by going to the directory yourself or through Open IV (as long as you’re in edit mode in Open IV).

Installing Mods

Now that our Open IV is ready and set to go, we can continue with the mods. There are several websites where you can find thousands of mods. I recommend the GTA-5 mods website as they have one of the largest libraries of all types of mods, including scripts, weapons, vehicles, and more!

Scripts

Let’s begin by installing the most commonly sought-after mod type, the scripts. The scripts are usually fun and add new things to your game. Whether you’re interested in jumping from building to building as Spider-Man or flying over Los Santos as Superman, scripts allows you to do all that. As an example for this guide, we will install the Shazam mod to get the Shazam superpowers.

One important thing to remember when downloading the mods from the GTA-5 mods website is to always check the current version and the date it was last updated. Always use the “current version” download link instead of the big green download button.

It will redirect you to another page with a green download button, which is safe to click and download.

It is also important to read the mod description, as it usually contains installation instructions. The instructions include the pathways and directories where certain files should go. If the mod description doesn’t include any instructions, the downloaded .zip file always contains a read-me file with all the relevant instructions.

After downloading the .zip file and extracting its content, we see a bunch of files. Do not worry, as it will all make sense in a minute. According to the instructions given to us by the modder, we need to install the Shazam Lightning Color (which is a MUST, according to them) and Shazam Mod OIV (which is the main mod file by ZefGtav in the extracted folder). OIV is an extension of the files that can run using the Open IV program.

To install these .OIV files, you first need to open up your Open IV and go into edit mode by clicking on the ‘Edit mode’ at the top-right corner.

Next, open the Package Installer from the top-left corner (directly under Tools).

Navigate to your .OIV file and open it.

Once you open it, you will get an installation pop-up. Click on the install button to install the mod.

When you click on the install button, you will get an option to select the location to install the mod. Select the “mods” folder, not the “Game folder.”

You will get a confirmation that the mod has been installed at the end. Once installed, do the same with the .OIV file inside the Shazam Lightning color folder. You can skip the Black Adam Lightning folder if you’d like, as this is just an example.

We can now go into the game and activate the Shazam mod. Once again, referring back to the modder’s instruction manual, we can access the Shazam mod menu by pressing ‘L’ on our keyboard.

We might have activated the Shazam powers, but now you must be confused why our character doesn’t look the part. That’s because this mod is only a script that gives you the powers and not the skin of Shazam.

This brings us to our next mod type, custom character skins.

Character Skins

You can change your Franklin, Michael, or Trevor character into whoever you like. You can turn them into the Hulk, Superman, Spider-Man, or in our case, Shazam.

To change your character skin, you can install AddonPeds. AddonPeds is an excellent tool that allows you to add hundreds of skins without replacing any in-game files. The best part about this mod is that it comes with a ped selector that allows you to instantly change your skin into any of the installed skins on the go.

But first, we need to set up AddonPeds and learn how to add skins to the AddonPeds library for us to use in-game. You can download AddonPeds from the GTA-5 mods website.

Extract the downloaded .zip file, and you will see different files and folders. We need to copy some of these files to their designated locations within the GTA 5 game directory. You can go through the instructions in the mod description on the official website or follow our guide on how to install it.

First, go to the ‘scripts’ folder inside your GTA 5 game directory and copy the PedSelector.dll file from the download ‘scripts’ folder to your GTA 5 game directory ‘scripts’ folder.

Then copy AddonPeds Editor.exe and AddonPedsVars.xml files to your GTA 5 game directory. Remember, you can do all this in Open IV as long as you’re in edit mode.

Next, go to the ‘mods’ folder and create a new folder called ‘update’ and inside update create another new folder called ‘x64.’

Go inside x64 and create another folder called ‘dlcpacks.’

Go back to the downloaded AddonPeds files, and go inside the dlcpacks folder that comes with it. Inside the folder, you will find another folder called ‘addonpeds.’ Copy this folder to your newly created ‘dlcpacks’ folder inside your GTA 5 directory.

The next step must be performed within Open IV. Go to the ‘update’ folder inside your GTA 5 game directory and open update.rpf by double-clicking it.

At the top, you will see a notification stating the archive is not located in your mods folder. Select the “Copy to mods folder” option and wait for the contents to be copied to your mods folder. This is an important step that you must always perform when you are editing an archive for the first time.It always copies the content to your ‘mods’ folder for you to edit in the future and utilizes the mod folder files to run your mods. This is much safer as it doesn’t edit your original in-game files.

Once the copying is finished, you will land on the same update.rpf page, but now it is located inside the mods folder. Continue going to common > data and scroll down until you see dlclist.xml.

Right-click dlclist.xml and click on edit. If you do not see the edit option, it is because you are not in edit mode. Click ‘Edit mode’ at the top-right corner of the interface.

Scroll to the bottom of the dlclist and add the following line:

dlcpacks:/addonpeds/

Do not change anything else, and click ‘Save’ at the bottom-right corner.

Go to the addonpeds folder you copied to your GTA 5 game directory (mods > update > x64 > dlcpacks > addonpeds) and open dlc.rpf. Inside dlc.rpf, open peds.rf.

When you open peds.rpf, you will see all your skins here. When you download your skins (addonpeds skins), you must always copy them here. Since we’ve installed the Shazam mod, let’s download a high-quality Shazam skin for addonpeds as recommended by the original Shazam script mod author.

After downloading the skin, you will see some files inside the folder. The number and types of files you get determine whether the skin is streamed or not streamed. I will explain more about it in just a minute.

First, copy the Shazam(Movie) folder, Shazam(Movie).yft, and Shazam(Movie).ymt files inside your peds.rpf. The skin also comes with a script that gives Shazam powers, but we won’t be needing that since we’ve already installed our own script.

Now, go to your GTA 5 game directory and open AddonPeds Editor. You will already have two skins by default (Vito Mafia and Superman).

Click on Peds at the top-left corner of the program and click New Ped.

For the model name, ensure it is exactly the same as the files you copied to your peds.rpf. These are case-sensitive and won’t be recognized if the names are not exactly the same. So here we will name the model Shazam(Movie). The ped type is male.

Finally, whether it is streamed or not streamed? We can determine this by the number and types of files we get when downloading the skins. If the skin is NOT STREAMED, it will have four normal skin files with the following extensions:

  • .ydd
  • .ytd
  • .ymt
  • .yft

If the skin is STREAMED, it will have three files, with one being a folder:

  • Folder
  • .yft
  • .ymt

Our Shazam skin is streamed since we have a folder, a .yft, and a .ymt file. We will select TRUE here.

When done, click ‘Add Ped.’ After that, you will see the model name in your list of all peds. Click ‘Rebuild’ at the top, and you’re done.

When you return to the game, press ‘L’ to bring up the Ped Selector and select your Shazam skin.

You might run into an issue where two menus appear since the ‘L’ key is assigned to both the Ped Selector and the Shazam powers script. Usually, these mods come with a .ini file which allows you to change your hotkey.

Unfortunately, the Shazam script mod had no option for us to change that.

In general, you must avoid mods that have such conflicts. You can use them side by side as long as they have a .ini file that allows you to set your own hotkeys.

Vehicle Skins

There are two ways you can install vehicle mods. The first method is to replace the existing vehicles with the new ones you download. However, I wouldn’t recommend doing this. A better way to install vehicle mods is as an add-on.

Add-on vehicle mods do not replace your existing vehicles and add a new vehicle to your game. Let’s take the 2020 BMW 330i G20 add-on mod as an example.

When you download the mod, you can extract it out of a .zip file. It will contain a read-me file with all the necessary instructions. The instructions are more or less the same for all the other add-on vehicles you will install in the future.

First, copy the gxg20 folder to mods > update > x64 > dlcpacks.

After that, go to mods > update > update.rpf > common > data and edit dlclist.xml.

Like the addonpeds, you need to add another line for the vehicle mod to be recognized in the game as a mod. Scroll to the bottom of the list and add the following:

dlcpacks:/gxg20/

Save and exit.

That’s all you have to do. Now, you can go in-game and test your vehicle. This is where the MenyooSP trainer comes in super handy. When you go in-game, press F8 to bring up the MenyooSP trainer and go to Vehicle Options.

Then go to Vehicle Spawner.

Scroll to the bottom and select Input Model.

Here, you can enter the vehicle model name, and it will automatically spawn it for you. The read-me file states that the in-game model name for the vehicle is gxg20. So, you will enter that in the field and press enter for it to spawn.

Let’s move on to our final mod type, Weapon Mods!

Weapons

The weapon mods are as easy as replacing your existing weapon models. However, I highly recommend always backing up the original models before installing weapon mods. It is as simple as selecting and dragging the files into a folder.

As an example, we will install the M14 from Modern Warfare Remastered (MWR). This mod comes with a skin replacement for the marksman rifle and a scope replacement to match the one from MWR.

To install the weapon mods, you must navigate to update > x64 > dlcpacks > patchday8ng and open up dlc.rpf.

Once again, since it is your first time accessing the archives inside this folder, copy it to the “mods” folder to continue editing it. Now the location of the patchday8ng for your use would be mods > update > x64 > dlcpacks > patchday8ng.

So if in the future you have any weapon mod that needs to go inside the dlc.rpf of patchday8ng, you can navigate to the one inside the mods folder. If any other weapon may require a different dlcpacks folder, such as patchday7ng, you must copy them to the mods folder as well. Luckily, most of the weapons modded or replaced are present inside patchday8ng. So you don’t have to worry too much about it.

Anyway, continuing with our mod installation, once you’re in the patchday8ng folder, continue navigating to dlc.rpf > x64 > models > cdimages > weapons.rpf.

You will find all your weapon models inside weapons.rpf. Before you install your weapon mod, match the names from the modded files to the ones inside weapons.rpf and copy those in a folder somewhere to keep a backup of the original models to essentially “uninstall” the weapon mod.

Next, copy the downloaded files inside weapons.rpf. The same goes for the scope files. Copy all the files inside the scope folder and put them inside weapons.rpf (also remember to make a backup of the scope files).

Once done, you can go in-game and check out your weapon. It has replaced the marksman rifle, you can search for it using the MenyooSP trainer.

Frequently Asked Questions

My game keeps crashing after installing the mods. How can I fix it?

This is a common occurrence for many when they install the mods for the first time. You can solve it by editing the dlclist.xml file. First go to your Open IV and enter edit mode. Navigate to mods > update > update.rpf > common > data and right-click edit dlclist.xml.

Inside this text file, you will notice all the forward slashes (/). All you need to do is change them into backslash (\).

You don’t need to edit the ones inside the string of texts, such as dlcpacks/mpValentines. But you need to change the one at the beginning and the one at the end.

For instance, in platform:/dlcPacks/mpBeach/, the one right after platform: must be changed, and the one right at the end before /item must be changed.

Can I get banned for modding?

No, you will not get banned as long as you follow our guide carefully. Even if you don’t, you just cannot get banned as certain files won’t allow you to enter GTA Online. You will only get banned if you try and use mods in GTA Online.

Can I play online with mods?

You cannot play GTA Online with mods on and this is the reason why you can’t get banned. Whenever you try to play online with mods on, you will receive a message stating you have an altered version of the game and cannot enter an online session.

How can I play online without deleting the mods?

You can play online without deleting your mods and mod setups. All you need to do is delete the dinput8.dll file from your GTA 5’s game directory. Consider this .dll file as the main file that enables all the mods in your game. When you remove this one .dll file from your game directory, the game does not recognize any of the mods inside your game folder except the official game files.

Whenever you want to play online, move the dinput8.dll file somewhere other than the GTA 5 game directory. After your online session, you can move it back to enjoy your modded offline session.

How can I uninstall .oiv mod files manually?

Certain mods won’t allow you to uninstall .oiv files automatically through an executable launcher. In that case, you need to uninstall the mod by removing the mod-related files manually.

But since we don’t know where the files went, it can be challenging to uninstall them. You can use a simple trick to identify the directory where the Open IV installer installs the mod files.

Let’s take our Shazam superpowers mod as an example for this demonstration. We know some of the files are in the scripts folder. However, when you have multiple mods, you cannot tell which one belongs to the mod you’re looking to delete.

So let us first identify the files and their locations to confirm and then we can proceed to delete. Some of these files can only be accessed using Open IV. First, go to the folder where you have the originally downloaded .zip file. Do not extract the contents and open it using Winrar.

Right-click on the .oiv file you installed and click on ‘View.’ It will open another instance of Winrar showing some more files.

You will find a file called assembly.xml. Double click on it to open.

In this .xml file, you can identify all the files installed for this mod and where they are installed. Every line that starts with “addsource” refer to the addition of the file for this mod. Let’s start with the first batch that states the name of the files and their location. They are in the scripts folder according to the assembly document.

You can go to your GTA 5 folder > scripts to find all the relevant files. This method not only allows you to see the location of the files but also their names. For example, ModMenu.dll doesn’t exactly confirm whether it belongs to the Shazam mod or some other. But the assembly document confirms our suspicion. You can delete these files from Open IV or by navigating to the folder.

The next section of the assembly tells us where the rest of the files are and what archive holds them. The classic x64c.rpf archive holds all the animations for this mod.

According to the assembly document, we need to navigate to mods > x64c.rpf > anim > ingame > [emailprotected]. In this archive, you can find all the added files.

Finally, the last section of the assembly shows some more files in the script folder which we can delete along with a .asi file. You can usually find the .asi files inside your GTA 5 game directory. In this case, our file is called ObjectSpawnUnlockNbuild.asi. DirectShowLib-2005.dll and NAudio.dll are both in scripts folder which we overlooked earlier (since we were going in order).

Although it doesn’t say make sure you delete any other file named the same as your .asi or other script files. Sometimes files such as .txt log files are generated once the script or the mod has run once. They won’t show up until you’ve played the game once with the mod.

And that’s it, you’ve now successfully uninstalled the Shazam mod manually without leaving a trace.

I am not seeing the ‘view’ option when right-clicking the .oiv file within Winrar?

Don’t worry, it is quite simple to fix. This is because your .oiv file has not been opened up directly using the Open IV program. The .oiv file needs to recognize Open IV as the default program for it to show its icon and allow you to view the files inside so that you may check out the contents of the assembly document.

Extract the files, right-click on the .oiv file and open it (open with) using Open IV as the default program. Now when you go back to your Winrar, you should be able to see the ‘view’ option. it will automatically open up Open IV and ask you to install the program again. You don’t have to install it. You can close the program once the prompt to install shows up.

Comments: 6 replies

Loading new replies...

RetroRanger

Active member

101 messages 50 likes

#1Aug 18, 2023

This will come in handy. I was just starting to mess with mods. I hadn't really gotten deep into using them but since I am playing on PC again for the time being (my live ran out) I will check out some mods.

Reply Like

xXGameSlayerXx

Active member

131 messages 73 likes

#2Aug 23, 2023

I still have yet to mess with GTA mods. I ended up getting the PC version when it was on sale but didn't play much cause of all the hackers. I can mess around with mods though. Going to try this over the weekend.

Reply Like

SilentSniperAU

Active member

108 messages 61 likes

#3Aug 28, 2023

A forum I was on before this one had a decent sized modding community and a small group focused on mods just for GTA 5. It was fascinating what can be done with the game. I really should try some of the more popular mods out there though.

Reply Like

auroraoctopus

Member

83 messages 30 likes

#4Aug 31, 2023

When the game went on sale on Steam, I picked it up. Been having fun with it. Online is a bit of a mess at times from all the hacking but I am fining my way around it. I wanted to try some mods but had no clue what I was doing. This is a fantastic guide. Helped me actually get one running pretty fast.

Reply Like

SolarSloth66

Member

70 messages 24 likes

#5Sep 02, 2023

This might be the only thing worth me getting the game on PC cause I cannot bother with it online.

I never actually tried doing mods so I will see if I can manage to install anything.

Reply Like

m

midnightmango7

Member

70 messages 35 likes

#6Sep 04, 2023

How hard would you say this is for someone that has never done mods before? I have not done them in any game. I kind of want to try it though.

Reply Like

Join the full discussion at the GTA BOOM Community →

About the AuthorHassan Sajid// Articles: 107

Combining his engineering background with his lifelong gaming passion, Hassan creates deeply informative, technically comprehensive guides to help fellow players master GTA. // Full Bio

log in

forgot password

Back to

log in

'),b.insertAdjacentHTML(d,e));return document.getElementById(a)};c.prototype._repeatDynamicAds=function(b){var a=[],d=this._removeRecipeCapExperiment.result&&"Recipe"===b.location?99:this.locationMaxLazySequence.get(b.location),e=b.lazy?u(d,0):0;d=b.max;var f=b.lazyMax;e=Math.max(d,0===e&&b.lazy?d+f:Math.min(Math.max(e-b.sequence+1,0),d+f));for(f=0;f

=d;a.push(y(y({},b),{sequence:g,lazy:h}))}return a};c.prototype._locationEnabled=function(b){b=this._clsOptions.enabledLocations.includes(b.location);var a=this._clsOptions.disableAds&&this._clsOptions.disableAds.all||document.body.classList.contains("adthrive-disable-all"),d=!document.body.classList.contains("adthrive-disable-content")&&!this._clsOptions.disableAds.reasons.has("content_plugin");return b&&!a&&d};return c}(),Za=function(c){function b(a,d){var e=c.call(this,a,"ClsVideoInsertion")||this;e._videoConfig=a;e._clsOptions=d;e._IN_POST_SELECTOR=".adthrive-video-player";e._WRAPPER_BAR_HEIGHT=36;e._playersAddedFromPlugin=[];d.removeVideoTitleWrapper&&(e._WRAPPER_BAR_HEIGHT=0);return e}v(b,c);b.prototype.init=function(){this._initializePlayers()};b.prototype._wrapJWPlayerWithCLS=function(a,d,e){void 0===e&&(e=0);return a.parentNode?(d=this._createGenericCLSWrapper(.5625*a.offsetWidth,d,e),a.parentNode.insertBefore(d,a),d.appendChild(a),d):null};b.prototype._createGenericCLSWrapper=function(a,d,e){var f=document.createElement("div");f.id="cls-video-container-".concat(d);f.className="adthrive";f.style.minHeight="".concat(a+e,"px");return f};b.prototype._getTitleHeight=function(a){a.innerText="Title";a.style.visibility="hidden";document.body.appendChild(a);var d=window.getComputedStyle(a),e=parseInt(d.height,10),f=parseInt(d.marginTop,10);d=parseInt(d.marginBottom,10);document.body.removeChild(a);return Math.min(e+d+f,50)};b.prototype._initializePlayers=function(){var a=document.querySelectorAll(this._IN_POST_SELECTOR);a.length&&this._initializeRelatedPlayers(a);this._shouldRunAutoplayPlayers()&&this._determineAutoplayPlayers()};b.prototype._createStationaryRelatedPlayer=function(a,d,e){var f="mobile"===this._device?[400,225]:[640,360],g=G.Video_In_Post_ClicktoPlay_SoundOn;d&&a.mediaOrPlaylistId&&(e="".concat(a.mediaOrPlaylistId,"_").concat(e),d=this._wrapJWPlayerWithCLS(d,e),this._playersAddedFromPlugin.push(a.mediaOrPlaylistId),d&&this._clsOptions.setInjectedVideoSlots({playerId:a.playerId,playerName:g,playerSize:f,element:d,type:"stationaryRelated"}))};b.prototype._createStickyRelatedPlayer=function(a,d){var e="mobile"===this._device?[400,225]:[640,360],f=G.Video_Individual_Autoplay_SOff;this._stickyRelatedOnPage=!0;this._videoConfig.mobileStickyPlayerOnPage="mobile"===this._device;if(d&&a.position&&a.mediaId){var g=document.createElement("div");d.insertAdjacentElement(a.position,g);d=document.createElement("h3");d.style.margin="10px 0";d=this._getTitleHeight(d);d=this._wrapJWPlayerWithCLS(g,a.mediaId,this._WRAPPER_BAR_HEIGHT+d);this._playersAddedFromPlugin.push(a.mediaId);d&&this._clsOptions.setInjectedVideoSlots({playlistId:a.playlistId,playerId:a.playerId,playerSize:e,playerName:f,element:g,type:"stickyRelated"})}};b.prototype._createPlaylistPlayer=function(a,d){var e=a.playlistId,f="mobile"===this._device?G.Video_Coll_SOff_Smartphone:G.Video_Collapse_Autoplay_SoundOff,g="mobile"===this._device?[400,225]:[640,360];this._videoConfig.mobileStickyPlayerOnPage=!0;var h=document.createElement("div");d.insertAdjacentElement(a.position,h);d=this._wrapJWPlayerWithCLS(h,e,this._WRAPPER_BAR_HEIGHT);this._playersAddedFromPlugin.push("playlist-".concat(e));d&&this._clsOptions.setInjectedVideoSlots({playlistId:a.playlistId,playerId:a.playerId,playerSize:g,playerName:f,element:h,type:"stickyPlaylist"})};b.prototype._isVideoAllowedOnPage=function(){var a=this._clsOptions.disableAds;if(a&&a.video){var d="";a.reasons.has("video_tag")?d="video tag":a.reasons.has("video_plugin")?d="video plugin":a.reasons.has("video_page")&&(d="command queue");q.error(d?"ClsVideoInsertionMigrated":"ClsVideoInsertion","isVideoAllowedOnPage",Error("DBP: Disabled by publisher via ".concat(d||"other")));return!1}return this._clsOptions.videoDisabledFromPlugin?!1:!0};return b}(function(c){function b(a,d){var e=c.call(this)||this;e._videoConfig=a;e._component=d;e._stickyRelatedOnPage=!1;e._relatedMediaIds=[];a=void 0;void 0===a&&(a=navigator.userAgent);a=/Windows NT|Macintosh/i.test(a);e._device=a?"desktop":"mobile";e._potentialPlayerMap=e.setPotentialPlayersMap();return e}v(b,c);b.prototype.setPotentialPlayersMap=function(){var a=this._videoConfig.players||[],d=this._filterPlayerMap();a=a.filter(function(e){return"stationaryRelated"===e.type&&e.enabled});d.stationaryRelated=a;return this._potentialPlayerMap=d};b.prototype._filterPlayerMap=function(){var a=this,d=this._videoConfig.players,e={stickyRelated:[],stickyPlaylist:[],stationaryRelated:[]};return d&&d.length?d.filter(function(f){var g;return null===(g=f.devices)||void 0===g?void 0:g.includes(a._device)}).reduce(function(f,g){f[g.type]||(q.event(a._component,"constructor","Unknown Video Player Type detected",g.type),f[g.type]=[]);g.enabled&&f[g.type].push(g);return f},e):e};b.prototype._checkPlayerSelectorOnPage=function(a){var d=this;a=this._potentialPlayerMap[a].map(function(e){return{player:e,playerElement:d._getPlacementElement(e)}});return a.length?a[0]:{player:null,playerElement:null}};b.prototype._getOverrideElement=function(a,d,e){a&&d?(e=document.createElement("div"),d.insertAdjacentElement(a.position,e)):(d=this._checkPlayerSelectorOnPage("stickyPlaylist"),a=d.player,d=d.playerElement,a&&d&&(e=document.createElement("div"),d.insertAdjacentElement(a.position,e)));return e};b.prototype._shouldOverrideElement=function(a){a=a.getAttribute("override-embed");return"true"===a||"false"===a?"true"===a:this._videoConfig.relatedSettings?this._videoConfig.relatedSettings.overrideEmbedLocation:!1};b.prototype._checkPageSelector=function(a,d,e){void 0===e&&(e=[]);return a&&d&&0===e.length?("/"!==window.location.pathname&&q.event("VideoUtils","getPlacementElement",Error("PSNF: ".concat(a," does not exist on the page"))),!1):!0};b.prototype._getElementSelector=function(a,d,e){if(d&&d.length>e)return d[e];q.event("VideoUtils","getPlacementElement",Error("ESNF: ".concat(a," does not exist on the page")));return null};b.prototype._getPlacementElement=function(a){var d=a.pageSelector,e=a.elementSelector;a=a.skip;var f=da(d),g=f.valid,h=f.elements;f=S(f,["valid","elements"]);var k=ca(e),l=k.valid,p=k.elements;k=S(k,["valid","elements"]);return""===d||g?l?this._checkPageSelector(d,g,h)?this._getElementSelector(e,p,a)||null:null:(q.error("VideoUtils","getPlacementElement",Error("".concat(e," is not a valid selector")),k),null):(q.error("VideoUtils","getPlacementElement",Error("".concat(d," is not a valid selector")),f),null)};b.prototype._getEmbeddedPlayerType=function(a){(a=a.getAttribute("data-player-type"))&&"default"!==a||(a=this._videoConfig.relatedSettings?this._videoConfig.relatedSettings.defaultPlayerType:"static");this._stickyRelatedOnPage&&(a="static");return a};b.prototype._getMediaId=function(a){return(a=a.getAttribute("data-video-id"))?(this._relatedMediaIds.push(a),a):!1};b.prototype._createRelatedPlayer=function(a,d,e,f){"collapse"===d?this._createCollapsePlayer(a,e):"static"===d&&this._createStaticPlayer(a,e,f)};b.prototype._createCollapsePlayer=function(a,d){var e=this._checkPlayerSelectorOnPage("stickyRelated"),f=e.player;e=e.playerElement;var g=f?f:this._potentialPlayerMap.stationaryRelated[0];g&&g.playerId?(this._shouldOverrideElement(d)&&(d=this._getOverrideElement(f,e,d)),d=document.querySelector("#cls-video-container-".concat(a," > div"))||d,this._createStickyRelatedPlayer(y(y({},g),{mediaId:a}),d)):q.error(this._component,"_createCollapsePlayer","No video player found")};b.prototype._createStaticPlayer=function(a,d,e){this._potentialPlayerMap.stationaryRelated.length&&this._potentialPlayerMap.stationaryRelated[0].playerId?this._createStationaryRelatedPlayer(y(y({},this._potentialPlayerMap.stationaryRelated[0]),{mediaOrPlaylistId:a}),d,e):q.error(this._component,"_createStaticPlayer","No video player found")};b.prototype._shouldRunAutoplayPlayers=function(){return this._isVideoAllowedOnPage()&&(this._potentialPlayerMap.stickyRelated.length||this._potentialPlayerMap.stickyPlaylist.length)?!0:!1};b.prototype._determineAutoplayPlayers=function(){var a=this._component,d="VideoManagerComponent"===a,e=this._config;if(this._stickyRelatedOnPage)q.event(a,"stickyRelatedOnPage",d&&{device:e&&e.context.device,isDesktop:this._device}||{});else{var f=this._checkPlayerSelectorOnPage("stickyPlaylist"),g=f.player;f=f.playerElement;g&&g.playerId&&g.playlistId&&f?this._createPlaylistPlayer(g,f):q.event(a,"noStickyPlaylist",d&&{vendor:"none",device:e&&e.context.device,isDesktop:this._device}||{})}};b.prototype._initializeRelatedPlayers=function(a){for(var d=new Map,e=0;e
Installing GTA 5 Mods on PC (2024)
Top Articles
Latest Posts
Article information

Author: Nicola Considine CPA

Last Updated:

Views: 5443

Rating: 4.9 / 5 (69 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Nicola Considine CPA

Birthday: 1993-02-26

Address: 3809 Clinton Inlet, East Aleisha, UT 46318-2392

Phone: +2681424145499

Job: Government Technician

Hobby: Calligraphy, Lego building, Worldbuilding, Shooting, Bird watching, Shopping, Cooking

Introduction: My name is Nicola Considine CPA, I am a determined, witty, powerful, brainy, open, smiling, proud person who loves writing and wants to share my knowledge and understanding with you.