2012-03-16 5 views
1

私はG.W.Tで開発されたシンプルなメールシステムを持っており、ビデオやオーディオファイルが添付ファイルとして提供されている場合は、オーディオとビデオファイルを再生する機能を追加しようとしています。gwtでメディアを再生する

私はbstプレーヤーとHTMLビデオタグを使って仕事をしていますが、.avi、.mpeg、.mpgなどのビデオフォーマットは再生できません。

これらの種類のビデオフォーマットを再生するには、他に何ができますか?

一方、私はJavaサーブレットでビデオファイルを変換してから、そのURLをプレーヤに渡すことを考えていますが、それが意味を成しているかどうかはわかりません。

最後のものは、 VlcPlayerPluginや別のビデオプレーヤーで再生できるように、まずビデオファイルを変換する必要がある一般的なフォーマット(おそらく.flv?)がありますか?その他のヒントが参考になります。

ありがとうございます。

答えて

0

、VlcPlayerのreply.Becauseにチャンスが奇妙な行動とUbuntuとWindows上の別のコントロールボタンを示していた持っていなかった、私は最初BstPlayer.IのFlashPlayerPluginを使用することにしましたjaveを使用してflvにファイルを変換すると、ここで説明されているドキュメントに変換されたビデオがFlashPlayerに提供され、問題なく動作します。

0

html5ビデオタグは特定のフォーマットのみを再生できます。サポートされているブラウザ形式の一覧はこちらでご覧いただけます。

0

私もBSTプレーヤーといくつかの問題を抱えていたが、少なくとも、それは次のコードで働いていた:

public YoutubeVideoPopup(String youtubeUrl) 
{ 
    // PopupPanel's constructor takes 'auto-hide' as its boolean parameter. 
    // If this is set, the panel closes itself automatically when the user 
    // clicks outside of it. 
    super(true); 
    this.setAnimationEnabled(true); 

    Widget player = null; 
    try 
    { 
     player = new YouTubePlayer(youtubeUrl, "500", "375"); 
     player.setStyleName("player"); 
    } 
    catch (PluginVersionException e) 
    { 
     // catch plugin version exception and alert user to download plugin first. 
     // An option is to use the utility method in PlayerUtil class. 
     player = PlayerUtil.getMissingPluginNotice(Plugin.Auto, "Missing Plugin", 
      "You have to install a flash plaxer first!", 
      false); 
    } 
    catch (PluginNotFoundException e) 
    { 
     // catch PluginNotFoundException and tell user to download plugin, possibly providing 
     // a link to the plugin download page. 
     player = new HTML("You have to install a flash plaxer first!"); 
    } 
    setWidget(player); 
} 

はあなたが見ることができるように、我々はプラスの効果を持ってここユーチューブプレーヤーを、使用されたもの見よができますYouTubeに配置して、GWTアプリを再デプロイするたびにサーバーに貼り付けてはいけません。 また、tryブロックで正しいPlayerクラスを使用するだけで、他のフォーマットをフラッシュして再生することもできます。フラッシュのための例:

遅れて申し訳ありません
player = new com.bramosystems.oss.player.core.client.ui.FlashMediaPlayer(GWT.getHostPageBaseURL() + 
      f4vFileName, true, "375", "500"); 
    player.setWidth(500 + "px"); 
    player.setHeight("100%"); 
関連する問題