2014-07-12 5 views
0

video.js를 반응 적으로 만들기 위해이 빈을 만들었습니다. 친절하게 어떻게 할 수 있는지 알려주세요. 나는 많이 시도했지만 모바일보기에 해당 컨트롤은 항상 플레이어에서 부유하고 그 자리에 막대기를 doesnot : 작은 화면를 들어, 플레이어의 컨트롤의 CSS를 변경하는 미디어 쿼리를 사용해야합니다 http://jsbin.com/idinaf/627/editVideo.js 응답 성이 작은 화면에서 작동하지 않습니다.

videojs.autoSetup(); 

videojs('example_video_1').ready(function(){ 
    console.log(this.options()); //log all of the default videojs options 

    // Store the video object 
    var myPlayer = this, id = myPlayer.id(); 
    // Make up an aspect ratio 
    var aspectRatio = 264/640; 

    function resizeVideoJS(){ 
    var width = document.getElementById(id).parentElement.offsetWidth; 
    myPlayer.width(width).height(width * aspectRatio); 

    } 

    // Initialize resizeVideoJS() 
    resizeVideoJS(); 
    // Then on resize call resizeVideoJS() 
    window.onresize = resizeVideoJS; 
}); 

답변

1

. 나는이 방법으로 그것을했고 그것은 효과가 있었다. 그것이 당신을 위해 또한 작동하기를 바랍니다.

관련 문제