如何使用jqtouch加载媒体播放器来播放视频或音频文件?

发布于 2024-10-06 14:41:38 字数 87 浏览 0 评论 0原文

我目前正在使用 jqtouch 将 ruby​​ on Rails 开发成 iPhone 应用程序。我不知道如何加载媒体播放器来播放音频/视频文件。有谁知道吗?

I am currently using jqtouch to develop my ruby on rails into an iphone app. I can't figure out how to load a media player to play audio / video files. Does anyone know?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

丑疤怪 2024-10-13 14:41:38

向 jqtouch 添加电影页面(改编自 jqTouch 演示页面< /a>):

<!doctype html>
<html>
    <head>
        <title>Video Demo</title>
        <style type="text/css" media="screen">@import "../../jqtouch/jqtouch.css";</style>
        <style type="text/css" media="screen">@import "../../themes/jqt/theme.css";</style>
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript" charset="utf-8"></script>
        <script src="../../jqtouch/jqtouch.js" type="application/x-javascript" charset="utf-8"></script>
    <script type="text/javascript" charset="utf-8"> 
    $('#play_movie').bind('tap', function(){
        $('#movie').get(0).play();
        $(this).removeClass('active');
    });

    $('#video').bind('pageAnimationStart', function(e, info){
        $('#movie').css('display', 'none');
    }).bind('pageAnimationEnd', function(e, info){
        if (info.direction == 'in')
        {
            $('#movie').css('display', 'block');
        }
    });
    </script>
</head>
<body>
    <div id="jqt">
        <div id="home" class="current">
            <div class="toolbar">
                <h1>Video Demo</h1>
                <a class="button slideup" id="infoButton" href="#about">About</a>
            </div>
            <ul class="rounded">
                <li class="arrow"><a href="#video">Video</a></li>
            </ul>
        </div>
        <div id="video">
            <div class="toolbar">
                <h1>Video</h1>
                <a class="back" href="#">Home</a>
            </div>
            <video id="movie" src="video/fireworks.mov" poster="video/fireworks.jpg" width="320" height="426" controls></video>

            <a href="#" style="margin: 10px;" id="play_movie" class="whiteButton">Play Movie</a>
        </div>
    </div>
</body>
</html>

To add a movie page to jqtouch (adapted from the jqTouch demo page):

<!doctype html>
<html>
    <head>
        <title>Video Demo</title>
        <style type="text/css" media="screen">@import "../../jqtouch/jqtouch.css";</style>
        <style type="text/css" media="screen">@import "../../themes/jqt/theme.css";</style>
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript" charset="utf-8"></script>
        <script src="../../jqtouch/jqtouch.js" type="application/x-javascript" charset="utf-8"></script>
    <script type="text/javascript" charset="utf-8"> 
    $('#play_movie').bind('tap', function(){
        $('#movie').get(0).play();
        $(this).removeClass('active');
    });

    $('#video').bind('pageAnimationStart', function(e, info){
        $('#movie').css('display', 'none');
    }).bind('pageAnimationEnd', function(e, info){
        if (info.direction == 'in')
        {
            $('#movie').css('display', 'block');
        }
    });
    </script>
</head>
<body>
    <div id="jqt">
        <div id="home" class="current">
            <div class="toolbar">
                <h1>Video Demo</h1>
                <a class="button slideup" id="infoButton" href="#about">About</a>
            </div>
            <ul class="rounded">
                <li class="arrow"><a href="#video">Video</a></li>
            </ul>
        </div>
        <div id="video">
            <div class="toolbar">
                <h1>Video</h1>
                <a class="back" href="#">Home</a>
            </div>
            <video id="movie" src="video/fireworks.mov" poster="video/fireworks.jpg" width="320" height="426" controls></video>

            <a href="#" style="margin: 10px;" id="play_movie" class="whiteButton">Play Movie</a>
        </div>
    </div>
</body>
</html>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文