Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
xjbeta committed May 5, 2023
2 parents 367505f + 69b8d68 commit 3455af1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
10 changes: 6 additions & 4 deletions Info.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Danmaku",
"identifier": "com.xjbeta.danmaku",
"version": "0.1.0",
"version": "0.1.5",
"ghVersion": 2,
"ghRepo": "xjbeta/iina-plugin-danmaku",
"description": "IINA Danmaku",
Expand All @@ -11,6 +11,7 @@
"url": "https://github.com/xjbeta"
},
"entry": "main.js",
"globalEntry": "global.js",
"permissions": [
"show-osd",
"menu-items",
Expand All @@ -22,8 +23,9 @@
"allowedDomains": ["127.0.0.1"],
"preferencesPage": "pref.html",
"preferenceDefaults": {
"keyNum": 10,
"keyString": "hello",
"keyBool": true
"dmOpacity": 1,
"dmSpeed": 680,
"dmFont": "PingFang SC",
"enableIINAPLUSOptsParse": 0
}
}
Empty file added global.js
Empty file.
24 changes: 9 additions & 15 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ var danmakuWebInited = false;

var stopped = true;

let defaultPreferences = {
dmOpacity: 1,
dmSpeed: 680,
dmFont: 'PingFang SC',
enableIINAPLUSOptsParse: 0
};

function print(str) {
console.log('[' + instanceID + '] ' + str);
};
Expand Down Expand Up @@ -219,9 +212,9 @@ function initDanmakuWeb() {
return;
};

iinaPlusOpts.dmOpacity = iina.preferences.get('dmOpacity') ?? defaultPreferences.dmOpacity;
iinaPlusOpts.dmSpeed = iina.preferences.get('dmSpeed') ?? defaultPreferences.dmSpeed;
iinaPlusOpts.dmFont = iina.preferences.get('dmFont') ?? defaultPreferences.dmFont;
iinaPlusOpts.dmOpacity = iina.preferences.get('dmOpacity');
iinaPlusOpts.dmSpeed = iina.preferences.get('dmSpeed');
iinaPlusOpts.dmFont = iina.preferences.get('dmFont');

var blockList = [];
if ((iina.preferences.get('blockTypeScroll') ?? 0) == 1) {
Expand Down Expand Up @@ -276,13 +269,14 @@ iina.event.on("iina.pip.changed", (pip) => {
iina.event.on("iina.file-started", () => {
print('iina.file-started');
stopped = false;
let e = iina.preferences.get('enableIINAPLUSOptsParse') ?? defaultPreferences.enableIINAPLUSOptsParse;
if (e == 0) {
print('Ignore IINA+ Opts Parse')
initMenuItems();
let e = iina.preferences.get('enableIINAPLUSOptsParse');

if (e != 0 && mpv.getString('path') == "-") {
parseOpts();
return;
}
parseOpts();
print('Ignore IINA+ Opts Parse')
initMenuItems();
});

iina.event.on("mpv.pause.changed", (isPaused) => {
Expand Down

0 comments on commit 3455af1

Please sign in to comment.