Merge lp:~renatofilho/mediaplayer-app/fix-1365497 into lp:mediaplayer-app

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Bill Filler
Approved revision: 273
Merged at revision: 277
Proposed branch: lp:~renatofilho/mediaplayer-app/fix-1365497
Merge into: lp:mediaplayer-app
Diff against target: 85 lines (+51/-1)
2 files modified
src/qml/player/AbstractPlayer.qml (+4/-1)
src/qml/player/VideoPlayer.qml (+47/-0)
To merge this branch: bzr merge lp:~renatofilho/mediaplayer-app/fix-1365497
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+234750@code.launchpad.net

Commit message

Show a proper message if the video format is not supported.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/qml/player/AbstractPlayer.qml'
--- src/qml/player/AbstractPlayer.qml 2014-04-09 16:50:50 +0000
+++ src/qml/player/AbstractPlayer.qml 2014-09-15 21:45:08 +0000
@@ -40,6 +40,8 @@
40 property int backwardSeekStep: Math.min(30000, mediaPlayer.duration * 0.025)40 property int backwardSeekStep: Math.min(30000, mediaPlayer.duration * 0.025)
4141
4242
43 signal error(int errorCode, string errorString)
44
43 objectName: "videoPlayer"45 objectName: "videoPlayer"
44 state: "stopped"46 state: "stopped"
45 color: "black"47 color: "black"
@@ -131,7 +133,8 @@
131 property int heightMargin: aspectRatio != -1 ? (aspectRatio < parent.aspectRatio ? 0 : (height - realHeight) / 2) : -1133 property int heightMargin: aspectRatio != -1 ? (aspectRatio < parent.aspectRatio ? 0 : (height - realHeight) / 2) : -1
132134
133 onError: {135 onError: {
134 console.log("AbstractPlayer: " + errorString)136 console.error("AbstractPlayer: " + error + ":" + errorString)
137 player.error(error, errorString)
135 }138 }
136 }139 }
137140
138141
=== modified file 'src/qml/player/VideoPlayer.qml'
--- src/qml/player/VideoPlayer.qml 2014-02-13 18:26:52 +0000
+++ src/qml/player/VideoPlayer.qml 2014-09-15 21:45:08 +0000
@@ -37,6 +37,7 @@
37 property alias controlsActive: _controls.active37 property alias controlsActive: _controls.active
38 property bool componentLoaded: false38 property bool componentLoaded: false
39 readonly property int seekStep: 100039 readonly property int seekStep: 1000
40 property var errorDialog: null
4041
41 signal timeClicked42 signal timeClicked
4243
@@ -198,4 +199,50 @@
198 break;199 break;
199 }200 }
200 }201 }
202
203 Component {
204 id: dialogPlayerError
205
206 Popups.Dialog {
207 id: dialogue
208 objectName: "playError"
209
210 property string errorString: ""
211
212 title: i18n.tr("Error playing video")
213 text: errorString
214
215 Button {
216 text: i18n.tr("Close")
217 onClicked: PopupUtils.close(dialogue)
218 }
219
220 Component.onDestruction: player.errorDialog = null
221 }
222 }
223
224 onError: {
225 if (player.errorDialog !== null)
226
227 return
228
229 player.errorDialog = PopupUtils.open(dialogPlayerError, null)
230 switch(errorCode) {
231 case 1:
232 player.errorDialog.errorString = i18n.tr("Fail to open the source video.")
233 break;
234 case 2:
235 player.errorDialog.errorString = i18n.tr("Video format not supported.")
236 break;
237 case 3:
238 player.errorDialog.errorString = i18n.tr("A network error occurred.")
239 break;
240 case 4:
241 player.errorDialog.errorString = i18n.tr("There are not the appropriate permissions to play a media resource.")
242 break;
243 case 5:
244 player.errorDialog.errorString = i18n.tr("Fail to connect with playback backend.")
245 break;
246 }
247 }
201}248}

Subscribers

People subscribed via source and target branches