[Android Software Development] giofrida:
Hello guys and happy new year!

I would like to add here my modifications to the video player and file browser, feeling that they could be helpful for anyone who is in my situation.

As you know Hisense and other TV brands uses a HTML-like system to create the interface for their TV. This is great for whom, like me, wants to edit the UI.

The files to be modified are stored in 3rd_rw/UI/hisenseUI

the folder css, as you probably know, contains all the data used to set the 'style' (like colors, widths and heights, etc.) of the objects in the interface

the folder modulePages/himedia contains instead javascripts/jquery scripts used by the TV to interact with these objects

Mods:

Increase file name length:

In file browser: open css/fileBrowser.css; edit

#dropboxContainer #filepath { ... max-width: [COLOR="Red"]940px[/COLOR]; ... }

In video player: open css/videoPlayer.css; edit

#videoPlayerDiv .videoTitle { ... width: [COLOR="red"]1700px[/COLOR]; ... }

Add fast seek mode:

open himedia/videoPlayer.js; edit

HiVideoPlayer.keydownhander = function (event) {
....
[COLOR="red"]case VK_x: //with x from 0 to 9[/COLOR]
debugE(HiVideoPlayer.dialogShowStatus);
if (HiVideoPlayer.dialogShowStatus == 1) {
HiVideoPlayer.timeStr[HiVideoPlayer.timeIndex] = 0;
HiVideoPlayer.refreshTimeInfo();
HiVideoPlayer.timeIndex++;
if (HiVideoPlayer.timeIndex > 1) {
HiVideoPlayer.timeIndex = 0;
}
}
else if (HiVideoPlayer.dialogShowStatus == 5) {
pvr_inputNum(0);
} else {
[COLOR="Red"]model.mpctrl.setMpCtrlPlaytimeCurrent(x * HiVideoPlayer.videoTotaltime / 10); //set x accordingly to VK_x[/COLOR]
}
break;

Organise files in a vertical list:

To achieve what you see in the picture you need to:

Disable scrolling of file name: open himedia/fileBrowser.js; edit

HiFileBrowser.openFileBrowser = function () {
DBG_ALWAYS("Function openFileBrowser and curFile is " + HiFileBrowser.curFile);
HiFileBrowser.initLanguage();
if (HiFileBrowser.curFile > 0) {
var text = getText(HiFileBrowser.curFile);
if (text.length > 14) {
// $("#filename" + start_id).html('<marquee>' + text + '</marquee>');
[COLOR="Red"]//[/COLOR]$("#filename" + HiFileBrowser.curFile).html('<marquee style="width: inherit" scrollAmount=4 scrollDelay=100>' + text + '</marquee>');

function setDropboxTextScroll(stop_id, start_id, len) {

$("#filename" + stop_id).html(getText(stop_id));
debugPrint($("#filename" + stop_id).width());
if (start_id === null) {
return;
}
if (!len) {
len = 14;
}

var text = getText(start_id);
[COLOR="red"]/*[/COLOR]if (text.length > len) {
// $("#filename" + start_id).html('<marquee>' + text + '</marquee>');
$("#filename" + start_id).html('<marquee style="width: inherit" scrollAmount=4 scrollDelay=100>' + text + '</marquee>');

}
else {[COLOR="red"]*/[/COLOR]
$("#filename" + start_id).html(text);
[COLOR="red"]//[/COLOR]}
}

Go to the first/last file when over-scrolling the list: open himedia/fileBrowser.js; edit

function dropboxConetentKeyDown(event) {
debugPrint("dropboxConetentKeyDown begin and keyCode is :" + event.keyCode);
switch (checkDMPkeycode(event.keyCode)) {
[COLOR="red"] case VK_RIGHT:
if (HiFileBrowser.curFile + 5 < HiFileBrowser.totalFile) {

if (HiFileBrowser.curFile + 5 < (HiFileBrowser.curPage + 1) * 19) {
setFileFocus(HiFileBrowser.curFile, HiFileBrowser.curFile + 5);
HiFileBrowser.curFile += 5;
}
else {
HiFileBrowser.curFile += 5;
changePage(HiFileBrowser.curPage, HiFileBrowser.curPage + 1);
}
}
else {
HiFileBrowser.curPage = HiFileBrowser.totalPage - 1;
HiFileBrowser.curFile = HiFileBrowser.totalFile - 1;
changePage(0, HiFileBrowser.curPage);
setFileFocus(0, HiFileBrowser.curFile);
}
break;
case VK_LEFT:
if (HiFileBrowser.curFile - 5 >= 0) {
if (HiFileBrowser.curFile - 5 >= HiFileBrowser.curPage * 19) {
setFileFocus(HiFileBrowser.curFile, HiFileBrowser.curFile - 5);
HiFileBrowser.curFile -= 5;
}
else {
HiFileBrowser.curFile -= 5;
changePage(HiFileBrowser.curPage, HiFileBrowser.curPage - 1);
}
}
else {
changePage(HiFileBrowser.curPage, 0);
setFileFocus(HiFileBrowser.curFile, 0);
HiFileBrowser.curFile = 0;
HiFileBrowser.curPage = 0;
}
break;
case VK_UP:
if (HiFileBrowser.curFile == 0) {
HiFileBrowser.curPage = HiFileBrowser.totalPage - 1;
HiFileBrowser.curFile = HiFileBrowser.totalFile - 1;
changePage(0, HiFileBrowser.curPage);
setFileFocus(0, HiFileBrowser.curFile);

} else if (HiFileBrowser.curFile == HiFileBrowser.curPage * 19) {
HiFileBrowser.curFile--;
changePage(HiFileBrowser.curPage, HiFileBrowser.curPage - 1);
}
else {
setFileFocus(HiFileBrowser.curFile, HiFileBrowser.curFile - 1);
HiFileBrowser.curFile--;
}
break;
case VK_DOWN:
if (HiFileBrowser.curFile == (HiFileBrowser.totalFile - 1)) {
changePage(HiFileBrowser.curPage, 0);
setFileFocus(HiFileBrowser.curFile, 0);
HiFileBrowser.curFile = 0;
HiFileBrowser.curPage = 0;

} else if (HiFileBrowser.curFile < HiFileBrowser.totalFile - 1) {
if (HiFileBrowser.curFile + 1 == (HiFileBrowser.curPage + 1) * 19) {
HiFileBrowser.curFile++;
changePage(HiFileBrowser.curPage, HiFileBrowser.curPage + 1);
}
else {
setFileFocus(HiFileBrowser.curFile, HiFileBrowser.curFile + 1);
HiFileBrowser.curFile++;
}
}
break;[/COLOR]

Increase the total number of files: open himedia/fileBrowser.js and replace the number 15 with 19. This is the list of modifications I've done:

function nextPageTest() {
HiFileBrowser.curFile = (HiFileBrowser.curPage + 1) * [COLOR="red"]19[/COLOR];
changePage(HiFileBrowser.curPage, HiFileBrowser.curPage + 1);

}

function previewPageTest() {
HiFileBrowser.curFile = (HiFileBrowser.curPage - 1) * [COLOR="Red"]19[/COLOR]
changePage(HiFileBrowser.curPage, HiFileBrowser.curPage - 1);
}
[...]
function changePage(curind, nxtind) {
if (nxtind >= 0 && nxtind < HiFileBrowser.totalPage) {
for (x in HiFileBrowser.thumbnailxhrs) {
HiFileBrowser.thumbnailxhrs[x].abort();
}

HiFileBrowser.thumbnailxhrs = [];
HiFileBrowser.curPage = nxtind;
// HiFileBrowser.curFile = curind > nxtind ? HiFileBrowser.curFile - 1 : nxtind * [COLOR="Red"]19[/COLOR];
[...]
function setImageIcon(files) {
debugPrint("setImageIcon function begin, and the param files.length is : " + files.length);
if (!!files) {
for (var i = HiFileBrowser.curPage * [COLOR="red"]19[/COLOR]; i < (HiFileBrowser.curPage + 1) * [COLOR="red"]19[/COLOR] && i < files.length; i++) {
getFileIcon(files[i], $("#fileimg" + i));
}
}
}
[...]
function setHTML(files) {
//debugPrint(JSON.stringify(files));
debugPrint("setHTML function begin,and the patam firstInit is : " + HiFileBrowser.firstInit);
if (!!files) {
HiFileBrowser.totalPage = Math.ceil(files.length / [COLOR="Red"]19[/COLOR]);
[...]
for (var kk = 0; kk < HiFileBrowser.totalPage; kk++) {
html = "";
for (var ii = 0; ii < [COLOR="red"]19 [/COLOR]&& kk * [COLOR="red"]19 [/COLOR]+ ii < files.length; ii++) {
html += '<div id="file' + (kk * [COLOR="red"]19 [/COLOR]+ ii) + '" class="dropboxmiddle_unfocus">' +
'<img id="fileimg' + (kk * [COLOR="red"]19 [/COLOR]+ ii) + '" src="' + 'img/himedia/fileBrowser/defaultimg.png" onerror="useDefaultImg(this)">' +
'<p id="filename' + (kk * [COLOR="red"]19 [/COLOR]+ ii) + '">' + files[kk * [COLOR="red"]19 [/COLOR]+ ii].usbFileName + '</p>' +
'</div>';
}
HiFileBrowser.fileHTML.push(html);
[...]
for (var ii = 0; ii < [COLOR="red"]19 [/COLOR]&& kk * [COLOR="red"]19 [/COLOR]+ ii < files.length; ii++) {
html += '<div id="file' + (kk * [COLOR="red"]19 [/COLOR]+ ii) + '" class="dropboxmiddle_unfocus">' +
'<img id="fileimg' + (kk * [COLOR="red"]19 [/COLOR]+ ii) + '" src="' + 'img/himedia/fileBrowser/defaultimg.png" onerror="useDefaultImg(this)">' +
'<p id="filename' + (kk * [COLOR="red"]19 [/COLOR]+ ii) + '">' + getFileName(files[kk * [COLOR="red"]19 [/COLOR]+ ii]) + '</p>' +
'</div>';
}
[...]
for (var kk = 0; kk < HiFileBrowser.totalPage; kk++) {
html = "";
for (var ii = 0; ii < [COLOR="red"]19 [/COLOR]&& kk * [COLOR="red"]19 [/COLOR]+ ii < files.length; ii++) {
debugPrint(files[kk * 19 + ii].thumb_url + "_______lock mark");
// if (!files[kk * [COLOR="red"]19 [/COLOR]+ ii].thumb_url)
// lockerClass = "dropboxmiddle_focus_pvr_img_lock";
// else
// lockerClass = "dropboxmiddle_focus_pvr_img_lock_none";
if (kk * [COLOR="red"]19 [/COLOR]+ ii == 0) {
html = '<div id="file0" class="dropboxmiddle_unfocus_pvr">' +
'<img id="fileimg0" src="' + 'img/himedia/fileBrowser/backup.png" onerror="useDefaultImg(this)">' +
'<p id="filename0">' + hiMediaLanguages[cLanguage_himedia]["Return"] + '</p>' +
'</div>';
} else if (!!files[kk * [COLOR="red"]19 [/COLOR]+ ii].thumb_url)
html += "<div id="file" + (kk * [COLOR="Red"]19 [/COLOR]+ ii) + "" class="dropboxmiddle_unfocus_pvr">" +
" <img src="" + "img/himedia/fileBrowser/deleteBlock.png" class="dropboxmiddle_focus_pvr_img_lock"/>" +
" <img src="" + "img/himedia/fileBrowser/pvr1.png" class="dropboxmiddle_focus_pvr_img_pvr"/>" +
"" + " <div id="pvr_info" class="dropboxmiddle_focus_pvr_img_pvr_info">" +
" <div class="pvr_play_logo"><img id="playLogo" src="" + "img/himedia/fileBrowser/pvrPlay.png"/></div>" +
" <div class="pvr_date_info">" +
" <span class="pvr_date">" + files[kk * [COLOR="red"]19 [/COLOR]+ ii].artist + "</span></br>" +
" <span class="pvr_time">" + files[kk * [COLOR="red"]19 [/COLOR]+ ii].icon + "-" + files[kk * [COLOR="red"]19 [/COLOR]+ ii].album + "</span>" +
" </div>" + " </div>" + "" +
" <div class="dropboxmiddle_focus_pvr_text_pvr"> <p id="filename" + (kk * [COLOR="red"]19 [/COLOR]+ ii) + "" >" + getFileName(files[kk * [COLOR="red"]19 [/COLOR]+ ii]) + "</p></div>" + "</div>";
else
html += "<div id="file" + (kk * [COLOR="red"]19 [/COLOR]+ ii) + "" class="dropboxmiddle_unfocus_pvr">" +
// " <img src="" + "img/himedia/fileBrowser/deleteBlock.png" class="dropboxmiddle_focus_pvr_img_lock"/>" +
" <img src="" + "img/himedia/fileBrowser/pvr1.png" class="dropboxmiddle_focus_pvr_img_pvr"/>" +
"" + " <div id="pvr_info" class="dropboxmiddle_focus_pvr_img_pvr_info">" +
" <div class="pvr_play_logo"><img id="playLogo" src="" + "img/himedia/fileBrowser/pvrPlay.png"/></div>" +
" <div class="pvr_date_info">" +
" <span class="pvr_date">" + files[kk * [COLOR="red"]19 [/COLOR]+ ii].artist + "</span></br>" +
" <span class="pvr_time">" + files[kk * [COLOR="red"]19 [/COLOR]+ ii].icon + "-" + files[kk * 19 + ii].album + "</span>" +
" </div>" + " </div>" + "" +
" <div class="dropboxmiddle_focus_pvr_text_pvr"> <p id="filename" + (kk * [COLOR="red"]19 [/COLOR]+ ii) + "" >" + files[kk * 19 + ii].usbFileName + "</p></div>" + "</div>";

// html += '<div id="file' + (kk * k + ii) + '" class="dropboxmiddle_unfocusPVR">' +
// '<img id="fileimg' + (kk * [COLOR="red"]19 [/COLOR]+ ii) + '" src="'+baseLauncherDir+'img/himedia/fileBrowser/defaultimg.png" onerror="useDefaultImg(this)">' +
// '<div id="PVRdate' + (kk * [COLOR="red"]19 [/COLOR]+ ii) + '">' + files[kk * [COLOR="red"]19 [/COLOR]+ ii].usbFileName + '</div>' +
// '<div id="PVRtime' + (kk * [COLOR="red"]19 [/COLOR]+ ii) + '">' + files[kk * [COLOR="red"]19 [/COLOR]+ ii].usbFileName + '</div>' +
// '<p id="filename' + (kk * [COLOR="red"]19 [/COLOR]+ ii) + '">' + files[kk * [COLOR="red"]19 [/COLOR]+ ii].usbFileName + '</p>' +
// '</div>';
}
HiFileBrowser.fileHTML.push(html);
[...]
setDropboxTextScroll("0", "0");
if (!!files && files.length > 0) {
setFilePath(files[0]);
setImageIcon(files.slice(0, [COLOR="Red"]19[/COLOR]));
}
[...]
function dropboxConetentKeyDown(event) {
debugPrint("dropboxConetentKeyDown begin and keyCode is :" + event.keyCode);
switch (checkDMPkeycode(event.keyCode)) {
case VK_RIGHT:
if (HiFileBrowser.curFile + 5 < HiFileBrowser.totalFile) {

if (HiFileBrowser.curFile + 5 < (HiFileBrowser.curPage + 1) * [COLOR="red"]19[/COLOR]) {
setFileFocus(HiFileBrowser.curFile, HiFileBrowser.curFile + 5);
HiFileBrowser.curFile += 5;
}
else {
HiFileBrowser.curFile += 5;
changePage(HiFileBrowser.curPage, HiFileBrowser.curPage + 1);
}
}
else if (Math.floor(HiFileBrowser.totalFile / 5) != Math.floor(HiFileBrowser.curFile / 5)) {
if (HiFileBrowser.curFile + 5 < (HiFileBrowser.curPage + 1) * [COLOR="red"]19[/COLOR]) {
setFileFocus(HiFileBrowser.curFile, HiFileBrowser.totalFile - 1);
HiFileBrowser.curFile = HiFileBrowser.totalFile - 1;
}
else if (HiFileBrowser.curFile + 5 > (HiFileBrowser.curPage + 1) * [COLOR="red"]19 [/COLOR]&& HiFileBrowser.curFile + 5 >= HiFileBrowser.totalFile && HiFileBrowser.totalFile > (HiFileBrowser.curPage + 1) * [COLOR="red"]19[/COLOR]) {
HiFileBrowser.curFile = HiFileBrowser.totalFile - 1;
changePage(HiFileBrowser.curPage, HiFileBrowser.curPage + 1);
}

}
break;
case VK_LEFT:
if (HiFileBrowser.curFile == 0) {

// pathStack.pop();
goToList();
} else if (HiFileBrowser.curFile - 5 >= 0) {
if (HiFileBrowser.curFile - 5 >= HiFileBrowser.curPage * [COLOR="red"]19[/COLOR]) {
setFileFocus(HiFileBrowser.curFile, HiFileBrowser.curFile - 5);
HiFileBrowser.curFile -= 5;
}
else {
HiFileBrowser.curFile -= 5;
changePage(HiFileBrowser.curPage, HiFileBrowser.curPage - 1);
}
}
break;
case VK_UP:
if (HiFileBrowser.curFile == 0) {
HiFileBrowser.curPage = HiFileBrowser.totalPage - 1;
HiFileBrowser.curFile = HiFileBrowser.totalFile - 1;
changePage(0, HiFileBrowser.curPage);
setFileFocus(0, HiFileBrowser.curFile);

} else if (HiFileBrowser.curFile == HiFileBrowser.curPage * [COLOR="red"]19[/COLOR]) {
HiFileBrowser.curFile--;
changePage(HiFileBrowser.curPage, HiFileBrowser.curPage - 1);
}
else {
setFileFocus(HiFileBrowser.curFile, HiFileBrowser.curFile - 1);

HiFileBrowser.curFile--;
}
break;
case VK_DOWN:
if (HiFileBrowser.curFile == (HiFileBrowser.totalFile - 1)) {
changePage(HiFileBrowser.curPage, 0);
setFileFocus(HiFileBrowser.curFile, 0);
HiFileBrowser.curFile = 0;
HiFileBrowser.curPage = 0;

} else if (HiFileBrowser.curFile < HiFileBrowser.totalFile - 1) {
if (HiFileBrowser.curFile + 1 == (HiFileBrowser.curPage + 1) * [COLOR="red"]19[/COLOR]) {
HiFileBrowser.curFile++;
changePage(HiFileBrowser.curPage, HiFileBrowser.curPage + 1);
}
else {
setFileFocus(HiFileBrowser.curFile, HiFileBrowser.curFile + 1);
HiFileBrowser.curFile++;
}
}

Remove file name from the directory: open himedia/fileBrowser.js; edit

function setFilePath(file) {
[...]
else {
if (file.root != null && file.artist != null && file.icon != null && file.album != null) {

//处理PVR显示时间
var PVRDATE = file.artist;
var PVRSTARTTIME = file.icon;
var PVRENDTIME = file.album;
$("#folderpath").html(PVRDATE + " " + PVRSTARTTIME + " - " + PVRENDTIME);
$("#filepath").html("");
}
else {
$("#folderpath").html(getFolderName(file));
[COLOR="red"]//[/COLOR]$("#filepath").html(getFileName(file));
}

Change the shape of the file to be an element of the list: open css/fileBrowser.css; copy and paste these blocks of code:

#dropboxContainer #dropboxmiddle p {
/*height: 40px;*/
[COLOR="Red"]/*width: 230px;*/[/COLOR]
overflow: hidden;
text-overflow: ellipsis;
white-space: pre;
[COLOR="red"]text-align: left;
margin-left: 50px;
line-height: 42px;[/COLOR]
}

#dropboxContainer .dropboxmiddle_focus {
width: [COLOR="red"]1515px;[/COLOR]
height: [COLOR="red"]42px;[/COLOR]
margin: 0px 0px -7px 61px;
color: white;
border: solid [COLOR="red"]7[/COLOR]px rgba(8, 210, 247, 1);
[COLOR="red"] position: relative;[/COLOR]
/*box-shadow: inset 0 0 0 1px #0b1a39, inset 0 0 0 5px #08d2f7, inset 0 0 0 6px #bef5ff;*/

/*box-shadow: 0 0 28px rgba(250, 128, 10, .5);*/

[COLOR="red"] overflow: hidden;[/COLOR]
}

#dropboxContainer .dropboxmiddle_focus img {
[COLOR="red"] /*width: 230px;*/[/COLOR]
height: [COLOR="red"]inherit[/COLOR];
[COLOR="red"] position: absolute;[/COLOR]
}

#dropboxContainer .dropboxmiddle_unfocus {
width: [COLOR="red"]1515px[/COLOR];
height: [COLOR="red"]42px[/COLOR];
margin: [COLOR="red"]3px 0px 0px 68px[/COLOR];
color: #b2b2b2;
[COLOR="red"] border-top: 1px solid rgb(40, 40, 40);
padding-top: 3px;[/COLOR]
}

#dropboxContainer .dropboxmiddle_unfocus img {
[COLOR="red"] /*width: 230px;*/[/COLOR]
height: [COLOR="red"]inherit[/COLOR];
margin: 0px;
[COLOR="red"] position: absolute;[/COLOR]
}

#dropboxContainer .dropboxmiddle_focusPVR {
width: 242px;
height: 282px;
margin: 6px 0px -10px 56px;
color: white;
border: solid [COLOR="red"]6px [/COLOR]rgba(252, 213, 56, 1);

/*box-shadow: 0 0 28px rgba(250, 128, 10, .5);*/
}

[...]

#dropboxContainer #folderpath {
margin-left: 66px;
color: #b2b2b2;
float: left;
max-width: [COLOR="red"]1440px[/COLOR];
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

#dropboxContainer #filepath {
color: #fff;
float: left;
max-width: [COLOR="red"]940px[/COLOR];
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

I perfectly know all of this could be confusing for someone. That is why I am attaching the already edited files. Make a backup before replacing them. I want to reassure who is scared of bricking their TVs that these files are not loaded at boot and can be modified every time you want. If anything wrong happens, you can always recover them if you made a backup before, or flash the firmware again if not.

These files have been edited from a H43M3000 TV but should be compatible with any Hisense TV. You can check using a diff program if the files (original and edited) are similar.

The folder v1 contains the first modifications: increased file name in file browser and video player and fast seek mode.

The folder v1 + list contains the modifications of v1 plus the organization in list.

Any update of this will be posted here. Report issues if you find any.