2012-02-06 2 views
0

버튼을 클릭하여 .mp4를 재생하려고합니다.티타늄 Android의 동영상 플레이어가 작동하지 않습니다.

1.7.5 : 블랙 화면을 누를 때 버튼 1.8.0.1 & 1.8.1 : 아무것도 이벤트가 경고 '테스트로 등록

발생하지 나는 다른 SDK의과를 heres 결과를이 테스트 한 '주석 처리가되지 않은 경우 작동합니다. 다음은 내 코드입니다.

// Create main window 
var win = Ti.UI.createWindow({ 
    backgroundColor: '#fff' 
}); 

// Initialize the variable that will hold the playing video 
var activeVideo; 

// Create a play button 
var button = Ti.UI.createButton({ 
    title: 'Play Video', 
}); 

// Add the button to the window 
win.add(button); 

// Listen for a 'click' on the button 
button.addEventListener('click', function() { 
    // alert('Test'); 
    // Create the media player 
    activeVideo = Ti.Media.createVideoPlayer({ 
     url: 'video.mp4', 
     autoplay: true 
    }); 
}); 

// Open the window 
win.open(); 
+0

안녕하세요, 당신은 var activeVariable에 미디어 플레이어를 설정하고 있습니다. 활성화하거나 .open()하거나 볼 수있는 영역이나 다른 것으로 설정해야합니다. 이 기계에는 내 티타늄 소재가 없지만 한 단계 더 나아가는 것 같습니다. 다른 비디오 포맷을 사용해 보셨습니까? 경로가 맞습니까? –

답변

1

동영상 플레이어가 창에 추가되지 않았습니다. 시도해보십시오 : win.add(activeVideo);

관련 문제