[TIMOB-12230] BlackBerry: Implement important Titanium.Media.VideoPlayer functionality
| GitHub Issue | n/a |
|---|---|
| Type | Story |
| Priority | Medium |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2013-07-12T17:03:02.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | 2013 Sprint 14, 2013 Sprint 14 API, Release 3.1.2, Release 3.2.0 |
| Components | BlackBerry |
| Labels | documentation, notable, qe-testadded |
| Reporter | Russell McMahon |
| Assignee | Russell McMahon |
| Created | 2013-01-07T11:56:02.000+0000 |
| Updated | 2017-03-09T07:53:14.000+0000 |
Description
Attachments
| File | Date | Size |
|---|---|---|
| efencefun.mp4 | 2013-07-26T22:55:23.000+0000 | 4698306 |
PR: https://github.com/appcelerator/titanium_mobile_blackberry/pull/123 Merged. Quick note, this seems to only be working on BB device, tested on Mac.
We need to document that the video player only works on device. Although some codecs may work it appears common ones, like mp3, mp4 do not work and there does not appear to be BB docs that list the codecs that work on simulator. http://supportforums.blackberry.com/t5/Cascades-Development/MediaPlayer-playing-an-MP3/m-p/1931967/highlight/true#M4251
var vidWin = Titanium.UI.createWindow({ title : 'Video View Demo', backgroundColor : 'red', layout: 'vertical' }); var startStopButton = Titanium.UI.createButton({ title:'Start/Stop Streaming', top:20, width:300 }); var pauseResumeButton = Titanium.UI.createButton({ title:'Pause/Resume Streaming', top:20, width:300, enabled:false }); var videoPlayer = Titanium.Media.createVideoPlayer({ top : 20, height : 300, width : 300 }); vidWin.add(startStopButton); vidWin.add(pauseResumeButton); startStopButton.addEventListener('click',function() { // When paused, playing returns false. // If both are false, playback is stopped. if (videoPlayer.playing || videoPlayer.paused) { videoPlayer.stop(); pauseResumeButton.enabled = false; videoPlayer.release(); } else { videoPlayer.start(); pauseResumeButton.enabled = true; } }); pauseResumeButton.addEventListener('click', function() { if (videoPlayer.paused) { videoPlayer.start(); } else { videoPlayer.pause(); } }); videoPlayer.addEventListener('progress',function(e) { Ti.API.info('Time Played: ' + Math.round(e.progress) + ' milliseconds'); }); videoPlayer.addEventListener('change',function(e) { Ti.API.info('State: ' + e.description + ' (' + e.state + ')'); // currently blackberry does not support scaling but by hooking this // change event and getting the actual video dimensions the developer can scale // or do and boxing that may be necessary videoPlayer.width = e.videoWidth/2; videoPlayer.height = e.videoHeight/2; }); videoPlayer.addEventListener('completed',function(e) { Ti.API.info('media completed'); }); vidWin.addEventListener('close',function() { videoPlayer.stop(); videoPlayer.release(); }); videoPlayer.url = 'video/efencefun.mp4'; vidWin.add(videoPlayer); vidWin.open();Closing ticket as fixed.