プレーヤーにテキストを印刷するフラッシュプラグインを開発しようとしています。私の質問はそれをどのように行うかです。つまり、プレーヤーにテキストを表示する機能はありますか?
質問する
845 次
2 に答える
0
JWPlayerはSRTファイル(字幕)をサポートしているため、このファイルを作成してビデオにテキストを配置できます。これらのテキストを生成する必要がある場合は、PHPを使用して出力URLを指定できます。
あなたは彼らの公式ウェブサイトで字幕を追加する方法の詳細を見つけることができます
他の方法は、CSSとJavascriptの組み合わせを使用して、ビデオプレーヤーコンテナにテキストを追加することです。
于 2012-08-23T08:43:36.443 に答える
0
プレーヤーにテキストを表示するための組み込み関数はありませんが、自分で行うのはかなり簡単なはずです。
まず、 Flashプラグインを作成するためのJWPlayerのドキュメントを次に示します。
次に、プラグインの表示にスプライトとテキストフィールドを追加します。
まず、.asファイルの先頭にある関連するフラッシュクラスをインポートする必要があります。
import flash.text.TextField
import flash.text.TextFormat;
import flash.display.Sprite;
次に、スプライトとテキストフィールドを作成します。TextFieldをスプライト内に配置し、スプライトをプレーヤーのディスプレイコントロール内に配置します。
var textHolderSprite:Sprite = new Sprite();
var displayText:TextField = new TextField();
displayText.width = 200; // set size of your text field
displayText.height = 300;
displayText.x = 50;//and position it.
displayText.y = 100;
displayText.text = "hello world";//set the text you want to display.
displayText.wordWrap = true; // wrap text if you want to.
displayText.selectable = false; //probably want to make it not selectable.
displayText.textColor = 0xFFFFFF; //set the text colour;
//bonus: set font size and alignment; look at TextFormat documentation for more options.
var displayTextFormat:TextFormat = new TextFormat();
displayTextFormat.size = "17";
displayTextFormat.align = "center";
displayText.setTextFormat(displayTextFormat);
//put the TextField inside the sprite.
textHolderSprite.addChild(displayText);
//the following api object, is a com.longtailvideo.jwplayer.player.IPlayer object, as described in the JWPlayer plugin documentation.
var displayControl:MovieClip = (api.controls.display as MovieClip); //get the player's display control.
displayControl.addChild(textHolderSprite);//add youre sprite.
//When you're done with the text, don't forget to remove the sprite.
displayControl.removeChild(textHolderSprite);
幸運を!
于 2012-10-15T19:11:24.280 に答える