Skip to content

Commit 7391227

Browse files
committed
Added subtitle's button for changing it
1 parent f7a351a commit 7391227

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

qml/pages/play.qml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ FullscreenContentPage {
6363
onFileLoaded: {
6464
console.log("onFileLoaded")
6565
var count = renderer.getProperty("track-list/count")
66+
67+
var item = {mpvid: {"mpvid":-1, "langid":"", "title":"no"}}
68+
subs.push(item)
6669
for ( var i = 0; i < count; i++){
6770
var type = renderer.getProperty("track-list/" + i + "/type")
6871
if (type == "")
@@ -224,8 +227,8 @@ FullscreenContentPage {
224227
icon.source: "image://theme/icon-m-browser-popup"
225228
onClicked: {
226229
if (current_mpvid == -1){
227-
current_mpvid = subs[0]["mpvid"]["mpvid"]
228-
Notices.show(subs[0]["mpvid"]["langid"] + " " + subs[0]["mpvid"]["title"], Notice.Short, Notice.Center)
230+
current_mpvid = subs[1]["mpvid"]["mpvid"]
231+
Notices.show(subs[1]["mpvid"]["langid"] + " " + subs[1]["mpvid"]["title"], Notice.Short, Notice.Center)
229232
}else{
230233
var myflag = false
231234
for(var value in subs){
@@ -244,7 +247,11 @@ FullscreenContentPage {
244247
Notices.show(subs[0]["mpvid"]["langid"] + " " + subs[0]["mpvid"]["title"], Notice.Short, Notice.Center)
245248
}
246249
}
247-
renderer.setProperty("sub", current_mpvid)
250+
if (current_mpvid == -1)
251+
renderer.setProperty("sub", "no")
252+
else{
253+
renderer.setProperty("sub", current_mpvid)
254+
}
248255
//renderer.setProperty("sub", 2)
249256
}
250257
}

0 commit comments

Comments
 (0)