問題タブ [object-tag]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
1 に答える
968 参照

html - 自己ホスト コンテンツとプレーヤーのオブジェクト タグを使用したビデオの埋め込み

私はビデオプレーヤーの世界に不慣れです。モバイル ブラウザ ベースのビデオ プレーヤーを開発したいと考えています。HTML5 とその Flash フォールバックは知っていますが、これは別の要件です。

要件は、Object タグを使用してビデオを埋め込み、すべてのモバイル デバイス (ブラウザ) で再生できるようにすることです。コード ヘルプは非常に便利です。Object tag の使用は必須です。すべてのモバイルブラウザと互換性のあるswfまたはそのようなものがあれば..

前もって感謝します 。

0 投票する
0 に答える
482 参照

javascript - object タグで pdf をロードする際のエラー処理

名前に基づいたオブジェクト タグを使用して pdf を動的に表示しているため、pdf が追加されずに名前が追加される可能性があります。私はそれを処理し、pdf が見つからないときに空白を残すのではなく、少なくともいくつかのテキストを表示したいと思います。

これは基本的に私が持っているものです:

ファイルがロードされないときにhtmlまたはjavascriptを使用して何かを行う方法はありますか? また、IE7 をサポートするにはこれが必要です。

0 投票する
1 に答える
29703 参照

html - Base64 でエンコードされた PDF データ URI を HTML 5 に埋め込む方法 `` data attribute?

So in my application, users have the option to upload a file to an <input type = "file" id = "my-file"> (HTML 5 File input). I can subsequently

So in my application, users have the option to upload a file to an <input type = "file" id = "my-file"> (HTML 5 File input). I can subsequently grab this file using the following Javascript:

Can I somehow use this var file as the data in an <object> tag? Here is an example of an object tag where the PDF is grabbed by hitting a URL and contacting the server.

How can I accomplish this? Please note, I must support Internet Explorer 11.

UPDATE:

I've tried something that ultimately ended in failure. I converted the PDF to a data-uri using FileReader and then used that in the data attribute of the <object> tag, which renders perfectly in Chrome but not at all in Internet explorer.

Where the reader data comes out looking like:

Here is the reason PDF's don't work with this approach in Internet Explorer (images only)...so sad :(

UPDATE 2:

Tried pdf.js with some success...it displays the PDF on the page, although it is incredibly slow (5 seconds for a single page) in Internet Explorer 11. It also only displays one page at a time, whereas the <object> tag displayed all pages instantly in a nice scrollable container. While this is an extreme fallback option, I'd like to not go down this route.

Anyone have any other idea as to how I can preview the PDF's that the user uploads directly in the webpage?


I would try this insetad of simply stop(); this line

And create this method as:

stopProcess() method changes the started variable, so it will stop in this two cases:

  1. if it is finished

AND

  1. if it is reqested to stop

Not tested, just an idea

0 投票する
0 に答える
43 参照

javascript - OBJECTタグにロードされた外部ページ内のDIVからhtmlを取得するJavascript

ローカル Web ページがあります。

アラート機能は、オブジェクト タグに読み込まれた HTML コンテンツではなく、「テスト」を表示しています。読み込まれたコンテンツから html を表示するために必要です。私は何を間違っていますか?

0 投票する
2 に答える
6969 参照

javascript - ページのリロード時に Safari で Load イベントが発生しない

object以下のコードのようなタグ内にロードされたシンプルな SVG があります。Safari では、loadブラウザを開いた後に初めてページをロードしたときに、イベントが 1 回だけ発生します。それ以外の場合はそうではありません。イベントを使用しloadて GSAP でいくつかのアニメーションを初期化しているため、DOM ノードを選択する前に、SVG が完全に読み込まれるタイミングを知る必要があります。setTimeoutイベントにアタッチする代わりに を使用することで、うまくいくと思われる簡単な回避策がありますが、遅いネットワークobjectでは指定された時間内に をロードできないため、少し厄介なようです。このイベントが標準化されていないことは承知していますが、この問題に直面したのは私が初めてではないと思います。どのように解決しますか?